diff --git a/.gitignore b/.gitignore index 549d5ba5b..aea5beacc 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,9 @@ project.properties .settings build/ jacoco.exec +opensrp-chw-hf/nacp/ +caches +daemon +native +wrapper +github.properties diff --git a/opensrp-chw-hf/build.gradle b/opensrp-chw-hf/build.gradle index 96c3c8051..2c55c02de 100644 --- a/opensrp-chw-hf/build.gradle +++ b/opensrp-chw-hf/build.gradle @@ -15,9 +15,43 @@ buildscript { } } +def githubProperties = new Properties() +if (rootProject.file("github.properties").exists()) { + githubProperties.load(new FileInputStream(rootProject.file("github.properties"))) +} +allprojects { + repositories { + maven { url 'https://maven.google.com' } + + maven { + + name = "GitHubPackages" + + url = uri("https://maven.pkg.github.com/Digital-Square-Tanzania/opensrp-client-chw-core") + credentials { + username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER") + password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY") + } + + } + + maven { + + name = "GitHubPackages" + + url = uri("https://maven.pkg.github.com/Digital-Square-Tanzania/opensrp-client-chw-ld") + credentials { + username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER") + password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY") + } + } + + } +} + android { useLibrary 'org.apache.http.legacy' - compileSdkVersion 28 + compileSdkVersion 32 buildToolsVersion androidBuildToolsVersion compileOptions { @@ -27,15 +61,16 @@ android { defaultConfig { applicationId "org.smartregister.chw.hf" - minSdkVersion 18 - targetSdkVersion 28 + minSdkVersion 21 + targetSdkVersion 32 versionCode 11 versionName "1.2.13" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled true buildConfigField "String", 'opensrp_url', '"https://boresha-afya.smartregister.org/opensrp/"' - buildConfigField "String", 'opensrp_url_debug', '"https://boresha-afya-stage.smartregister.org/opensrp/"' - // buildConfigField "String", 'opensrp_url_debug', '"https://ba-unified-stage.smartregister.org/opensrp/"' + buildConfigField "String", 'opensrp_url_debug', '"http://50.116.15.4:8082/opensrp/"' +// buildConfigField "String", 'opensrp_url_debug', '"https://boresha-afya-stage.smartregister.org/opensrp/"' + // buildConfigField "String", 'opensrp_url_debug', '"https://ba-unified-stage.smartregister.org/opensrp/"' buildConfigField "boolean", 'SUPPORT_QR', 'true' buildConfigField "int", "DATABASE_VERSION", '12' buildConfigField "int", "DATA_SYNC_DURATION_MINUTES", '15' @@ -50,6 +85,22 @@ android { includeCompileClasspath = true } } + + if (project.rootProject.file("local.properties").exists()) { + Properties properties = new Properties() + properties.load(project.rootProject.file("local.properties").newDataInputStream()) + if (properties != null && + properties.containsKey("mapbox.sdk.token")) { + buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", properties["mapbox.sdk.token"] + } else { + println("Mapbox key config variables is not set in your local.properties") + buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", "\"sample_key\"" + } + + } else { + println("local.properties does not exist") + buildConfigField "String", "MAPBOX_SDK_ACCESS_TOKEN", "\"sample_key\"" + } } android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true @@ -64,17 +115,20 @@ android { buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '100' buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' buildConfigField "boolean", "TIME_CHECK", "true" - buildConfigField "int", "DATA_SYNC_DURATION_MINUTES", '15' + buildConfigField "int", "DATA_SYNC_DURATION_MINUTES", '30' buildConfigField "int", "VACCINE_SYNC_PROCESSING_MINUTES", '30' buildConfigField "int", "IMAGE_UPLOAD_MINUTES", '180' buildConfigField "int", "PULL_UNIQUE_IDS_MINUTES", '180' - buildConfigField "int", "REPORT_INDICATOR_GENERATION_MINUTES", '15' + buildConfigField "int", "REPORT_INDICATOR_GENERATION_MINUTES", '150' buildConfigField "int", "HOME_VISIT_MINUTES", '60' buildConfigField "int", "STOCK_USAGE_REPORT_MINUTES", '1440' buildConfigField "boolean", 'SUPPORT_REPORT', 'false' - buildConfigField "String[]", "ALLOWED_LOCATION_LEVELS", '{"Ward" , "Council", "Facility", "MOH Jhpiego Facility Name", "Health Facility", "Village", "Village Sublocations"}' - buildConfigField "String[]", "LOCATION_HIERACHY", '{"Country","Region","District","Ward" ,"Council", "Facility", "MOH Jhpiego Facility Name", "Health Facility", "Village", "Village Sublocations"}' + buildConfigField "String[]", "ALLOWED_LOCATION_LEVELS", '{"Ward" , "Council", "Facility", "Village"}' + buildConfigField "String[]", "LOCATION_HIERACHY", '{"Country","Zone","Region","District","Council","Ward", "Facility","Village"}' buildConfigField "String", 'DEFAULT_LOCATION', '"Facility"' + buildConfigField "boolean", "BUILD_FOR_BORESHA_AFYA_SOUTH", "true" + buildConfigField "boolean", "BUILD_FOR_PMTCT_CASE_BASED_MANAGEMENT", "true" + buildConfigField "boolean", "ENABLED_MALARIA_MODULE", "false" buildConfigField "String[]", 'FACILITY_LEVEL', '{"MOH Jhpiego Facility Name", "Health Facility", "Facility"}' } @@ -83,17 +137,20 @@ android { buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '15' buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' buildConfigField "boolean", "TIME_CHECK", "false" - buildConfigField "int", "DATA_SYNC_DURATION_MINUTES", '15' + buildConfigField "int", "DATA_SYNC_DURATION_MINUTES", '30' buildConfigField "int", "VACCINE_SYNC_PROCESSING_MINUTES", '30' buildConfigField "int", "IMAGE_UPLOAD_MINUTES", '15' buildConfigField "int", "PULL_UNIQUE_IDS_MINUTES", '15' - buildConfigField "int", "REPORT_INDICATOR_GENERATION_MINUTES", '15' + buildConfigField "int", "REPORT_INDICATOR_GENERATION_MINUTES", '150' buildConfigField "int", "HOME_VISIT_MINUTES", '60' buildConfigField "int", "STOCK_USAGE_REPORT_MINUTES", '1440' buildConfigField "boolean", 'SUPPORT_REPORT', 'false' - buildConfigField "String[]", "ALLOWED_LOCATION_LEVELS", '{"Ward" , "Council", "Facility", "MOH Jhpiego Facility Name", "Health Facility", "Village", "Village Sublocations"}' - buildConfigField "String[]", "LOCATION_HIERACHY", '{"Country","Region","District","Ward" ,"Council", "Facility", "MOH Jhpiego Facility Name", "Health Facility", "Village", "Village Sublocations"}' + buildConfigField "String[]", "ALLOWED_LOCATION_LEVELS", '{"Ward" , "Council", "Facility", "Village"}' + buildConfigField "String[]", "LOCATION_HIERACHY", '{"Country","Zone","Region","District","Council","Ward", "Facility","Village"}' buildConfigField "String", 'DEFAULT_LOCATION', '"Facility"' + buildConfigField "boolean", "BUILD_FOR_BORESHA_AFYA_SOUTH", "true" + buildConfigField "boolean", "BUILD_FOR_PMTCT_CASE_BASED_MANAGEMENT", "false" + buildConfigField "boolean", "ENABLED_MALARIA_MODULE", "true" buildConfigField "String[]", 'FACILITY_LEVEL', '{"MOH Jhpiego Facility Name", "Health Facility", "Facility"}' testCoverageEnabled true } @@ -138,16 +195,95 @@ android { } } + flavorDimensions 'baseDimension' + productFlavors { + nacp { + applicationId "org.smartregister.chw.moh.hf" + minSdkVersion 21 + targetSdkVersion 31 + versionCode 21 + versionName "1.1.13" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + multiDexEnabled true + buildConfigField "String", 'opensrp_url', '"https://ucs.nacp.go.tz/opensrp/"' +// buildConfigField "String", 'opensrp_url_debug', '"http://50.116.15.4:8082/opensrp/"' + buildConfigField "String", 'opensrp_url_debug', '"http://170.187.199.69:8082/opensrp/"' + buildConfigField "boolean", 'SUPPORT_QR', 'true' + buildConfigField "int", "DATABASE_VERSION", '17' + buildConfigField "int", "DATA_SYNC_DURATION_MINUTES", '15' + buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l" + buildConfigField "boolean", "TIME_CHECK", "false" + buildConfigField "String", "SYNC_TYPE", '"teamId"' + buildConfigField "int", "MAX_SYNC_RETRIES", '3' + buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L" + buildConfigField "boolean", "IS_SYNC_SETTINGS", "false" + javaCompileOptions { + annotationProcessorOptions { + includeCompileClasspath = true + } + } + } + ba { + applicationId "org.smartregister.chw.hf" + minSdkVersion 21 + targetSdkVersion 28 + versionCode 11 + versionName "1.2.13" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + multiDexEnabled true + buildConfigField "String", 'opensrp_url', '"https://boresha-afya.smartregister.org/opensrp/"' + buildConfigField "String", 'opensrp_url_debug', '"https://boresha-afya-stage.smartregister.org/opensrp/"' + // buildConfigField "String", 'opensrp_url_debug', '"https://ba-unified-stage.smartregister.org/opensrp/"' + buildConfigField "boolean", 'SUPPORT_QR', 'true' + buildConfigField "int", "DATABASE_VERSION", '12' + buildConfigField "int", "DATA_SYNC_DURATION_MINUTES", '15' + buildConfigField "long", "MAX_SERVER_TIME_DIFFERENCE", "1800000l" + buildConfigField "boolean", "TIME_CHECK", "false" + buildConfigField "String", "SYNC_TYPE", '"teamId"' + buildConfigField "int", "MAX_SYNC_RETRIES", '3' + buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L" + buildConfigField "boolean", "IS_SYNC_SETTINGS", "false" + javaCompileOptions { + annotationProcessorOptions { + includeCompileClasspath = true + } + } + } + } + lintOptions { checkReleaseBuilds false abortOnError false } + dataBinding { + enabled = true + } + + bundle { + language { + // Specifies that the app bundle should not support + // configuration APKs for language resources. These + // resources are instead packaged with each base and + // dynamic feature APK. + enableSplit = false + } + } + +} + +def flavors = android.productFlavors.collect { flavor -> flavor.name } +if (!flavors) flavors.add('') + +def testDependencies = [] +flavors.each { productFlavorName -> + testDependencies.add("test${productFlavorName.capitalize()}DebugUnitTest") + testDependencies.add("create${productFlavorName.capitalize()}DebugCoverageReport") } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation('org.smartregister:opensrp-client-chw-core:1.5.27-SNAPSHOT@aar') { + implementation('org.smartregister:opensrp-client-chw-core:1.5.36.15-NACP-SNAPSHOT@aar') { // implementation(project(":opensrp-chw-core")) { transitive = true exclude group: 'com.android.support', module: 'appcompat-v7' @@ -155,24 +291,38 @@ dependencies { exclude group: 'androidx.appcompat', module: 'appcompat' exclude group: 'androidx.constraintlayout', module: 'constraintlayout' exclude group: 'com.google.guava', module: 'guava' - exclude group: 'com.rengwuxian.materialedittext', module: 'library' + exclude group: 'org.smartregister', module: 'opensrp-client-materialedittext' + exclude group: 'org.smartregister', module: 'opensrp-client-chw-ld' } + + implementation('org.smartregister:opensrp-client-chw-ld:1.0.31-NACP-SNAPSHOT@aar') { + transitive = true + exclude group: 'org.smartregister', module: 'opensrp-client-core' + exclude group: 'org.smartregister', module: 'opensrp-client-native-form' + exclude group: 'org.smartregister', module: 'opensrp-client-configurable-views' + exclude group: 'com.android.support', module: 'appcompat-v7' + exclude group: 'id.zelory', module: 'compressor' + } + //Do not upgrade to 1.1.0 due to compatibility issues + implementation 'com.github.rey5137:material:1.2.5' implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'com.google.android.material:material:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' //Do not upgrade to 1.1.0 due to compatibility issues - implementation 'androidx.recyclerview:recyclerview:1.0.2' - implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + implementation 'androidx.recyclerview:recyclerview:1.1.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.3' implementation 'com.android.support:multidex:1.0.3' //Do not upgrade to 24.jre-1 due to compatibility issues implementation 'com.google.guava:guava:20.0' + implementation 'androidx.webkit:webkit:1.4.0' + implementation 'com.whiteelephant:monthandyearpicker:1.3.0' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' androidTestImplementation 'org.mockito:mockito-android:3.0.0' - implementation 'com.github.lecho:hellocharts-android:v1.5.8' + implementation 'com.github.lecho:hellocharts-library:1.5.8@aar' testImplementation 'junit:junit:4.13' testImplementation 'org.mockito:mockito-core:3.1.0' @@ -187,7 +337,9 @@ tasks.withType(Test) { jacoco.includeNoLocationClasses = true } -task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) { +task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport', + 'testBaDebugUnitTest', 'createBaDebugCoverageReport', + 'testNacpDebugUnitTest', 'createNacpDebugCoverageReport']) { reports { xml.enabled = true diff --git a/opensrp-chw-hf/src/main/AndroidManifest.xml b/opensrp-chw-hf/src/main/AndroidManifest.xml index 40972a876..43f587432 100644 --- a/opensrp-chw-hf/src/main/AndroidManifest.xml +++ b/opensrp-chw-hf/src/main/AndroidManifest.xml @@ -3,53 +3,200 @@ xmlns:tools="http://schemas.android.com/tools" package="org.smartregister.chw.hf"> + + + + + + + + + + + + - + tools:replace="android:theme, android:icon"> + + android:windowSoftInputMode="stateAlwaysHidden|adjustResize"/> + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + - + + + + + + + + + + @@ -127,6 +325,18 @@ android:theme="@style/HFTheme.NoActionBar" /> + + + - - @@ -163,15 +371,140 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - @@ -203,30 +524,44 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/config/anc-reporting-indicator-definitions.yml b/opensrp-chw-hf/src/main/assets/config/anc-reporting-indicator-definitions.yml new file mode 100644 index 000000000..a2facf500 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/config/anc-reporting-indicator-definitions.yml @@ -0,0 +1,4511 @@ +indicators: + - key: "2a-10-14" + description: "Gestation age less than 12 weeks for 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.gest_age as INT) < 12 AND eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || '01')" + + - key: "2b-10-14" + description: "Gestation age greater than or equals to 12 weeks for 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.gest_age as INT) >= 12 AND eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || '01')" + + - key: "2c-10-14" + description: "Followup visits for 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.visit_number > 1 OR is_transfer_in IS NOT NULL) + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "2d-10-14" + description: "Followup visits for 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number >= 4 + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "2e-10-14" + description: "Clients Who Tested HB Levels on First Visit 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND eaf.hb_level IS NOT NULL + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4b-10-14" + description: "Pregnant Clients 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4d-10-14" + description: "Clients with HB Level less than 8.5 for 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.hb_level AS FLOAT) < 8.5 + AND eaf.visit_number = 1 + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4e-10-14" + description: "Clients with BP greater than or equalts to 140/90 mm/hg for 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.systolic AS INTEGER) > 140 + AND CAST(eaf.diastolic AS INTEGER) > 90 + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4g-10-14" + description: "Clients with glucose in urine for 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.glucose_in_urine = 'positive' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4h-10-14" + description: "Clients with protein in urine for 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.protein_in_urine = 'positive' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4i-10-14" + description: "Clients tested syphilis for 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.syphilis <> 'test_not_conducted' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4j-10-14" + description: "Clients tested syphilis for 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.syphilis = 'positive') + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4l-10-14" + description: "Partners tested syphilis for 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis <> 'test_not_conducted' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "5a-10-14" + description: "Known on ART Clients for 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND medical_surgical_history LIKE '%known_on_art%' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5c-10-14" + description: "Clients Tested for HIV on first visit for 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_number = 1 + AND eaf.hiv <> 'test_not_conducted' + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5d-10-14" + description: "Clients Tested for HIV on first visit and found positive for 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_number = 1 + AND eaf.hiv = 'positive' + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5e-10-14" + description: "Wajawazito waliokutwa na VVU (positive) kipimo cha kwanza walio chini ya umri wa miaka 25" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv = 'positive' + AND eaf.hiv_test_number = 1 + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5g-10-14" + description: "Couple testing for clients who are 10 - 14 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.couple_testing = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + + - key: "2a-15-19" + description: "Gestation age less than 12 weeks for 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.gest_age as INT) < 12 AND eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || '01')" + + - key: "2b-15-19" + description: "Gestation age greater than or equals to 12 weeks for 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.gest_age as INT) >= 12 + AND is_transfer_in IS NULL + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || '01')" + + - key: "2c-15-19" + description: "Followup visits for 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.visit_number > 1 OR is_transfer_in IS NOT NULL) + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "2d-15-19" + description: "Followup visits for 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number >= 4 + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "2e-15-19" + description: "Clients Who Tested HB Levels on First Visit For 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND eaf.hb_level IS NOT NULL + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4a-15-19" + description: "Pregnant Clients with four or more pregnancies 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND medical_surgical_history LIKE '%pregnant_more_than_four%' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4b-15-19" + description: "Pregnant Clients 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4d-15-19" + description: "Clients with HB Level less than 8.5 for 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.hb_level AS FLOAT) < 8.5 + AND eaf.visit_number = 1 + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4e-15-19" + description: "Clients with BP greater than or equalts to 140/90 mm/hg for 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.systolic AS INTEGER) > 140 + AND CAST(eaf.diastolic AS INTEGER) > 90 + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "4g-15-19" + description: "Clients with glucose in urine for 10 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.glucose_in_urine = 'positive' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "4h-15-19" + description: "Clients with protein in urine for 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.protein_in_urine = 'positive' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4i-15-19" + description: "Clients tested syphilis for 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.syphilis <> 'test_not_conducted' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4j-15-19" + description: "Clients tested syphilis for 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.syphilis = 'positive') + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4l-15-19" + description: "Partners tested syphilis for 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis <> 'test_not_conducted' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5a-15-19" + description: "Known on ART Clients for 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND medical_surgical_history LIKE '%known_on_art%' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5c-15-19" + description: "Clients Tested for HIV on first visit for 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_number = 1 + AND eaf.hiv <> 'test_not_conducted' + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5d-15-19" + description: "Clients Tested for HIV on first visit and found positive for 15 - 19 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND eaf.hiv = 'positive' + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5e-15-19" + description: "Wajawazito waliokutwa na VVU (positive) kipimo cha kwanza walio chini ya umri wa miaka 25" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv = 'positive' + AND eaf.hiv_test_number = 1 + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "2a-20-24" + description: "Gestation age less than 12 weeks for 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.gest_age as INT) < 12 AND eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || '01')" + + - key: "2b-20-24" + description: "Gestation age greater than or equals to 12 weeks for 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.gest_age as INT) >= 12 AND eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || '01')" + + + - key: "2c-20-24" + description: "Followup visits for 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.visit_number > 1 OR is_transfer_in IS NOT NULL) + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "2d-20-24" + description: "Followup visits for 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number >= 4 + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "2e-20-24" + description: "Clients Who Tested HB Levels on First Visit for 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND eaf.hb_level IS NOT NULL + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4a-20-24" + description: "Pregnant Clients with four or more pregnancies 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND medical_surgical_history LIKE '%pregnant_more_than_four%' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4d-20-24" + description: "Clients with HB Level less than 8.5 for 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.hb_level AS FLOAT) < 8.5 + AND eaf.visit_number = 1 + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4e-20-24" + description: "Clients with BP greater than or equalts to 140/90 mm/hg for 20 - 25 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.systolic AS INTEGER) > 140 + AND CAST(eaf.diastolic AS INTEGER) > 90 + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4g-20-24" + description: "Clients with glucose in urine for 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.glucose_in_urine = 'positive' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "4h-20-24" + description: "Clients with protein in urine for 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.protein_in_urine = 'positive' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4i-20-24" + description: "Clients tested syphilis for 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.syphilis <> 'test_not_conducted' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4j-20-24" + description: "Clients tested syphilis for 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.syphilis = 'positive') + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4l-20-24" + description: "Partners tested syphilis for 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis <> 'test_not_conducted' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5a-20-24" + description: "Known on ART Clients for 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND medical_surgical_history LIKE '%known_on_art%' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5c-20-24" + description: "Clients Tested for HIV on first visit for 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_number = 1 + AND eaf.hiv <> 'test_not_conducted' + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5d-20-24" + description: "Clients Tested for HIV on first visit and found positive for 20 - 24 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_number = 1 + AND eaf.hiv = 'positive' + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5e-20-24" + description: "Wajawazito waliokutwa na VVU (positive) kipimo cha kwanza walio chini ya umri wa miaka 25" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv = 'positive' + AND eaf.hiv_test_number = 1 + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "2a-25-29" + description: "Gestation age less than 12 weeks for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.gest_age as INT) < 12 AND eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || '01')" + + - key: "2b-25-29" + description: "Gestation age greater than or equals to 12 weeks for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.gest_age as INT) >= 12 AND eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+29 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || '01')" + + + - key: "2c-25-29" + description: "Followup visits for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.visit_number > 1 OR is_transfer_in IS NOT NULL) + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "2d-25-29" + description: "Followup visits for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number >= 4 + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "2e-25-29" + description: "Clients Who Tested HB Levels on First Visit for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND eaf.hb_level IS NOT NULL + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4a-25-29" + description: "Pregnant Clients with four or more pregnancies 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND medical_surgical_history LIKE '%pregnant_more_than_four%' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4d-25-29" + description: "Clients with HB Level less than 8.5 for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.hb_level AS FLOAT) < 8.5 + AND eaf.visit_number = 1 + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4e-25-29" + description: "Clients with BP greater than or equalts to 140/90 mm/hg for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.systolic AS INTEGER) > 140 + AND CAST(eaf.diastolic AS INTEGER) > 90 + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4g-25-29" + description: "Clients with glucose in urine for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.glucose_in_urine = 'positive' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "4h-25-29" + description: "Clients with protein in urine for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.protein_in_urine = 'positive' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4i-25-29" + description: "Clients tested syphilis for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.syphilis <> 'test_not_conducted' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4j-25-29" + description: "Clients tested syphilis for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.syphilis = 'positive') + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4l-25-29" + description: "Partners tested syphilis for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis <> 'test_not_conducted' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5a-25-29" + description: "Known on ART Clients for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND medical_surgical_history LIKE '%known_on_art%' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5c-25-29" + description: "Clients Tested for HIV on first visit for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_number = 1 + AND eaf.hiv <> 'test_not_conducted' + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5d-25-29" + description: "Clients Tested for HIV on first visit and found positive for 25 - 29 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_number = 1 + AND eaf.hiv = 'positive' + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "2a-30-34" + description: "Gestation age less than 12 weeks for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.gest_age as INT) < 12 AND eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || '01')" + + - key: "2b-30-34" + description: "Gestation age greater than or equals to 12 weeks for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.gest_age as INT) >= 12 AND eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || '01')" + + - key: "2c-30-34" + description: "Followup visits for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.visit_number > 1 OR is_transfer_in IS NOT NULL) + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "2d-30-34" + description: "Followup visits for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number >= 4 + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "2e-30-34" + description: "Clients Who Tested HB Levels on First Visit for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND eaf.hb_level IS NOT NULL + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4a-30-34" + description: "Pregnant Clients with four or more pregnancies 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND medical_surgical_history LIKE '%pregnant_more_than_four%' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4d-30-34" + description: "Clients with HB Level less than 8.5 for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.hb_level AS FLOAT) < 8.5 + AND eaf.visit_number = 1 + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4e-30-34" + description: "Clients with BP greater than or equalts to 140/90 mm/hg for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.systolic AS INTEGER) > 140 + AND CAST(eaf.diastolic AS INTEGER) > 90 + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4g-30-34" + description: "Clients with glucose in urine for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.glucose_in_urine = 'positive' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "4h-30-34" + description: "Clients with protein in urine for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.protein_in_urine = 'positive' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4i-30-34" + description: "Clients tested syphilis for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.syphilis <> 'test_not_conducted' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4j-30-34" + description: "Clients tested syphilis for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.syphilis = 'positive') + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4l-30-34" + description: "Partners tested syphilis for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis <> 'test_not_conducted' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5a-30-34" + description: "Known on ART Clients for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND medical_surgical_history LIKE '%known_on_art%' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5c-30-34" + description: "Clients Tested for HIV on first visit for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_number = 1 + AND eaf.hiv <> 'test_not_conducted' + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5d-30-34" + description: "Clients Tested for HIV on first visit and found positive for 30 - 34 year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_number = 1 + AND eaf.hiv = 'positive' + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "2a-35+" + description: "Gestation age less than 12 weeks for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.gest_age as INT) < 12 AND eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || '01')" + + + - key: "2b-35+" + description: "Gestation age greater than or equals to 12 weeks for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.gest_age as INT) >= 12 AND eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || '01')" + + - key: "2c-35+" + description: "Followup visits for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.visit_number > 1 OR is_transfer_in IS NOT NULL) + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "2d-35+" + description: "Followup visits for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number >= 4 + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "2e-35+" + description: "Clients Who Tested HB Levels on First Visit for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND is_transfer_in IS NULL + AND eaf.hb_level IS NOT NULL + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4a-35+" + description: "Pregnant Clients with four or more pregnancies 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND medical_surgical_history LIKE '%pregnant_more_than_four%' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4c-35+" + description: "Pregnant Clients 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND medical_surgical_history LIKE '%first_pregnancy_at_or_above_thirty_five%' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4d-35+" + description: "Clients with HB Level less than 8.5 for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.hb_level AS FLOAT) < 8.5 + AND eaf.visit_number = 1 + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4e-35+" + description: "Clients with BP greater than or equalts to 140/90 mm/hg for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE CAST(eaf.systolic AS INTEGER) > 140 + AND CAST(eaf.diastolic AS INTEGER) > 90 + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4g-35+" + description: "Clients with glucose in urine for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.glucose_in_urine = 'positive' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "4h-35+" + description: "Clients with protein in urine for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.protein_in_urine = 'positive' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4i-35+" + description: "Clients tested syphilis for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.syphilis <> 'test_not_conducted' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4j-35+" + description: "Clients tested syphilis for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.syphilis = 'positive') + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4l-35+" + description: "Partners tested syphilis for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis <> 'test_not_conducted' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "5a-35+" + description: "Known on ART Clients for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.visit_number = 1 + AND medical_surgical_history LIKE '%known_on_art%' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5c-35+" + description: "Clients Tested for HIV on first visit for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_number = 1 + AND eaf.hiv <> 'test_not_conducted' + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5d-35+" + description: "Clients Tested for HIV on first visit and found positive for 35+ year olds" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_number = 1 + AND eaf.hiv = 'positive' + AND medical_surgical_history NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "3-10-14" + description: "Wajawazito waliopata Chanjo ya TT2+" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (ear.tt_vaccination_type LIKE '%tt2%' OR ear.tt_vaccination_type LIKE '%tt3%' OR ear.tt_vaccination_type LIKE '%tt4%' OR ear.tt_vaccination_type LIKE '%tt5%') + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "3-15-19" + description: "Wajawazito waliopata Chanjo ya TT2+" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (ear.tt_vaccination_type LIKE '%tt2%' OR ear.tt_vaccination_type LIKE '%tt3%' OR ear.tt_vaccination_type LIKE '%tt4%' OR ear.tt_vaccination_type LIKE '%tt5%') + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "3-20-24" + description: "Wajawazito waliopata Chanjo ya TT2+" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (ear.tt_vaccination_type LIKE '%tt2%' OR ear.tt_vaccination_type LIKE '%tt3%' OR ear.tt_vaccination_type LIKE '%tt4%' OR ear.tt_vaccination_type LIKE '%tt5%') + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "3-25-29" + description: "Wajawazito waliopata Chanjo ya TT2+" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (ear.tt_vaccination_type LIKE '%tt2%' OR ear.tt_vaccination_type LIKE '%tt3%' OR ear.tt_vaccination_type LIKE '%tt4%' OR ear.tt_vaccination_type LIKE '%tt5%') + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "3-30-34" + description: "Wajawazito waliopata Chanjo ya TT2+" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (ear.tt_vaccination_type LIKE '%tt2%' OR ear.tt_vaccination_type LIKE '%tt3%' OR ear.tt_vaccination_type LIKE '%tt4%' OR ear.tt_vaccination_type LIKE '%tt5%') + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "3-35+" + description: "Wajawazito waliopata Chanjo ya TT2+" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (ear.tt_vaccination_type LIKE '%tt2%' OR ear.tt_vaccination_type LIKE '%tt3%' OR ear.tt_vaccination_type LIKE '%tt4%' OR ear.tt_vaccination_type LIKE '%tt5%') + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4f-10-14" + description: "Kifua Kikuu" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.tb_status = 'positive' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4f-15-19" + description: "Kifua Kikuu" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.tb_status = 'positive' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4f-20-24" + description: "Kifua Kikuu" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.tb_status = 'positive' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4f-25-29" + description: "Kifua Kikuu" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.tb_status = 'positive' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4f-30-34" + description: "Kifua Kikuu" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.tb_status = 'positive' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4f-35+" + description: "Kifua Kikuu" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.tb_status = 'positive' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4k-10-14" + description: "Waliopata matibabu ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.syphilis_treatment = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4k-15-19" + description: "Waliopata matibabu ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.syphilis_treatment = 'yes' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4k-20-24" + description: "Waliopata matibabu ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.syphilis_treatment = 'yes' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4k-25-29" + description: "Waliopata matibabu ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.syphilis_treatment = 'yes' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4k-30-34" + description: "Waliopata matibabu ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.syphilis_treatment = 'yes' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "4k-35+" + description: "Waliopata matibabu ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.syphilis_treatment = 'yes' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4m-10-14" + description: "Wenza/Waume Waliogundulika na maambukizi ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis = 'positive' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4m-15-19" + description: "Wenza/Waume Waliogundulika na maambukizi ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis = 'positive' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4m-20-24" + description: "Wenza/Waume Waliogundulika na maambukizi ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis = 'positive' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4m-25-29" + description: "Wenza/Waume Waliogundulika na maambukizi ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis = 'positive' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4m-30-34" + description: "Wenza/Waume Waliogundulika na maambukizi ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis = 'positive' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4m-35+" + description: "Wenza/Waume Waliogundulika na maambukizi ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis = 'positive' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4n-10-14" + description: "Wenza/waume waliopata matibabu ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis_treatment = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4n-15-19" + description: "Wenza/waume waliopata matibabu ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis_treatment = 'yes' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4n-20-24" + description: "Wenza/waume waliopata matibabu ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis_treatment = 'yes' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4n-25-29" + description: "Wenza/waume waliopata matibabu ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis_treatment = 'yes' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4n-30-34" + description: "Wenza/waume waliopata matibabu ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis_treatment = 'yes' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4n-35+" + description: "Wenza/waume waliopata matibabu ya Kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_syphilis_treatment = 'yes' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4o-10-14" + description: "Wajawazito Waliopatikana na magonjwa ya maambukizo ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.other_stds = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4o-15-19" + description: "Wajawazito Waliopatikana na magonjwa ya maambukizo ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.other_stds = 'yes' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4o-20-24" + description: "Wajawazito Waliopatikana na magonjwa ya maambukizo ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.other_stds = 'yes' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4o-25-29" + description: "Wajawazito Waliopatikana na magonjwa ya maambukizo ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.other_stds = 'yes' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4o-30-34" + description: "Wajawazito Waliopatikana na magonjwa ya maambukizo ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.other_stds = 'yes' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4o-35+" + description: "Wajawazito Waliopatikana na magonjwa ya maambukizo ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.other_stds = 'yes' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4q-10-14" + description: "Wenza/Waume waliopatikana na mgonjwa ya maambukizo ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_other_stds = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4q-15-19" + description: "Wenza/Waume waliopatikana na mgonjwa ya maambukizo ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_other_stds = 'yes' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4q-20-24" + description: "Wenza/Waume waliopatikana na mgonjwa ya maambukizo ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_other_stds = 'yes' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4q-25-29" + description: "Wenza/Waume waliopatikana na mgonjwa ya maambukizo ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_other_stds = 'yes' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4q-30-34" + description: "Wenza/Waume waliopatikana na mgonjwa ya maambukizo ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_other_stds = 'yes' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4q-35+" + description: "Wenza/Waume waliopatikana na mgonjwa ya maambukizo ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_other_stds = 'yes' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4p-10-14" + description: "Wajawazito Waliopata tiba sahihi ya magonjwa ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.other_stds_treatment = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4p-15-19" + description: "Wajawazito Waliopata tiba sahihi ya magonjwa ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.other_stds_treatment = 'yes' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4p-20-24" + description: "Wajawazito Waliopata tiba sahihi ya magonjwa ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.other_stds_treatment = 'yes' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4p-25-29" + description: "Wajawazito Waliopata tiba sahihi ya magonjwa ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.other_stds_treatment = 'yes' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4p-30-34" + description: "Wajawazito Waliopata tiba sahihi ya magonjwa ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.other_stds_treatment = 'yes' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4p-35+" + description: "Wajawazito Waliopata tiba sahihi ya magonjwa ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.other_stds_treatment = 'yes' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4r-10-14" + description: "Wenzi/Waume waliopata tiba sahihi ya magonjwa ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_other_stds_treatment = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4r-15-19" + description: "Wenzi/Waume waliopata tiba sahihi ya magonjwa ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_other_stds_treatment = 'yes' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4r-20-24" + description: "Wenzi/Waume waliopata tiba sahihi ya magonjwa ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_other_stds_treatment = 'yes' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4r-25-29" + description: "Wenzi/Waume waliopata tiba sahihi ya magonjwa ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_other_stds_treatment = 'yes' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4r-30-34" + description: "Wenzi/Waume waliopata tiba sahihi ya magonjwa ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_other_stds_treatment = 'yes' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "4r-35+" + description: "Wenzi/Waume waliopata tiba sahihi ya magonjwa ya ngono yasiyo kaswende" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + WHERE eaf.partner_other_stds_treatment = 'yes' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5b-10-14" + description: "Wajawazito wote Waliopata Ushauri nasaha kabla ya Kupima VVU kliniki" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_counselling_before_testing = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5b-15-19" + description: "Wajawazito wote Waliopata Ushauri nasaha kabla ya Kupima VVU kliniki" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_counselling_before_testing = 'yes' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5b-20-24" + description: "Wajawazito wote Waliopata Ushauri nasaha kabla ya Kupima VVU kliniki" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_counselling_before_testing = 'yes' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5b-25-29" + description: "Wajawazito wote Waliopata Ushauri nasaha kabla ya Kupima VVU kliniki" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_counselling_before_testing = 'yes' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5b-30-34" + description: "Wajawazito wote Waliopata Ushauri nasaha kabla ya Kupima VVU kliniki" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_counselling_before_testing = 'yes' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5b-35+" + description: "Wajawazito wote Waliopata Ushauri nasaha kabla ya Kupima VVU kliniki" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_counselling_before_testing = 'yes' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5f-10-14" + description: "Wajawazito waliopata ushauri 0 baada ya kupima" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_counselling_after_testing = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5f-15-19" + description: "Wajawazito waliopata ushauri 0 baada ya kupima" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_counselling_after_testing = 'yes' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5f-20-24" + description: "Wajawazito waliopata ushauri 0 baada ya kupima" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_counselling_after_testing = 'yes' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5f-25-29" + description: "Wajawazito waliopata ushauri 0 baada ya kupima" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_counselling_after_testing = 'yes' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5f-30-34" + description: "Wajawazito waliopata ushauri 0 baada ya kupima" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_counselling_after_testing = 'yes' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5f-35+" + description: "Wajawazito waliopata ushauri 0 baada ya kupima" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_counselling_after_testing = 'yes' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5g-10-14" + description: "Wajawazito waliopimwa VVU na wenza wao (Couple) kwa pamoja katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.couple_testing = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5g-15-19" + description: "Wajawazito waliopimwa VVU na wenza wao (Couple) kwa pamoja katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.couple_testing = 'yes' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5g-20-24" + description: "Wajawazito waliopimwa VVU na wenza wao (Couple) kwa pamoja katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.couple_testing = 'yes' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5g-25-29" + description: "Wajawazito waliopimwa VVU na wenza wao (Couple) kwa pamoja katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.couple_testing = 'yes' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5g-30-34" + description: "Wajawazito waliopimwa VVU na wenza wao (Couple) kwa pamoja katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.couple_testing = 'yes' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + - key: "5g-35+" + description: "Wajawazito waliopimwa VVU na wenza wao (Couple) kwa pamoja katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.couple_testing = 'yes' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5h-10-14" + description: "Wajawazito waliopima VVU kipimo cha pili" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_at_32 = 'true' + AND eaf.hiv <> 'test_not_conducted' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5h-15-19" + description: "Wajawazito waliopima VVU kipimo cha pili" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_at_32 = 'true' + AND eaf.hiv <> 'test_not_conducted' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5h-20-24" + description: "Wajawazito waliopima VVU kipimo cha pili" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_at_32 = 'true' + AND eaf.hiv <> 'test_not_conducted' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5h-25-29" + description: "Wajawazito waliopima VVU kipimo cha pili" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_at_32 = 'true' + AND eaf.hiv <> 'test_not_conducted' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5h-30-34" + description: "Wajawazito waliopima VVU kipimo cha pili" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_at_32 = 'true' + AND eaf.hiv <> 'test_not_conducted' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5h-35+" + description: "Wajawazito waliopima VVU kipimo cha pili" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_at_32 = 'true' + AND eaf.hiv <> 'test_not_conducted' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5i-10-14" + description: "Wajawazito waliokutwa na maambukizi ya VVU kipimo cha pili" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_at_32 = 'true' + AND eaf.hiv = 'positive' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5i-15-19" + description: "Wajawazito waliokutwa na maambukizi ya VVU kipimo cha pili" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_at_32 = 'true' + AND eaf.hiv = 'positive' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5i-20-24" + description: "Wajawazito waliokutwa na maambukizi ya VVU kipimo cha pili" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_at_32 = 'true' + AND eaf.hiv = 'positive' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5i-25-29" + description: "Wajawazito waliokutwa na maambukizi ya VVU kipimo cha pili" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_at_32 = 'true' + AND eaf.hiv = 'positive' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5i-30-34" + description: "Wajawazito waliokutwa na maambukizi ya VVU kipimo cha pili" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_at_32 = 'true' + AND eaf.hiv = 'positive' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5i-35+" + description: "Wajawazito waliokutwa na maambukizi ya VVU kipimo cha pili" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv_test_at_32 = 'true' + AND eaf.hiv = 'positive' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5j-10-14" + description: "Wenza waliopima VVU kipimo cha kwanza Kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_number = 1 + AND eaf.partner_hiv <> 'test_not_conducted' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5j-15-19" + description: "Wenza waliopima VVU kipimo cha kwanza Kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_number = 1 + AND eaf.partner_hiv <> 'test_not_conducted' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5j-20-24" + description: "Wenza waliopima VVU kipimo cha kwanza Kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_number = 1 + AND eaf.partner_hiv <> 'test_not_conducted' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5j-25-29" + description: "Wenza waliopima VVU kipimo cha kwanza Kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_number = 1 + AND eaf.partner_hiv <> 'test_not_conducted' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5j-30-34" + description: "Wenza waliopima VVU kipimo cha kwanza Kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_number = 1 + AND eaf.partner_hiv <> 'test_not_conducted' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5j-35+" + description: "Wenza waliopima VVU kipimo cha kwanza Kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_number = 1 + AND eaf.partner_hiv <> 'test_not_conducted' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5k-10-14" + description: "Wenza waliogundulika kuwa na maambukizi ya VVU kipimo cha kwanza katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_number = 1 + AND eaf.partner_hiv = 'positive' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5k-15-19" + description: "Wenza waliogundulika kuwa na maambukizi ya VVU kipimo cha kwanza katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_number = 1 + AND eaf.partner_hiv = 'positive' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5k-20-24" + description: "Wenza waliogundulika kuwa na maambukizi ya VVU kipimo cha kwanza katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_number = 1 + AND eaf.partner_hiv = 'positive' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5k-25-29" + description: "Wenza waliogundulika kuwa na maambukizi ya VVU kipimo cha kwanza katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_number = 1 + AND eaf.partner_hiv = 'positive' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5k-30-34" + description: "Wenza waliogundulika kuwa na maambukizi ya VVU kipimo cha kwanza katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_number = 1 + AND eaf.partner_hiv = 'positive' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5k-35+" + description: "Wenza waliogundulika kuwa na maambukizi ya VVU kipimo cha kwanza katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_number = 1 + AND eaf.partner_hiv = 'positive' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5l-10-14" + description: "Wenza waliopima VVU kipimo cha 0 pili Kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_at_32 = 'true' + AND eaf.partner_hiv <> 'test_not_conducted' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5l-15-19" + description: "Wenza waliopima VVU kipimo cha 0 pili Kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_at_32 = 'true' + AND eaf.partner_hiv <> 'test_not_conducted' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5l-20-24" + description: "Wenza waliopima VVU kipimo cha 0 pili Kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_at_32 = 'true' + AND eaf.partner_hiv <> 'test_not_conducted' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5l-25-29" + description: "Wenza waliopima VVU kipimo cha 0 pili Kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_at_32 = 'true' + AND eaf.partner_hiv <> 'test_not_conducted' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5l-30-34" + description: "Wenza waliopima VVU kipimo cha 0 pili Kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_at_32 = 'true' + AND eaf.partner_hiv <> 'test_not_conducted' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5l-35+" + description: "Wenza waliopima VVU kipimo cha 0 pili Kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_at_32 = 'true' + AND eaf.partner_hiv <> 'test_not_conducted' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5m-10-14" + description: "Wenza waliogundulika kuwa na maambukizi ya VVU kipimo cha pili katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_at_32 = 'true' + AND eaf.partner_hiv = 'positive' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5m-15-19" + description: "Wenza waliogundulika kuwa na maambukizi ya VVU kipimo cha pili katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_at_32 = 'true' + AND eaf.partner_hiv = 'positive' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5m-20-24" + description: "Wenza waliogundulika kuwa na maambukizi ya VVU kipimo cha pili katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_at_32 = 'true' + AND eaf.partner_hiv = 'positive' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5m-25-29" + description: "Wenza waliogundulika kuwa na maambukizi ya VVU kipimo cha pili katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_at_32 = 'true' + AND eaf.partner_hiv = 'positive' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5m-30-34" + description: "Wenza waliogundulika kuwa na maambukizi ya VVU kipimo cha pili katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_at_32 = 'true' + AND eaf.partner_hiv = 'positive' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5m-35+" + description: "Wenza waliogundulika kuwa na maambukizi ya VVU kipimo cha pili katika kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.partner_hiv_test_at_32 = 'true' + AND eaf.partner_hiv = 'positive' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5n-10-14" + description: "Wajawazito na wenza waliopata majibu tofauti(discordant) baada ya kupima VVU kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN (SELECT visit_date, hiv, entity_id FROM ec_anc_followup where hiv IS NOT NULL AND hiv <> 'test_not_conducted') eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv IS NOT NULL AND ear.hiv <> ear.partner_hiv + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5n-15-19" + description: "Wajawazito na wenza waliopata majibu tofauti(discordant) baada ya kupima VVU kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN (SELECT visit_date, hiv, entity_id FROM ec_anc_followup where hiv IS NOT NULL AND hiv <> 'test_not_conducted') eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv IS NOT NULL AND ear.hiv <> ear.partner_hiv + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5n-20-24" + description: "Wajawazito na wenza waliopata majibu tofauti(discordant) baada ya kupima VVU kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN (SELECT visit_date, hiv, entity_id FROM ec_anc_followup where hiv IS NOT NULL AND hiv <> 'test_not_conducted') eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv IS NOT NULL AND ear.hiv <> ear.partner_hiv + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5n-25-29" + description: "Wajawazito na wenza waliopata majibu tofauti(discordant) baada ya kupima VVU kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN (SELECT visit_date, hiv, entity_id FROM ec_anc_followup where hiv IS NOT NULL AND hiv <> 'test_not_conducted') eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv IS NOT NULL AND ear.hiv <> ear.partner_hiv + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5n-30-34" + description: "Wajawazito na wenza waliopata majibu tofauti(discordant) baada ya kupima VVU kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN (SELECT visit_date, hiv, entity_id FROM ec_anc_followup where hiv IS NOT NULL AND hiv <> 'test_not_conducted') eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv IS NOT NULL AND ear.hiv <> ear.partner_hiv + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5n-35+" + description: "Wajawazito na wenza waliopata majibu tofauti(discordant) baada ya kupima VVU kliniki ya wajawazito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN (SELECT visit_date, hiv, entity_id FROM ec_anc_followup where hiv IS NOT NULL AND hiv <> 'test_not_conducted') eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.hiv IS NOT NULL AND ear.hiv <> ear.partner_hiv + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5o-10-14" + description: "Waliopata ushauri juu ya ulishaji wa mtoto" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.given_counselling LIKE '%chk_child_feeding%' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5o-15-19" + description: "Waliopata ushauri juu ya ulishaji wa mtoto" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.given_counselling LIKE '%chk_child_feeding%' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5o-20-24" + description: "Waliopata ushauri juu ya ulishaji wa mtoto" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.given_counselling LIKE '%chk_child_feeding%' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5o-25-29" + description: "Waliopata ushauri juu ya ulishaji wa mtoto" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.given_counselling LIKE '%chk_child_feeding%' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5o-30-34" + description: "Waliopata ushauri juu ya ulishaji wa mtoto" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.given_counselling LIKE '%chk_child_feeding%' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5o-35+" + description: "Waliopata ushauri juu ya ulishaji wa mtoto" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.given_counselling LIKE '%chk_child_feeding%' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5p-10-14" + description: "Wajawazito waliopima VVU kipimo cha kwanza walio chini ya umri wa miaka 25" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + WHERE eaf.hiv_test_number = 1 + AND eaf.hiv <> 'test_not_conducted' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5p-15-19" + description: "Wajawazito waliopima VVU kipimo cha kwanza walio chini ya umri wa miaka 25" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + WHERE eaf.hiv_test_number = 1 + AND eaf.hiv <> 'test_not_conducted' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "5p-20-24" + description: "Wajawazito waliopima VVU kipimo cha kwanza walio chini ya umri wa miaka 25" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_anc_followup eaf on ear.base_entity_id = eaf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + WHERE eaf.hiv_test_number = 1 + AND eaf.hiv <> 'test_not_conducted' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6a-10-14" + description: "Waliopewa LLIN" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.llin_provision = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "6a-15-19" + description: "Waliopewa LLIN" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.llin_provision = 'yes' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6a-20-24" + description: "Waliopewa LLIN" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.llin_provision = 'yes' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6a-25-29" + description: "Waliopewa LLIN" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.llin_provision = 'yes' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6a-30-34" + description: "Waliopewa LLIN" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.llin_provision = 'yes' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6a-35+" + description: "Waliopewa LLIN" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.llin_provision = 'yes' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6b-10-14" + description: "Waliopimwa Malaria kutumia mRDT/BS" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.mRDT_for_malaria <> 'test_not_conducted' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6b-15-19" + description: "Waliopimwa Malaria kutumia mRDT/BS" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.mRDT_for_malaria <> 'test_not_conducted' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6b-20-24" + description: "Waliopimwa Malaria kutumia mRDT/BS" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.mRDT_for_malaria <> 'test_not_conducted' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6b-25-29" + description: "Waliopimwa Malaria kutumia mRDT/BS" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.mRDT_for_malaria <> 'test_not_conducted' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6b-30-34" + description: "Waliopimwa Malaria kutumia mRDT/BS" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.mRDT_for_malaria <> 'test_not_conducted' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6b-35+" + description: "Waliopimwa Malaria kutumia mRDT/BS" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.mRDT_for_malaria <> 'test_not_conducted' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6c-10-14" + description: "Waliogundulika Malaria positive" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.mRDT_for_malaria = 'positive' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6c-15-19" + description: "Waliogundulika Malaria positive" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.mRDT_for_malaria = 'positive' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6c-20-24" + description: "Waliogundulika Malaria positive" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.mRDT_for_malaria = 'positive' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6c-25-29" + description: "Waliogundulika Malaria positive" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.mRDT_for_malaria = 'positive' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6c-30-34" + description: "Waliogundulika Malaria positive" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.mRDT_for_malaria = 'positive' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6c-35+" + description: "Waliogundulika Malaria positive" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.mRDT_for_malaria = 'positive' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6d-10-14" + description: "Waliopewa IPT2" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt2' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6d-15-19" + description: "Waliopewa IPT2" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt2' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6d-20-24" + description: "Waliopewa IPT2" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt2' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6d-25-29" + description: "Waliopewa IPT2" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt2' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6d-30-34" + description: "Waliopewa IPT2" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt2' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6d-35+" + description: "Waliopewa IPT2" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt2' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6e-10-14" + description: "Waliopewa IPT3" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt3' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6e-15-19" + description: "Waliopewa IPT3" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt3' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6e-20-24" + description: "Waliopewa IPT3" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt3' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6e-25-29" + description: "Waliopewa IPT3" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt3' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6e-30-34" + description: "Waliopewa IPT3" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt3' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6e-35+" + description: "Waliopewa IPT3" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt3' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "6f-10-14" + description: "Waliopewa IPT4" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt4' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6f-15-19" + description: "Waliopewa IPT4" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt4' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6f-20-24" + description: "Waliopewa IPT4" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt4' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6f-25-29" + description: "Waliopewa IPT4" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt4' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6f-30-34" + description: "Waliopewa IPT4" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt4' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "6f-35+" + description: "Waliopewa IPT4" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.malaria_preventive_therapy = 'ipt4' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "7-10-14" + description: "Waliopewa Iron/Folic Acid (I,F,IFA) vidonge vya kutosha mpaka hudhurio linalofuata" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.iron_folate_supplements LIKE '%FeFo%' OR eaf.iron_folate_supplements LIKE '%folic%') + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "7-15-19" + description: "Waliopewa Iron/Folic Acid (I,F,IFA) vidonge vya kutosha mpaka hudhurio linalofuata" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.iron_folate_supplements LIKE '%FeFo%' OR eaf.iron_folate_supplements LIKE '%folic%') + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "7-20-24" + description: "Waliopewa Iron/Folic Acid (I,F,IFA) vidonge vya kutosha mpaka hudhurio linalofuata" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.iron_folate_supplements LIKE '%FeFo%' OR eaf.iron_folate_supplements LIKE '%folic%') + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "7-25-29" + description: "Waliopewa Iron/Folic Acid (I,F,IFA) vidonge vya kutosha mpaka hudhurio linalofuata" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.iron_folate_supplements LIKE '%FeFo%' OR eaf.iron_folate_supplements LIKE '%folic%') + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "7-30-34" + description: "Waliopewa Iron/Folic Acid (I,F,IFA) vidonge vya kutosha mpaka hudhurio linalofuata" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.iron_folate_supplements LIKE '%FeFo%' OR eaf.iron_folate_supplements LIKE '%folic%') + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "7-35+" + description: "Waliopewa Iron/Folic Acid (I,F,IFA) vidonge vya kutosha mpaka hudhurio linalofuata" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE (eaf.iron_folate_supplements LIKE '%FeFo%' OR eaf.iron_folate_supplements LIKE '%folic%') + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "8-10-14" + description: "Waliopewa Dawa za minyoo(Mebendazole/Albendazole)" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.deworming <> 'medication_not_given' + AND eaf.deworming IS NOT NULL + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "8-15-19" + description: "Waliopewa Dawa za minyoo(Mebendazole/Albendazole)" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.deworming <> 'medication_not_given' + AND eaf.deworming IS NOT NULL + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "8-20-24" + description: "Waliopewa Dawa za minyoo(Mebendazole/Albendazole)" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.deworming <> 'medication_not_given' + AND eaf.deworming IS NOT NULL + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "8-25-29" + description: "Waliopewa Dawa za minyoo(Mebendazole/Albendazole)" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.deworming <> 'medication_not_given' + AND eaf.deworming IS NOT NULL + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "8-30-34" + description: "Waliopewa Dawa za minyoo(Mebendazole/Albendazole)" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.deworming <> 'medication_not_given' + AND eaf.deworming IS NOT NULL + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "8-35+" + description: "Waliopewa Dawa za minyoo(Mebendazole/Albendazole)" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.deworming <> 'medication_not_given' + AND eaf.deworming IS NOT NULL + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "9-10-14" + description: "Waliopewa ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.given_counselling LIKE '%chk_condom_use%' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "9-15-19" + description: "Waliopewa ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.given_counselling LIKE '%chk_condom_use%' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "9-20-24" + description: "Waliopewa ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.given_counselling LIKE '%chk_condom_use%' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "9-25-29" + description: "Waliopewa ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.given_counselling LIKE '%chk_condom_use%' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "9-30-34" + description: "Waliopewa ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.given_counselling LIKE '%chk_condom_use%' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "9-35+" + description: "Waliopewa ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + WHERE eaf.given_counselling LIKE '%chk_condom_use%' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "10-10-14" + description: "Waliopewa Rufaa wakati wa ujauzito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + INNER JOIN task t on fm.base_entity_id = t.for + WHERE date(substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || + substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 9, 2)) > + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || + substr(ear.confirmation_date, 1, 2)) + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "10-15-19" + description: "Waliopewa Rufaa wakati wa ujauzito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + INNER JOIN task t on fm.base_entity_id = t.for + WHERE date(substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || + substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 9, 2)) > + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || + substr(ear.confirmation_date, 1, 2)) + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "10-20-24" + description: "Waliopewa Rufaa wakati wa ujauzito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + INNER JOIN task t on fm.base_entity_id = t.for + WHERE date(substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || + substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 9, 2)) > + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || + substr(ear.confirmation_date, 1, 2)) + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "10-25-29" + description: "Waliopewa Rufaa wakati wa ujauzito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + INNER JOIN task t on fm.base_entity_id = t.for + WHERE date(substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || + substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 9, 2)) > + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || + substr(ear.confirmation_date, 1, 2)) + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "10-30-34" + description: "Waliopewa Rufaa wakati wa ujauzito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + INNER JOIN task t on fm.base_entity_id = t.for + WHERE date(substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || + substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 9, 2)) > + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || + substr(ear.confirmation_date, 1, 2)) + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "10-35+" + description: "Waliopewa Rufaa wakati wa ujauzito" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + INNER JOIN task t on fm.base_entity_id = t.for + WHERE date(substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || + substr(strftime('%Y-%m-%d', datetime(t.server_version / 1000, 'unixepoch', 'localtime')), 9, 2)) > + date(substr(ear.confirmation_date, 7, 4) || '-' || substr(ear.confirmation_date, 4, 2) || '-' || + substr(ear.confirmation_date, 1, 2)) + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "11-10-14" + description: "Waliopewa Rufaa kwenda CTC" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + INNER JOIN ec_pmtct_registration epr on fm.base_entity_id = epr.base_entity_id + WHERE epr.ctc_number IS NOT NULL + AND ear.known_on_art NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "11-15-19" + description: "Waliopewa Rufaa kwenda CTC" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + INNER JOIN ec_pmtct_registration epr on fm.base_entity_id = epr.base_entity_id + WHERE epr.ctc_number IS NOT NULL + AND ear.known_on_art NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "11-20-24" + description: "Waliopewa Rufaa kwenda CTC" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + INNER JOIN ec_pmtct_registration epr on fm.base_entity_id = epr.base_entity_id + WHERE epr.ctc_number IS NOT NULL + AND ear.known_on_art NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "11-25-29" + description: "Waliopewa Rufaa kwenda CTC" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + INNER JOIN ec_pmtct_registration epr on fm.base_entity_id = epr.base_entity_id + WHERE epr.ctc_number IS NOT NULL + AND ear.known_on_art NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "11-30-34" + description: "Waliopewa Rufaa kwenda CTC" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + INNER JOIN ec_pmtct_registration epr on fm.base_entity_id = epr.base_entity_id + WHERE epr.ctc_number IS NOT NULL + AND ear.known_on_art NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "11-35+" + description: "Waliopewa Rufaa kwenda CTC" + indicatorQuery: " SELECT count(DISTINCT ear.base_entity_id) as count + FROM ec_anc_register ear + INNER JOIN ec_family_member fm on fm.base_entity_id = ear.base_entity_id + INNER JOIN ec_anc_followup eaf on fm.base_entity_id = eaf.entity_id + INNER JOIN ec_pmtct_registration epr on fm.base_entity_id = epr.base_entity_id + WHERE epr.ctc_number IS NOT NULL + AND ear.known_on_art NOT LIKE '%known_on_art%' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(eaf.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/config/cbhs-reporting-indicator-definitions.yml b/opensrp-chw-hf/src/main/assets/config/cbhs-reporting-indicator-definitions.yml new file mode 100644 index 000000000..1350da7e4 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/config/cbhs-reporting-indicator-definitions.yml @@ -0,0 +1,1145 @@ +indicators: + - key: "cbhs-1a-jumla-me" + description: "Number of Male clients enrolled to HIV services until last month" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 9, 2)) < + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-1a-jumla-ke" + description: "Number of Female clients enrolled to HIV services until last month" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 9, 2)) < + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-1b-jumla-me" + description: "Total Male continuing with care this month" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Male' + AND ecf.registration_or_followup_status = 'continuing_with_services' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-1b-jumla-ke" + description: "Total Female continuing with care this month" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Female' + AND ecf.registration_or_followup_status = 'continuing_with_services' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-jumla-me" + description: "Total new male clients registered this month" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-jumla-ke" + description: "Total new female clients registered this month" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-1-me" + description: "Total new male clients less than one year old registered this month" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+1 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-1-ke" + description: "Total new female clients less than one year old registered this month" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+1 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-1-5-me" + description: "Total new male clients registered this month for 1-5 year olds" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+1 years') <= date('now')) + AND (date(fm.dob, '+6 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-1-5-ke" + description: "Total new female clients registered this month for 1-5 year olds" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+1 years') <= date('now')) + AND (date(fm.dob, '+6 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-6-9-me" + description: "Total new male clients registered this month for 6-9 year olds" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+6 years') <= date('now')) + AND (date(fm.dob, '+10 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-6-9-ke" + description: "Total new female clients registered this month for 6-9 year olds" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+6 years') <= date('now')) + AND (date(fm.dob, '+10 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-10-14-me" + description: "Total new male clients registered this month for 10-14 year olds" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-10-14-ke" + description: "Total new female clients registered this month for 10-14 year olds" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-15-19-me" + description: "Total new male clients registered this month for 15-19 year olds" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-15-19-ke" + description: "Total new female clients registered this month for 15-19 year olds" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-20-24-me" + description: "Total new male clients registered this month for 20-24 year olds" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-20-24-ke" + description: "Total new female clients registered this month for 20-24 year olds" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-25-49-me" + description: "Total new male clients registered this month for 25-49 year olds" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+50 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-25-49-ke" + description: "Total new female clients registered this month for 25-49 year olds" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+50 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-50-59-me" + description: "Total new male clients registered this month for 50-59 year olds" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+50 years') <= date('now')) + AND (date(fm.dob, '+60 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-50-59-ke" + description: "Total new female clients registered this month for 50-59 year olds" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+50 years') <= date('now')) + AND (date(fm.dob, '+60 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-60-me" + description: "Total new male clients registered this month above 60 years" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+60 years') <= date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2a-60-ke" + description: "Total new female clients registered this month above 60 years" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND (ecf.registration_or_followup_status = 'new_client' or ecr.registration_or_followup_status is null) + AND (date(fm.dob, '+60 years') <= date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-1-jumla-me" + description: "Total male with HIV infections" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND ecr.reasons_for_registration = 'hiv_aids' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-1-jumla-ke" + description: "Total female with HIV infections" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND ecr.reasons_for_registration = 'hiv_aids' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-2-jumla-me" + description: "Total male with Tuberculosis" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND ecr.reasons_for_registration = 'tuberculosis' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-2-jumla-ke" + description: "Total male with Tuberculosis" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND ecr.reasons_for_registration = 'tuberculosis' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-3-jumla-me" + description: "Total homosexuals" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND ecr.reasons_for_registration = 'homosexual' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-4-jumla-ke" + description: "Total Sex workers" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND ecr.reasons_for_registration = 'sex_worker_woman' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-5-jumla-me" + description: "Total male infants born with HIV infections" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND ecr.reasons_for_registration = 'hiv_infected_child' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-5-jumla-ke" + description: "Total female infants born with HIV infections" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND ecr.reasons_for_registration = 'hiv_infected_child' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-6-jumla-me" + description: "Total HIV untested male infants" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND ecr.reasons_for_registration = 'untested_hiv_infected_child' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-6-jumla-ke" + description: "Total HIV untested female infants" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND ecr.reasons_for_registration = 'untested_hiv_infected_child' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-7-jumla-me" + description: "Total male children abused" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND ecr.reasons_for_registration = 'abused_child' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-7-jumla-ke" + description: "Total Female children abused" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND ecr.reasons_for_registration = 'abused_child' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-8-jumla-me" + description: "Total Male gender violence" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND ecr.reasons_for_registration = 'gender_violence' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-8-jumla-ke" + description: "Total Female gender violence" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND ecr.reasons_for_registration = 'gender_violence' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-9-jumla-me" + description: "Total Male drug addicts" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Male' + AND ecr.reasons_for_registration = 'drug_abuse' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-9-jumla-ke" + description: "Total Female drug addicts" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND ecr.reasons_for_registration = 'drug_abuse' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-10-jumla-ke" + description: "Total pregnant women" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND ecr.reasons_for_registration = 'pregnant_mother' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2b-11-jumla-ke" + description: "Total breast feeding mothers" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + fm.gender = 'Female' + AND ecr.reasons_for_registration = 'breastfeeding_mother' + AND date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2c-2-jumla-me" + description: "Total male infected with HIV" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Male' + AND ( + (ecr.client_hiv_status_during_registration = 'positive' + AND + date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, + 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, + 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))) + OR (ecf.client_hiv_status_after_testing = 'positive' + AND + date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, + 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, + 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))))" + + - key: "cbhs-2c-2-jumla-ke" + description: "Total female infected with HIV" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Female' + AND ( + (ecr.client_hiv_status_during_registration = 'positive' + AND + date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, + 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, + 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))) + OR (ecf.client_hiv_status_after_testing = 'positive' + AND + date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, + 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, + 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))))" + + - key: "cbhs-2c-3-jumla-me" + description: "Total male not infected with HIV" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Male' + AND ( + (ecr.client_hiv_status_during_registration = 'negative' + AND + date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, + 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, + 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))) + OR (ecf.client_hiv_status_after_testing = 'negative' + AND + date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, + 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, + 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))))" + + - key: "cbhs-2c-3-jumla-ke" + description: "Total female not infected with HIV" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Female' + AND ( + (ecr.client_hiv_status_during_registration = 'negative' + AND + date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, + 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, + 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))) + OR (ecf.client_hiv_status_after_testing = 'negative' + AND + date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, + 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, + 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))))" + + - key: "cbhs-2c-4-jumla-me" + description: "Total male unknown HIV status" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Male' + AND ( + (ecr.client_hiv_status_during_registration = 'unknown' + AND + date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, + 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, + 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))) + OR (ecf.client_hiv_status_after_testing = 'unknown' + AND + date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, + 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, + 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))))" + + - key: "cbhs-2c-4-jumla-ke" + description: "Total female unknown HIV status" + indicatorQuery: "SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Female' + AND ( + (ecr.client_hiv_status_during_registration = 'unknown' + AND + date(substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 1, + 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.hiv_registration_date / 1000, 'unixepoch', 'localtime')), 6, + 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))) + OR (ecf.client_hiv_status_after_testing = 'unknown' + AND + date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, + 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, + 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))))" + + - key: "cbhs-2d-1-jumla-me" + description: "Total male given HIV counselling and testing" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Male' + AND ecf.hiv_services_provided LIKE '%hiv_counselling_and_testing%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-1-jumla-ke" + description: "Total female given HIV counselling and testing" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Female' + AND ecf.hiv_services_provided LIKE '%hiv_counselling_and_testing%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-2-jumla-me" + description: "Total male given ARV medication" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Male' + AND ecf.hiv_services_provided LIKE '%arv_services%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-2-jumla-ke" + description: "Total female given ARV medication" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Female' + AND ecf.hiv_services_provided LIKE '%arv_services%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-3-jumla-me" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Male' + AND ecf.hiv_services_provided LIKE '%hiv_prevention_services_from_mother_to_infant%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-3-jumla-ke" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Female' + AND ecf.hiv_services_provided LIKE '%hiv_prevention_services_from_mother_to_infant%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-4-jumla-me" + description: "Total male given Collaborative HIV and TB Health services" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Male' + AND ecf.hiv_services_provided LIKE '%collaborative_community_services_for_tb_and_hiv%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-4-jumla-ke" + description: "Total female given Collaborative HIV and TB Health services" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Female' + AND ecf.hiv_services_provided LIKE '%collaborative_community_services_for_tb_and_hiv%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-5-jumla-me" + description: "Total male given services to reduce the spread of STDs" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + ecf.hiv_services_provided LIKE '%prevention_of_the_spread_of_stds_service%' AND fm.gender = 'Male' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-5-jumla-ke" + description: "Total female given services to reduce the spread of STDs" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + ecf.hiv_services_provided LIKE '%prevention_of_the_spread_of_stds_service%' AND fm.gender = 'Female' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-6-jumla-me" + description: "Total male given special group services" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Male' + AND ecf.hiv_services_provided LIKE '%for_special_group_services%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-6-jumla-ke" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Female' + AND ecf.hiv_services_provided LIKE '%for_special_group_services%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-7-jumla-me" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Male' + AND ecf.hiv_services_provided LIKE '%prevention_of_gender_based_violence_and_child_abuse_services%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-7-jumla-ke" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Female' + AND ecf.hiv_services_provided LIKE '%prevention_of_gender_based_violence_and_child_abuse_services%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-8-jumla-me" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Male' + AND ecf.hiv_services_provided LIKE '%psychological_services%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-8-jumla-ke" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Female' + AND ecf.hiv_services_provided LIKE '%psychological_services%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-9-jumla-me" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Male' + AND ecf.hiv_services_provided LIKE '%information_about_fgm%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-9-jumla-ke" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Female' + AND ecf.hiv_services_provided LIKE '%information_about_fgm%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-10-jumla-me" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Male' + AND ecf.hiv_services_provided LIKE '%family_planning_and_condom_distribution_services%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-10-jumla-ke" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Female' + AND ecf.hiv_services_provided LIKE '%family_planning_and_condom_distribution_services%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-11-jumla-me" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Male' + AND ecf.hiv_services_provided LIKE '%distribution_of_self_test_kits%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-2d-11-jumla-ke" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE fm.gender = 'Female' + AND ecf.hiv_services_provided LIKE '%distribution_of_self_test_kits%' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-5-jumla" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + ecf.registration_or_followup_status <> 'client_continues_with_clinic_from_elsewhere' AND ecf.registration_or_followup_status <> 'new_client' AND ecf.registration_or_followup_status <> 'continuing_with_services' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-5-deseased" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + ecf.registration_or_followup_status = 'deceased' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-5-continue-with-clinic-from-elsewhere" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + ecf.registration_or_followup_status = 'client_continues_with_clinic_from_elsewhere' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-5-moved" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + ecf.registration_or_followup_status = 'client_has_moved' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-5-absconded" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + ecf.registration_or_followup_status = 'client_has_absconded' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "cbhs-5-completed_and_qualified_from_the_services" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.base_entity_id) as count + FROM ec_cbhs_register ecr + INNER JOIN ec_cbhs_followup ecf on ecf.entity_id = ecr.base_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = ecr.base_entity_id + WHERE + ecf.registration_or_followup_status = 'completed_and_qualified_from_the_services' + AND date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + - key: "cbhs-6-kisheria" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecf.entity_id) as count + FROM ec_cbhs_followup ecf + WHERE instr(ecf.referrals_issued_to_other_services ,'legal_services') AND + date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + - key: "cbhs-6-vikundi" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecf.entity_id) as count + FROM ec_cbhs_followup ecf + WHERE instr(ecf.referrals_issued_to_other_services ,'support_groups') AND + date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + - key: "cbhs-6-huduma-zingine" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecf.entity_id) as count + FROM ec_cbhs_followup ecf + WHERE instr(ecf.referrals_issued_to_other_services ,'other_referrals') AND + date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + - key: "cbhs-7-kisheria" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecf.entity_id) as count + FROM ec_cbhs_followup ecf + WHERE instr(ecf.referrals_to_other_services_completed ,'legal_services') AND + date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + - key: "cbhs-7-vikundi" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecf.entity_id) as count + FROM ec_cbhs_followup ecf + WHERE instr(ecf.referrals_to_other_services_completed ,'support_groups') AND + date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + - key: "cbhs-7-huduma-zingine" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecf.entity_id) as count + FROM ec_cbhs_followup ecf + WHERE instr(ecf.referrals_to_other_services_completed ,'other_referrals') AND + date(substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecf.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + - key: "cbhs-8-jumla" + description: "" + indicatorQuery: " SELECT count(DISTINCT ecr.provider_id) as count + FROM ec_cbhs_register ecr + WHERE date(substr(strftime('%Y-%m-%d', datetime(ecr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(ecr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/config/community-ltfu-summary.yml b/opensrp-chw-hf/src/main/assets/config/community-ltfu-summary.yml new file mode 100644 index 000000000..ab3e04964 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/config/community-ltfu-summary.yml @@ -0,0 +1,3704 @@ +indicators: + # - Male under 2 years + - key: "ltfu-less-2-me-ctc" + description: "Wateja wanaume chini ya miaka 2 wasiofika kliniki ya CTC" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'CTC' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-prep" + description: "Wateja wanaume chini ya miaka 2 wasiofika kliniki ya PrEP" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'Prep' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-pmtct" + description: "Wateja wanaume chini ya miaka 2 wasiofika kliniki ya PMTCT" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PMTCT' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-tb" + description: "Wateja wanaume chini ya miaka 2 wasiofika kliniki ya wenye TB " + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'TB' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-wajidunga" + description: "Wateja wanaume chini ya miaka 2 wasiofika kliniki ya wanaojidunga" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PWID' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-arv-yes" + description: "Wateja wanaume chini ya miaka 2 wanaotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'yes' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-arv-no" + description: "Wateja wanaume chini ya miaka 2 wasiotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'no' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-a1" + description: "Wateja wanaume chini ya miaka 2 wanaohudhuria kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'continuing_with_services' and + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-b1" + description: "Wateja wanaume chini ya miaka 2 waliopatikana na wako tayari kurudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_found_ready_to_return' and + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-c1" + description: "Wateja wanaume chini ya miaka 2 waliopatikana na wamerudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + INNER JOIN task t on t.for = elf.entity_id + WHERE + elf.followup_status = 'client_found_and_has_returned_to_clinic' + AND t.business_status = 'Complete' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-d1" + description: "Wateja wanaume chini ya miaka 2 waliohamia kituo kingine bila taarifa" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_moved_to_another_facility' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-e1" + description: "Wateja wanaume chini ya miaka 2 waliohama makazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_relocated' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-f1" + description: "Wateja wanaume chini ya miaka 2 waliopatikana lakini hayuko tayari kurudi kliniki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_does_not_want_to_return' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-g1" + description: "Wateja wanaume chini ya miaka 2 ambao wamefariki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'deceased' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-h1" + description: "Wateja wanaume chini ya miaka 2 ambao hawajapatikana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_not_found' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-a2" + description: "Wateja wanaume chini ya miaka 2 ambao walisahau" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_has_forgotten' AND + fm.gender = 'Male' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-b2" + description: "Wateja wanaume chini ya miaka 2 ambao walikuwa wagonjwa sana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_ill' AND + fm.gender = 'Male' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-c2" + description: "Wateja wanaume chini ya miaka 2 ambao walishindwa kujiweka wazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_failed_to_disclose_his_status' AND + fm.gender = 'Male' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-d2" + description: "Wateja wanaume chini ya miaka 2 ambao walikosa nauli" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_did_not_have_fare' AND + fm.gender = 'Male' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-e2" + description: "Wateja wanaume chini ya miaka 2 ambao umbali au usafiri mgumu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_lives_far_away_from_the_health_facility' AND + fm.gender = 'Male' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-f2" + description: "Wateja wanaume chini ya miaka 2 ambao wamepata nafuu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_feels_well' AND + fm.gender = 'Male' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-g2" + description: "Wateja wanaume chini ya miaka 2 ambao hawakupata ruhusa kazini" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_busy_at_work' AND + fm.gender = 'Male' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-h2" + description: "Wateja wanaume chini ya miaka 2 ambao walisafiri" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_traveled' AND + fm.gender = 'Male' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-i2" + description: "Wateja wanaume chini ya miaka 2 ambao wanatumia tiba mbadala" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_uses_alternative_medicine' AND + fm.gender = 'Male' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-j2" + description: "Wateja wanaume chini ya miaka 2 ambao wameona huduma haziridhishi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'poor_services_at_health_facility' AND + fm.gender = 'Male' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-me-k2" + description: "Wateja wanaume chini ya miaka 2 wenye sababu nyinginezo" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'other' AND + fm.gender = 'Male' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + # Female under 2 years + - key: "ltfu-less-2-ke-ctc" + description: "Wateja wanawake chini ya miaka 2 wasiofika kliniki ya CTC" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'CTC' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-prep" + description: "Wateja wanawake chini ya miaka 2 wasiofika kliniki ya PrEP" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'Prep' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-pmtct" + description: "Wateja wanawake chini ya miaka 2 wasiofika kliniki ya PMTCT" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PMTCT' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-tb" + description: "Wateja wanawake chini ya miaka 2 wasiofika kliniki ya wenye TB " + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'TB' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + date(fm.dob, '+2 years') > date('now') AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-wajidunga" + description: "Wateja wanawake chini ya miaka 2 wasiofika kliniki ya wanaojidunga" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PWID' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + date(fm.dob, '+2 years') > date('now') AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-arv-yes" + description: "Wateja wanawake chini ya miaka 2 wanaotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'yes' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-arv-no" + description: "Wateja wanwake chini ya miaka 2 wasiotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'no' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-a1" + description: "Wateja wanawake chini ya miaka 2 wanaohudhuria kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'continuing_with_services' and + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-b1" + description: "Wateja wanawake chini ya miaka 2 waliopatikana na wako tayari kurudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_found_ready_to_return' and + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-c1" + description: "Wateja wanawake chini ya miaka 2 waliopatikana na wamerudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + INNER JOIN task t on t.for = elf.entity_id + WHERE + elf.followup_status = 'client_found_and_has_returned_to_clinic' + AND t.business_status = 'Complete' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-d1" + description: "Wateja wanawake chini ya miaka 2 waliohamia kituo kingine bila taarifa" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_moved_to_another_facility' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-e1" + description: "Wateja wanawake chini ya miaka 2 waliohama makazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_relocated' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-f1" + description: "Wateja wanwake chini ya miaka 2 waliopatikana lakini hayuko tayari kurudi kliniki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_does_not_want_to_return' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-g1" + description: "Wateja wanawake chini ya miaka 2 ambao wamefariki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'deceased' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-h1" + description: "Wateja wanawake chini ya miaka 2 ambao hawajapatikana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_not_found' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-a2" + description: "Wateja wanawake chini ya miaka 2 ambao walisahau" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_has_forgotten' AND + fm.gender = 'Female' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-b2" + description: "Wateja wanawake chini ya miaka 2 ambao walikuwa wagonjwa sana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_ill' AND + fm.gender = 'Female' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-c2" + description: "Wateja wanawake chini ya miaka 2 ambao walishindwa kujiweka wazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_failed_to_disclose_his_status' AND + fm.gender = 'Female' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-d2" + description: "Wateja wanawake chini ya miaka 2 ambao walikosa nauli" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_did_not_have_fare' AND + fm.gender = 'Female' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-e2" + description: "Wateja wanawake chini ya miaka 2 ambao umbali au usafiri mgumu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_lives_far_away_from_the_health_facility' AND + fm.gender = 'Female' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-f2" + description: "Wateja wanawake chini ya miaka 2 ambao wamepata nafuu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_feels_well' AND + fm.gender = 'Female' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-g2" + description: "Wateja wanawake chini ya miaka 2 ambao hawakupata ruhusa kazini" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_busy_at_work' AND + fm.gender = 'Female' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-h2" + description: "Wateja wanawake chini ya miaka 2 ambao walisafiri" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_traveled' AND + fm.gender = 'Female' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-i2" + description: "Wateja wanawake chini ya miaka 2 ambao wanatumia tiba mbadala" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_uses_alternative_medicine' AND + fm.gender = 'Female' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-j2" + description: "Wateja wanawake chini ya miaka 2 ambao wameona huduma haziridhishi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'poor_services_at_health_facility' AND + fm.gender = 'Female' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-less-2-ke-k2" + description: "Wateja wanawake chini ya miaka 2 wenye sababu nyinginezo" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'other' AND + fm.gender = 'Female' + AND (date(fm.dob, '+2 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + # Male above 2 years and below 15 years + - key: "ltfu-2-14-me-ctc" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 wasiofika kliniki ya CTC" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'CTC' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-prep" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 wasiofika kliniki ya PrEP" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'Prep' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-pmtct" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 wasiofika wasiofika kliniki ya PMTCT" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PMTCT' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-tb" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 wasiofika kliniki ya wenye TB " + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'TB' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-wajidunga" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 wasiofika kliniki ya wanaojidunga" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PWID' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-arv-yes" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 wanaotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'yes' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-arv-no" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 wasiotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'no' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-a1" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 wanaohudhuria kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'continuing_with_services' and + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-b1" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 waliopatikana na wako tayari kurudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_found_ready_to_return' and + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-c1" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 waliopatikana na wamerudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + INNER JOIN task t on t.for = elf.entity_id + WHERE + elf.followup_status = 'client_found_and_has_returned_to_clinic' + AND t.business_status = 'Complete' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-d1" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 waliohamia kituo kingine bila taarifa" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_moved_to_another_facility' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-e1" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 waliohama makazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_relocated' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-f1" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 waliopatikana lakini hayuko tayari kurudi kliniki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_does_not_want_to_return' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-g1" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 ambao wamefariki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'deceased' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-h1" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 ambao hawajapatikana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_not_found' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-a2" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 ambao walisahau" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_has_forgotten' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-b2" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 ambao walikuwa wagonjwa sana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_ill' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-c2" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 ambao walishindwa kujiweka wazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_failed_to_disclose_his_status' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-d2" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 ambao walikosa nauli" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_did_not_have_fare' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-e2" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 ambao umbali au usafiri mgumu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_lives_far_away_from_the_health_facility' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-f2" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 ambao wamepata nafuu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_feels_well' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-g2" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 ambao hawakupata ruhusa kazini" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_busy_at_work' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-h2" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 ambao walisafiri" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_traveled' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-i2" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 ambao wanatumia tiba mbadala" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_uses_alternative_medicine' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-j2" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 ambao wameona huduma haziridhishi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'poor_services_at_health_facility' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-me-k2" + description: "Wateja wanaume juu ya miaka 2 na chini ya miaka 15 wenye sababu nyinginezo" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'other' AND + fm.gender = 'Male' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + # Female above 2 years and below 15 years + - key: "ltfu-2-14-ke-ctc" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 wasiofika kliniki ya CTC" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'CTC' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-prep" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 wasiofika kliniki ya PrEP" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'Prep' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-pmtct" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 wasiofika wasiofika kliniki ya PMTCT" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PMTCT' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-tb" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 wasiofika kliniki ya wenye TB " + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'TB' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-wajidunga" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 wasiofika kliniki ya wanaojidunga" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PWID' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-arv-yes" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 wanaotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'yes' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-arv-no" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 wasiotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'no' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-a1" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 wanaohudhuria kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'continuing_with_services' and + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-b1" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 waliopatikana na wako tayari kurudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_found_ready_to_return' and + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-c1" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 waliopatikana na wamerudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + INNER JOIN task t on t.for = elf.entity_id + WHERE + elf.followup_status = 'client_found_and_has_returned_to_clinic' + AND t.business_status = 'Complete' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-d1" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 waliohamia kituo kingine bila taarifa" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_moved_to_another_facility' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-e1" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 waliohama makazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_relocated' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-f1" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 waliopatikana lakini hayuko tayari kurudi kliniki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_does_not_want_to_return' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-g1" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 ambao wamefariki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'deceased' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-h1" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 ambao hawajapatikana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_not_found' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-a2" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 ambao walisahau" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_has_forgotten' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-b2" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 ambao walikuwa wagonjwa sana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_ill' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-c2" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 ambao walishindwa kujiweka wazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_failed_to_disclose_his_status' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-d2" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 ambao walikosa nauli" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_did_not_have_fare' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-e2" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 ambao umbali au usafiri mgumu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_lives_far_away_from_the_health_facility' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-f2" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 ambao wamepata nafuu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_feels_well' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-g2" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 ambao hawakupata ruhusa kazini" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_busy_at_work' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-h2" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 ambao walisafiri" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_traveled' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-i2" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 ambao wanatumia tiba mbadala" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_uses_alternative_medicine' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-j2" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 ambao wameona huduma haziridhishi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'poor_services_at_health_facility' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-2-14-ke-k2" + description: "Wateja wanawake juu ya miaka 2 na chini ya miaka 15 wenye sababu nyinginezo" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'other' AND + fm.gender = 'Female' AND + (date(fm.dob, '+2 years') <= date('now')) AND + (date(fm.dob, '+15 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + # Male above 15 years and below 24 years + - key: "ltfu-15-24-me-ctc" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 wasiofika kliniki ya CTC" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'CTC' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-prep" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 wasiofika kliniki ya PrEP" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'Prep' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-pmtct" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 wasiofika wasiofika kliniki ya PMTCT" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PMTCT' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-tb" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 wasiofika kliniki ya wenye TB " + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'TB' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-wajidunga" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 wasiofika kliniki ya wanaojidunga" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PWID' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-arv-yes" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 wanaotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'yes' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-arv-no" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 wasiotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'no' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-a1" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 wanaohudhuria kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'continuing_with_services' and + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-b1" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 waliopatikana na wako tayari kurudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_found_ready_to_return' and + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-c1" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 waliopatikana na wamerudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + INNER JOIN task t on t.for = elf.entity_id + WHERE + elf.followup_status = 'client_found_and_has_returned_to_clinic' + AND t.business_status = 'Complete' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-d1" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 waliohamia kituo kingine bila taarifa" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_moved_to_another_facility' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-e1" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 waliohama makazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_relocated' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-f1" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 waliopatikana lakini hayuko tayari kurudi kliniki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_does_not_want_to_return' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-g1" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 ambao wamefariki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'deceased' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-h1" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 ambao hawajapatikana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_not_found' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-a2" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 ambao walisahau" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_has_forgotten' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-b2" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 ambao walikuwa wagonjwa sana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_ill' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-c2" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 ambao walishindwa kujiweka wazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_failed_to_disclose_his_status' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-d2" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 ambao walikosa nauli" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_did_not_have_fare' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-e2" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 ambao umbali au usafiri mgumu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_lives_far_away_from_the_health_facility' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-f2" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 ambao wamepata nafuu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_feels_well' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-g2" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 ambao hawakupata ruhusa kazini" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_busy_at_work' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-h2" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 ambao walisafiri" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_traveled' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-i2" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 ambao wanatumia tiba mbadala" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_uses_alternative_medicine' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-j2" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 ambao wameona huduma haziridhishi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'poor_services_at_health_facility' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-me-k2" + description: "Wateja wanaume juu ya miaka 15 na chini ya miaka 24 wenye sababu nyinginezo" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'other' AND + fm.gender = 'Male' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + + # Female above 15 years and below 24 years + - key: "ltfu-15-24-ke-ctc" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 wasiofika kliniki ya CTC" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'CTC' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-prep" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 wasiofika kliniki ya PrEP" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'Prep' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-pmtct" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 wasiofika wasiofika kliniki ya PMTCT" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PMTCT' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-tb" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 wasiofika kliniki ya wenye TB " + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'TB' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-wajidunga" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 wasiofika kliniki ya wanaojidunga" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PWID' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-arv-yes" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 wanaotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'yes' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-arv-no" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 wasiotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'no' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-a1" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 wanaohudhuria kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'continuing_with_services' and + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now'))" + + - key: "ltfu-15-24-ke-b1" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 waliopatikana na wako tayari kurudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_found_ready_to_return' and + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-c1" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 waliopatikana na wamerudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + INNER JOIN task t on t.for = elf.entity_id + WHERE + elf.followup_status = 'client_found_and_has_returned_to_clinic' + AND t.business_status = 'Complete' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-d1" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 waliohamia kituo kingine bila taarifa" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_moved_to_another_facility' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-e1" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 waliohama makazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_relocated' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-f1" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 waliopatikana lakini hayuko tayari kurudi kliniki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_does_not_want_to_return' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-g1" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 ambao wamefariki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'deceased' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-h1" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 ambao hawajapatikana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_not_found' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-a2" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 ambao walisahau" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_has_forgotten' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-b2" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 ambao walikuwa wagonjwa sana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_ill' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-c2" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 ambao walishindwa kujiweka wazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_failed_to_disclose_his_status' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-d2" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 ambao walikosa nauli" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_did_not_have_fare' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-e2" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 ambao umbali au usafiri mgumu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_lives_far_away_from_the_health_facility' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-f2" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 ambao wamepata nafuu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_feels_well' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-g2" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 ambao hawakupata ruhusa kazini" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_busy_at_work' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-h2" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 ambao walisafiri" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_traveled' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-i2" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 ambao wanatumia tiba mbadala" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_uses_alternative_medicine' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-j2" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 ambao wameona huduma haziridhishi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'poor_services_at_health_facility' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-15-24-ke-k2" + description: "Wateja wanawake juu ya miaka 15 na chini ya miaka 25 wenye sababu nyinginezo" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'other' AND + fm.gender = 'Female' AND + (date(fm.dob, '+15 years') <= date('now')) AND + (date(fm.dob, '+25 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + + # Male above 25 years and below 49 years + - key: "ltfu-25-49-me-ctc" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 wasiofika kliniki ya CTC" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'CTC' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-prep" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 wasiofika kliniki ya PrEP" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'Prep' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-pmtct" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 wasiofika wasiofika kliniki ya PMTCT" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PMTCT' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-tb" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 wasiofika kliniki ya wenye TB " + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'TB' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-wajidunga" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 wasiofika kliniki ya wanaojidunga" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PWID' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-arv-yes" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 wanaotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'yes' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-arv-no" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 wasiotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'no' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-a1" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 49 wanaohudhuria kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'continuing_with_services' and + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-b1" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 waliopatikana na wako tayari kurudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_found_ready_to_return' and + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-c1" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 waliopatikana na wamerudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + INNER JOIN task t on t.for = elf.entity_id + WHERE + elf.followup_status = 'client_found_and_has_returned_to_clinic' + AND t.business_status = 'Complete' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-d1" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 waliohamia kituo kingine bila taarifa" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_moved_to_another_facility' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-e1" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 waliohama makazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_relocated' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-f1" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 waliopatikana lakini hayuko tayari kurudi kliniki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_does_not_want_to_return' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-g1" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 ambao wamefariki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'deceased' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-h1" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 ambao hawajapatikana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_not_found' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-a2" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 ambao walisahau" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_has_forgotten' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-b2" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 ambao walikuwa wagonjwa sana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_ill' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-c2" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 ambao walishindwa kujiweka wazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_failed_to_disclose_his_status' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-d2" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 ambao walikosa nauli" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_did_not_have_fare' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-e2" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 ambao umbali au usafiri mgumu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_lives_far_away_from_the_health_facility' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-f2" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 ambao wamepata nafuu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_feels_well' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-g2" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 ambao hawakupata ruhusa kazini" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_busy_at_work' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-h2" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 ambao walisafiri" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_traveled' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-i2" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 ambao wanatumia tiba mbadala" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_uses_alternative_medicine' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-j2" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 ambao wameona huduma haziridhishi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'poor_services_at_health_facility' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-me-k2" + description: "Wateja wanaume juu ya miaka 25 na chini ya miaka 50 wenye sababu nyinginezo" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'other' AND + fm.gender = 'Male' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + # Female above 25 years and below 49 years + - key: "ltfu-25-49-ke-ctc" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 wasiofika kliniki ya CTC" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'CTC' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-prep" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 wasiofika kliniki ya PrEP" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'Prep' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-pmtct" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 wasiofika wasiofika kliniki ya PMTCT" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PMTCT' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-tb" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 wasiofika kliniki ya wenye TB " + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'TB' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-wajidunga" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 wasiofika kliniki ya wanaojidunga" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PWID' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-arv-yes" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 wanaotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'yes' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-arv-no" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 wasiotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'no' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-a1" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 49 wanaohudhuria kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'continuing_with_services' and + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-b1" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 waliopatikana na wako tayari kurudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_found_ready_to_return' and + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-c1" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 waliopatikana na wamerudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + INNER JOIN task t on t.for = elf.entity_id + WHERE + elf.followup_status = 'client_found_and_has_returned_to_clinic' + AND t.business_status = 'Complete' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-d1" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 waliohamia kituo kingine bila taarifa" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_moved_to_another_facility' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-e1" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 waliohama makazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_relocated' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-f1" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 waliopatikana lakini hayuko tayari kurudi kliniki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_does_not_want_to_return' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-g1" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 ambao wamefariki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'deceased' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-h1" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 ambao hawajapatikana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_not_found' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-a2" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 ambao walisahau" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_has_forgotten' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-b2" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 ambao walikuwa wagonjwa sana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_ill' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-c2" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 ambao walishindwa kujiweka wazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_failed_to_disclose_his_status' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-d2" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 ambao walikosa nauli" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_did_not_have_fare' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-e2" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 ambao umbali au usafiri mgumu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_lives_far_away_from_the_health_facility' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now'))" + + - key: "ltfu-25-49-ke-f2" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 ambao wamepata nafuu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_feels_well' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-g2" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 ambao hawakupata ruhusa kazini" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_busy_at_work' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-h2" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 ambao walisafiri" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_traveled' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-i2" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 ambao wanatumia tiba mbadala" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_uses_alternative_medicine' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-j2" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 ambao wameona huduma haziridhishi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'poor_services_at_health_facility' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-25-49-ke-k2" + description: "Wateja wanawake juu ya miaka 25 na chini ya miaka 50 wenye sababu nyinginezo" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'other' AND + fm.gender = 'Female' AND + (date(fm.dob, '+25 years') <= date('now')) AND + (date(fm.dob, '+50 years') > date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + + # Male above 50 years + - key: "ltfu-50-me-ctc" + description: "Wateja wanaume juu ya miaka 50 wasiofika kliniki ya CTC" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'CTC' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-prep" + description: "Wateja wanaume juu ya miaka 50 wasiofika kliniki ya CTC" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'Prep' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-pmtct" + description: "Wateja wanaume juu ya miaka 50 wasiofika wasiofika kliniki ya PMTCT" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PMTCT' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-tb" + description: "Wateja wanaume juu ya miaka 50 wasiofika kliniki ya wenye TB " + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'TB' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-wajidunga" + description: "Wateja wanaume juu ya miaka 50 wasiofika kliniki ya wanaojidunga" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PWID' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-arv-yes" + description: "Wateja wanaume juu ya miaka 50 wanaotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'yes' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-arv-no" + description: "Wateja wanaume juu ya miaka 50 wasiotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'no' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-a1" + description: "Wateja wanaume juu ya miaka 50 wanaohudhuria kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'continuing_with_services' and + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-b1" + description: "Wateja wanaume juu ya miaka 50 waliopatikana na wako tayari kurudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_found_ready_to_return' and + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-c1" + description: "Wateja wanaume juu ya miaka 50 waliopatikana na wamerudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + INNER JOIN task t on t.for = elf.entity_id + WHERE + elf.followup_status = 'client_found_and_has_returned_to_clinic' + AND t.business_status = 'Complete' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-d1" + description: "Wateja wanaume juu ya miaka 50 waliohamia kituo kingine bila taarifa" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_moved_to_another_facility' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-e1" + description: "Wateja wanaume juu ya miaka 50 waliohama makazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_relocated' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-f1" + description: "Wateja wanaume juu ya miaka 50 waliopatikana lakini hayuko tayari kurudi kliniki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_does_not_want_to_return' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-g1" + description: "Wateja wanaume juu ya miaka 50 ambao wamefariki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'deceased' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-h1" + description: "Wateja wanaume juu ya miaka 50 ambao hawajapatikana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_not_found' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-a2" + description: "Wateja wanaume juu ya miaka 50 ambao walisahau" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_has_forgotten' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-b2" + description: "Wateja wanaume juu ya miaka 50 ambao walikuwa wagonjwa sana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_ill' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-c2" + description: "Wateja wanaume juu ya miaka 50 ambao walishindwa kujiweka wazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_failed_to_disclose_his_status' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-d2" + description: "Wateja wanaume juu ya miaka 50 ambao walikosa nauli" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_did_not_have_fare' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-e2" + description: "Wateja wanaume juu ya miaka 50 ambao umbali au usafiri mgumu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_lives_far_away_from_the_health_facility' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-f2" + description: "Wateja wanaume juu ya miaka 50 ambao wamepata nafuu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_feels_well' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-g2" + description: "Wateja wanaume juu ya miaka 50 ambao hawakupata ruhusa kazini" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_busy_at_work' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-h2" + description: "Wateja wanaume juu ya miaka 50 ambao walisafiri" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_traveled' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-i2" + description: "Wateja wanaume juu ya miaka 50 ambao wanatumia tiba mbadala" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_uses_alternative_medicine' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-j2" + description: "Wateja wanaume juu ys miaka 50 ambao wameona huduma haziridhishi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'poor_services_at_health_facility' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-me-k2" + description: "Wateja wanaume juu ya miaka 50 wenye sababu nyinginezo" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'other' AND + fm.gender = 'Male' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + + # Female above 50 years + - key: "ltfu-50-ke-ctc" + description: "Wateja wanamke juu ya miaka 50 wasiofika kliniki ya CTC" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'CTC' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-prep" + description: "Wateja wanamke juu ya miaka 50 wasiofika kliniki ya PrEP" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'Prep' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-pmtct" + description: "Wateja wanamke juu ya miaka 50 wasiofika wasiofika kliniki ya PMTCT" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PMTCT' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-tb" + description: "Wateja wanamke juu ya miaka 50 wasiofika kliniki ya wenye TB " + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'TB' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-wajidunga" + description: "Wateja wanamke juu ya miaka 50 wasiofika kliniki ya wanaojidunga" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.problem = 'PWID' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-arv-yes" + description: "Wateja wanamke juu ya miaka 50 wanaotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'yes' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-arv-no" + description: "Wateja wanamke juu ya miaka 50 wasiotumia ARV na hawajafika kliniki" + indicatorQuery: "SELECT count(DISTINCT er.entity_id) as count + FROM ec_referral er + INNER JOIN ec_family_member fm on fm.base_entity_id = er.entity_id + WHERE + er.chw_referral_service = 'LTFU' AND + er.on_art = 'no' AND + er.referral_type = 'facility_to_community_referral' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(er.referral_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-a1" + description: "Wateja wanaume juu ya miaka 50 wanaohudhuria kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'continuing_with_services' and + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-b1" + description: "Wateja wanamke juu ya miaka 50 waliopatikana na wako tayari kurudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_found_ready_to_return' and + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-c1" + description: "Wateja wanaume juu ya miaka 50 waliopatikana na wamerudi kliniki baada ya ufuatiliaji" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + INNER JOIN task t on t.for = elf.entity_id + WHERE + elf.followup_status = 'client_found_and_has_returned_to_clinic' + AND t.business_status = 'Complete' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-d1" + description: "Wateja wanamke juu ya miaka 50 waliohamia kituo kingine bila taarifa" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_moved_to_another_facility' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-e1" + description: "Wateja wanamke juu ya miaka 50 waliohama makazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_has_relocated' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-f1" + description: "Wateja wanamke juu ya miaka 50 waliopatikana lakini hayuko tayari kurudi kliniki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_does_not_want_to_return' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-g1" + description: "Wateja wanamke juu ya miaka 50 ambao wamefariki" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'deceased' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-h1" + description: "Wateja wanamke juu ya miaka 50 ambao hawajapatikana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.followup_status = 'client_not_found' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-a2" + description: "Wateja wanamke juu ya miaka 50 ambao walisahau" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_has_forgotten' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-b2" + description: "Wateja wanamke juu ya miaka 50 ambao walikuwa wagonjwa sana" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_ill' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-c2" + description: "Wateja wanamke juu ya miaka 50 ambao walishindwa kujiweka wazi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_failed_to_disclose_his_status' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-d2" + description: "Wateja wanamke juu ya miaka 50 ambao walikosa nauli" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_did_not_have_fare' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-e2" + description: "Wateja wanamke juu ya miaka 50 ambao umbali au usafiri mgumu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_lives_far_away_from_the_health_facility' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-f2" + description: "Wateja wanamke juu ya miaka 50 ambao wamepata nafuu" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_feels_well' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-g2" + description: "Wateja wanamke juu ya miaka 50 ambao hawakupata ruhusa kazini" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_was_busy_at_work' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-h2" + description: "Wateja wanamke juu ya miaka 50 ambao walisafiri" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_traveled' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-i2" + description: "Wateja wanamke juu ya miaka 50 ambao wanatumia tiba mbadala" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'client_uses_alternative_medicine' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-j2" + description: "Wateja wanamke juu ys miaka 50 ambao wameona huduma haziridhishi" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'poor_services_at_health_facility' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + + - key: "ltfu-50-ke-k2" + description: "Wateja wanamke juu ya miaka 50 wenye sababu nyinginezo" + indicatorQuery: "SELECT count(DISTINCT elf.entity_id) as count + FROM ec_ltfu_feedback elf + INNER JOIN ec_family_member fm on fm.base_entity_id = elf.entity_id + WHERE + elf.reasons_for_missed_appointment = 'other' AND + fm.gender = 'Female' AND + (date(fm.dob, '+50 years') <= date('now')) AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(elf.feedback_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/config/indicator-definitions.yml b/opensrp-chw-hf/src/main/assets/config/indicator-definitions.yml index 55002de67..607b645b6 100644 --- a/opensrp-chw-hf/src/main/assets/config/indicator-definitions.yml +++ b/opensrp-chw-hf/src/main/assets/config/indicator-definitions.yml @@ -1,1416 +1,1416 @@ -indicators: - - key: "newpreg_mama_visit" - description: "newpreg_mama_visit_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN visits v on v.base_entity_id = e.baseEntityId - WHERE e.eventType = 'ANC Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND (substr(e.eventDate, 1, 4) == strftime('%Y',date('now'), 'localtime')) - AND (substr(e.eventDate, 6, 2) == strftime('%m',date('now'), 'localtime')) - AND (v.visit_type = 'ANC Home Visit') - AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) - AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime'))" - - - key: "oldpreg_mama_visit" - description: "oldpreg_mama_visit_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN visits v on v.base_entity_id = e.baseEntityId - WHERE e.eventType = 'ANC Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND (date (e.eventDate) < date('now','start of month')) - AND v.visit_type = 'ANC Home Visit' - AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) - AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime'))" - - - key: "total_preg_visit" - description: "total_preg_visit_label" - indicatorQuery: "SELECT count (DISTINCT(v.base_entity_id)) as count - FROM visits v - WHERE v.visit_type = 'ANC Home Visit' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) - AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime'))" - - - key: "pnc_visit" - description: "pnc_visit_label" - indicatorQuery: "SELECT count (DISTINCT(v.base_entity_id)) as count - FROM visits v - WHERE v.visit_type = 'PNC Home Visit' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) - AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime'))" - - - key: "total_F_visited" - description: "total_F_visited_label" - indicatorQuery: "SELECT count (DISTINCT(v.base_entity_id)) as count - FROM visits v - WHERE ( v.visit_type = 'PNC Home Visit' OR v.visit_type = 'ANC Home Visit') - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) - AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime'))" - - - key: "less1m_visit" - description: "less1m_visit_label" - indicatorQuery: "SELECT SUM(count) as count - FROM( - SELECT count(DISTINCT c.base_entity_id) as count - FROM ec_child c - INNER JOIN visits v on v.base_entity_id = c.mother_entity_id - WHERE v.visit_type = 'PNC Home Visit' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) - AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime')) - AND ( date(c.dob, '+1 month') > date ('now')) - UNION ALL - SELECT count(DISTINCT c.base_entity_id) as count - FROM ec_child c - INNER JOIN visits v on v.base_entity_id = c.base_entity_id - WHERE( date(c.dob, '+1 month') > date ('now')) - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND v.visit_type = 'Child Home Visit' - AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) - AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime')) - )" - - - key: "1m1yr_visit" - description: "reporting_1m1yr_visit_label" - indicatorQuery: "SELECT count(DISTINCT c.base_entity_id) as count - FROM ec_child c - INNER JOIN visits v on v.base_entity_id = c.base_entity_id - WHERE( date(c.dob, '+1 month') <= date ('now')) - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND( date(c.dob, '+1 year') > date ('now')) - AND v.visit_type = 'Child Home Visit' - AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) - AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime'))" - - - key: "1yr5yr_visit" - description: "reporting_1yr5yr_visit_label" - indicatorQuery: "SELECT count(DISTINCT c.base_entity_id) as count - FROM ec_child c - INNER JOIN visits v on v.base_entity_id = c.base_entity_id - WHERE( date(c.dob, '+1 year') <= date ('now')) - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND( date(c.dob, '+5 years') >= date ('now')) - AND v.visit_type = 'Child Home Visit' - AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) - AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime'))" - - - key: "total_U5_visit" - description: "total_U5_visit_label" - indicatorQuery: "SELECT count(1) as count - FROM event e - INNER JOIN ec_child c on c.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Child Registration' OR e.eventType = 'PNC Child Registration') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND (c.is_closed = '0')" - - - key: "hh_visited" - description: "hh_visited_label" - indicatorQuery: "SELECT SUM(count) - FROM ( - SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - WHERE e.eventType = 'Family Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND (substr(e.eventDate, 1, 4) == strftime('%Y',date('now'), 'localtime')) - AND (substr(e.eventDate, 6, 2) == strftime('%m',date('now'), 'localtime')) - AND e.baseEntityId NOT IN( - SELECT DISTINCT fm.relational_id - FROM ec_family_member fm - INNER JOIN visits v on v.base_entity_id = fm.base_entity_id - WHERE ( v.visit_type = 'PNC Home Visit' OR v.visit_type = 'ANC Home Visit' OR v.visit_type = 'FP Follow up Visit Resupply' - OR v.visit_type = 'FP Follow-up Visit Side-effects' OR v.visit_type = 'FP Follow up visit Counselling' OR v.visit_type = 'Child Home Visit') - AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) - AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime')) - ) - UNION ALL - SELECT COUNT(DISTINCT fm.relational_id) as count - FROM visits v - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE ( v.visit_type = 'PNC Home Visit' OR v.visit_type = 'ANC Home Visit' OR v.visit_type = 'FP Follow up Visit Resupply' - OR v.visit_type = 'FP Follow-up Visit Side-effects' OR v.visit_type = 'FP Follow up visit Counselling' OR v.visit_type = 'Child Home Visit') - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) - AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime')) - )" - - - key: "F_referral_hf" - description: "F_referral_hf_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - WHERE (e.eventType = 'ANC Referral' OR e.eventType = 'PNC Referral' OR e.eventType = 'Family Planning Referral' OR e.eventType = 'Malaria Referral') - AND ('%s' = (substr(e.eventDate, 1,10)))" - - - key: "less1m_referral_hf" - description: "less1m_referral_hf_label" - indicatorQuery: "SELECT SUM(count) as count - FROM( - SELECT count(DISTINCT c.base_entity_id) as count - FROM ec_child c - INNER JOIN event e on e.baseEntityId = c.base_entity_id - WHERE( date(c.dob, '+1 month') > date ('now')) - AND ('%s' = (substr(e.eventDate, 1,10))) - AND e.eventType = 'Sick Child Referral' - UNION ALL - SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_child c on c.mother_entity_id = e.baseEntityId - WHERE e.eventType = 'PNC Referral' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(c.dob, '+1 month') > date ('now')) - AND e.eventType = 'PNC Referral')" - - - key: "1m1yr_referral_hf" - description: "reporting_1m1yr_referral_hf_label" - indicatorQuery: "SELECT count(DISTINCT c.base_entity_id) as count - FROM ec_child c - INNER JOIN event e on e.baseEntityId = c.base_entity_id - WHERE( date(c.dob, '+1 month') <= date ('now')) - AND ('%s' = (substr(e.eventDate, 1,10))) - AND( date(c.dob, '+1 year') > date ('now')) - AND e.eventType = 'Sick Child Referral'" - - - key: "1yr5yr_referral_hf" - description: "reporting_1yr5yr_referral_hf_label" - indicatorQuery: "SELECT count(DISTINCT c.base_entity_id) as count - FROM ec_child c - INNER JOIN event e on e.baseEntityId = c.base_entity_id - WHERE( date(c.dob, '+1 year') <= date ('now')) - AND ('%s' = (substr(e.eventDate, 1,10))) - AND( date(c.dob, '+5 years') >= date ('now')) - AND e.eventType = 'Sick Child Referral'" - - - key: "total_referral" - description: "total_referral_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - WHERE (e.eventType = 'ANC Referral' OR e.eventType = 'PNC Referral' OR e.eventType = 'Family Planning Referral' OR e.eventType = 'Malaria Referral' OR e.eventType = 'Sick Child Referral') - AND ('%s' = (substr(e.eventDate, 1,10)))" - - - key: "no_healthedu_meet" - description: "no_healthedu_meet_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - WHERE (e.eventType = ' Health Education Meeting') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND (substr(e.eventDate, 1, 4) == strftime('%Y',date('now'), 'localtime')) - AND (substr(e.eventDate, 6, 2) == strftime('%m',date('now'), 'localtime'))" - - - key: "no_ppl_attend_meet" - description: "no_ppl_attend_meet_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - WHERE (e.eventType = ' Health Education Meeting') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND (substr(e.eventDate, 1, 4) == strftime('%Y',date('now'), 'localtime')) - AND (substr(e.eventDate, 6, 2) == strftime('%m',date('now'), 'localtime'))" - - - key: "F_death_home" - description: "F_death_home_label" - indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" - - - key: "no_maternal_death" - description: "no_maternal_death_label" - indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" - - - key: "less1m_death_home" - description: "less1m_death_home_label" - indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" - - - key: "total_less1m_deaths" - description: "total_less1m_deaths_label" - indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" - - - key: "1m1yr_death_home" - description: "reporting_1m1yr_death_home_label" - indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" - - - key: "total_1m1yr_deaths" - description: "total_1m1yr_deaths_label" - indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" - - - key: "1yr5yr_death_home" - description: "reporting_1yr5yr_death_home_label" - indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" - - - key: "total_1yr5yr_deaths" - description: "total_1yr5yr_deaths_label" - indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" - - - key: "birth_home" - description: "birth_home_label" - indicatorQuery: "SELECT count(DISTINCT pg.base_entity_id) as count - FROM ec_pregnancy_outcome pg - INNER JOIN event e on e.baseEntityId = pg.base_entity_id - WHERE pg.delivery_place = 'At home' - AND ('%s' = (substr(e.eventDate, 1,10)))" - - - key: "birth_home_healer" - description: "birth_home_healer_label" - indicatorQuery: "SELECT count(DISTINCT pg.base_entity_id) as count - FROM ec_pregnancy_outcome pg - INNER JOIN event e on e.baseEntityId = pg.base_entity_id - WHERE pg.delivery_place = 'At home' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND pg.delivery_home = 'She gave birth at home with the help of a traditional midwife'" - - - key: "birth_way_hf" - description: "birth_way_hf_label" - indicatorQuery: "SELECT count(DISTINCT pg.base_entity_id) as count - FROM ec_pregnancy_outcome pg - INNER JOIN event e on e.baseEntityId = pg.base_entity_id - WHERE pg.delivery_place = 'On the way to the health facility' - AND ('%s' = (substr(e.eventDate, 1,10)))" - - - key: "total_birth_home" - description: "total_birth_home_label" - indicatorQuery: "SELECT count(DISTINCT pg.base_entity_id) as count - FROM ec_pregnancy_outcome pg - INNER JOIN event e on e.baseEntityId = pg.base_entity_id - WHERE ( pg.delivery_place = 'At home' OR pg.delivery_place = 'On the way to the health facility') - AND ('%s' = (substr(e.eventDate, 1,10)))" - - - key: "10y14y_new_clients" - description: "reporting_10y14y_new_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND ( fp.using_method = 'no') - AND ( fm.gender = 'Female')" - - - key: "10y14y_new_men_clients" - description: "reporting_10y14y_new_men_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND ( fp.using_method = 'no') - AND ( fm.gender = 'Male')" - - - key: "10y14y_return_clients" - description: "reporting_10y14y_return_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND ( fp.using_method = 'yes') - AND ( fm.gender = 'Female')" - - - key: "10y14y_return_men_clients" - description: "reporting_10y14y_return_men_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND ( fp.using_method = 'yes') - AND ( fm.gender = 'Male')" - - - key: "10y14y_total_clients" - description: "reporting_10y14y_total_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now'))" - - - key: "15y19y_new_clients" - description: "reporting_15y19y_new_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND ( fp.using_method = 'no') - AND ( fm.gender = 'Female')" - - - key: "15y19y_new_men_clients" - description: "reporting_15y19y_new_men_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND ( fp.using_method = 'no') - AND ( fm.gender = 'Male')" - - - key: "15y19y_return_clients" - description: "reporting_15y19y_return_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND ( fp.using_method = 'yes') - AND ( fm.gender = 'Female')" - - - key: "15y19y_return_men_clients" - description: "reporting_15y19y_return_men_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND ( fp.using_method = 'yes') - AND ( fm.gender = 'Male')" - - - key: "15y19y_total_clients" - description: "reporting_15y19y_total_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now'))" - - - key: "20y24y_new_clients" - description: "reporting_20y24y_new_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND ( fp.using_method = 'no') - AND ( fm.gender = 'Female')" - - - key: "20y24y_new_men_clients" - description: "reporting_20y24y_new_men_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND ( fp.using_method = 'no') - AND ( fm.gender = 'Male')" - - - key: "20y24y_return_clients" - description: "reporting_20y24y_return_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND ( fp.using_method = 'yes') - AND ( fm.gender = 'Female')" - - - key: "20y24y_return_men_clients" - description: "reporting_20y24y_return_men_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND ( fp.using_method = 'yes') - AND ( fm.gender = 'Male')" - - - key: "20y24y_total_clients" - description: "reporting_20y24y_total_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now'))" - - - key: "25_new_clients" - description: "reporting_25_new_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND ( fp.using_method = 'no') - AND ( fm.gender = 'Female')" - - - key: "25_new_men_clients" - description: "reporting_25_new_men_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND ( fp.using_method = 'no') - AND ( fm.gender = 'Male')" - - - key: "25_return_clients" - description: "reporting_25_return_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND ( fp.using_method = 'yes') - AND ( fm.gender = 'Female')" - - - key: "25_return_men_clients" - description: "reporting_25_return_men_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND ( fp.using_method = 'yes') - AND ( fm.gender = 'Male')" - - - key: "25_total_clients" - description: "reporting_25_total_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now'))" - - - key: "total_new_clients" - description: "total_new_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( fp.using_method = 'no') - AND ( fm.gender = 'Female')" - - - key: "total_new_men_clients" - description: "total_new_men_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( fp.using_method = 'no') - AND ( fm.gender = 'Male')" - - - key: "total_return_clients" - description: "total_return_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( fp.using_method = 'yes') - AND ( fm.gender = 'Female')" - - - key: "total_return_men_clients" - description: "total_return_men_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( fp.using_method = 'yes') - AND ( fm.gender = 'Male')" - - - key: "total_total_clients" - description: "total_total_clients_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Registration' - AND ('%s' = (substr(e.eventDate, 1,10))) " - - - key: "10y14y_pop" - description: "reporting_10y14y_pop_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND fp.fp_method_accepted = 'POP'" - - - key: "10y14y_coc" - description: "reporting_10y14y_coc_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND fp.fp_method_accepted = 'COC'" - - - key: "10y14y_emc" - description: "reporting_10y14y_emc_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND fp.fp_method_accepted = 'Emergency contraceptive'" - - - key: "10y14y_total_pills" - description: "reporting_10y14y_total_pills_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Emergency contraceptive' OR fp.fp_method_accepted = 'COC' OR fp.fp_method_accepted = 'POP')" - - - key: "15y19y_pop" - description: "reporting_15y19y_pop_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND fp.fp_method_accepted = 'POP'" - - - key: "15y19y_coc" - description: "reporting_15y19y_coc_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND fp.fp_method_accepted = 'COC'" - - - key: "15y19y_emc" - description: "reporting_15y19y_emc_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND fp.fp_method_accepted = 'Emergency contraceptive'" - - - key: "15y19y_total_pills" - description: "reporting_15y19y_total_pills_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Emergency contraceptive' OR fp.fp_method_accepted = 'COC' OR fp.fp_method_accepted = 'POP')" - - - key: "20y24y_pop" - description: "reporting_20y24y_pop_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND fp.fp_method_accepted = 'POP'" - - - key: "20y24y_coc" - description: "reporting_20y24y_coc_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND fp.fp_method_accepted = 'COC'" - - - key: "20y24y_emc" - description: "reporting_20y24y_emc_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND fp.fp_method_accepted = 'Emergency contraceptive'" - - - key: "20y24y_total_pills" - description: "reporting_20y24y_total_pills_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Emergency contraceptive' OR fp.fp_method_accepted = 'COC' OR fp.fp_method_accepted = 'POP')" - - - key: "25_pop" - description: "reporting_25_pop_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND fp.fp_method_accepted = 'POP'" - - - key: "25_coc" - description: "reporting_25_coc_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND fp.fp_method_accepted = 'COC'" - - - key: "25_emc" - description: "reporting_25_emc_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND fp.fp_method_accepted = 'Emergency contraceptive'" - - - key: "25_total_pills" - description: "reporting_25_total_pills_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND ( fp.fp_method_accepted = 'Emergency contraceptive' OR fp.fp_method_accepted = 'COC' OR fp.fp_method_accepted = 'POP')" - - - key: "total_pop" - description: "total_pop_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND fp.fp_method_accepted = 'POP'" - - - key: "total_coc" - description: "total_coc_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND fp.fp_method_accepted = 'COC'" - - - key: "total_emc" - description: "total_emc_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND fp.fp_method_accepted = 'Emergency contraceptive'" - - - key: "total_total_pills" - description: "total_total_pills_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( fp.fp_method_accepted = 'Emergency contraceptive' OR fp.fp_method_accepted = 'COC' OR fp.fp_method_accepted = 'POP')" - - - key: "10y14y_F_mcondom" - description: "reporting_10y14y_F_mcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Male condom') - AND ( fm.gender = 'Female')" - - - key: "10y14y_men_F_mcondom" - description: "reporting_10y14y_men_F_mcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Male condom') - AND ( fm.gender = 'Male')" - - - key: "10y14y_F_fcondom" - description: "reporting_10y14y_F_fcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Female condom') - AND ( fm.gender = 'Female')" - - - key: "10y14y_men_F_fcondom" - description: "reporting_10y14y_men_F_fcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Female condom') - AND ( fm.gender = 'Male')" - - - key: "10y14y_total_condoms" - description: "reporting_10y14y_total_condoms_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Female condom' OR fp.fp_method_accepted = 'Male condom' )" - - - key: "15y19y_F_mcondom" - description: "reporting_15y19y_F_mcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Male condom') - AND ( fm.gender = 'Female')" - - - key: "15y19y_men_F_mcondom" - description: "reporting_15y19y_men_F_mcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND (fp.fp_method_accepted = 'Male condom') - AND (fm.gender = 'Male')" - - - key: "15y19y_F_fcondom" - description: "reporting_15y19y_F_fcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Female condom') - AND ( fm.gender = 'Female')" - - - key: "15y19y_men_F_fcondom" - description: "reporting_15y19y_men_F_fcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND (fp.fp_method_accepted = 'Female condom') - AND (fm.gender = 'Male')" - - - key: "15y19y_total_condoms" - description: "reporting_15y19y_total_condoms_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Female condom' OR fp.fp_method_accepted = 'Male condom' )" - - - key: "20y24y_F_mcondom" - description: "reporting_20y24y_F_mcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND (fp.fp_method_accepted = 'Male condom') - AND (fm.gender = 'Female')" - - - key: "20y24y_men_F_mcondom" - description: "reporting_20y24y_men_F_mcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Male condom') - AND ( fm.gender = 'Male')" - - - key: "20y24y_F_fcondom" - description: "reporting_20y24y_F_fcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Female condom') - AND ( fm.gender = 'Female')" - - - key: "20y24y_men_F_fcondom" - description: "reporting_20y24y_men_F_fcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Female condom') - AND ( fm.gender = 'Male')" - - - key: "20y24y_total_condoms" - description: "reporting_20y24y_total_condoms_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND ( fp.fp_method_accepted = 'Female condom' OR fp.fp_method_accepted = 'Male condom' )" - - - key: "25_F_mcondom" - description: "reporting_25_F_mcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND ( fp.fp_method_accepted = 'Male condom') - AND ( fm.gender = 'Female')" - - - key: "25_men_F_mcondom" - description: "reporting_25_men_F_mcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND ( fp.fp_method_accepted = 'Male condom') - AND ( fm.gender = 'Male')" - - - key: "25_F_fcondom" - description: "reporting_25_F_fcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND ( fp.fp_method_accepted = 'Female condom') - AND ( fm.gender = 'Female')" - - - key: "25_men_F_fcondom" - description: "reporting_25_men_F_fcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND ( fp.fp_method_accepted = 'Female condom') - AND ( fm.gender = 'Male')" - - - key: "25_total_condoms" - description: "reporting_25_total_condoms_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND ( fp.fp_method_accepted = 'Female condom' OR fp.fp_method_accepted = 'Male condom')" - - - key: "total_F_mcondom" - description: "total_F_mcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( fp.fp_method_accepted = 'Male condom') - AND ( fm.gender = 'Female')" - - - key: "total_men_F_mcondom" - description: "total_men_F_mcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( fp.fp_method_accepted = 'Male condom') - AND ( fm.gender = 'Male')" - - - key: "total_F_fcondom" - description: "total_F_fcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( fp.fp_method_accepted = 'Female condom') - AND ( fm.gender = 'Female')" - - - key: "total_men_F_fcondom" - description: "total_men_F_fcondom_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( fp.fp_method_accepted = 'Female condom') - AND ( fm.gender = 'Male')" - - - key: "total_total_condoms" - description: "total_total_condoms_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( fp.fp_method_accepted = 'Female condom' OR fp.fp_method_accepted = 'Male condom')" - - - key: "10y14y_beads" - description: "reporting_10y14y_beads_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND fp.fp_method_accepted = 'Standard day method'" - - - key: "15y19y_beads" - description: "reporting_15y19y_beads_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND fp.fp_method_accepted = 'Standard day method'" - - - key: "20y24y_beads" - description: "reporting_20y24y_beads_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND fp.fp_method_accepted = 'Standard day method'" - - - key: "25_beads" - description: "reporting_25_beads_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND fp.fp_method_accepted = 'Standard day method'" - - - key: "total_beads" - description: "total_beads_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND fp.fp_method_accepted = 'Standard day method'" - - - key: "10y14y_cousel_ANC" - description: "reporting_10y14y_cousel_ANC_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During ANC' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now'))" - - - key: "15y19y_cousel_ANC" - description: "reporting_15y19y_cousel_ANC_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During ANC' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now'))" - - - key: "20y24y_cousel_ANC" - description: "reporting_20y24y_cousel_ANC_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During ANC' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now'))" - - - key: "25_cousel_ANC" - description: "reporting_25_cousel_ANC_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During ANC' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+25 years') <= date ('now'))" - - - key: "total_cousel_ANC" - description: "total_cousel_ANC_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During ANC' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+10 years') <= date ('now'))" - - - key: "10y14y_cousel_delivery" - description: "reporting_10y14y_cousel_delivery_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During labour and delivery' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now'))" - - - key: "15y19y_cousel_delivery" - description: "reporting_15y19y_cousel_delivery_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During labour and delivery' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now'))" - - - key: "20y24y_cousel_delivery" - description: "reporting_20y24y_cousel_delivery_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During labour and delivery' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now'))" - - - key: "25_cousel_delivery" - description: "reporting_25_cousel_delivery_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During labour and delivery' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+25 years') <= date ('now'))" - - - key: "total_cousel_delivery" - description: "total_cousel_delivery_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During labour and delivery' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+10 years') <= date ('now'))" - - - key: "10y14y_cousel_PNC" - description: "reporting_10y14y_cousel_PNC_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During PNC' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now'))" - - - key: "15y19y_cousel_PNC" - description: "reporting_15y19y_cousel_PNC_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During PNC' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now'))" - - - key: "20y24y_cousel_PNC" - description: "reporting_20y24y_cousel_PNC_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During PNC' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now'))" - - - key: "25_cousel_PNC" - description: "reporting_25_cousel_PNC_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During PNC' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+25 years') <= date ('now'))" - - - key: "total_cousel_PNC" - description: "total_cousel_PNC_label" - indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count - FROM visit_details vd - INNER JOIN visits v on v.visit_id = vd.visit_id - INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id - WHERE vd.human_readable_details = 'During PNC' - AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) - AND ( date(fm.dob, '+10 years') <= date ('now'))" - - - key: "10y14y_referral" - description: "reporting_10y14y_referral_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Referral' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND ( fm.gender = 'Female')" - - - key: "10y14y_men_referral" - description: "reporting_10y14y_men_referral_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Referral' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now')) - AND ( date(fm.dob, '+14 years') >= date ('now')) - AND ( fm.gender = 'Male')" - - - key: "15y19y_referral" - description: "reporting_15y19y_referral_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Referral' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND ( fm.gender = 'Female')" - - - key: "15y19y_men_referral" - description: "reporting_15y19y_men_referral_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Referral' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+15 years') <= date ('now')) - AND ( date(fm.dob, '+19 years') >= date ('now')) - AND ( fm.gender = 'Male')" - - - key: "20y24y_referral" - description: "reporting_20y24y_referral_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Referral' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND ( fm.gender = 'Female')" - - - key: "20y24y_men_referral" - description: "reporting_20y24y_men_referral_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Referral' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+20 years') <= date ('now')) - AND ( date(fm.dob, '+24 years') >= date ('now')) - AND ( fm.gender = 'Male')" - - - key: "25_referral" - description: "reporting_25_referral_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Referral' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND ( fm.gender = 'Female')" - - - key: "25_men_referral" - description: "reporting_25_men_referral_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Referral' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+25 years') <= date ('now')) - AND ( fm.gender = 'Male')" - - - key: "total_fp_referral" - description: "total_fp_referral_label" - indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count - FROM event e - INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId - WHERE e.eventType = 'Family Planning Referral' - AND ('%s' = (substr(e.eventDate, 1,10))) - AND ( date(fm.dob, '+10 years') <= date ('now'))" +#indicators: +# - key: "newpreg_mama_visit" +# description: "newpreg_mama_visit_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN visits v on v.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'ANC Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND (substr(e.eventDate, 1, 4) == strftime('%Y',date('now'), 'localtime')) +# AND (substr(e.eventDate, 6, 2) == strftime('%m',date('now'), 'localtime')) +# AND (v.visit_type = 'ANC Home Visit') +# AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) +# AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime'))" +# +# - key: "oldpreg_mama_visit" +# description: "oldpreg_mama_visit_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN visits v on v.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'ANC Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND (date (e.eventDate) < date('now','start of month')) +# AND v.visit_type = 'ANC Home Visit' +# AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) +# AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime'))" +# +# - key: "total_preg_visit" +# description: "total_preg_visit_label" +# indicatorQuery: "SELECT count (DISTINCT(v.base_entity_id)) as count +# FROM visits v +# WHERE v.visit_type = 'ANC Home Visit' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) +# AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime'))" +# +# - key: "pnc_visit" +# description: "pnc_visit_label" +# indicatorQuery: "SELECT count (DISTINCT(v.base_entity_id)) as count +# FROM visits v +# WHERE v.visit_type = 'PNC Home Visit' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) +# AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime'))" +# +# - key: "total_F_visited" +# description: "total_F_visited_label" +# indicatorQuery: "SELECT count (DISTINCT(v.base_entity_id)) as count +# FROM visits v +# WHERE ( v.visit_type = 'PNC Home Visit' OR v.visit_type = 'ANC Home Visit') +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) +# AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime'))" +# +# - key: "less1m_visit" +# description: "less1m_visit_label" +# indicatorQuery: "SELECT SUM(count) as count +# FROM( +# SELECT count(DISTINCT c.base_entity_id) as count +# FROM ec_child c +# INNER JOIN visits v on v.base_entity_id = c.mother_entity_id +# WHERE v.visit_type = 'PNC Home Visit' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) +# AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime')) +# AND ( date(c.dob, '+1 month') > date ('now')) +# UNION ALL +# SELECT count(DISTINCT c.base_entity_id) as count +# FROM ec_child c +# INNER JOIN visits v on v.base_entity_id = c.base_entity_id +# WHERE( date(c.dob, '+1 month') > date ('now')) +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND v.visit_type = 'Child Home Visit' +# AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) +# AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime')) +# )" +# +# - key: "1m1yr_visit" +# description: "reporting_1m1yr_visit_label" +# indicatorQuery: "SELECT count(DISTINCT c.base_entity_id) as count +# FROM ec_child c +# INNER JOIN visits v on v.base_entity_id = c.base_entity_id +# WHERE( date(c.dob, '+1 month') <= date ('now')) +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND( date(c.dob, '+1 year') > date ('now')) +# AND v.visit_type = 'Child Home Visit' +# AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) +# AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime'))" +# +# - key: "1yr5yr_visit" +# description: "reporting_1yr5yr_visit_label" +# indicatorQuery: "SELECT count(DISTINCT c.base_entity_id) as count +# FROM ec_child c +# INNER JOIN visits v on v.base_entity_id = c.base_entity_id +# WHERE( date(c.dob, '+1 year') <= date ('now')) +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND( date(c.dob, '+5 years') >= date ('now')) +# AND v.visit_type = 'Child Home Visit' +# AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) +# AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime'))" +# +# - key: "total_U5_visit" +# description: "total_U5_visit_label" +# indicatorQuery: "SELECT count(1) as count +# FROM event e +# INNER JOIN ec_child c on c.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Child Registration' OR e.eventType = 'PNC Child Registration') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND (c.is_closed = '0')" +# +# - key: "hh_visited" +# description: "hh_visited_label" +# indicatorQuery: "SELECT SUM(count) +# FROM ( +# SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# WHERE e.eventType = 'Family Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND (substr(e.eventDate, 1, 4) == strftime('%Y',date('now'), 'localtime')) +# AND (substr(e.eventDate, 6, 2) == strftime('%m',date('now'), 'localtime')) +# AND e.baseEntityId NOT IN( +# SELECT DISTINCT fm.relational_id +# FROM ec_family_member fm +# INNER JOIN visits v on v.base_entity_id = fm.base_entity_id +# WHERE ( v.visit_type = 'PNC Home Visit' OR v.visit_type = 'ANC Home Visit' OR v.visit_type = 'FP Follow up Visit Resupply' +# OR v.visit_type = 'FP Follow-up Visit Side-effects' OR v.visit_type = 'FP Follow up visit Counselling' OR v.visit_type = 'Child Home Visit') +# AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) +# AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime')) +# ) +# UNION ALL +# SELECT COUNT(DISTINCT fm.relational_id) as count +# FROM visits v +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE ( v.visit_type = 'PNC Home Visit' OR v.visit_type = 'ANC Home Visit' OR v.visit_type = 'FP Follow up Visit Resupply' +# OR v.visit_type = 'FP Follow-up Visit Side-effects' OR v.visit_type = 'FP Follow up visit Counselling' OR v.visit_type = 'Child Home Visit') +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( strftime('%Y',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%Y',date('now'), 'localtime')) +# AND ( strftime('%m',(datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) == strftime('%m',date('now'), 'localtime')) +# )" +# +# - key: "F_referral_hf" +# description: "F_referral_hf_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# WHERE (e.eventType = 'ANC Referral' OR e.eventType = 'PNC Referral' OR e.eventType = 'Family Planning Referral' OR e.eventType = 'Malaria Referral') +# AND ('%s' = (substr(e.eventDate, 1,10)))" +# +# - key: "less1m_referral_hf" +# description: "less1m_referral_hf_label" +# indicatorQuery: "SELECT SUM(count) as count +# FROM( +# SELECT count(DISTINCT c.base_entity_id) as count +# FROM ec_child c +# INNER JOIN event e on e.baseEntityId = c.base_entity_id +# WHERE( date(c.dob, '+1 month') > date ('now')) +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND e.eventType = 'Sick Child Referral' +# UNION ALL +# SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_child c on c.mother_entity_id = e.baseEntityId +# WHERE e.eventType = 'PNC Referral' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(c.dob, '+1 month') > date ('now')) +# AND e.eventType = 'PNC Referral')" +# +# - key: "1m1yr_referral_hf" +# description: "reporting_1m1yr_referral_hf_label" +# indicatorQuery: "SELECT count(DISTINCT c.base_entity_id) as count +# FROM ec_child c +# INNER JOIN event e on e.baseEntityId = c.base_entity_id +# WHERE( date(c.dob, '+1 month') <= date ('now')) +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND( date(c.dob, '+1 year') > date ('now')) +# AND e.eventType = 'Sick Child Referral'" +# +# - key: "1yr5yr_referral_hf" +# description: "reporting_1yr5yr_referral_hf_label" +# indicatorQuery: "SELECT count(DISTINCT c.base_entity_id) as count +# FROM ec_child c +# INNER JOIN event e on e.baseEntityId = c.base_entity_id +# WHERE( date(c.dob, '+1 year') <= date ('now')) +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND( date(c.dob, '+5 years') >= date ('now')) +# AND e.eventType = 'Sick Child Referral'" +# +# - key: "total_referral" +# description: "total_referral_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# WHERE (e.eventType = 'ANC Referral' OR e.eventType = 'PNC Referral' OR e.eventType = 'Family Planning Referral' OR e.eventType = 'Malaria Referral' OR e.eventType = 'Sick Child Referral') +# AND ('%s' = (substr(e.eventDate, 1,10)))" +# +# - key: "no_healthedu_meet" +# description: "no_healthedu_meet_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# WHERE (e.eventType = ' Health Education Meeting') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND (substr(e.eventDate, 1, 4) == strftime('%Y',date('now'), 'localtime')) +# AND (substr(e.eventDate, 6, 2) == strftime('%m',date('now'), 'localtime'))" +# +# - key: "no_ppl_attend_meet" +# description: "no_ppl_attend_meet_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# WHERE (e.eventType = ' Health Education Meeting') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND (substr(e.eventDate, 1, 4) == strftime('%Y',date('now'), 'localtime')) +# AND (substr(e.eventDate, 6, 2) == strftime('%m',date('now'), 'localtime'))" +# +# - key: "F_death_home" +# description: "F_death_home_label" +# indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" +# +# - key: "no_maternal_death" +# description: "no_maternal_death_label" +# indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" +# +# - key: "less1m_death_home" +# description: "less1m_death_home_label" +# indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" +# +# - key: "total_less1m_deaths" +# description: "total_less1m_deaths_label" +# indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" +# +# - key: "1m1yr_death_home" +# description: "reporting_1m1yr_death_home_label" +# indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" +# +# - key: "total_1m1yr_deaths" +# description: "total_1m1yr_deaths_label" +# indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" +# +# - key: "1yr5yr_death_home" +# description: "reporting_1yr5yr_death_home_label" +# indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" +# +# - key: "total_1yr5yr_deaths" +# description: "total_1yr5yr_deaths_label" +# indicatorQuery: "SELECT count (0) as count FROM ec_child WHERE is_closed is 2" +# +# - key: "birth_home" +# description: "birth_home_label" +# indicatorQuery: "SELECT count(DISTINCT pg.base_entity_id) as count +# FROM ec_pregnancy_outcome pg +# INNER JOIN event e on e.baseEntityId = pg.base_entity_id +# WHERE pg.delivery_place = 'At home' +# AND ('%s' = (substr(e.eventDate, 1,10)))" +# +# - key: "birth_home_healer" +# description: "birth_home_healer_label" +# indicatorQuery: "SELECT count(DISTINCT pg.base_entity_id) as count +# FROM ec_pregnancy_outcome pg +# INNER JOIN event e on e.baseEntityId = pg.base_entity_id +# WHERE pg.delivery_place = 'At home' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND pg.delivery_home = 'She gave birth at home with the help of a traditional midwife'" +# +# - key: "birth_way_hf" +# description: "birth_way_hf_label" +# indicatorQuery: "SELECT count(DISTINCT pg.base_entity_id) as count +# FROM ec_pregnancy_outcome pg +# INNER JOIN event e on e.baseEntityId = pg.base_entity_id +# WHERE pg.delivery_place = 'On the way to the health facility' +# AND ('%s' = (substr(e.eventDate, 1,10)))" +# +# - key: "total_birth_home" +# description: "total_birth_home_label" +# indicatorQuery: "SELECT count(DISTINCT pg.base_entity_id) as count +# FROM ec_pregnancy_outcome pg +# INNER JOIN event e on e.baseEntityId = pg.base_entity_id +# WHERE ( pg.delivery_place = 'At home' OR pg.delivery_place = 'On the way to the health facility') +# AND ('%s' = (substr(e.eventDate, 1,10)))" +# +# - key: "10y14y_new_clients" +# description: "reporting_10y14y_new_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND ( fp.using_method = 'no') +# AND ( fm.gender = 'Female')" +# +# - key: "10y14y_new_men_clients" +# description: "reporting_10y14y_new_men_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND ( fp.using_method = 'no') +# AND ( fm.gender = 'Male')" +# +# - key: "10y14y_return_clients" +# description: "reporting_10y14y_return_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND ( fp.using_method = 'yes') +# AND ( fm.gender = 'Female')" +# +# - key: "10y14y_return_men_clients" +# description: "reporting_10y14y_return_men_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND ( fp.using_method = 'yes') +# AND ( fm.gender = 'Male')" +# +# - key: "10y14y_total_clients" +# description: "reporting_10y14y_total_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now'))" +# +# - key: "15y19y_new_clients" +# description: "reporting_15y19y_new_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND ( fp.using_method = 'no') +# AND ( fm.gender = 'Female')" +# +# - key: "15y19y_new_men_clients" +# description: "reporting_15y19y_new_men_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND ( fp.using_method = 'no') +# AND ( fm.gender = 'Male')" +# +# - key: "15y19y_return_clients" +# description: "reporting_15y19y_return_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND ( fp.using_method = 'yes') +# AND ( fm.gender = 'Female')" +# +# - key: "15y19y_return_men_clients" +# description: "reporting_15y19y_return_men_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND ( fp.using_method = 'yes') +# AND ( fm.gender = 'Male')" +# +# - key: "15y19y_total_clients" +# description: "reporting_15y19y_total_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now'))" +# +# - key: "20y24y_new_clients" +# description: "reporting_20y24y_new_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND ( fp.using_method = 'no') +# AND ( fm.gender = 'Female')" +# +# - key: "20y24y_new_men_clients" +# description: "reporting_20y24y_new_men_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND ( fp.using_method = 'no') +# AND ( fm.gender = 'Male')" +# +# - key: "20y24y_return_clients" +# description: "reporting_20y24y_return_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND ( fp.using_method = 'yes') +# AND ( fm.gender = 'Female')" +# +# - key: "20y24y_return_men_clients" +# description: "reporting_20y24y_return_men_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND ( fp.using_method = 'yes') +# AND ( fm.gender = 'Male')" +# +# - key: "20y24y_total_clients" +# description: "reporting_20y24y_total_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now'))" +# +# - key: "25_new_clients" +# description: "reporting_25_new_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND ( fp.using_method = 'no') +# AND ( fm.gender = 'Female')" +# +# - key: "25_new_men_clients" +# description: "reporting_25_new_men_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND ( fp.using_method = 'no') +# AND ( fm.gender = 'Male')" +# +# - key: "25_return_clients" +# description: "reporting_25_return_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND ( fp.using_method = 'yes') +# AND ( fm.gender = 'Female')" +# +# - key: "25_return_men_clients" +# description: "reporting_25_return_men_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND ( fp.using_method = 'yes') +# AND ( fm.gender = 'Male')" +# +# - key: "25_total_clients" +# description: "reporting_25_total_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now'))" +# +# - key: "total_new_clients" +# description: "total_new_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( fp.using_method = 'no') +# AND ( fm.gender = 'Female')" +# +# - key: "total_new_men_clients" +# description: "total_new_men_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( fp.using_method = 'no') +# AND ( fm.gender = 'Male')" +# +# - key: "total_return_clients" +# description: "total_return_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( fp.using_method = 'yes') +# AND ( fm.gender = 'Female')" +# +# - key: "total_return_men_clients" +# description: "total_return_men_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( fp.using_method = 'yes') +# AND ( fm.gender = 'Male')" +# +# - key: "total_total_clients" +# description: "total_total_clients_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Registration' +# AND ('%s' = (substr(e.eventDate, 1,10))) " +# +# - key: "10y14y_pop" +# description: "reporting_10y14y_pop_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND fp.fp_method_accepted = 'POP'" +# +# - key: "10y14y_coc" +# description: "reporting_10y14y_coc_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND fp.fp_method_accepted = 'COC'" +# +# - key: "10y14y_emc" +# description: "reporting_10y14y_emc_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND fp.fp_method_accepted = 'Emergency contraceptive'" +# +# - key: "10y14y_total_pills" +# description: "reporting_10y14y_total_pills_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Emergency contraceptive' OR fp.fp_method_accepted = 'COC' OR fp.fp_method_accepted = 'POP')" +# +# - key: "15y19y_pop" +# description: "reporting_15y19y_pop_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND fp.fp_method_accepted = 'POP'" +# +# - key: "15y19y_coc" +# description: "reporting_15y19y_coc_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND fp.fp_method_accepted = 'COC'" +# +# - key: "15y19y_emc" +# description: "reporting_15y19y_emc_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND fp.fp_method_accepted = 'Emergency contraceptive'" +# +# - key: "15y19y_total_pills" +# description: "reporting_15y19y_total_pills_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Emergency contraceptive' OR fp.fp_method_accepted = 'COC' OR fp.fp_method_accepted = 'POP')" +# +# - key: "20y24y_pop" +# description: "reporting_20y24y_pop_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND fp.fp_method_accepted = 'POP'" +# +# - key: "20y24y_coc" +# description: "reporting_20y24y_coc_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND fp.fp_method_accepted = 'COC'" +# +# - key: "20y24y_emc" +# description: "reporting_20y24y_emc_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND fp.fp_method_accepted = 'Emergency contraceptive'" +# +# - key: "20y24y_total_pills" +# description: "reporting_20y24y_total_pills_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Emergency contraceptive' OR fp.fp_method_accepted = 'COC' OR fp.fp_method_accepted = 'POP')" +# +# - key: "25_pop" +# description: "reporting_25_pop_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND fp.fp_method_accepted = 'POP'" +# +# - key: "25_coc" +# description: "reporting_25_coc_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND fp.fp_method_accepted = 'COC'" +# +# - key: "25_emc" +# description: "reporting_25_emc_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND fp.fp_method_accepted = 'Emergency contraceptive'" +# +# - key: "25_total_pills" +# description: "reporting_25_total_pills_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND ( fp.fp_method_accepted = 'Emergency contraceptive' OR fp.fp_method_accepted = 'COC' OR fp.fp_method_accepted = 'POP')" +# +# - key: "total_pop" +# description: "total_pop_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND fp.fp_method_accepted = 'POP'" +# +# - key: "total_coc" +# description: "total_coc_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND fp.fp_method_accepted = 'COC'" +# +# - key: "total_emc" +# description: "total_emc_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND fp.fp_method_accepted = 'Emergency contraceptive'" +# +# - key: "total_total_pills" +# description: "total_total_pills_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( fp.fp_method_accepted = 'Emergency contraceptive' OR fp.fp_method_accepted = 'COC' OR fp.fp_method_accepted = 'POP')" +# +# - key: "10y14y_F_mcondom" +# description: "reporting_10y14y_F_mcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Male condom') +# AND ( fm.gender = 'Female')" +# +# - key: "10y14y_men_F_mcondom" +# description: "reporting_10y14y_men_F_mcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Male condom') +# AND ( fm.gender = 'Male')" +# +# - key: "10y14y_F_fcondom" +# description: "reporting_10y14y_F_fcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Female condom') +# AND ( fm.gender = 'Female')" +# +# - key: "10y14y_men_F_fcondom" +# description: "reporting_10y14y_men_F_fcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Female condom') +# AND ( fm.gender = 'Male')" +# +# - key: "10y14y_total_condoms" +# description: "reporting_10y14y_total_condoms_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Female condom' OR fp.fp_method_accepted = 'Male condom' )" +# +# - key: "15y19y_F_mcondom" +# description: "reporting_15y19y_F_mcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Male condom') +# AND ( fm.gender = 'Female')" +# +# - key: "15y19y_men_F_mcondom" +# description: "reporting_15y19y_men_F_mcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND (fp.fp_method_accepted = 'Male condom') +# AND (fm.gender = 'Male')" +# +# - key: "15y19y_F_fcondom" +# description: "reporting_15y19y_F_fcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Female condom') +# AND ( fm.gender = 'Female')" +# +# - key: "15y19y_men_F_fcondom" +# description: "reporting_15y19y_men_F_fcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND (fp.fp_method_accepted = 'Female condom') +# AND (fm.gender = 'Male')" +# +# - key: "15y19y_total_condoms" +# description: "reporting_15y19y_total_condoms_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Female condom' OR fp.fp_method_accepted = 'Male condom' )" +# +# - key: "20y24y_F_mcondom" +# description: "reporting_20y24y_F_mcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND (fp.fp_method_accepted = 'Male condom') +# AND (fm.gender = 'Female')" +# +# - key: "20y24y_men_F_mcondom" +# description: "reporting_20y24y_men_F_mcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Male condom') +# AND ( fm.gender = 'Male')" +# +# - key: "20y24y_F_fcondom" +# description: "reporting_20y24y_F_fcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Female condom') +# AND ( fm.gender = 'Female')" +# +# - key: "20y24y_men_F_fcondom" +# description: "reporting_20y24y_men_F_fcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Female condom') +# AND ( fm.gender = 'Male')" +# +# - key: "20y24y_total_condoms" +# description: "reporting_20y24y_total_condoms_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND ( fp.fp_method_accepted = 'Female condom' OR fp.fp_method_accepted = 'Male condom' )" +# +# - key: "25_F_mcondom" +# description: "reporting_25_F_mcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND ( fp.fp_method_accepted = 'Male condom') +# AND ( fm.gender = 'Female')" +# +# - key: "25_men_F_mcondom" +# description: "reporting_25_men_F_mcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND ( fp.fp_method_accepted = 'Male condom') +# AND ( fm.gender = 'Male')" +# +# - key: "25_F_fcondom" +# description: "reporting_25_F_fcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND ( fp.fp_method_accepted = 'Female condom') +# AND ( fm.gender = 'Female')" +# +# - key: "25_men_F_fcondom" +# description: "reporting_25_men_F_fcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND ( fp.fp_method_accepted = 'Female condom') +# AND ( fm.gender = 'Male')" +# +# - key: "25_total_condoms" +# description: "reporting_25_total_condoms_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND ( fp.fp_method_accepted = 'Female condom' OR fp.fp_method_accepted = 'Male condom')" +# +# - key: "total_F_mcondom" +# description: "total_F_mcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( fp.fp_method_accepted = 'Male condom') +# AND ( fm.gender = 'Female')" +# +# - key: "total_men_F_mcondom" +# description: "total_men_F_mcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( fp.fp_method_accepted = 'Male condom') +# AND ( fm.gender = 'Male')" +# +# - key: "total_F_fcondom" +# description: "total_F_fcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( fp.fp_method_accepted = 'Female condom') +# AND ( fm.gender = 'Female')" +# +# - key: "total_men_F_fcondom" +# description: "total_men_F_fcondom_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( fp.fp_method_accepted = 'Female condom') +# AND ( fm.gender = 'Male')" +# +# - key: "total_total_condoms" +# description: "total_total_condoms_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( fp.fp_method_accepted = 'Female condom' OR fp.fp_method_accepted = 'Male condom')" +# +# - key: "10y14y_beads" +# description: "reporting_10y14y_beads_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND fp.fp_method_accepted = 'Standard day method'" +# +# - key: "15y19y_beads" +# description: "reporting_15y19y_beads_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND fp.fp_method_accepted = 'Standard day method'" +# +# - key: "20y24y_beads" +# description: "reporting_20y24y_beads_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND fp.fp_method_accepted = 'Standard day method'" +# +# - key: "25_beads" +# description: "reporting_25_beads_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND fp.fp_method_accepted = 'Standard day method'" +# +# - key: "total_beads" +# description: "total_beads_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_planning fp on fp.base_entity_id = e.baseEntityId +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE ( e.eventType = 'Family Planning Registration' OR e.eventType = 'Family Planning Change Method') +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND fp.fp_method_accepted = 'Standard day method'" +# +# - key: "10y14y_cousel_ANC" +# description: "reporting_10y14y_cousel_ANC_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During ANC' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now'))" +# +# - key: "15y19y_cousel_ANC" +# description: "reporting_15y19y_cousel_ANC_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During ANC' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now'))" +# +# - key: "20y24y_cousel_ANC" +# description: "reporting_20y24y_cousel_ANC_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During ANC' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now'))" +# +# - key: "25_cousel_ANC" +# description: "reporting_25_cousel_ANC_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During ANC' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+25 years') <= date ('now'))" +# +# - key: "total_cousel_ANC" +# description: "total_cousel_ANC_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During ANC' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+10 years') <= date ('now'))" +# +# - key: "10y14y_cousel_delivery" +# description: "reporting_10y14y_cousel_delivery_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During labour and delivery' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now'))" +# +# - key: "15y19y_cousel_delivery" +# description: "reporting_15y19y_cousel_delivery_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During labour and delivery' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now'))" +# +# - key: "20y24y_cousel_delivery" +# description: "reporting_20y24y_cousel_delivery_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During labour and delivery' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now'))" +# +# - key: "25_cousel_delivery" +# description: "reporting_25_cousel_delivery_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During labour and delivery' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+25 years') <= date ('now'))" +# +# - key: "total_cousel_delivery" +# description: "total_cousel_delivery_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During labour and delivery' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+10 years') <= date ('now'))" +# +# - key: "10y14y_cousel_PNC" +# description: "reporting_10y14y_cousel_PNC_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During PNC' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now'))" +# +# - key: "15y19y_cousel_PNC" +# description: "reporting_15y19y_cousel_PNC_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During PNC' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now'))" +# +# - key: "20y24y_cousel_PNC" +# description: "reporting_20y24y_cousel_PNC_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During PNC' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now'))" +# +# - key: "25_cousel_PNC" +# description: "reporting_25_cousel_PNC_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During PNC' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+25 years') <= date ('now'))" +# +# - key: "total_cousel_PNC" +# description: "total_cousel_PNC_label" +# indicatorQuery: "SELECT count (DISTINCT v.base_entity_id) as count +# FROM visit_details vd +# INNER JOIN visits v on v.visit_id = vd.visit_id +# INNER JOIN ec_family_member fm on fm.base_entity_id = v.base_entity_id +# WHERE vd.human_readable_details = 'During PNC' +# AND ('%s' = strftime('%Y-%m-%d',datetime(v.visit_date/1000, 'unixepoch', 'localtime'))) +# AND ( date(fm.dob, '+10 years') <= date ('now'))" +# +# - key: "10y14y_referral" +# description: "reporting_10y14y_referral_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Referral' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND ( fm.gender = 'Female')" +# +# - key: "10y14y_men_referral" +# description: "reporting_10y14y_men_referral_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Referral' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now')) +# AND ( date(fm.dob, '+14 years') >= date ('now')) +# AND ( fm.gender = 'Male')" +# +# - key: "15y19y_referral" +# description: "reporting_15y19y_referral_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Referral' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND ( fm.gender = 'Female')" +# +# - key: "15y19y_men_referral" +# description: "reporting_15y19y_men_referral_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Referral' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+15 years') <= date ('now')) +# AND ( date(fm.dob, '+19 years') >= date ('now')) +# AND ( fm.gender = 'Male')" +# +# - key: "20y24y_referral" +# description: "reporting_20y24y_referral_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Referral' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND ( fm.gender = 'Female')" +# +# - key: "20y24y_men_referral" +# description: "reporting_20y24y_men_referral_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Referral' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+20 years') <= date ('now')) +# AND ( date(fm.dob, '+24 years') >= date ('now')) +# AND ( fm.gender = 'Male')" +# +# - key: "25_referral" +# description: "reporting_25_referral_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Referral' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND ( fm.gender = 'Female')" +# +# - key: "25_men_referral" +# description: "reporting_25_men_referral_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Referral' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+25 years') <= date ('now')) +# AND ( fm.gender = 'Male')" +# +# - key: "total_fp_referral" +# description: "total_fp_referral_label" +# indicatorQuery: "SELECT count(DISTINCT e.baseEntityId) as count +# FROM event e +# INNER JOIN ec_family_member fm on fm.base_entity_id = e.baseEntityId +# WHERE e.eventType = 'Family Planning Referral' +# AND ('%s' = (substr(e.eventDate, 1,10))) +# AND ( date(fm.dob, '+10 years') <= date ('now'))" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/config/kvp-monthly-report.yml b/opensrp-chw-hf/src/main/assets/config/kvp-monthly-report.yml new file mode 100644 index 000000000..741e318b8 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/config/kvp-monthly-report.yml @@ -0,0 +1,36246 @@ +indicators: + - key: "kvp-1-<10-pwid-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-10-14-pwid-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-15-19-pwid-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-20-24-pwid-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-25-29-pwid-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-30-34-pwid-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-35-39-pwid-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-40-44-pwid-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-45-49-pwid-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1->50-pwid-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-<10-pwid-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-10-14-pwid-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-15-19-pwid-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-20-24-pwid-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-25-29-pwid-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-30-34-pwid-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-35-39-pwid-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-40-44-pwid-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-45-49-pwid-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2->50-pwid-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-<10-pwid-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-10-14-pwid-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-15-19-pwid-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-20-24-pwid-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-25-29-pwid-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-30-34-pwid-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-35-39-pwid-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-40-44-pwid-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-45-49-pwid-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3->50-pwid-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-<10-pwid-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-10-14-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-15-19-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-20-24-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-25-29-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-30-34-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-35-39-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-40-44-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-45-49-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4->50-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-<10-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-10-14-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-15-19-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-20-24-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-25-29-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-30-34-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-35-39-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-40-44-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-45-49-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5->50-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-<10-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-10-14-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-15-19-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-20-24-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-25-29-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-30-34-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-35-39-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-40-44-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-45-49-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6->50-pwid-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-7-<10-pwid-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-10-14-pwid-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-15-19-pwid-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-20-24-pwid-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-25-29-pwid-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-30-34-pwid-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-35-39-pwid-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-40-44-pwid-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-45-49-pwid-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7->50-pwid-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-<10-pwid-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-10-14-pwid-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-15-19-pwid-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-20-24-pwid-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-25-29-pwid-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-30-34-pwid-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-35-39-pwid-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-40-44-pwid-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-45-49-pwid-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8->50-pwid-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-9-<10-pwid-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-10-14-pwid-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-15-19-pwid-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-20-24-pwid-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-25-29-pwid-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-30-34-pwid-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-35-39-pwid-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-40-44-pwid-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-45-49-pwid-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9->50-pwid-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-<10-pwid-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-10-14-pwid-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-15-19-pwid-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-20-24-pwid-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-25-29-pwid-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-30-34-pwid-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-35-39-pwid-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-40-44-pwid-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-45-49-pwid-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10->50-pwid-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-<10-pwid-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-10-14-pwid-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-15-19-pwid-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-20-24-pwid-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-25-29-pwid-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-30-34-pwid-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-35-39-pwid-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-40-44-pwid-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-45-49-pwid-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11->50-pwid-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-<10-pwid-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-10-14-pwid-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-15-19-pwid-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-20-24-pwid-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-25-29-pwid-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-30-34-pwid-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-35-39-pwid-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-40-44-pwid-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-45-49-pwid-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14->50-pwid-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-<10-pwid-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-10-14-pwid-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-15-19-pwid-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-20-24-pwid-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-25-29-pwid-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-30-34-pwid-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-35-39-pwid-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-40-44-pwid-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-45-49-pwid-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15->50-pwid-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-<10-pwid-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-10-14-pwid-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-15-19-pwid-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-20-24-pwid-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-25-29-pwid-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-30-34-pwid-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-35-39-pwid-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-40-44-pwid-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-45-49-pwid-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16->50-pwid-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-<10-pwid-ME" + description: "Wapya waliopimwa na kupokea majibu Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-10-14-pwid-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-15-19-pwid-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-20-24-pwid-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-25-29-pwid-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-30-34-pwid-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-35-39-pwid-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-40-44-pwid-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-45-49-pwid-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a->50-pwid-ME" + description: "Wapya waliopimwa na kupokea majibu Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-<10-pwid-ME" + description: "Wapya wenye majibu ya VVU chanya Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services='enrolled_and_on_arv' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='known_positive')) +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-10-14-pwid-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services='enrolled_and_on_arv' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='known_positive')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-15-19-pwid-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services='enrolled_and_on_arv' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='known_positive')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-20-24-pwid-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services='enrolled_and_on_arv' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='known_positive')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-25-29-pwid-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services='enrolled_and_on_arv' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='known_positive')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-30-34-pwid-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services='enrolled_and_on_arv' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='known_positive')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-35-39-pwid-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services='enrolled_and_on_arv' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='known_positive')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-40-44-pwid-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services='enrolled_and_on_arv' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='known_positive')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-45-49-pwid-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services='enrolled_and_on_arv' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='known_positive')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b->50-pwid-ME" + description: "Wapya wenye majibu ya VVU chanya Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services='enrolled_and_on_arv' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='known_positive')) +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-<10-pwid-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable')) +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-10-14-pwid-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-15-19-pwid-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-20-24-pwid-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-25-29-pwid-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-30-34-pwid-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-35-39-pwid-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-40-44-pwid-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-45-49-pwid-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c->50-pwid-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable')) +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-<10-pwid-ME" + description: "Wapya walioanzishiwa ART Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv')) +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-10-14-pwid-ME" + description: "Wapya walioanzishiwa ART Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-15-19-pwid-ME" + description: "Wapya walioanzishiwa ART Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-20-24-pwid-ME" + description: "Wapya walioanzishiwa ART Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-25-29-pwid-ME" + description: "Wapya walioanzishiwa ART Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-30-34-pwid-ME" + description: "Wapya walioanzishiwa ART Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-35-39-pwid-ME" + description: "Wapya walioanzishiwa ART Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-40-44-pwid-ME" + description: "Wapya walioanzishiwa ART Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-45-49-pwid-ME" + description: "Wapya walioanzishiwa ART Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d->50-pwid-ME" + description: "Wapya walioanzishiwa ART Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ((ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv')) +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-<10-pwid-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-10-14-pwid-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-15-19-pwid-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-20-24-pwid-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-25-29-pwid-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-30-34-pwid-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-35-39-pwid-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-40-44-pwid-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-45-49-pwid-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18->50-pwid-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-<10-pwid-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-10-14-pwid-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-15-19-pwid-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-20-24-pwid-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-25-29-pwid-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-30-34-pwid-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-35-39-pwid-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-40-44-pwid-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-45-49-pwid-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19->50-pwid-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-<10-pwid-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-10-14-pwid-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-15-19-pwid-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-20-24-pwid-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-25-29-pwid-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-30-34-pwid-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-35-39-pwid-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-40-44-pwid-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-45-49-pwid-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20->50-pwid-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-<10-pwid-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri <10" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-10-14-pwid-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 10-14" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-15-19-pwid-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 15-19" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-20-24-pwid-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 20-24" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-25-29-pwid-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 25-29" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-30-34-pwid-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 30-34" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-35-39-pwid-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 35-39" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-40-44-pwid-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 40-44" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-45-49-pwid-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 45-49" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21->50-pwid-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri >50" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-<10-pwid-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-10-14-pwid-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-15-19-pwid-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-20-24-pwid-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-25-29-pwid-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-30-34-pwid-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-35-39-pwid-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-40-44-pwid-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-45-49-pwid-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22->50-pwid-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-<10-pwid-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-10-14-pwid-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-15-19-pwid-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-20-24-pwid-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-25-29-pwid-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-30-34-pwid-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-35-39-pwid-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-40-44-pwid-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-45-49-pwid-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1->50-pwid-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-<10-pwid-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-10-14-pwid-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-15-19-pwid-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-20-24-pwid-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-25-29-pwid-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-30-34-pwid-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-35-39-pwid-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-40-44-pwid-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-45-49-pwid-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2->50-pwid-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-<10-pwid-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-10-14-pwid-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-15-19-pwid-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-20-24-pwid-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-25-29-pwid-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-30-34-pwid-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-35-39-pwid-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-40-44-pwid-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-45-49-pwid-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3->50-pwid-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-<10-pwid-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-10-14-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-15-19-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-20-24-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-25-29-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-30-34-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-35-39-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-40-44-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-45-49-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4->50-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-<10-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-10-14-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-15-19-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-20-24-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-25-29-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-30-34-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-35-39-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-40-44-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-45-49-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5->50-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-<10-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-10-14-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-15-19-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-20-24-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-25-29-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-30-34-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-35-39-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-40-44-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-45-49-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6->50-pwid-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-7-<10-pwid-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-10-14-pwid-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-15-19-pwid-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-20-24-pwid-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-25-29-pwid-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-30-34-pwid-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-35-39-pwid-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-40-44-pwid-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-45-49-pwid-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7->50-pwid-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-<10-pwid-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-10-14-pwid-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-15-19-pwid-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-20-24-pwid-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-25-29-pwid-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-30-34-pwid-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-35-39-pwid-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-40-44-pwid-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-45-49-pwid-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8->50-pwid-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-9-<10-pwid-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-10-14-pwid-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-15-19-pwid-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-20-24-pwid-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-25-29-pwid-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-30-34-pwid-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-35-39-pwid-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-40-44-pwid-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-45-49-pwid-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9->50-pwid-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-<10-pwid-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-10-14-pwid-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-15-19-pwid-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-20-24-pwid-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-25-29-pwid-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-30-34-pwid-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-35-39-pwid-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-40-44-pwid-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-45-49-pwid-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10->50-pwid-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-<10-pwid-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-10-14-pwid-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-15-19-pwid-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-20-24-pwid-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-25-29-pwid-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-30-34-pwid-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-35-39-pwid-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-40-44-pwid-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-45-49-pwid-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11->50-pwid-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-<10-pwid-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-10-14-pwid-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-15-19-pwid-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-20-24-pwid-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-25-29-pwid-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-30-34-pwid-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-35-39-pwid-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-40-44-pwid-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-45-49-pwid-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14->50-pwid-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-<10-pwid-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-10-14-pwid-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-15-19-pwid-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-20-24-pwid-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-25-29-pwid-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-30-34-pwid-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-35-39-pwid-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-40-44-pwid-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-45-49-pwid-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15->50-pwid-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-<10-pwid-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-10-14-pwid-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-15-19-pwid-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-20-24-pwid-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-25-29-pwid-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-30-34-pwid-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-35-39-pwid-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-40-44-pwid-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-45-49-pwid-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16->50-pwid-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-<10-pwid-KE" + description: "Wapya waliopimwa na kupokea majibu Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-10-14-pwid-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-15-19-pwid-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-20-24-pwid-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-25-29-pwid-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-30-34-pwid-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-35-39-pwid-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-40-44-pwid-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-45-49-pwid-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a->50-pwid-KE" + description: "Wapya waliopimwa na kupokea majibu Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-<10-pwid-KE" + description: "Wapya wenye majibu ya VVU chanya Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-10-14-pwid-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-15-19-pwid-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-20-24-pwid-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-25-29-pwid-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-30-34-pwid-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-35-39-pwid-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-40-44-pwid-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-45-49-pwid-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b->50-pwid-KE" + description: "Wapya wenye majibu ya VVU chanya Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-<10-pwid-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-10-14-pwid-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-15-19-pwid-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-20-24-pwid-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-25-29-pwid-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-30-34-pwid-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-35-39-pwid-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-40-44-pwid-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-45-49-pwid-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c->50-pwid-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-<10-pwid-KE" + description: "Wapya walioanzishiwa ART Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-10-14-pwid-KE" + description: "Wapya walioanzishiwa ART Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-15-19-pwid-KE" + description: "Wapya walioanzishiwa ART Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-20-24-pwid-KE" + description: "Wapya walioanzishiwa ART Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-25-29-pwid-KE" + description: "Wapya walioanzishiwa ART Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-30-34-pwid-KE" + description: "Wapya walioanzishiwa ART Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-35-39-pwid-KE" + description: "Wapya walioanzishiwa ART Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-40-44-pwid-KE" + description: "Wapya walioanzishiwa ART Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-45-49-pwid-KE" + description: "Wapya walioanzishiwa ART Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d->50-pwid-KE" + description: "Wapya walioanzishiwa ART Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-<10-pwid-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-10-14-pwid-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-15-19-pwid-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-20-24-pwid-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-25-29-pwid-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-30-34-pwid-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-35-39-pwid-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-40-44-pwid-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-45-49-pwid-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18->50-pwid-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-<10-pwid-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-10-14-pwid-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-15-19-pwid-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-20-24-pwid-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-25-29-pwid-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-30-34-pwid-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-35-39-pwid-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-40-44-pwid-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-45-49-pwid-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19->50-pwid-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-<10-pwid-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-10-14-pwid-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-15-19-pwid-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-20-24-pwid-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-25-29-pwid-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-30-34-pwid-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-35-39-pwid-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-40-44-pwid-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-45-49-pwid-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20->50-pwid-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-<10-pwid-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri <10" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-10-14-pwid-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 10-14" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-15-19-pwid-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 15-19" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-20-24-pwid-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 20-24" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-25-29-pwid-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 25-29" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-30-34-pwid-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 30-34" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-35-39-pwid-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 35-39" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-40-44-pwid-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 40-44" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-45-49-pwid-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 45-49" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21->50-pwid-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri >50" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-<10-pwid-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-10-14-pwid-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-15-19-pwid-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-20-24-pwid-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-25-29-pwid-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-30-34-pwid-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-35-39-pwid-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-40-44-pwid-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-45-49-pwid-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22->50-pwid-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-<10-pwud-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-10-14-pwud-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-15-19-pwud-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-20-24-pwud-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-25-29-pwud-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-30-34-pwud-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-35-39-pwud-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-40-44-pwud-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-45-49-pwud-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1->50-pwud-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-<10-pwud-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-10-14-pwud-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-15-19-pwud-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-20-24-pwud-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-25-29-pwud-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-30-34-pwud-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-35-39-pwud-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-40-44-pwud-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-45-49-pwud-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2->50-pwud-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-<10-pwud-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-10-14-pwud-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-15-19-pwud-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-20-24-pwud-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-25-29-pwud-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-30-34-pwud-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-35-39-pwud-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-40-44-pwud-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-45-49-pwud-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3->50-pwud-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-<10-pwud-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-10-14-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-15-19-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-20-24-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-25-29-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-30-34-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-35-39-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-40-44-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-45-49-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4->50-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-<10-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-10-14-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-15-19-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-20-24-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-25-29-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-30-34-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-35-39-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-40-44-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-45-49-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5->50-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-<10-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-10-14-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-15-19-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-20-24-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-25-29-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-30-34-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-35-39-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-40-44-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-45-49-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6->50-pwud-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-7-<10-pwud-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-10-14-pwud-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-15-19-pwud-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-20-24-pwud-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-25-29-pwud-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-30-34-pwud-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-35-39-pwud-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-40-44-pwud-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-45-49-pwud-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7->50-pwud-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-<10-pwud-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-10-14-pwud-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-15-19-pwud-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-20-24-pwud-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-25-29-pwud-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-30-34-pwud-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-35-39-pwud-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-40-44-pwud-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-45-49-pwud-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8->50-pwud-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-9-<10-pwud-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-10-14-pwud-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-15-19-pwud-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-20-24-pwud-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-25-29-pwud-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-30-34-pwud-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-35-39-pwud-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-40-44-pwud-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-45-49-pwud-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9->50-pwud-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-<10-pwud-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-10-14-pwud-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-15-19-pwud-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-20-24-pwud-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-25-29-pwud-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-30-34-pwud-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-35-39-pwud-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-40-44-pwud-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-45-49-pwud-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10->50-pwud-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-<10-pwud-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-10-14-pwud-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-15-19-pwud-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-20-24-pwud-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-25-29-pwud-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-30-34-pwud-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-35-39-pwud-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-40-44-pwud-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-45-49-pwud-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11->50-pwud-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-<10-pwud-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-10-14-pwud-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-15-19-pwud-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-20-24-pwud-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-25-29-pwud-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-30-34-pwud-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-35-39-pwud-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-40-44-pwud-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-45-49-pwud-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14->50-pwud-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-<10-pwud-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-10-14-pwud-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-15-19-pwud-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-20-24-pwud-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-25-29-pwud-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-30-34-pwud-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-35-39-pwud-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-40-44-pwud-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-45-49-pwud-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15->50-pwud-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-<10-pwud-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-10-14-pwud-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-15-19-pwud-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-20-24-pwud-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-25-29-pwud-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-30-34-pwud-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-35-39-pwud-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-40-44-pwud-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-45-49-pwud-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16->50-pwud-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-<10-pwud-ME" + description: "Wapya waliopimwa na kupokea majibu Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-10-14-pwud-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-15-19-pwud-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-20-24-pwud-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-25-29-pwud-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-30-34-pwud-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-35-39-pwud-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-40-44-pwud-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-45-49-pwud-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a->50-pwud-ME" + description: "Wapya waliopimwa na kupokea majibu Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-<10-pwud-ME" + description: "Wapya wenye majibu ya VVU chanya Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-10-14-pwud-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-15-19-pwud-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-20-24-pwud-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-25-29-pwud-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-30-34-pwud-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-35-39-pwud-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-40-44-pwud-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-45-49-pwud-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b->50-pwud-ME" + description: "Wapya wenye majibu ya VVU chanya Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-<10-pwud-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-10-14-pwud-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-15-19-pwud-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-20-24-pwud-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-25-29-pwud-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-30-34-pwud-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-35-39-pwud-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-40-44-pwud-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-45-49-pwud-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c->50-pwud-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-<10-pwud-ME" + description: "Wapya walioanzishiwa ART Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-10-14-pwud-ME" + description: "Wapya walioanzishiwa ART Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-15-19-pwud-ME" + description: "Wapya walioanzishiwa ART Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-20-24-pwud-ME" + description: "Wapya walioanzishiwa ART Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-25-29-pwud-ME" + description: "Wapya walioanzishiwa ART Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-30-34-pwud-ME" + description: "Wapya walioanzishiwa ART Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-35-39-pwud-ME" + description: "Wapya walioanzishiwa ART Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-40-44-pwud-ME" + description: "Wapya walioanzishiwa ART Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-45-49-pwud-ME" + description: "Wapya walioanzishiwa ART Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d->50-pwud-ME" + description: "Wapya walioanzishiwa ART Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-<10-pwud-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-10-14-pwud-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-15-19-pwud-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-20-24-pwud-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-25-29-pwud-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-30-34-pwud-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-35-39-pwud-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-40-44-pwud-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-45-49-pwud-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18->50-pwud-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-<10-pwud-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-10-14-pwud-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-15-19-pwud-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-20-24-pwud-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-25-29-pwud-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-30-34-pwud-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-35-39-pwud-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-40-44-pwud-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-45-49-pwud-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19->50-pwud-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-<10-pwud-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-10-14-pwud-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-15-19-pwud-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-20-24-pwud-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-25-29-pwud-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-30-34-pwud-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-35-39-pwud-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-40-44-pwud-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-45-49-pwud-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20->50-pwud-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-<10-pwud-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri <10" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-10-14-pwud-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 10-14" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-15-19-pwud-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 15-19" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-20-24-pwud-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 20-24" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-25-29-pwud-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 25-29" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-30-34-pwud-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 30-34" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-35-39-pwud-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 35-39" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-40-44-pwud-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 40-44" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-45-49-pwud-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 45-49" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21->50-pwud-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri >50" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-<10-pwud-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-10-14-pwud-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-15-19-pwud-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-20-24-pwud-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-25-29-pwud-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-30-34-pwud-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-35-39-pwud-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-40-44-pwud-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-45-49-pwud-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22->50-pwud-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-<10-pwud-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-10-14-pwud-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-15-19-pwud-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-20-24-pwud-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-25-29-pwud-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-30-34-pwud-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-35-39-pwud-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-40-44-pwud-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-45-49-pwud-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1->50-pwud-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-<10-pwud-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-10-14-pwud-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-15-19-pwud-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-20-24-pwud-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-25-29-pwud-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-30-34-pwud-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-35-39-pwud-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-40-44-pwud-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-45-49-pwud-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2->50-pwud-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-<10-pwud-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-10-14-pwud-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-15-19-pwud-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-20-24-pwud-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-25-29-pwud-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-30-34-pwud-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-35-39-pwud-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-40-44-pwud-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-45-49-pwud-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3->50-pwud-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-<10-pwud-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-10-14-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-15-19-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-20-24-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-25-29-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-30-34-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-35-39-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-40-44-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-45-49-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4->50-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-<10-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-10-14-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-15-19-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-20-24-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-25-29-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-30-34-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-35-39-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-40-44-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-45-49-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5->50-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-<10-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-10-14-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-15-19-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-20-24-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-25-29-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-30-34-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-35-39-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-40-44-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-45-49-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6->50-pwud-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-7-<10-pwud-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-10-14-pwud-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-15-19-pwud-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-20-24-pwud-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-25-29-pwud-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-30-34-pwud-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-35-39-pwud-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-40-44-pwud-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-45-49-pwud-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7->50-pwud-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-<10-pwud-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-10-14-pwud-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-15-19-pwud-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-20-24-pwud-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-25-29-pwud-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-30-34-pwud-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-35-39-pwud-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-40-44-pwud-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-45-49-pwud-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8->50-pwud-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-9-<10-pwud-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-10-14-pwud-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-15-19-pwud-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-20-24-pwud-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-25-29-pwud-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-30-34-pwud-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-35-39-pwud-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-40-44-pwud-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-45-49-pwud-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9->50-pwud-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-<10-pwud-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-10-14-pwud-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-15-19-pwud-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-20-24-pwud-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-25-29-pwud-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-30-34-pwud-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-35-39-pwud-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-40-44-pwud-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-45-49-pwud-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10->50-pwud-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-<10-pwud-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-10-14-pwud-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-15-19-pwud-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-20-24-pwud-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-25-29-pwud-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-30-34-pwud-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-35-39-pwud-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-40-44-pwud-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-45-49-pwud-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11->50-pwud-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-<10-pwud-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-10-14-pwud-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-15-19-pwud-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-20-24-pwud-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-25-29-pwud-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-30-34-pwud-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-35-39-pwud-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-40-44-pwud-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-45-49-pwud-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14->50-pwud-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-<10-pwud-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-10-14-pwud-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-15-19-pwud-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-20-24-pwud-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-25-29-pwud-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-30-34-pwud-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-35-39-pwud-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-40-44-pwud-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-45-49-pwud-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15->50-pwud-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-<10-pwud-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-10-14-pwud-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-15-19-pwud-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-20-24-pwud-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-25-29-pwud-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-30-34-pwud-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-35-39-pwud-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-40-44-pwud-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-45-49-pwud-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16->50-pwud-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-<10-pwud-KE" + description: "Wapya waliopimwa na kupokea majibu Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-10-14-pwud-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-15-19-pwud-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-20-24-pwud-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-25-29-pwud-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-30-34-pwud-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-35-39-pwud-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-40-44-pwud-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-45-49-pwud-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a->50-pwud-KE" + description: "Wapya waliopimwa na kupokea majibu Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-<10-pwud-KE" + description: "Wapya wenye majibu ya VVU chanya Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-10-14-pwud-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-15-19-pwud-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-20-24-pwud-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-25-29-pwud-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-30-34-pwud-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-35-39-pwud-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-40-44-pwud-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-45-49-pwud-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b->50-pwud-KE" + description: "Wapya wenye majibu ya VVU chanya Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-<10-pwud-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-10-14-pwud-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-15-19-pwud-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-20-24-pwud-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-25-29-pwud-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-30-34-pwud-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-35-39-pwud-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-40-44-pwud-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-45-49-pwud-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c->50-pwud-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-<10-pwud-KE" + description: "Wapya walioanzishiwa ART Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-10-14-pwud-KE" + description: "Wapya walioanzishiwa ART Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-15-19-pwud-KE" + description: "Wapya walioanzishiwa ART Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-20-24-pwud-KE" + description: "Wapya walioanzishiwa ART Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-25-29-pwud-KE" + description: "Wapya walioanzishiwa ART Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-30-34-pwud-KE" + description: "Wapya walioanzishiwa ART Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-35-39-pwud-KE" + description: "Wapya walioanzishiwa ART Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-40-44-pwud-KE" + description: "Wapya walioanzishiwa ART Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-45-49-pwud-KE" + description: "Wapya walioanzishiwa ART Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d->50-pwud-KE" + description: "Wapya walioanzishiwa ART Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-<10-pwud-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-10-14-pwud-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-15-19-pwud-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-20-24-pwud-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-25-29-pwud-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-30-34-pwud-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-35-39-pwud-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-40-44-pwud-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-45-49-pwud-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18->50-pwud-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-<10-pwud-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-10-14-pwud-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-15-19-pwud-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-20-24-pwud-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-25-29-pwud-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-30-34-pwud-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-35-39-pwud-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-40-44-pwud-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-45-49-pwud-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19->50-pwud-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-<10-pwud-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-10-14-pwud-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-15-19-pwud-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-20-24-pwud-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-25-29-pwud-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-30-34-pwud-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-35-39-pwud-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-40-44-pwud-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-45-49-pwud-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20->50-pwud-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-<10-pwud-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri <10" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-10-14-pwud-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 10-14" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-15-19-pwud-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 15-19" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-20-24-pwud-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 20-24" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-25-29-pwud-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 25-29" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-30-34-pwud-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 30-34" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-35-39-pwud-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 35-39" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-40-44-pwud-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 40-44" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-45-49-pwud-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 45-49" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21->50-pwud-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri >50" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-<10-pwud-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-10-14-pwud-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-15-19-pwud-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-20-24-pwud-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-25-29-pwud-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-30-34-pwud-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-35-39-pwud-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-40-44-pwud-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-45-49-pwud-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22->50-pwud-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-<10-fsw-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-10-14-fsw-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-15-19-fsw-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-20-24-fsw-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-25-29-fsw-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-30-34-fsw-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-35-39-fsw-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-40-44-fsw-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-45-49-fsw-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1->50-fsw-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-<10-fsw-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-10-14-fsw-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-15-19-fsw-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-20-24-fsw-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-25-29-fsw-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-30-34-fsw-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-35-39-fsw-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-40-44-fsw-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-45-49-fsw-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2->50-fsw-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE ((ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided)) +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-<10-fsw-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-10-14-fsw-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-15-19-fsw-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-20-24-fsw-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-25-29-fsw-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-30-34-fsw-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-35-39-fsw-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-40-44-fsw-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-45-49-fsw-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3->50-fsw-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-<10-fsw-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-10-14-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-15-19-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-20-24-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-25-29-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-30-34-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-35-39-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-40-44-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-45-49-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4->50-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-<10-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-10-14-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-15-19-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-20-24-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-25-29-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-30-34-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-35-39-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-40-44-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-45-49-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5->50-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-<10-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-10-14-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-15-19-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-20-24-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-25-29-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-30-34-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-35-39-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-40-44-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-45-49-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6->50-fsw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-7-<10-fsw-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-10-14-fsw-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-15-19-fsw-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-20-24-fsw-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-25-29-fsw-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-30-34-fsw-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-35-39-fsw-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-40-44-fsw-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-45-49-fsw-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7->50-fsw-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-<10-fsw-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-10-14-fsw-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-15-19-fsw-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-20-24-fsw-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-25-29-fsw-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-30-34-fsw-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-35-39-fsw-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-40-44-fsw-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-45-49-fsw-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8->50-fsw-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-9-<10-fsw-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-10-14-fsw-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-15-19-fsw-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-20-24-fsw-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-25-29-fsw-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-30-34-fsw-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-35-39-fsw-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-40-44-fsw-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-45-49-fsw-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9->50-fsw-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-<10-fsw-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-10-14-fsw-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-15-19-fsw-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-20-24-fsw-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-25-29-fsw-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-30-34-fsw-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-35-39-fsw-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-40-44-fsw-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-45-49-fsw-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10->50-fsw-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-<10-fsw-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-10-14-fsw-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-15-19-fsw-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-20-24-fsw-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-25-29-fsw-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-30-34-fsw-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-35-39-fsw-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-40-44-fsw-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-45-49-fsw-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11->50-fsw-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-<10-fsw-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-10-14-fsw-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-15-19-fsw-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-20-24-fsw-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-25-29-fsw-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-30-34-fsw-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-35-39-fsw-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-40-44-fsw-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-45-49-fsw-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14->50-fsw-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-<10-fsw-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-10-14-fsw-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-15-19-fsw-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-20-24-fsw-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-25-29-fsw-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-30-34-fsw-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-35-39-fsw-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-40-44-fsw-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-45-49-fsw-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15->50-fsw-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-<10-fsw-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-10-14-fsw-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-15-19-fsw-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-20-24-fsw-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-25-29-fsw-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-30-34-fsw-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-35-39-fsw-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-40-44-fsw-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-45-49-fsw-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16->50-fsw-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-<10-fsw-KE" + description: "Wapya waliopimwa na kupokea majibu Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-10-14-fsw-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-15-19-fsw-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-20-24-fsw-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-25-29-fsw-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-30-34-fsw-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-35-39-fsw-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-40-44-fsw-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-45-49-fsw-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a->50-fsw-KE" + description: "Wapya waliopimwa na kupokea majibu Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-<10-fsw-KE" + description: "Wapya wenye majibu ya VVU chanya Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-10-14-fsw-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-15-19-fsw-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-20-24-fsw-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-25-29-fsw-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-30-34-fsw-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-35-39-fsw-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-40-44-fsw-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-45-49-fsw-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b->50-fsw-KE" + description: "Wapya wenye majibu ya VVU chanya Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-<10-fsw-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-10-14-fsw-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-15-19-fsw-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-20-24-fsw-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-25-29-fsw-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-30-34-fsw-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-35-39-fsw-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-40-44-fsw-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-45-49-fsw-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c->50-fsw-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-<10-fsw-KE" + description: "Wapya walioanzishiwa ART Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-10-14-fsw-KE" + description: "Wapya walioanzishiwa ART Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-15-19-fsw-KE" + description: "Wapya walioanzishiwa ART Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-20-24-fsw-KE" + description: "Wapya walioanzishiwa ART Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-25-29-fsw-KE" + description: "Wapya walioanzishiwa ART Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-30-34-fsw-KE" + description: "Wapya walioanzishiwa ART Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-35-39-fsw-KE" + description: "Wapya walioanzishiwa ART Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-40-44-fsw-KE" + description: "Wapya walioanzishiwa ART Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-45-49-fsw-KE" + description: "Wapya walioanzishiwa ART Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d->50-fsw-KE" + description: "Wapya walioanzishiwa ART Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-<10-fsw-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-10-14-fsw-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-15-19-fsw-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-20-24-fsw-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-25-29-fsw-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-30-34-fsw-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-35-39-fsw-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-40-44-fsw-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-45-49-fsw-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18->50-fsw-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-<10-fsw-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-10-14-fsw-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-15-19-fsw-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-20-24-fsw-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-25-29-fsw-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-30-34-fsw-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-35-39-fsw-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-40-44-fsw-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-45-49-fsw-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19->50-fsw-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-<10-fsw-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-10-14-fsw-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-15-19-fsw-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-20-24-fsw-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-25-29-fsw-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-30-34-fsw-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-35-39-fsw-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-40-44-fsw-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-45-49-fsw-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20->50-fsw-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-<10-fsw-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri <10" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-10-14-fsw-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 10-14" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-15-19-fsw-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 15-19" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-20-24-fsw-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 20-24" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-25-29-fsw-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 25-29" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-30-34-fsw-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 30-34" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-35-39-fsw-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 35-39" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-40-44-fsw-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 40-44" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-45-49-fsw-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 45-49" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21->50-fsw-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri >50" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-<10-fsw-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-10-14-fsw-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-15-19-fsw-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-20-24-fsw-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-25-29-fsw-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-30-34-fsw-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-35-39-fsw-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-40-44-fsw-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-45-49-fsw-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22->50-fsw-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-<10-msm-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-10-14-msm-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-15-19-msm-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-20-24-msm-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-25-29-msm-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-30-34-msm-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-35-39-msm-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-40-44-msm-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-45-49-msm-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1->50-msm-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-<10-msm-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-10-14-msm-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-15-19-msm-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-20-24-msm-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-25-29-msm-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-30-34-msm-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-35-39-msm-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-40-44-msm-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-45-49-msm-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2->50-msm-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-<10-msm-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-10-14-msm-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-15-19-msm-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-20-24-msm-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-25-29-msm-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-30-34-msm-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-35-39-msm-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-40-44-msm-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-45-49-msm-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3->50-msm-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-<10-msm-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-10-14-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-15-19-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-20-24-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-25-29-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-30-34-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-35-39-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-40-44-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-45-49-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4->50-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-<10-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-10-14-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-15-19-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-20-24-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-25-29-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-30-34-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-35-39-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-40-44-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-45-49-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5->50-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-<10-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-10-14-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-15-19-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-20-24-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-25-29-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-30-34-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-35-39-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-40-44-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-45-49-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6->50-msm-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-7-<10-msm-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-10-14-msm-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-15-19-msm-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-20-24-msm-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-25-29-msm-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-30-34-msm-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-35-39-msm-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-40-44-msm-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-45-49-msm-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7->50-msm-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-<10-msm-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-10-14-msm-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-15-19-msm-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-20-24-msm-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-25-29-msm-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-30-34-msm-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-35-39-msm-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-40-44-msm-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-45-49-msm-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8->50-msm-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-9-<10-msm-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-10-14-msm-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-15-19-msm-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-20-24-msm-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-25-29-msm-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-30-34-msm-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-35-39-msm-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-40-44-msm-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-45-49-msm-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9->50-msm-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-<10-msm-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-10-14-msm-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-15-19-msm-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-20-24-msm-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-25-29-msm-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-30-34-msm-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-35-39-msm-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-40-44-msm-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-45-49-msm-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10->50-msm-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-<10-msm-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-10-14-msm-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-15-19-msm-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-20-24-msm-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-25-29-msm-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-30-34-msm-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-35-39-msm-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-40-44-msm-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-45-49-msm-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11->50-msm-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-<10-msm-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-10-14-msm-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-15-19-msm-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-20-24-msm-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-25-29-msm-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-30-34-msm-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-35-39-msm-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-40-44-msm-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-45-49-msm-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14->50-msm-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-<10-msm-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-10-14-msm-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-15-19-msm-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-20-24-msm-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-25-29-msm-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-30-34-msm-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-35-39-msm-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-40-44-msm-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-45-49-msm-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15->50-msm-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-<10-msm-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-10-14-msm-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-15-19-msm-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-20-24-msm-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-25-29-msm-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-30-34-msm-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-35-39-msm-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-40-44-msm-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-45-49-msm-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16->50-msm-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-<10-msm-ME" + description: "Wapya waliopimwa na kupokea majibu Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-10-14-msm-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-15-19-msm-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-20-24-msm-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-25-29-msm-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-30-34-msm-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-35-39-msm-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-40-44-msm-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-45-49-msm-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a->50-msm-ME" + description: "Wapya waliopimwa na kupokea majibu Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-<10-msm-ME" + description: "Wapya wenye majibu ya VVU chanya Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-10-14-msm-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-15-19-msm-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-20-24-msm-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-25-29-msm-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-30-34-msm-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-35-39-msm-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-40-44-msm-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-45-49-msm-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b->50-msm-ME" + description: "Wapya wenye majibu ya VVU chanya Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-<10-msm-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-10-14-msm-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-15-19-msm-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-20-24-msm-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-25-29-msm-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-30-34-msm-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-35-39-msm-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-40-44-msm-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-45-49-msm-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c->50-msm-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-<10-msm-ME" + description: "Wapya walioanzishiwa ART Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-10-14-msm-ME" + description: "Wapya walioanzishiwa ART Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-15-19-msm-ME" + description: "Wapya walioanzishiwa ART Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-20-24-msm-ME" + description: "Wapya walioanzishiwa ART Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-25-29-msm-ME" + description: "Wapya walioanzishiwa ART Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-30-34-msm-ME" + description: "Wapya walioanzishiwa ART Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-35-39-msm-ME" + description: "Wapya walioanzishiwa ART Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-40-44-msm-ME" + description: "Wapya walioanzishiwa ART Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-45-49-msm-ME" + description: "Wapya walioanzishiwa ART Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d->50-msm-ME" + description: "Wapya walioanzishiwa ART Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-<10-msm-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-10-14-msm-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-15-19-msm-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-20-24-msm-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-25-29-msm-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-30-34-msm-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-35-39-msm-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-40-44-msm-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-45-49-msm-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18->50-msm-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-<10-msm-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-10-14-msm-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-15-19-msm-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-20-24-msm-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-25-29-msm-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-30-34-msm-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-35-39-msm-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-40-44-msm-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-45-49-msm-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19->50-msm-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-<10-msm-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-10-14-msm-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-15-19-msm-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-20-24-msm-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-25-29-msm-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-30-34-msm-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-35-39-msm-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-40-44-msm-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-45-49-msm-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20->50-msm-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-<10-msm-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri <10" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-10-14-msm-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 10-14" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-15-19-msm-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 15-19" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-20-24-msm-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 20-24" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-25-29-msm-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 25-29" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-30-34-msm-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 30-34" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-35-39-msm-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 35-39" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-40-44-msm-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 40-44" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-45-49-msm-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 45-49" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21->50-msm-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri >50" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-<10-msm-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-10-14-msm-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-15-19-msm-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-20-24-msm-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-25-29-msm-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-30-34-msm-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-35-39-msm-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-40-44-msm-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-45-49-msm-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22->50-msm-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-<10-mobile_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-10-14-mobile_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-15-19-mobile_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-20-24-mobile_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-25-29-mobile_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-30-34-mobile_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-35-39-mobile_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-40-44-mobile_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-45-49-mobile_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1->50-mobile_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-<10-mobile_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-10-14-mobile_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-15-19-mobile_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-20-24-mobile_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-25-29-mobile_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-30-34-mobile_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-35-39-mobile_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-40-44-mobile_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-45-49-mobile_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2->50-mobile_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-<10-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-10-14-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-15-19-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-20-24-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-25-29-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-30-34-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-35-39-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-40-44-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-45-49-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3->50-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-<10-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-10-14-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-15-19-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-20-24-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-25-29-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-30-34-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-35-39-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-40-44-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-45-49-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4->50-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-<10-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-10-14-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-15-19-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-20-24-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-25-29-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-30-34-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-35-39-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-40-44-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-45-49-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5->50-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-<10-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-10-14-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-15-19-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-20-24-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-25-29-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-30-34-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-35-39-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-40-44-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-45-49-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6->50-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-7-<10-mobile_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-10-14-mobile_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-15-19-mobile_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-20-24-mobile_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-25-29-mobile_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-30-34-mobile_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-35-39-mobile_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-40-44-mobile_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-45-49-mobile_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7->50-mobile_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-<10-mobile_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-10-14-mobile_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-15-19-mobile_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-20-24-mobile_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-25-29-mobile_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-30-34-mobile_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-35-39-mobile_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-40-44-mobile_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-45-49-mobile_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8->50-mobile_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-9-<10-mobile_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-10-14-mobile_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-15-19-mobile_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-20-24-mobile_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-25-29-mobile_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-30-34-mobile_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-35-39-mobile_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-40-44-mobile_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-45-49-mobile_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9->50-mobile_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-<10-mobile_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-10-14-mobile_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-15-19-mobile_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-20-24-mobile_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-25-29-mobile_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-30-34-mobile_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-35-39-mobile_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-40-44-mobile_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-45-49-mobile_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10->50-mobile_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-<10-mobile_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-10-14-mobile_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-15-19-mobile_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-20-24-mobile_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-25-29-mobile_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-30-34-mobile_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-35-39-mobile_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-40-44-mobile_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-45-49-mobile_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11->50-mobile_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-<10-mobile_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-10-14-mobile_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-15-19-mobile_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-20-24-mobile_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-25-29-mobile_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-30-34-mobile_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-35-39-mobile_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-40-44-mobile_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-45-49-mobile_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14->50-mobile_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-<10-mobile_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-10-14-mobile_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-15-19-mobile_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-20-24-mobile_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-25-29-mobile_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-30-34-mobile_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-35-39-mobile_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-40-44-mobile_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-45-49-mobile_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15->50-mobile_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-<10-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-10-14-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-15-19-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-20-24-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-25-29-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-30-34-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-35-39-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-40-44-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-45-49-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16->50-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-<10-mobile_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-10-14-mobile_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-15-19-mobile_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-20-24-mobile_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-25-29-mobile_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-30-34-mobile_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-35-39-mobile_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-40-44-mobile_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-45-49-mobile_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a->50-mobile_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-<10-mobile_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-10-14-mobile_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-15-19-mobile_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-20-24-mobile_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-25-29-mobile_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-30-34-mobile_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-35-39-mobile_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-40-44-mobile_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-45-49-mobile_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b->50-mobile_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-<10-mobile_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-10-14-mobile_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-15-19-mobile_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-20-24-mobile_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-25-29-mobile_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-30-34-mobile_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-35-39-mobile_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-40-44-mobile_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-45-49-mobile_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c->50-mobile_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-<10-mobile_population-ME" + description: "Wapya walioanzishiwa ART Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-10-14-mobile_population-ME" + description: "Wapya walioanzishiwa ART Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-15-19-mobile_population-ME" + description: "Wapya walioanzishiwa ART Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-20-24-mobile_population-ME" + description: "Wapya walioanzishiwa ART Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-25-29-mobile_population-ME" + description: "Wapya walioanzishiwa ART Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-30-34-mobile_population-ME" + description: "Wapya walioanzishiwa ART Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-35-39-mobile_population-ME" + description: "Wapya walioanzishiwa ART Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-40-44-mobile_population-ME" + description: "Wapya walioanzishiwa ART Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-45-49-mobile_population-ME" + description: "Wapya walioanzishiwa ART Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d->50-mobile_population-ME" + description: "Wapya walioanzishiwa ART Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-<10-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-10-14-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-15-19-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-20-24-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-25-29-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-30-34-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-35-39-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-40-44-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-45-49-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18->50-mobile_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-<10-mobile_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-10-14-mobile_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-15-19-mobile_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-20-24-mobile_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-25-29-mobile_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-30-34-mobile_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-35-39-mobile_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-40-44-mobile_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-45-49-mobile_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19->50-mobile_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-<10-mobile_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-10-14-mobile_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-15-19-mobile_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-20-24-mobile_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-25-29-mobile_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-30-34-mobile_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-35-39-mobile_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-40-44-mobile_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-45-49-mobile_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20->50-mobile_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-<10-mobile_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri <10" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-10-14-mobile_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 10-14" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-15-19-mobile_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 15-19" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-20-24-mobile_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 20-24" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-25-29-mobile_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 25-29" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-30-34-mobile_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 30-34" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-35-39-mobile_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 35-39" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-40-44-mobile_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 40-44" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-45-49-mobile_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 45-49" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21->50-mobile_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri >50" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-<10-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-10-14-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-15-19-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-20-24-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-25-29-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-30-34-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-35-39-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-40-44-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-45-49-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22->50-mobile_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-<10-mobile_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-10-14-mobile_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-15-19-mobile_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-20-24-mobile_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-25-29-mobile_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-30-34-mobile_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-35-39-mobile_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-40-44-mobile_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-45-49-mobile_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1->50-mobile_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-<10-mobile_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-10-14-mobile_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-15-19-mobile_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-20-24-mobile_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-25-29-mobile_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-30-34-mobile_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-35-39-mobile_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-40-44-mobile_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-45-49-mobile_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2->50-mobile_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-<10-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-10-14-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-15-19-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-20-24-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-25-29-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-30-34-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-35-39-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-40-44-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-45-49-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3->50-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-<10-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-10-14-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-15-19-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-20-24-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-25-29-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-30-34-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-35-39-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-40-44-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-45-49-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4->50-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-<10-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-10-14-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-15-19-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-20-24-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-25-29-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-30-34-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-35-39-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-40-44-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-45-49-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5->50-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-<10-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-10-14-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-15-19-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-20-24-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-25-29-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-30-34-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-35-39-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-40-44-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-45-49-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6->50-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-7-<10-mobile_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-10-14-mobile_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-15-19-mobile_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-20-24-mobile_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-25-29-mobile_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-30-34-mobile_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-35-39-mobile_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-40-44-mobile_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-45-49-mobile_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7->50-mobile_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-<10-mobile_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-10-14-mobile_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-15-19-mobile_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-20-24-mobile_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-25-29-mobile_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-30-34-mobile_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-35-39-mobile_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-40-44-mobile_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-45-49-mobile_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8->50-mobile_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-9-<10-mobile_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-10-14-mobile_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-15-19-mobile_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-20-24-mobile_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-25-29-mobile_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-30-34-mobile_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-35-39-mobile_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-40-44-mobile_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-45-49-mobile_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9->50-mobile_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-<10-mobile_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-10-14-mobile_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-15-19-mobile_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-20-24-mobile_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-25-29-mobile_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-30-34-mobile_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-35-39-mobile_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-40-44-mobile_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-45-49-mobile_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10->50-mobile_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-<10-mobile_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-10-14-mobile_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-15-19-mobile_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-20-24-mobile_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-25-29-mobile_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-30-34-mobile_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-35-39-mobile_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-40-44-mobile_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-45-49-mobile_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11->50-mobile_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-<10-mobile_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-10-14-mobile_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-15-19-mobile_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-20-24-mobile_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-25-29-mobile_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-30-34-mobile_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-35-39-mobile_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-40-44-mobile_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-45-49-mobile_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14->50-mobile_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-<10-mobile_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-10-14-mobile_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-15-19-mobile_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-20-24-mobile_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-25-29-mobile_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-30-34-mobile_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-35-39-mobile_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-40-44-mobile_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-45-49-mobile_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15->50-mobile_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-<10-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-10-14-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-15-19-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-20-24-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-25-29-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-30-34-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-35-39-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-40-44-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-45-49-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16->50-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-<10-mobile_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-10-14-mobile_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-15-19-mobile_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-20-24-mobile_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-25-29-mobile_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-30-34-mobile_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-35-39-mobile_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-40-44-mobile_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-45-49-mobile_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a->50-mobile_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-<10-mobile_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-10-14-mobile_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-15-19-mobile_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-20-24-mobile_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-25-29-mobile_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-30-34-mobile_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-35-39-mobile_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-40-44-mobile_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-45-49-mobile_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b->50-mobile_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-<10-mobile_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-10-14-mobile_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-15-19-mobile_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-20-24-mobile_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-25-29-mobile_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-30-34-mobile_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-35-39-mobile_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-40-44-mobile_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-45-49-mobile_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c->50-mobile_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-<10-mobile_population-KE" + description: "Wapya walioanzishiwa ART Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-10-14-mobile_population-KE" + description: "Wapya walioanzishiwa ART Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-15-19-mobile_population-KE" + description: "Wapya walioanzishiwa ART Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-20-24-mobile_population-KE" + description: "Wapya walioanzishiwa ART Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-25-29-mobile_population-KE" + description: "Wapya walioanzishiwa ART Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-30-34-mobile_population-KE" + description: "Wapya walioanzishiwa ART Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-35-39-mobile_population-KE" + description: "Wapya walioanzishiwa ART Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-40-44-mobile_population-KE" + description: "Wapya walioanzishiwa ART Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-45-49-mobile_population-KE" + description: "Wapya walioanzishiwa ART Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d->50-mobile_population-KE" + description: "Wapya walioanzishiwa ART Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-<10-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-10-14-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-15-19-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-20-24-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-25-29-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-30-34-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-35-39-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-40-44-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-45-49-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18->50-mobile_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-<10-mobile_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-10-14-mobile_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-15-19-mobile_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-20-24-mobile_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-25-29-mobile_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-30-34-mobile_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-35-39-mobile_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-40-44-mobile_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-45-49-mobile_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19->50-mobile_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-<10-mobile_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-10-14-mobile_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-15-19-mobile_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-20-24-mobile_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-25-29-mobile_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-30-34-mobile_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-35-39-mobile_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-40-44-mobile_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-45-49-mobile_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20->50-mobile_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-<10-mobile_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri <10" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-10-14-mobile_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 10-14" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-15-19-mobile_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 15-19" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-20-24-mobile_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 20-24" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-25-29-mobile_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 25-29" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-30-34-mobile_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 30-34" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-35-39-mobile_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 35-39" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-40-44-mobile_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 40-44" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-45-49-mobile_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 45-49" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21->50-mobile_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri >50" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-<10-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-10-14-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-15-19-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-20-24-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-25-29-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-30-34-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-35-39-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-40-44-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-45-49-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22->50-mobile_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-<10-serodiscordant_couple-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-10-14-serodiscordant_couple-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-15-19-serodiscordant_couple-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-20-24-serodiscordant_couple-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-25-29-serodiscordant_couple-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-30-34-serodiscordant_couple-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-35-39-serodiscordant_couple-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-40-44-serodiscordant_couple-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-45-49-serodiscordant_couple-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1->50-serodiscordant_couple-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2->50-serodiscordant_couple-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3->50-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4->50-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5->50-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6->50-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-7-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7->50-serodiscordant_couple-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8->50-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-9-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9->50-serodiscordant_couple-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10->50-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11->50-serodiscordant_couple-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14->50-serodiscordant_couple-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15->50-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16->50-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-<10-serodiscordant_couple-ME" + description: "Wapya waliopimwa na kupokea majibu Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-10-14-serodiscordant_couple-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-15-19-serodiscordant_couple-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-20-24-serodiscordant_couple-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-25-29-serodiscordant_couple-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-30-34-serodiscordant_couple-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-35-39-serodiscordant_couple-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-40-44-serodiscordant_couple-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-45-49-serodiscordant_couple-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a->50-serodiscordant_couple-ME" + description: "Wapya waliopimwa na kupokea majibu Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-<10-serodiscordant_couple-ME" + description: "Wapya wenye majibu ya VVU chanya Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-10-14-serodiscordant_couple-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-15-19-serodiscordant_couple-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-20-24-serodiscordant_couple-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-25-29-serodiscordant_couple-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-30-34-serodiscordant_couple-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-35-39-serodiscordant_couple-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-40-44-serodiscordant_couple-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-45-49-serodiscordant_couple-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b->50-serodiscordant_couple-ME" + description: "Wapya wenye majibu ya VVU chanya Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-<10-serodiscordant_couple-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-10-14-serodiscordant_couple-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-15-19-serodiscordant_couple-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-20-24-serodiscordant_couple-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-25-29-serodiscordant_couple-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-30-34-serodiscordant_couple-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-35-39-serodiscordant_couple-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-40-44-serodiscordant_couple-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-45-49-serodiscordant_couple-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c->50-serodiscordant_couple-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-<10-serodiscordant_couple-ME" + description: "Wapya walioanzishiwa ART Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-10-14-serodiscordant_couple-ME" + description: "Wapya walioanzishiwa ART Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-15-19-serodiscordant_couple-ME" + description: "Wapya walioanzishiwa ART Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-20-24-serodiscordant_couple-ME" + description: "Wapya walioanzishiwa ART Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-25-29-serodiscordant_couple-ME" + description: "Wapya walioanzishiwa ART Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-30-34-serodiscordant_couple-ME" + description: "Wapya walioanzishiwa ART Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-35-39-serodiscordant_couple-ME" + description: "Wapya walioanzishiwa ART Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-40-44-serodiscordant_couple-ME" + description: "Wapya walioanzishiwa ART Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-45-49-serodiscordant_couple-ME" + description: "Wapya walioanzishiwa ART Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d->50-serodiscordant_couple-ME" + description: "Wapya walioanzishiwa ART Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18->50-serodiscordant_couple-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-<10-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-10-14-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-15-19-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-20-24-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-25-29-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-30-34-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-35-39-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-40-44-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-45-49-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19->50-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-<10-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-10-14-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-15-19-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-20-24-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-25-29-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-30-34-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-35-39-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-40-44-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-45-49-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20->50-serodiscordant_couple-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-<10-serodiscordant_couple-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri <10" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-10-14-serodiscordant_couple-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 10-14" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-15-19-serodiscordant_couple-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 15-19" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-20-24-serodiscordant_couple-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 20-24" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-25-29-serodiscordant_couple-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 25-29" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-30-34-serodiscordant_couple-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 30-34" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-35-39-serodiscordant_couple-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 35-39" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-40-44-serodiscordant_couple-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 40-44" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-45-49-serodiscordant_couple-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 45-49" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21->50-serodiscordant_couple-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri >50" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22->50-serodiscordant_couple-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-<10-serodiscordant_couple-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-10-14-serodiscordant_couple-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-15-19-serodiscordant_couple-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-20-24-serodiscordant_couple-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-25-29-serodiscordant_couple-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-30-34-serodiscordant_couple-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-35-39-serodiscordant_couple-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-40-44-serodiscordant_couple-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-45-49-serodiscordant_couple-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1->50-serodiscordant_couple-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2->50-serodiscordant_couple-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3->50-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4->50-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5->50-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6->50-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-7-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7->50-serodiscordant_couple-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8->50-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-9-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9->50-serodiscordant_couple-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10->50-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11->50-serodiscordant_couple-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14->50-serodiscordant_couple-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15->50-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16->50-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-<10-serodiscordant_couple-KE" + description: "Wapya waliopimwa na kupokea majibu Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-10-14-serodiscordant_couple-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-15-19-serodiscordant_couple-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-20-24-serodiscordant_couple-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-25-29-serodiscordant_couple-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-30-34-serodiscordant_couple-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-35-39-serodiscordant_couple-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-40-44-serodiscordant_couple-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-45-49-serodiscordant_couple-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a->50-serodiscordant_couple-KE" + description: "Wapya waliopimwa na kupokea majibu Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-<10-serodiscordant_couple-KE" + description: "Wapya wenye majibu ya VVU chanya Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-10-14-serodiscordant_couple-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-15-19-serodiscordant_couple-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-20-24-serodiscordant_couple-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-25-29-serodiscordant_couple-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-30-34-serodiscordant_couple-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-35-39-serodiscordant_couple-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-40-44-serodiscordant_couple-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-45-49-serodiscordant_couple-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b->50-serodiscordant_couple-KE" + description: "Wapya wenye majibu ya VVU chanya Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-<10-serodiscordant_couple-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-10-14-serodiscordant_couple-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-15-19-serodiscordant_couple-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-20-24-serodiscordant_couple-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-25-29-serodiscordant_couple-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-30-34-serodiscordant_couple-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-35-39-serodiscordant_couple-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-40-44-serodiscordant_couple-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-45-49-serodiscordant_couple-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c->50-serodiscordant_couple-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-<10-serodiscordant_couple-KE" + description: "Wapya walioanzishiwa ART Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-10-14-serodiscordant_couple-KE" + description: "Wapya walioanzishiwa ART Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-15-19-serodiscordant_couple-KE" + description: "Wapya walioanzishiwa ART Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-20-24-serodiscordant_couple-KE" + description: "Wapya walioanzishiwa ART Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-25-29-serodiscordant_couple-KE" + description: "Wapya walioanzishiwa ART Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-30-34-serodiscordant_couple-KE" + description: "Wapya walioanzishiwa ART Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-35-39-serodiscordant_couple-KE" + description: "Wapya walioanzishiwa ART Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-40-44-serodiscordant_couple-KE" + description: "Wapya walioanzishiwa ART Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-45-49-serodiscordant_couple-KE" + description: "Wapya walioanzishiwa ART Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d->50-serodiscordant_couple-KE" + description: "Wapya walioanzishiwa ART Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18->50-serodiscordant_couple-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-<10-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-10-14-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-15-19-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-20-24-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-25-29-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-30-34-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-35-39-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-40-44-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-45-49-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19->50-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-<10-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-10-14-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-15-19-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-20-24-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-25-29-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-30-34-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-35-39-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-40-44-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-45-49-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20->50-serodiscordant_couple-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-<10-serodiscordant_couple-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri <10" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-10-14-serodiscordant_couple-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 10-14" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-15-19-serodiscordant_couple-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 15-19" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-20-24-serodiscordant_couple-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 20-24" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-25-29-serodiscordant_couple-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 25-29" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-30-34-serodiscordant_couple-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 30-34" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-35-39-serodiscordant_couple-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 35-39" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-40-44-serodiscordant_couple-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 40-44" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-45-49-serodiscordant_couple-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 45-49" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21->50-serodiscordant_couple-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri >50" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22->50-serodiscordant_couple-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-<10-other_vulnerable_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-10-14-other_vulnerable_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-15-19-other_vulnerable_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-20-24-other_vulnerable_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-25-29-other_vulnerable_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-30-34-other_vulnerable_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-35-39-other_vulnerable_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-40-44-other_vulnerable_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-45-49-other_vulnerable_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1->50-other_vulnerable_population-ME" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2->50-other_vulnerable_population-ME" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3->50-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4->50-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5->50-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6->50-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-7-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7->50-other_vulnerable_population-ME" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8->50-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-9-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9->50-other_vulnerable_population-ME" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10->50-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11->50-other_vulnerable_population-ME" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14->50-other_vulnerable_population-ME" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15->50-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16->50-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-<10-other_vulnerable_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-10-14-other_vulnerable_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-15-19-other_vulnerable_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-20-24-other_vulnerable_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-25-29-other_vulnerable_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-30-34-other_vulnerable_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-35-39-other_vulnerable_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-40-44-other_vulnerable_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-45-49-other_vulnerable_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a->50-other_vulnerable_population-ME" + description: "Wapya waliopimwa na kupokea majibu Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-<10-other_vulnerable_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-10-14-other_vulnerable_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-15-19-other_vulnerable_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-20-24-other_vulnerable_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-25-29-other_vulnerable_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-30-34-other_vulnerable_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-35-39-other_vulnerable_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-40-44-other_vulnerable_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-45-49-other_vulnerable_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b->50-other_vulnerable_population-ME" + description: "Wapya wenye majibu ya VVU chanya Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-<10-other_vulnerable_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-10-14-other_vulnerable_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-15-19-other_vulnerable_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-20-24-other_vulnerable_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-25-29-other_vulnerable_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-30-34-other_vulnerable_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-35-39-other_vulnerable_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-40-44-other_vulnerable_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-45-49-other_vulnerable_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c->50-other_vulnerable_population-ME" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-<10-other_vulnerable_population-ME" + description: "Wapya walioanzishiwa ART Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-10-14-other_vulnerable_population-ME" + description: "Wapya walioanzishiwa ART Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-15-19-other_vulnerable_population-ME" + description: "Wapya walioanzishiwa ART Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-20-24-other_vulnerable_population-ME" + description: "Wapya walioanzishiwa ART Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-25-29-other_vulnerable_population-ME" + description: "Wapya walioanzishiwa ART Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-30-34-other_vulnerable_population-ME" + description: "Wapya walioanzishiwa ART Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-35-39-other_vulnerable_population-ME" + description: "Wapya walioanzishiwa ART Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-40-44-other_vulnerable_population-ME" + description: "Wapya walioanzishiwa ART Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-45-49-other_vulnerable_population-ME" + description: "Wapya walioanzishiwa ART Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d->50-other_vulnerable_population-ME" + description: "Wapya walioanzishiwa ART Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18->50-other_vulnerable_population-ME" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-<10-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-10-14-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-15-19-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-20-24-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-25-29-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-30-34-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-35-39-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-40-44-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-45-49-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19->50-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-<10-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-10-14-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-15-19-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-20-24-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-25-29-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-30-34-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-35-39-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-40-44-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-45-49-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20->50-other_vulnerable_population-ME" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-<10-other_vulnerable_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri <10" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-10-14-other_vulnerable_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 10-14" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-15-19-other_vulnerable_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 15-19" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-20-24-other_vulnerable_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 20-24" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-25-29-other_vulnerable_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 25-29" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-30-34-other_vulnerable_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 30-34" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-35-39-other_vulnerable_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 35-39" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-40-44-other_vulnerable_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 40-44" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-45-49-other_vulnerable_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 45-49" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21->50-other_vulnerable_population-ME" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri >50" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22->50-other_vulnerable_population-ME" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-<10-other_vulnerable_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-10-14-other_vulnerable_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-15-19-other_vulnerable_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-20-24-other_vulnerable_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-25-29-other_vulnerable_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-30-34-other_vulnerable_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-35-39-other_vulnerable_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-40-44-other_vulnerable_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-45-49-other_vulnerable_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1->50-other_vulnerable_population-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2->50-other_vulnerable_population-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3->50-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4->50-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5->50-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6->50-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-7-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7->50-other_vulnerable_population-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8->50-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-9-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9->50-other_vulnerable_population-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10->50-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11->50-other_vulnerable_population-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14->50-other_vulnerable_population-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15->50-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16->50-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-<10-other_vulnerable_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-10-14-other_vulnerable_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-15-19-other_vulnerable_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-20-24-other_vulnerable_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-25-29-other_vulnerable_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-30-34-other_vulnerable_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-35-39-other_vulnerable_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-40-44-other_vulnerable_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-45-49-other_vulnerable_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a->50-other_vulnerable_population-KE" + description: "Wapya waliopimwa na kupokea majibu Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-<10-other_vulnerable_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-10-14-other_vulnerable_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-15-19-other_vulnerable_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-20-24-other_vulnerable_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-25-29-other_vulnerable_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-30-34-other_vulnerable_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-35-39-other_vulnerable_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-40-44-other_vulnerable_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-45-49-other_vulnerable_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b->50-other_vulnerable_population-KE" + description: "Wapya wenye majibu ya VVU chanya Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-<10-other_vulnerable_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-10-14-other_vulnerable_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-15-19-other_vulnerable_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-20-24-other_vulnerable_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-25-29-other_vulnerable_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-30-34-other_vulnerable_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-35-39-other_vulnerable_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-40-44-other_vulnerable_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-45-49-other_vulnerable_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c->50-other_vulnerable_population-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-<10-other_vulnerable_population-KE" + description: "Wapya walioanzishiwa ART Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-10-14-other_vulnerable_population-KE" + description: "Wapya walioanzishiwa ART Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-15-19-other_vulnerable_population-KE" + description: "Wapya walioanzishiwa ART Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-20-24-other_vulnerable_population-KE" + description: "Wapya walioanzishiwa ART Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-25-29-other_vulnerable_population-KE" + description: "Wapya walioanzishiwa ART Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-30-34-other_vulnerable_population-KE" + description: "Wapya walioanzishiwa ART Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-35-39-other_vulnerable_population-KE" + description: "Wapya walioanzishiwa ART Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-40-44-other_vulnerable_population-KE" + description: "Wapya walioanzishiwa ART Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-45-49-other_vulnerable_population-KE" + description: "Wapya walioanzishiwa ART Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d->50-other_vulnerable_population-KE" + description: "Wapya walioanzishiwa ART Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18->50-other_vulnerable_population-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-<10-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-10-14-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-15-19-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-20-24-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-25-29-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-30-34-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-35-39-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-40-44-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-45-49-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19->50-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-<10-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-10-14-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-15-19-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-20-24-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-25-29-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-30-34-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-35-39-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-40-44-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-45-49-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20->50-other_vulnerable_population-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-<10-other_vulnerable_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri <10" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-10-14-other_vulnerable_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 10-14" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-15-19-other_vulnerable_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 15-19" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-20-24-other_vulnerable_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 20-24" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-25-29-other_vulnerable_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 25-29" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-30-34-other_vulnerable_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 30-34" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-35-39-other_vulnerable_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 35-39" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-40-44-other_vulnerable_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 40-44" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-45-49-other_vulnerable_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 45-49" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21->50-other_vulnerable_population-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri >50" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri <10" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22->50-other_vulnerable_population-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri >50" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-15-19-agyw-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-1-20-24-agyw-KE" + description: "Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE client_status = 'new_visit' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-15-19-agyw-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-2-20-24-agyw-KE" + description: "Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini kinachotakiwa (minimum standards) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +INNER JOIN ec_kvp_structural_services ekss ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_behavioral_services ekbs ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_other_services ekos ON efm.base_entity_id = ekos.entity_id +WHERE (ekbms.client_status IS NOT NULL OR ekbs.iec_sbcc_materials IS NOT NULL OR ekss.gbv_screening IS NOT NULL OR ekos.other_services_referrals_provided) +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-15-19-agyw-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-3-20-24-agyw-KE" + description: "Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekss.entity_id) as count FROM ec_kvp_structural_services ekss +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekss.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekss.gbv_screening = 'case_reported' OR ekss.gbv_screening = 'referred' OR ekss.gbv_screening = 'received_post_gbv_care') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekss.kvp_visit_date, 7, 4) || '-' || substr(ekss.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-15-19-agyw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-4-20-24-agyw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.sti_screening = 'positive' OR ekbms.sti_screening = 'negative') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-15-19-agyw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-5-20-24-agyw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_b_testing = 'positive' OR ekbms.hep_b_testing = 'negative' OR ekbms.hep_b_testing = 'positive_and_referred') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-15-19-agyw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-6-20-24-agyw-KE" + description: "Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.hep_c_testing = 'positive' OR ekbms.hep_c_testing = 'negative' OR ekbms.hep_c_testing = 'positive_and_referred') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-7-15-19-agyw-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-7-20-24-agyw-KE" + description: "Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_assessment='yes' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-15-19-agyw-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-8-20-24-agyw-KE" + description: "Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(ekr.id) as count FROM ec_kvp_register ekr +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekr.id +WHERE prep_qualified='yes' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || +substr(strftime('%Y-%m-%d', datetime(ekr.last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "kvp-9-15-19-agyw-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-9-20-24-agyw-KE" + description: "Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status = 'initiated' AND visit_type = 'new_client' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-15-19-agyw-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-10-20-24-agyw-KE" + description: "Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-15-19-agyw-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-11-20-24-agyw-KE" + description: "Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya) Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_drug_offered = 'tdf_ftc' AND visit_type != 'new_client' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-15-19-agyw-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-14-20-24-agyw-KE" + description: "Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep IS NOT NULL +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-15-19-agyw-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-15-20-24-agyw-KE" + description: "Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) wakati wa mahudhurio katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epf.entity_id) as count FROM ec_prep_followup epf +INNER JOIN ec_family_member efm ON efm.base_entity_id = epf.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE prep_status='discontinued_quit' AND reasons_stopping_prep='hiv_positive' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(epf.kvp_visit_date, 7, 4) || '-' || substr(epf.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-15-19-agyw-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-16-20-24-agyw-KE" + description: "Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.family_planning_service IS NOT NULL +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-15-19-agyw-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-a-20-24-agyw-KE" + description: "Wapya waliopimwa na kupokea majibu Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND (ekbms.hiv_status='positive' OR ekbms.hiv_status='negative')) +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-15-19-agyw-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-b-20-24-agyw-KE" + description: "Wapya wenye majibu ya VVU chanya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.hiv_status='positive') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-15-19-agyw-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-c-20-24-agyw-KE" + description: "Wapya waliosajiliwa huduma ya Tiba na Matunzo Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services !='not_applicable') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-15-19-agyw-KE" + description: "Wapya walioanzishiwa ART Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-17-d-20-24-agyw-KE" + description: "Wapya walioanzishiwa ART Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.client_status = 'new_visit' AND ekbms.ctc_services ='enrolled_and_on_arv') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-15-19-agyw-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-18-20-24-agyw-KE" + description: "Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE (ekbms.tb_screening = 'presumptive' OR ekbms.tb_screening = 'not_presumptive') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-15-19-agyw-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-19-20-24-agyw-KE" + description: "Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_female_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-15-19-agyw-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-20-20-24-agyw-KE" + description: "Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT SUM(ekbms.number_of_male_condoms_issued) as number_female_condom FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-15-19-agyw-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 15-19" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-21-20-24-agyw-KE" + description: "Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa Umri 20-24" + indicatorQuery: " SELECT sum(ekbs.iec_sbcc_materials) as number_iec_sbcc_materials FROM ec_kvp_behavioral_services ekbs +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbs.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbs.kvp_visit_date, 7, 4) || '-' || substr(ekbs.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-15-19-agyw-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-22-20-24-agyw-KE" + description: "Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT ekbms.entity_id) as count FROM ec_kvp_bio_medical_services ekbms +INNER JOIN ec_family_member efm ON efm.base_entity_id = ekbms.entity_id +INNER JOIN ec_kvp_register ekr ON efm.base_entity_id = ekr.id +WHERE ekbms.mat_provided = 'yes' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = +date(substr(ekbms.kvp_visit_date, 7, 4) || '-' || substr(ekbms.kvp_visit_date, 4, 2) || '-' || '01')" + + - key: "kvp-12-15-19-agyw-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-20-24-agyw-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-<10-pwid-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-10-14-pwid-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-15-19-pwid-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-20-24-pwid-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-25-29-pwid-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-30-34-pwid-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-35-39-pwid-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-40-44-pwid-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-45-49-pwid-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12->50-pwid-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-<10-pwid-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-10-14-pwid-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-15-19-pwid-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-20-24-pwid-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-25-29-pwid-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-30-34-pwid-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-35-39-pwid-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-40-44-pwid-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-45-49-pwid-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12->50-pwid-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-<10-pwud-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-10-14-pwud-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-15-19-pwud-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-20-24-pwud-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-25-29-pwud-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-30-34-pwud-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-35-39-pwud-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-40-44-pwud-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-45-49-pwud-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12->50-pwud-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-<10-pwud-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-10-14-pwud-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-15-19-pwud-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-20-24-pwud-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-25-29-pwud-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-30-34-pwud-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-35-39-pwud-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-40-44-pwud-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-45-49-pwud-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12->50-pwud-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-<10-mobile_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-10-14-mobile_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-15-19-mobile_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-20-24-mobile_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-25-29-mobile_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-30-34-mobile_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-35-39-mobile_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-40-44-mobile_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-45-49-mobile_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12->50-mobile_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-<10-mobile_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-10-14-mobile_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-15-19-mobile_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-20-24-mobile_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-25-29-mobile_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-30-34-mobile_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-35-39-mobile_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-40-44-mobile_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-45-49-mobile_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12->50-mobile_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12->50-serodiscordant_couple-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12->50-serodiscordant_couple-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12->50-other_vulnerable_population-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12->50-other_vulnerable_population-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-<10-msm-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-10-14-msm-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-15-19-msm-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-20-24-msm-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-25-29-msm-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-30-34-msm-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-35-39-msm-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-40-44-msm-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-45-49-msm-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12->50-msm-ME" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-<10-fsw-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-10-14-fsw-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-15-19-fsw-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-20-24-fsw-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-25-29-fsw-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-30-34-fsw-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-35-39-fsw-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-40-44-fsw-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12-45-49-fsw-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-12->50-fsw-KE" + description: "Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE epf.prep_status = 'initiated' +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = +date(substr(prep_initiation_date, 7, 4) || '-' || substr(prep_initiation_date, 4, 2) || '-' || '01')" + - key: "kvp-13-15-19-agyw-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-20-24-agyw-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='agyw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-<10-pwid-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-10-14-pwid-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-15-19-pwid-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-20-24-pwid-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-25-29-pwid-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-30-34-pwid-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-35-39-pwid-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-40-44-pwid-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-45-49-pwid-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13->50-pwid-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-<10-pwid-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-10-14-pwid-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-15-19-pwid-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-20-24-pwid-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-25-29-pwid-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-30-34-pwid-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-35-39-pwid-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-40-44-pwid-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-45-49-pwid-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13->50-pwid-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwid' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-<10-pwud-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-10-14-pwud-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-15-19-pwud-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-20-24-pwud-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-25-29-pwud-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-30-34-pwud-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-35-39-pwud-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-40-44-pwud-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-45-49-pwud-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13->50-pwud-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-<10-pwud-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-10-14-pwud-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-15-19-pwud-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-20-24-pwud-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-25-29-pwud-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-30-34-pwud-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-35-39-pwud-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-40-44-pwud-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-45-49-pwud-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13->50-pwud-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='pwud' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-<10-mobile_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-10-14-mobile_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-15-19-mobile_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-20-24-mobile_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-25-29-mobile_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-30-34-mobile_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-35-39-mobile_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-40-44-mobile_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-45-49-mobile_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13->50-mobile_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-<10-mobile_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-10-14-mobile_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-15-19-mobile_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-20-24-mobile_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-25-29-mobile_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-30-34-mobile_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-35-39-mobile_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-40-44-mobile_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-45-49-mobile_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13->50-mobile_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='mobile_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-<10-serodiscordant_couple-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-10-14-serodiscordant_couple-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-15-19-serodiscordant_couple-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-20-24-serodiscordant_couple-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-25-29-serodiscordant_couple-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-30-34-serodiscordant_couple-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-35-39-serodiscordant_couple-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-40-44-serodiscordant_couple-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-45-49-serodiscordant_couple-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13->50-serodiscordant_couple-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-<10-serodiscordant_couple-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-10-14-serodiscordant_couple-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-15-19-serodiscordant_couple-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-20-24-serodiscordant_couple-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-25-29-serodiscordant_couple-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-30-34-serodiscordant_couple-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-35-39-serodiscordant_couple-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-40-44-serodiscordant_couple-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-45-49-serodiscordant_couple-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13->50-serodiscordant_couple-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='serodiscordant_couple' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-<10-other_vulnerable_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-10-14-other_vulnerable_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-15-19-other_vulnerable_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-20-24-other_vulnerable_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-25-29-other_vulnerable_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-30-34-other_vulnerable_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-35-39-other_vulnerable_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-40-44-other_vulnerable_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-45-49-other_vulnerable_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13->50-other_vulnerable_population-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-<10-other_vulnerable_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-10-14-other_vulnerable_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-15-19-other_vulnerable_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-20-24-other_vulnerable_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-25-29-other_vulnerable_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-30-34-other_vulnerable_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-35-39-other_vulnerable_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-40-44-other_vulnerable_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-45-49-other_vulnerable_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13->50-other_vulnerable_population-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='other_vulnerable_population' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-<10-msm-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-10-14-msm-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-15-19-msm-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-20-24-msm-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-25-29-msm-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-30-34-msm-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-35-39-msm-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-40-44-msm-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-45-49-msm-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='msm' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13->50-msm-ME" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='msm' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Male') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-<10-fsw-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri <10" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))<10 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-10-14-fsw-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 10-14" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+10 years') <= date('now')) +AND (date(efm.dob, '+15 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-15-19-fsw-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+15 years') <= date('now')) +AND (date(efm.dob, '+20 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-20-24-fsw-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+20 years') <= date('now')) +AND (date(efm.dob, '+25 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-25-29-fsw-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+25 years') <= date('now')) +AND (date(efm.dob, '+30 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-30-34-fsw-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+30 years') <= date('now')) +AND (date(efm.dob, '+35 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-35-39-fsw-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+35 years') <= date('now')) +AND (date(efm.dob, '+40 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-40-44-fsw-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+40 years') <= date('now')) +AND (date(efm.dob, '+45 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13-45-49-fsw-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='fsw' +AND (date(efm.dob, '+45 years') <= date('now')) +AND (date(efm.dob, '+50 years') > date('now')) +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" + - key: "kvp-13->50-fsw-KE" + description: "Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6 Umri >50" + indicatorQuery: " SELECT count(DISTINCT epr.id) as count FROM ec_prep_register epr +INNER JOIN ec_kvp_register ekr ON ekr.id = epr.id +INNER JOIN ec_prep_followup epf ON epf.entity_id= epr.id +INNER JOIN ec_family_member efm ON efm.base_entity_id = epr.id +WHERE (epf.prep_status = 'initiated' OR epf.prep_status ='re_start') +AND ekr.client_group ='fsw' +AND (date('now')-date(efm.dob))>=50 +AND (efm.gender='Female') +AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = +date(substr(kvp_visit_date, 7, 4) || '-' || substr(kvp_visit_date, 4, 2) || '-' || '01')" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/config/ld-reporting-indicator-definitions.yml b/opensrp-chw-hf/src/main/assets/config/ld-reporting-indicator-definitions.yml new file mode 100644 index 000000000..961389113 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/config/ld-reporting-indicator-definitions.yml @@ -0,0 +1,5750 @@ +indicators: + - key: "ld-2a-10-14" + description: "Waliojifungua katika kituo cha kutolea huduma za afya" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'at_a_health_facility' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2a-15-19" + description: "Waliojifungua katika kituo cha kutolea huduma za afya" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'at_a_health_facility' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2a-20-24" + description: "Waliojifungua katika kituo cha kutolea huduma za afya" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'at_a_health_facility' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2a-25-29" + description: "Waliojifungua katika kituo cha kutolea huduma za afya" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'at_a_health_facility' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2a-30-34" + description: "Waliojifungua katika kituo cha kutolea huduma za afya" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'at_a_health_facility' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2a-35+" + description: "Waliojifungua katika kituo cha kutolea huduma za afya" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'at_a_health_facility' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2b-10-14" + description: "Waliojifungua kabla ya kufika kituoni(BBA)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'bba' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2b-15-19" + description: "Waliojifungua kabla ya kufika kituoni(BBA)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'bba' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2b-20-24" + description: "Waliojifungua kabla ya kufika kituoni(BBA)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'bba' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2b-25-29" + description: "Waliojifungua kabla ya kufika kituoni(BBA)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'bba' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2b-30-34" + description: "Waliojifungua kabla ya kufika kituoni(BBA)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'bba' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2b-35+" + description: "Waliojifungua kabla ya kufika kituoni(BBA)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'bba' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2c-10-14" + description: "Waliozalishwa na wakunga wa jadi(TBA)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'tba' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2c-15-19" + description: "Waliozalishwa na wakunga wa jadi(TBA)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'tba' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2c-20-24" + description: "Waliozalishwa na wakunga wa jadi(TBA)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'tba' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2c-25-29" + description: "Waliozalishwa na wakunga wa jadi(TBA)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'tba' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2c-30-34" + description: "Waliozalishwa na wakunga wa jadi(TBA)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'tba' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2c-35+" + description: "Waliozalishwa na wakunga wa jadi(TBA)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'tba' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2d-10-14" + description: "Waliojifungua nyumbani (H) bila msaada wa TBA" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'at_home' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2d-15-19" + description: "Waliojifungua nyumbani (H) bila msaada wa TBA" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'at_home' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2d-20-24" + description: "Waliojifungua nyumbani (H) bila msaada wa TBA" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'at_home' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2d-25-29" + description: "Waliojifungua nyumbani (H) bila msaada wa TBA" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'at_home' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2d-30-34" + description: "Waliojifungua nyumbani (H) bila msaada wa TBA" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'at_home' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2d-35+" + description: "Waliojifungua nyumbani (H) bila msaada wa TBA" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.delivery_place = 'at_home' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2e-10-14" + description: "Waliozalishwa na watoa huduma wenye ujuzi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE + (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND elpc.delivery_place = 'at_a_health_facility' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2e-15-19" + description: "Waliozalishwa na watoa huduma wenye ujuzi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE + (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND elpc.delivery_place = 'at_a_health_facility' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2e-20-24" + description: "Waliozalishwa na watoa huduma wenye ujuzi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE + (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND elpc.delivery_place = 'at_a_health_facility' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2e-25-29" + description: "Waliozalishwa na watoa huduma wenye ujuzi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE + (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND elpc.delivery_place = 'at_a_health_facility' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2e-30-34" + description: "Waliozalishwa na watoa huduma wenye ujuzi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE + (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND elpc.delivery_place = 'at_a_health_facility' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-2e-35+" + description: "Waliozalishwa na watoa huduma wenye ujuzi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE + (date(efm.dob, '+35 years') <= date('now')) + AND elpc.delivery_place = 'at_a_health_facility' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-3a-10-14" + description: "Waliojifungua baada ya saa 12 toka uchungu kuanza" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.labour_duration/(1000*60*60) > 12 + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-3a-15-19" + description: "Waliojifungua baada ya saa 12 toka uchungu kuanza" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.labour_duration/(1000*60*60) > 12 + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-3a-20-24" + description: "Waliojifungua baada ya saa 12 toka uchungu kuanza" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.labour_duration/(1000*60*60) > 12 + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-3a-25-29" + description: "Waliojifungua baada ya saa 12 toka uchungu kuanza" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.labour_duration/(1000*60*60) > 12 + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-3a-30-34" + description: "Waliojifungua baada ya saa 12 toka uchungu kuanza" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.labour_duration/(1000*60*60) > 12 + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-3a-35+" + description: "Waliojifungua baada ya saa 12 toka uchungu kuanza" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.labour_duration/(1000*60*60) > 12 + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4a-10-14" + description: "Waliojifungua Kawaida (SVD)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'spontaneous_vaginal_delivery' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4a-15-19" + description: "Waliojifungua Kawaida (SVD)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'spontaneous_vaginal_delivery' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4a-20-24" + description: "Waliojifungua Kawaida (SVD)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'spontaneous_vaginal_delivery' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4a-25-29" + description: "Waliojifungua Kawaida (SVD)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'spontaneous_vaginal_delivery' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4a-30-34" + description: "Waliojifungua Kawaida (SVD)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'spontaneous_vaginal_delivery' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4a-35+" + description: "Waliojifungua Kawaida (SVD)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'spontaneous_vaginal_delivery' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4b-10-14" + description: "Waliojifungua Vacuum (VM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'vacuum_extraction' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4b-15-19" + description: "Waliojifungua Vacuum (VM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'vacuum_extraction' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4b-20-24" + description: "Waliojifungua Vacuum (VM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'vacuum_extraction' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4b-25-29" + description: "Waliojifungua Vacuum (VM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'vacuum_extraction' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4b-30-34" + description: "Waliojifungua Vacuum (VM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'vacuum_extraction' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4b-35+" + description: "Waliojifungua Vacuum (VM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'vacuum_extraction' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4c-10-14" + description: "Waliojifungua Breech delivery (BR)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'breech_delivery' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4c-15-19" + description: "Waliojifungua Breech delivery (BR)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'breech_delivery' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4c-20-24" + description: "Waliojifungua Breech delivery (BR)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'breech_delivery' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4c-25-29" + description: "Waliojifungua Breech delivery (BR)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'breech_delivery' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4c-30-34" + description: "Waliojifungua Breech delivery (BR)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'breech_delivery' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4c-35+" + description: "Waliojifungua Breech delivery (BR)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'breech_delivery' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4d-10-14" + description: "Waliojifungua Caesarian Section (CS)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'cesarean' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4d-15-19" + description: "Waliojifungua Caesarian Section (CS)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'cesarean' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4d-20-24" + description: "Waliojifungua Caesarian Section (CS)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'cesarean' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4d-25-29" + description: "Waliojifungua Caesarian Section (CS)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'cesarean' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4d-30-34" + description: "Waliojifungua Caesarian Section (CS)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'cesarean' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-4d-35+" + description: "Waliojifungua Caesarian Section (CS)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elc.mode_of_delivery = 'cesarean' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5a-10-14" + description: "Matatizo kabla ya kujifungua APH" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_aph%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5a-15-19" + description: "Matatizo kabla ya kujifungua APH" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_aph%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5a-20-24" + description: "Matatizo kabla ya kujifungua APH" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_aph%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5a-25-29" + description: "Matatizo kabla ya kujifungua APH" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_aph%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5a-30-34" + description: "Matatizo kabla ya kujifungua APH" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_aph%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5a-35+" + description: "Matatizo kabla ya kujifungua APH" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_aph%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5b-10-14" + description: "Matatizo kabla ya kujifungua Pre-mature Rupture of Membrane (PROM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_prom%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5b-15-19" + description: "Matatizo kabla ya kujifungua Pre-mature Rupture of Membrane (PROM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_prom%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5b-20-24" + description: "Matatizo kabla ya kujifungua Pre-mature Rupture of Membrane (PROM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_prom%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5b-25-29" + description: "Matatizo kabla ya kujifungua Pre-mature Rupture of Membrane (PROM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_prom%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5b-30-34" + description: "Matatizo kabla ya kujifungua Pre-mature Rupture of Membrane (PROM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_prom%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + + - key: "ld-5b-35+" + description: "Matatizo kabla ya kujifungua Pre-mature Rupture of Membrane (PROM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_prom%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + + - key: "ld-5c-10-14" + description: "Matatizo kabla ya kujifungua High BP" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_high_bp%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5c-15-19" + description: "Matatizo kabla ya kujifungua High BP" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_high_bp%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5c-20-24" + description: "Matatizo kabla ya kujifungua High BP" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_high_bp%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5c-25-29" + description: "Matatizo kabla ya kujifungua High BP" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_high_bp%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5c-30-34" + description: "Matatizo kabla ya kujifungua High BP" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_high_bp%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + + - key: "ld-5c-35+" + description: "Matatizo kabla ya kujifungua High BP" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_high_bp%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5d-10-14" + description: "Matatizo kabla ya kujifungua Pre-eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_pre_eclampsia%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5d-15-19" + description: "Matatizo kabla ya kujifungua Pre-eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_pre_eclampsia%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5d-20-24" + description: "Matatizo kabla ya kujifungua Pre-eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_pre_eclampsia%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5d-25-29" + description: "Matatizo kabla ya kujifungua Pre-eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_pre_eclampsia%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5d-30-34" + description: "Matatizo kabla ya kujifungua Pre-eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_pre_eclampsia%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5d-35+" + description: "Matatizo kabla ya kujifungua Pre-eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_pre_eclampsia%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5e-10-14" + description: "Matatizo kabla ya kujifungua eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_eclampsia%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5e-15-19" + description: "Matatizo kabla ya kujifungua Eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_eclampsia%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5e-20-24" + description: "Matatizo kabla ya kujifungua Eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_eclampsia%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5e-25-29" + description: "Matatizo kabla ya kujifungua Eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_eclampsia%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5e-30-34" + description: "Matatizo kabla ya kujifungua Eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_eclampsia%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5e-35+" + description: "Matatizo kabla ya kujifungua Eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_eclampsia%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5f-10-14" + description: "Matatizo kabla ya kujifungua Anaemia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_anaemia%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5f-15-19" + description: "Matatizo kabla ya kujifungua Anaemia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_anaemia%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5f-20-24" + description: "Matatizo kabla ya kujifungua Anaemia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_anaemia%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5f-25-29" + description: "Matatizo kabla ya kujifungua Anaemia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_anaemia%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5f-30-34" + description: "Matatizo kabla ya kujifungua Anaemia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_anaemia%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5f-35+" + description: "Matatizo kabla ya kujifungua Anaemia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_anaemia%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5g-10-14" + description: "Matatizo kabla ya kujifungua Malaria" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_malaria%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5g-15-19" + description: "Matatizo kabla ya kujifungua Malaria" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_malaria%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5g-20-24" + description: "Matatizo kabla ya kujifungua Malaria" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_malaria%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5g-25-29" + description: "Matatizo kabla ya kujifungua Malaria" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_malaria%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5g-30-34" + description: "Matatizo kabla ya kujifungua Malaria" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_malaria%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5g-35+" + description: "Matatizo kabla ya kujifungua Malaria" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_malaria%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5h-10-14" + description: "Matatizo kabla ya kujifungua HIV + Stage III au IV" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_hiv_stage_3_or_4%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5h-15-19" + description: "Matatizo kabla ya kujifungua HIV + Stage III au IV" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_hiv_stage_3_or_4%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5h-20-24" + description: "Matatizo kabla ya kujifungua HIV + Stage III au IV" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_hiv_stage_3_or_4%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5h-25-29" + description: "Matatizo kabla ya kujifungua HIV + Stage III au IV" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_hiv_stage_3_or_4%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5h-30-34" + description: "Matatizo kabla ya kujifungua HIV + Stage III au IV" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_hiv_stage_3_or_4%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5h-35+" + description: "Matatizo kabla ya kujifungua HIV + Stage III au IV" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_hiv_stage_3_or_4%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5i-10-14" + description: "Matatizo kabla ya kujifungua Waliokekektwa (FGM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_fgm%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5i-15-19" + description: "Matatizo kabla ya kujifungua Waliokekektwa (FGM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_fgm%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5i-20-24" + description: "Matatizo kabla ya kujifungua Waliokekektwa (FGM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_fgm%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5i-25-29" + description: "Matatizo kabla ya kujifungua Waliokekektwa (FGM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_fgm%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5i-30-34" + description: "Matatizo kabla ya kujifungua Waliokekektwa (FGM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_fgm%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-5i-35+" + description: "Matatizo kabla ya kujifungua Waliokekektwa (FGM)" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_before_delivery LIKE '%chk_fgm%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6a-10-14" + description: "Matatizo wakati na baada ya kujifungua PPH" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_pph%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6a-15-19" + description: "Matatizo wakati na baada ya kujifungua PPH" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_pph%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6a-20-24" + description: "Matatizo wakati na baada ya kujifungua PPH" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_pph%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6a-25-29" + description: "Matatizo wakati na baada ya kujifungua PPH" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_pph%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6a-30-34" + description: "Matatizo wakati na baada ya kujifungua PPH" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_pph%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6a-35+" + description: "Matatizo wakati na baada ya kujifungua PPH" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_pph%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6b-10-14" + description: "Matatizo wakati na baada ya kujifungua Pre eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_pre_eclampsia%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6b-15-19" + description: "Matatizo wakati na baada ya kujifungua Pre eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_pre_eclampsia%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6b-20-24" + description: "Matatizo wakati na baada ya kujifungua Pre eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_pre_eclampsia%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6b-25-29" + description: "Matatizo wakati na baada ya kujifungua Pre eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_pre_eclampsia%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6b-30-34" + description: "Matatizo wakati na baada ya kujifungua Pre eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_pre_eclampsia%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6b-35+" + description: "Matatizo wakati na baada ya kujifungua Pre eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_pre_eclampsia%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6c-10-14" + description: "Matatizo wakati na baada ya kujifungua Eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_eclampsia%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6c-15-19" + description: "Matatizo wakati na baada ya kujifungua Eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_eclampsia%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6c-20-24" + description: "Matatizo wakati na baada ya kujifungua Eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_eclampsia%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6c-25-29" + description: "Matatizo wakati na baada ya kujifungua Eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_eclampsia%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6c-30-34" + description: "Matatizo wakati na baada ya kujifungua Eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_eclampsia%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6c-35+" + description: "Matatizo wakati na baada ya kujifungua Eclampsia" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_eclampsia%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6d-10-14" + description: "Matatizo wakati na baada ya kujifungua Obstructed Labour" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_obstructed_labour%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6d-15-19" + description: "Matatizo wakati na baada ya kujifungua Obstructed Labour" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_obstructed_labour%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6d-20-24" + description: "Matatizo wakati na baada ya kujifungua Obstructed Labour" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_obstructed_labour%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6d-25-29" + description: "Matatizo wakati na baada ya kujifungua Obstructed Labour" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_obstructed_labour%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6d-30-34" + description: "Matatizo wakati na baada ya kujifungua Obstructed Labour" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_obstructed_labour%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6d-35+" + description: "Matatizo wakati na baada ya kujifungua Obstructed Labour" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_obstructed_labour%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6e-10-14" + description: "Matatizo wakati na baada ya kujifungua Retained placenta" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_retained_placenta%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6e-15-19" + description: "Matatizo wakati na baada ya kujifungua Retained placenta" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_retained_placenta%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6e-20-24" + description: "Matatizo wakati na baada ya kujifungua Retained placenta" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_retained_placenta%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6e-25-29" + description: "Matatizo wakati na baada ya kujifungua Retained placenta" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_retained_placenta%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6e-30-34" + description: "Matatizo wakati na baada ya kujifungua Retained placenta" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_retained_placenta%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6e-35+" + description: "Matatizo wakati na baada ya kujifungua Retained placenta" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_retained_placenta%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6f-10-14" + description: "Matatizo wakati na baada ya kujifungua Third degree tear" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_3_degree_tear%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6f-15-19" + description: "Matatizo wakati na baada ya kujifungua Third degree tear" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_3_degree_tear%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6f-20-24" + description: "Matatizo wakati na baada ya kujifungua Third degree tear" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_3_degree_tear%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6f-25-29" + description: "Matatizo wakati na baada ya kujifungua Third degree tear" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_3_degree_tear%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6f-30-34" + description: "Matatizo wakati na baada ya kujifungua Third degree tear" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_3_degree_tear%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6f-35+" + description: "Matatizo wakati na baada ya kujifungua Third degree tear" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_3_degree_tear%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6g-10-14" + description: "Matatizo wakati na baada ya kujifungua Ruptured uterus" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_ruptured_uterus%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6g-15-19" + description: "Matatizo wakati na baada ya kujifungua Ruptured uterus" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_ruptured_uterus%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6g-20-24" + description: "Matatizo wakati na baada ya kujifungua Ruptured uterus" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_ruptured_uterus%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6g-25-29" + description: "Matatizo wakati na baada ya kujifungua Ruptured uterus" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_ruptured_uterus%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6g-30-34" + description: "Matatizo wakati na baada ya kujifungua Ruptured uterus" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_ruptured_uterus%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6g-35+" + description: "Matatizo wakati na baada ya kujifungua Ruptured uterus" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_ruptured_uterus%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6h-10-14" + description: "Matatizo wakati na baada ya kujifungua Uambukizo/Sepsis" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_sepsis%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6h-15-19" + description: "Matatizo wakati na baada ya kujifungua Uambukizo/Sepsis" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_sepsis%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6h-20-24" + description: "Matatizo wakati na baada ya kujifungua Uambukizo/Sepsis" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_sepsis%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6h-25-29" + description: "Matatizo wakati na baada ya kujifungua Uambukizo/Sepsis" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_sepsis%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6h-30-34" + description: "Matatizo wakati na baada ya kujifungua Uambukizo/Sepsis" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_sepsis%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-6h-35+" + description: "Matatizo wakati na baada ya kujifungua Uambukizo/Sepsis" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.maternal_complications_during_and_after_delivery LIKE '%chk_sepsis%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01')" + - key: "ld-7a-10-14" + description: "EmOC Amepewa Antibiotic" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.administered_antibiotics = 'yes' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7a-15-19" + description: "EmOC Amepewa Antibiotic" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.administered_antibiotics = 'yes' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7a-20-24" + description: "EmOC Amepewa Antibiotic" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.administered_antibiotics = 'yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7a-25-29" + description: "EmOC Amepewa Antibiotic" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.administered_antibiotics = 'yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7a-30-34" + description: "EmOC Amepewa Antibiotic" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.administered_antibiotics = 'yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7a-35+" + description: "EmOC Amepewa Antibiotic" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.administered_antibiotics = 'yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7b-10-14" + description: "EmOC Amepewa Uterotonic" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic IS NOT NULL AND elpam.uterotonic <> 'none' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7b-15-19" + description: "EmOC Amepewa Uterotonic" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic IS NOT NULL AND elpam.uterotonic <> 'none' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7b-20-24" + description: "EmOC Amepewa Uterotonic" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic IS NOT NULL AND elpam.uterotonic <> 'none' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7b-25-29" + description: "EmOC Amepewa Uterotonic" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic IS NOT NULL AND elpam.uterotonic <> 'none' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7b-30-34" + description: "EmOC Amepewa Uterotonic" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic IS NOT NULL AND elpam.uterotonic <> 'none' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7b-35+" + description: "EmOC Amepewa Uterotonic" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic IS NOT NULL AND elpam.uterotonic <> 'none' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7c-10-14" + description: "EmOC Amepewa Magnesium Sulphate" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.administered_magnesium_sulphate = 'yes' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7c-15-19" + description: "EmOC Amepewa Magnesium Sulphate" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.administered_magnesium_sulphate = 'yes' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7c-20-24" + description: "EmOC Amepewa Magnesium Sulphate" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.administered_magnesium_sulphate = 'yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7c-25-29" + description: "EmOC Amepewa Magnesium Sulphate" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.administered_magnesium_sulphate = 'yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7c-30-34" + description: "EmOC Amepewa Magnesium Sulphate" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.administered_magnesium_sulphate = 'yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7c-35+" + description: "EmOC Amepewa Magnesium Sulphate" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.administered_magnesium_sulphate = 'yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7d-10-14" + description: "EmOC Ameondolewa kwa mkono kondo la nyuma" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.placenta_removed_by_hand = 'yes' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7d-15-19" + description: "EmOC Ameondolewa kwa mkono kondo la nyuma" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.placenta_removed_by_hand = 'yes' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7d-20-24" + description: "EmOC Ameondolewa kwa mkono kondo la nyuma" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.placenta_removed_by_hand = 'yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7d-25-29" + description: "EmOC Ameondolewa kwa mkono kondo la nyuma" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.placenta_removed_by_hand = 'yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7d-30-34" + description: "EmOC Ameondolewa kwa mkono kondo la nyuma" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.placenta_removed_by_hand = 'yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7d-35+" + description: "EmOC Ameondolewa kwa mkono kondo la nyuma" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.placenta_removed_by_hand = 'yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7e-10-14" + description: "EmOC Amefanyiwa MVA/D&C" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.conducted_mva = 'yes' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7f-10-14" + description: "EmOC Ameongezewa damu" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.provided_blood_transfusion = 'yes' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8a-10-14" + description: "Wanawake waliosaidiwa kutoiewa kondo la nyuma kwa kuvutwa kitovu pole pole" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.method_used_to_remove_the_placenta = 'control_cord_traction' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8b-10-14" + description: "Wanawake waliosaidiwa kwa kukandwa kandwa nyumba ya uzazi." + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterus_massage_after_delivery = 'yes' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8c-10-14" + description: "Wanawake waliopata Oxytocin baada ya kujifungua (10 IU)" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%oxytocin%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8d-10-14" + description: "Wanawake waliopata Egometrine baada ya kujifungua (0.5mg)" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%ergometrine%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8e-10-14" + description: "Wanawake waliopata Misoprostol baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%misoprostol%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10a-10-14" + description: "Watoto Waliozaliwa mmoja Jumla ya watoto waliozaliwa hai" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elpc.number_of_children_born = 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-10b-10-14" + description: "Watoto Waliozaliwa mmoja Waliozaliwa hai Uzito<2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) < 2.5 + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-10c-10-14" + description: "Watoto Waliozaliwa mmoja Waliozaliwa hai Uzito =>2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) >= 2.5 + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-10d-10-14" + description: "Watoto Waliozaliwa mmoja Waliozaliwa wafu Macerated (MSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elpc.number_of_children_born = 1 + AND elinbc.still_birth_choice = 'msb' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-10e-10-14" + description: "Watoto Waliozaliwa mmoja Waliozaliwa wafu Fresh (FSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'fsb' + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-10f-10-14" + description: "Watoto Waliozaliwa mmoja Waliozaliwa na mama wenye VVU" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.risk_category IS NOT NULL + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-10g-10-14" + description: "Watoto Waliozaliwa mmoja Waliopewa dawa za ARV" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-10h-10-14" + description: "Watoto Watoto wenye APGAR Score chini ya 7 katika dakika 5" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.apgar_score_at_5_minutes AS FLOAT) < 7 + AND elpc.number_of_children_born = 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11a-10-14" + description: "Watoto Waliozaliwa mapacha Jumla ya watoto waliozaliwa hai" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11b-10-14" + description: "Watoto Waliozaliwa mapacha Waliozaliwa hai Uzito<2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) < 2.5 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11c-10-14" + description: "Watoto Waliozaliwa mapacha Waliozaliwa hai Uzito =>2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) >= 2.5 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11d-10-14" + description: "Watoto Waliozaliwa mapacha Waliozaliwa wafu Macerated (MSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'msb' + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11e-10-14" + description: "Watoto Waliozaliwa mapacha Waliozaliwa wafu Fresh (FSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'fsb' + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11f-10-14" + description: "Watoto Waliozaliwa mapacha Waliozaliwa na mama wenye VVU" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.risk_category IS NOT NULL + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11g-10-14" + description: "Watoto Waliozaliwa mapacha Waliopewa dawa za ARV" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11h-10-14" + description: "Watoto Waliozaliwa mapacha wenye APGAR Score chini ya 7 katika dakika 5" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.apgar_score_at_5_minutes AS FLOAT) < 7 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-12a-10-14" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto Waliosaidiwa kupumua - Suction " + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'suction_only' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-12b-10-14" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto waliosaidiwa kupumua- stimulation " + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'stimulation' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-12c-10-14" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto waliosaidiwa kupumua- bag and mask" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'suction_and_bag_mask' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-13a-10-14" + description: "Idadi ya watoto walionyonyeshwa ndani ya saa moja baada ya kuzaliwa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.early_bf_1hr = 'yes' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-14a-10-14" + description: "Wazazi waliofariki" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.status = 'died' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + + + - key: "ld-7e-15-19" + description: "EmOC Amefanyiwa MVA/D&C" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.conducted_mva = 'yes' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7f-15-19" + description: "EmOC Ameongezewa damu" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.provided_blood_transfusion = 'yes' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8a-15-19" + description: "Wanawake waliosaidiwa kutoiewa kondo la nyuma kwa kuvutwa kitovu pole pole" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.method_used_to_remove_the_placenta = 'control_cord_traction' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8b-15-19" + description: "Wanawake waliosaidiwa kwa kukandwa kandwa nyumba ya uzazi." + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterus_massage_after_delivery = 'yes' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8c-15-19" + description: "Wanawake waliopata Oxytocin baada ya kujifungua (10 IU)" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%oxytocin%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8d-15-19" + description: "Wanawake waliopata Egometrine baada ya kujifungua (0.5mg)" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%ergometrine%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8e-15-19" + description: "Wanawake waliopata Misoprostol baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%misoprostol%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10a-15-19" + description: "Watoto Waliozaliwa mmoja Jumla ya watoto waliozaliwa hai" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elpc.number_of_children_born = 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-10b-15-19" + description: "Watoto Waliozaliwa mmoja Waliozaliwa hai Uzito<2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) < 2.5 + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-10c-15-19" + description: "Watoto Waliozaliwa mmoja Waliozaliwa hai Uzito =>2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) >= 2.5 + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-10d-15-19" + description: "Watoto Waliozaliwa mmoja Waliozaliwa wafu Macerated (MSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elpc.number_of_children_born = 1 + AND elinbc.still_birth_choice = 'msb' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-10e-15-19" + description: "Watoto Waliozaliwa mmoja Waliozaliwa wafu Fresh (FSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'fsb' + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-10f-15-19" + description: "Watoto Waliozaliwa mmoja Waliozaliwa na mama wenye VVU" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.risk_category IS NOT NULL + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-10g-15-19" + description: "Watoto Waliozaliwa mmoja Waliopewa dawa za ARV" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-10h-15-19" + description: "Watoto Watoto wenye APGAR Score chini ya 7 katika dakika 5" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.apgar_score_at_5_minutes AS FLOAT) < 7 + AND elpc.number_of_children_born = 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11a-15-19" + description: "Watoto Waliozaliwa mapacha Jumla ya watoto waliozaliwa hai" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11b-15-19" + description: "Watoto Waliozaliwa mapacha Waliozaliwa hai Uzito<2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) < 2.5 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11c-15-19" + description: "Watoto Waliozaliwa mapacha Waliozaliwa hai Uzito =>2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) >= 2.5 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11d-15-19" + description: "Watoto Waliozaliwa mapacha Waliozaliwa wafu Macerated (MSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'msb' + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11e-15-19" + description: "Watoto Waliozaliwa mapacha Waliozaliwa wafu Fresh (FSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'fsb' + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11f-15-19" + description: "Watoto Waliozaliwa mapacha Waliozaliwa na mama wenye VVU" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.risk_category IS NOT NULL + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11g-15-19" + description: "Watoto Waliozaliwa mapacha Waliopewa dawa za ARV" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11h-15-19" + description: "Watoto Waliozaliwa mapacha wenye APGAR Score chini ya 7 katika dakika 5" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.apgar_score_at_5_minutes AS FLOAT) < 7 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-12a-15-19" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto Waliosaidiwa kupumua - Suction " + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'suction_only' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-12b-15-19" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto waliosaidiwa kupumua- stimulation " + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'stimulation' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-12c-15-19" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto waliosaidiwa kupumua- bag and mask" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'suction_and_bag_mask' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-13a-15-19" + description: "Idadi ya watoto walionyonyeshwa ndani ya saa moja baada ya kuzaliwa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.early_bf_1hr = 'yes' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-14a-15-19" + description: "Wazazi waliofariki" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.status = 'died' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + + - key: "ld-7e-20-24" + description: "EmOC Amefanyiwa MVA/D&C" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.conducted_mva = 'yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7f-20-24" + description: "EmOC Ameongezewa damu" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.provided_blood_transfusion = 'yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8a-20-24" + description: "Wanawake waliosaidiwa kutoiewa kondo la nyuma kwa kuvutwa kitovu pole pole" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.method_used_to_remove_the_placenta = 'control_cord_traction' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8b-20-24" + description: "Wanawake waliosaidiwa kwa kukandwa kandwa nyumba ya uzazi." + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterus_massage_after_delivery = 'yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8c-20-24" + description: "Wanawake waliopata Oxytocin baada ya kujifungua (10 IU)" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%oxytocin%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8d-20-24" + description: "Wanawake waliopata Egometrine baada ya kujifungua (0.5mg)" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%ergometrine%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8e-20-24" + description: "Wanawake waliopata Misoprostol baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%misoprostol%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10a-20-24" + description: "Watoto Waliozaliwa mmoja Jumla ya watoto waliozaliwa hai" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elpc.number_of_children_born = 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10b-20-24" + description: "Watoto Waliozaliwa mmoja Waliozaliwa hai Uzito<2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) < 2.5 + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10c-20-24" + description: "Watoto Waliozaliwa mmoja Waliozaliwa hai Uzito =>2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) >= 2.5 + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10d-20-24" + description: "Watoto Waliozaliwa mmoja Waliozaliwa wafu Macerated (MSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elpc.number_of_children_born = 1 + AND elinbc.still_birth_choice = 'msb' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10e-20-24" + description: "Watoto Waliozaliwa mmoja Waliozaliwa wafu Fresh (FSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'fsb' + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10f-20-24" + description: "Watoto Waliozaliwa mmoja Waliozaliwa na mama wenye VVU" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.risk_category IS NOT NULL + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10g-20-24" + description: "Watoto Waliozaliwa mmoja Waliopewa dawa za ARV" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10h-20-24" + description: "Watoto Watoto wenye APGAR Score chini ya 7 katika dakika 5" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.apgar_score_at_5_minutes AS FLOAT) < 7 + AND elpc.number_of_children_born = 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11a-20-24" + description: "Watoto Waliozaliwa mapacha Jumla ya watoto waliozaliwa hai" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11b-20-24" + description: "Watoto Waliozaliwa mapacha Waliozaliwa hai Uzito<2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) < 2.5 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11c-20-24" + description: "Watoto Waliozaliwa mapacha Waliozaliwa hai Uzito =>2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) >= 2.5 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11d-20-24" + description: "Watoto Waliozaliwa mapacha Waliozaliwa wafu Macerated (MSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'msb' + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11e-20-24" + description: "Watoto Waliozaliwa mapacha Waliozaliwa wafu Fresh (FSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'fsb' + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11f-20-24" + description: "Watoto Waliozaliwa mapacha Waliozaliwa na mama wenye VVU" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.risk_category IS NOT NULL + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11g-20-24" + description: "Watoto Waliozaliwa mapacha Waliopewa dawa za ARV" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11h-20-24" + description: "Watoto Waliozaliwa mapacha wenye APGAR Score chini ya 7 katika dakika 5" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.apgar_score_at_5_minutes AS FLOAT) < 7 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-12a-20-24" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto Waliosaidiwa kupumua - Suction " + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'suction_only' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-12b-20-24" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto waliosaidiwa kupumua- stimulation " + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'stimulation' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-12c-20-24" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto waliosaidiwa kupumua- bag and mask" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'suction_and_bag_mask' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-13a-20-24" + description: "Idadi ya watoto walionyonyeshwa ndani ya saa moja baada ya kuzaliwa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.early_bf_1hr = 'yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-14a-20-24" + description: "Wazazi waliofariki" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.status = 'died' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + + + - key: "ld-7e-25-29" + description: "EmOC Amefanyiwa MVA/D&C" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.conducted_mva = 'yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7f-25-29" + description: "EmOC Ameongezewa damu" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.provided_blood_transfusion = 'yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8a-25-29" + description: "Wanawake waliosaidiwa kutoiewa kondo la nyuma kwa kuvutwa kitovu pole pole" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.method_used_to_remove_the_placenta = 'control_cord_traction' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8b-25-29" + description: "Wanawake waliosaidiwa kwa kukandwa kandwa nyumba ya uzazi." + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterus_massage_after_delivery = 'yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8c-25-29" + description: "Wanawake waliopata Oxytocin baada ya kujifungua (10 IU)" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%oxytocin%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8d-25-29" + description: "Wanawake waliopata Egometrine baada ya kujifungua (0.5mg)" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%ergometrine%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8e-25-29" + description: "Wanawake waliopata Misoprostol baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%misoprostol%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10a-25-29" + description: "Watoto Waliozaliwa mmoja Jumla ya watoto waliozaliwa hai" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elpc.number_of_children_born = 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10b-25-29" + description: "Watoto Waliozaliwa mmoja Waliozaliwa hai Uzito<2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) < 2.5 + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10c-25-29" + description: "Watoto Waliozaliwa mmoja Waliozaliwa hai Uzito =>2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) >= 2.5 + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10d-25-29" + description: "Watoto Waliozaliwa mmoja Waliozaliwa wafu Macerated (MSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elpc.number_of_children_born = 1 + AND elinbc.still_birth_choice = 'msb' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10e-25-29" + description: "Watoto Waliozaliwa mmoja Waliozaliwa wafu Fresh (FSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'fsb' + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10f-25-29" + description: "Watoto Waliozaliwa mmoja Waliozaliwa na mama wenye VVU" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.risk_category IS NOT NULL + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10g-25-29" + description: "Watoto Waliozaliwa mmoja Waliopewa dawa za ARV" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10h-25-29" + description: "Watoto Watoto wenye APGAR Score chini ya 7 katika dakika 5" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.apgar_score_at_5_minutes AS FLOAT) < 7 + AND elpc.number_of_children_born = 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11a-25-29" + description: "Watoto Waliozaliwa mapacha Jumla ya watoto waliozaliwa hai" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11b-25-29" + description: "Watoto Waliozaliwa mapacha Waliozaliwa hai Uzito<2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) < 2.5 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11c-25-29" + description: "Watoto Waliozaliwa mapacha Waliozaliwa hai Uzito =>2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) >= 2.5 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11d-25-29" + description: "Watoto Waliozaliwa mapacha Waliozaliwa wafu Macerated (MSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'msb' + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11e-25-29" + description: "Watoto Waliozaliwa mapacha Waliozaliwa wafu Fresh (FSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'fsb' + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11f-25-29" + description: "Watoto Waliozaliwa mapacha Waliozaliwa na mama wenye VVU" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.risk_category IS NOT NULL + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11g-25-29" + description: "Watoto Waliozaliwa mapacha Waliopewa dawa za ARV" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11h-25-29" + description: "Watoto Waliozaliwa mapacha wenye APGAR Score chini ya 7 katika dakika 5" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.apgar_score_at_5_minutes AS FLOAT) < 7 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-12a-25-29" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto Waliosaidiwa kupumua - Suction " + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'suction_only' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-12b-25-29" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto waliosaidiwa kupumua- stimulation " + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'stimulation' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-12c-25-29" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto waliosaidiwa kupumua- bag and mask" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'suction_and_bag_mask' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-13a-25-29" + description: "Idadi ya watoto walionyonyeshwa ndani ya saa moja baada ya kuzaliwa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.early_bf_1hr = 'yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-14a-25-29" + description: "Wazazi waliofariki" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.status = 'died' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + + + - key: "ld-7e-30-34" + description: "EmOC Amefanyiwa MVA/D&C" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.conducted_mva = 'yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7f-30-34" + description: "EmOC Ameongezewa damu" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.provided_blood_transfusion = 'yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8a-30-34" + description: "Wanawake waliosaidiwa kutoiewa kondo la nyuma kwa kuvutwa kitovu pole pole" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.method_used_to_remove_the_placenta = 'control_cord_traction' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8b-30-34" + description: "Wanawake waliosaidiwa kwa kukandwa kandwa nyumba ya uzazi." + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterus_massage_after_delivery = 'yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8c-30-34" + description: "Wanawake waliopata Oxytocin baada ya kujifungua (10 IU)" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%oxytocin%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8d-30-34" + description: "Wanawake waliopata Egometrine baada ya kujifungua (0.5mg)" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%ergometrine%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8e-30-34" + description: "Wanawake waliopata Misoprostol baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%misoprostol%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10a-30-34" + description: "Watoto Waliozaliwa mmoja Jumla ya watoto waliozaliwa hai" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elpc.number_of_children_born = 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10b-30-34" + description: "Watoto Waliozaliwa mmoja Waliozaliwa hai Uzito<2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) < 2.5 + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10c-30-34" + description: "Watoto Waliozaliwa mmoja Waliozaliwa hai Uzito =>2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) >= 2.5 + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10d-30-34" + description: "Watoto Waliozaliwa mmoja Waliozaliwa wafu Macerated (MSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elpc.number_of_children_born = 1 + AND elinbc.still_birth_choice = 'msb' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10e-30-34" + description: "Watoto Waliozaliwa mmoja Waliozaliwa wafu Fresh (FSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'fsb' + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10f-30-34" + description: "Watoto Waliozaliwa mmoja Waliozaliwa na mama wenye VVU" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.risk_category IS NOT NULL + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10g-30-34" + description: "Watoto Waliozaliwa mmoja Waliopewa dawa za ARV" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10h-30-34" + description: "Watoto Watoto wenye APGAR Score chini ya 7 katika dakika 5" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.apgar_score_at_5_minutes AS FLOAT) < 7 + AND elpc.number_of_children_born = 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11a-30-34" + description: "Watoto Waliozaliwa mapacha Jumla ya watoto waliozaliwa hai" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11b-30-34" + description: "Watoto Waliozaliwa mapacha Waliozaliwa hai Uzito<2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) < 2.5 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11c-30-34" + description: "Watoto Waliozaliwa mapacha Waliozaliwa hai Uzito =>2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) >= 2.5 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11d-30-34" + description: "Watoto Waliozaliwa mapacha Waliozaliwa wafu Macerated (MSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'msb' + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11e-30-34" + description: "Watoto Waliozaliwa mapacha Waliozaliwa wafu Fresh (FSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'fsb' + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11f-30-34" + description: "Watoto Waliozaliwa mapacha Waliozaliwa na mama wenye VVU" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.risk_category IS NOT NULL + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11g-30-34" + description: "Watoto Waliozaliwa mapacha Waliopewa dawa za ARV" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11h-30-34" + description: "Watoto Waliozaliwa mapacha wenye APGAR Score chini ya 7 katika dakika 5" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.apgar_score_at_5_minutes AS FLOAT) < 7 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-12a-30-34" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto Waliosaidiwa kupumua - Suction " + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'suction_only' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-12b-30-34" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto waliosaidiwa kupumua- stimulation " + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'stimulation' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-12c-30-34" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto waliosaidiwa kupumua- bag and mask" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'suction_and_bag_mask' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-13a-30-34" + description: "Idadi ya watoto walionyonyeshwa ndani ya saa moja baada ya kuzaliwa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.early_bf_1hr = 'yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-14a-30-34" + description: "Wazazi waliofariki" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.status = 'died' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + + + - key: "ld-7e-35+" + description: "EmOC Amefanyiwa MVA/D&C" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.conducted_mva = 'yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-7f-35+" + description: "EmOC Ameongezewa damu" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.provided_blood_transfusion = 'yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8a-35+" + description: "Wanawake waliosaidiwa kutoiewa kondo la nyuma kwa kuvutwa kitovu pole pole" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.method_used_to_remove_the_placenta = 'control_cord_traction' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8b-35+" + description: "Wanawake waliosaidiwa kwa kukandwa kandwa nyumba ya uzazi." + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterus_massage_after_delivery = 'yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8c-35+" + description: "Wanawake waliopata Oxytocin baada ya kujifungua (10 IU)" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%oxytocin%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8d-35+" + description: "Wanawake waliopata Egometrine baada ya kujifungua (0.5mg)" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%ergometrine%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-8e-35+" + description: "Wanawake waliopata Misoprostol baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elpam.base_entity_id) as count + FROM ec_ld_placenta_and_membrane elpam + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpam.base_entity_id + WHERE elpam.uterotonic LIKE '%misoprostol%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpam.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10a-35+" + description: "Watoto Waliozaliwa mmoja Jumla ya watoto waliozaliwa hai" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elpc.number_of_children_born = 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10b-35+" + description: "Watoto Waliozaliwa mmoja Waliozaliwa hai Uzito<2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) < 2.5 + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10c-35+" + description: "Watoto Waliozaliwa mmoja Waliozaliwa hai Uzito =>2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) >= 2.5 + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10d-35+" + description: "Watoto Waliozaliwa mmoja Waliozaliwa wafu Macerated (MSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elpc.number_of_children_born = 1 + AND elinbc.still_birth_choice = 'msb' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10e-35+" + description: "Watoto Waliozaliwa mmoja Waliozaliwa wafu Fresh (FSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'fsb' + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10f-35+" + description: "Watoto Waliozaliwa mmoja Waliozaliwa na mama wenye VVU" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.risk_category IS NOT NULL + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10g-35+" + description: "Watoto Waliozaliwa mmoja Waliopewa dawa za ARV" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND elpc.number_of_children_born = 1 + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-10h-35+" + description: "Watoto Watoto wenye APGAR Score chini ya 7 katika dakika 5" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.apgar_score_at_5_minutes AS FLOAT) < 7 + AND elpc.number_of_children_born = 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11a-35+" + description: "Watoto Waliozaliwa mapacha Jumla ya watoto waliozaliwa hai" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11b-35+" + description: "Watoto Waliozaliwa mapacha Waliozaliwa hai Uzito<2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) < 2.5 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11c-35+" + description: "Watoto Waliozaliwa mapacha Waliozaliwa hai Uzito =>2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.weight AS FLOAT) >= 2.5 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11d-35+" + description: "Watoto Waliozaliwa mapacha Waliozaliwa wafu Macerated (MSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'msb' + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11e-35+" + description: "Watoto Waliozaliwa mapacha Waliozaliwa wafu Fresh (FSB)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.still_birth_choice = 'fsb' + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11f-35+" + description: "Watoto Waliozaliwa mapacha Waliozaliwa na mama wenye VVU" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.risk_category IS NOT NULL + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date((substr(elpc.delivery_date, 7, 4) || '-' || substr(elpc.delivery_date, 4, 2) || '-' || '01'))" + - key: "ld-11g-35+" + description: "Watoto Waliozaliwa mapacha Waliopewa dawa za ARV" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-11h-35+" + description: "Watoto Waliozaliwa mapacha wenye APGAR Score chini ya 7 katika dakika 5" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE CAST(elinbc.apgar_score_at_5_minutes AS FLOAT) < 7 + AND CAST(elpc.number_of_children_born AS FLOAT) > 1 + AND elinbc.newborn_status ='alive' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-12a-35+" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto Waliosaidiwa kupumua - Suction " + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'suction_only' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-12b-35+" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto waliosaidiwa kupumua- stimulation " + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'stimulation' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-12c-35+" + description: "Watoto waliosaidiwa kupumua, Idadi ya watoto waliosaidiwa kupumua- bag and mask" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.resuscitation = 'suction_and_bag_mask' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-13a-35+" + description: "Idadi ya watoto walionyonyeshwa ndani ya saa moja baada ya kuzaliwa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.early_bf_1hr = 'yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-14a-35+" + description: "Wazazi waliofariki" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.status = 'died' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9a-10-14" + description: "Jumla waliopimwa VVU ANC" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE elc.anc_hiv_status <> 'unknown' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elc.admission_date, 7, 4) || '-' || substr(elc.admission_date, 4, 2) || '-' || '01')" + + - key: "ld-9b-10-14" + description: "Waliogundulika Positive kutoka ANC" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE elc.anc_hiv_status = 'positive' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elc.admission_date, 7, 4) || '-' || substr(elc.admission_date, 4, 2) || '-' || '01')" + + - key: "ld-9c-10-14" + description: "Jumla waliopimwa VVU wakati na baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elgec.hiv IS NOT NULL OR epf.hiv = 'positive' OR epf.hiv = 'negative') + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9d-10-14" + description: "Waliogundulika Positive wakati na baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + INNER JOIN ec_ld_confirmation elc ON elc.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elc.hiv = 'positive' OR epf.hiv = 'positive') + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9e-10-14" + description: "Waliochagua kunyonyesha maziwa ya mama pekee (EBF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elinbc.early_bf_1hr = 'yes' + AND elc.hiv = 'positive' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9f-10-14" + description: "Waliochagua ulishaji wa maziwa mbadala (RF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.reason_for_not_breast_feeding_within_one_hour LIKE '%replacement_feeding%' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9g-10-14" + description: "Waliopewa ARV Prophylaxis (tail) wakati wa kuruhusiwa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-9a-15-19" + description: "Jumla waliopimwa VVU ANC" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE elc.anc_hiv_status <> 'unknown' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elc.admission_date, 7, 4) || '-' || substr(elc.admission_date, 4, 2) || '-' || '01')" + + - key: "ld-9b-15-19" + description: "Waliogundulika Positive kutoka ANC" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE elc.anc_hiv_status = 'positive' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elc.admission_date, 7, 4) || '-' || substr(elc.admission_date, 4, 2) || '-' || '01')" + + - key: "ld-9c-15-19" + description: "Jumla waliopimwa VVU wakati na baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elgec.hiv IS NOT NULL OR epf.hiv = 'positive' OR epf.hiv = 'negative') + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9d-15-19" + description: "Waliogundulika Positive wakati na baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + INNER JOIN ec_ld_confirmation elc ON elc.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elc.hiv = 'positive' OR epf.hiv = 'positive') + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9e-15-19" + description: "Waliochagua kunyonyesha maziwa ya mama pekee (EBF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elinbc.early_bf_1hr = 'yes' + AND elc.hiv = 'positive' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9f-15-19" + description: "Waliochagua ulishaji wa maziwa mbadala (RF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.reason_for_not_breast_feeding_within_one_hour LIKE '%replacement_feeding%' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9g-15-19" + description: "Waliopewa ARV Prophylaxis (tail) wakati wa kuruhusiwa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-9a-20-24" + description: "Jumla waliopimwa VVU ANC" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE elc.anc_hiv_status <> 'unknown' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elc.admission_date, 7, 4) || '-' || substr(elc.admission_date, 4, 2) || '-' || '01')" + + - key: "ld-9b-20-24" + description: "Waliogundulika Positive kutoka ANC" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE elc.anc_hiv_status = 'positive' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elc.admission_date, 7, 4) || '-' || substr(elc.admission_date, 4, 2) || '-' || '01')" + + - key: "ld-9c-20-24" + description: "Jumla waliopimwa VVU wakati na baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elgec.hiv IS NOT NULL OR epf.hiv = 'positive' OR epf.hiv = 'negative') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9d-20-24" + description: "Waliogundulika Positive wakati na baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + INNER JOIN ec_ld_confirmation elc ON elc.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elc.hiv = 'positive' OR epf.hiv = 'positive') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9e-20-24" + description: "Waliochagua kunyonyesha maziwa ya mama pekee (EBF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elinbc.early_bf_1hr = 'yes' + AND elc.hiv = 'positive' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9f-20-24" + description: "Waliochagua ulishaji wa maziwa mbadala (RF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.reason_for_not_breast_feeding_within_one_hour LIKE '%replacement_feeding%' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9g-20-24" + description: "Waliopewa ARV Prophylaxis (tail) wakati wa kuruhusiwa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-9a-25-29" + description: "Jumla waliopimwa VVU ANC" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE elc.anc_hiv_status <> 'unknown' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elc.admission_date, 7, 4) || '-' || substr(elc.admission_date, 4, 2) || '-' || '01')" + + - key: "ld-9b-25-29" + description: "Waliogundulika Positive kutoka ANC" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE elc.anc_hiv_status = 'positive' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elc.admission_date, 7, 4) || '-' || substr(elc.admission_date, 4, 2) || '-' || '01')" + + - key: "ld-9c-25-29" + description: "Jumla waliopimwa VVU wakati na baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elgec.hiv IS NOT NULL OR epf.hiv = 'positive' OR epf.hiv = 'negative') + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9d-25-29" + description: "Waliogundulika Positive wakati na baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + INNER JOIN ec_ld_confirmation elc ON elc.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elc.hiv = 'positive' OR epf.hiv = 'positive') + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9e-25-29" + description: "Waliochagua kunyonyesha maziwa ya mama pekee (EBF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elinbc.early_bf_1hr = 'yes' + AND elc.hiv = 'positive' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9f-25-29" + description: "Waliochagua ulishaji wa maziwa mbadala (RF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.reason_for_not_breast_feeding_within_one_hour LIKE '%replacement_feeding%' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9g-25-29" + description: "Waliopewa ARV Prophylaxis (tail) wakati wa kuruhusiwa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-9a-30-34" + description: "Jumla waliopimwa VVU ANC" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE elc.anc_hiv_status <> 'unknown' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elc.admission_date, 7, 4) || '-' || substr(elc.admission_date, 4, 2) || '-' || '01')" + + - key: "ld-9b-30-34" + description: "Waliogundulika Positive kutoka ANC" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE elc.anc_hiv_status = 'positive' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elc.admission_date, 7, 4) || '-' || substr(elc.admission_date, 4, 2) || '-' || '01')" + + - key: "ld-9c-30-34" + description: "Jumla waliopimwa VVU wakati na baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elgec.hiv IS NOT NULL OR epf.hiv = 'positive' OR epf.hiv = 'negative') + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9d-30-34" + description: "Waliogundulika Positive wakati na baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + INNER JOIN ec_ld_confirmation elc ON elc.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elc.hiv = 'positive' OR epf.hiv = 'positive') + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9e-30-34" + description: "Waliochagua kunyonyesha maziwa ya mama pekee (EBF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elinbc.early_bf_1hr = 'yes' + AND elc.hiv = 'positive' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9f-30-34" + description: "Waliochagua ulishaji wa maziwa mbadala (RF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.reason_for_not_breast_feeding_within_one_hour LIKE '%replacement_feeding%' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9g-30-34" + description: "Waliopewa ARV Prophylaxis (tail) wakati wa kuruhusiwa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-9a-35+" + description: "Jumla waliopimwa VVU ANC" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE elc.anc_hiv_status <> 'unknown' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elc.admission_date, 7, 4) || '-' || substr(elc.admission_date, 4, 2) || '-' || '01')" + + - key: "ld-9b-35+" + description: "Waliogundulika Positive kutoka ANC" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE elc.anc_hiv_status = 'positive' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(elc.admission_date, 7, 4) || '-' || substr(elc.admission_date, 4, 2) || '-' || '01')" + + - key: "ld-9c-35+" + description: "Jumla waliopimwa VVU wakati na baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elgec.hiv IS NOT NULL OR epf.hiv = 'positive' OR epf.hiv = 'negative') + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9d-35+" + description: "Waliogundulika Positive wakati na baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + INNER JOIN ec_ld_confirmation elc ON elc.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elc.hiv = 'positive' OR epf.hiv = 'positive') + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9e-35+" + description: "Waliochagua kunyonyesha maziwa ya mama pekee (EBF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + INNER JOIN ec_ld_confirmation elc ON efm.base_entity_id = elc.base_entity_id + WHERE elinbc.early_bf_1hr = 'yes' + AND elc.hiv = 'positive' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9f-35+" + description: "Waliochagua ulishaji wa maziwa mbadala (RF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE elinbc.reason_for_not_breast_feeding_within_one_hour LIKE '%replacement_feeding%' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9g-35+" + description: "Waliopewa ARV Prophylaxis (tail) wakati wa kuruhusiwa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE (elinbc.provided_azt_nvp_syrup = 'yes' OR elinbc.provided_other_combinations = 'yes' OR + elinbc.provided_nvp_syrup = 'yes') + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-15a-10-14" + description: "Waliopewa ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_counselling_after_delivery = 'yes' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15b-10-14" + description: "Wateja waliofunga kizazi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'tubal_litigation' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15c-10-14" + description: "Wateja waliowekewa kitanzi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'intrauterine_device' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15d-10-14" + description: "Wateja waliowekewa vipandikizi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'implants' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15e-10-14" + description: "Wateja waliowekewa vipandikizi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'progestogen_only_pills' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-15a-15-19" + description: "Waliopewa ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_counselling_after_delivery = 'yes' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15b-15-19" + description: "Wateja waliofunga kizazi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'tubal_litigation' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15c-15-19" + description: "Wateja waliowekewa kitanzi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'intrauterine_device' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15d-15-19" + description: "Wateja waliowekewa vipandikizi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'implants' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15e-15-19" + description: "Wateja waliowekewa vipandikizi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'progestogen_only_pills' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-15a-20-24" + description: "Waliopewa ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_counselling_after_delivery = 'yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15b-20-24" + description: "Wateja waliofunga kizazi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'tubal_litigation' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15c-20-24" + description: "Wateja waliowekewa kitanzi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'intrauterine_device' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15d-20-24" + description: "Wateja waliowekewa vipandikizi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'implants' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15e-20-24" + description: "Wateja waliowekewa vipandikizi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'progestogen_only_pills' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-15a-25-29" + description: "Waliopewa ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_counselling_after_delivery = 'yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15b-25-29" + description: "Wateja waliofunga kizazi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'tubal_litigation' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15c-25-29" + description: "Wateja waliowekewa kitanzi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'intrauterine_device' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15d-25-29" + description: "Wateja waliowekewa vipandikizi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'implants' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15e-25-29" + description: "Wateja waliowekewa vipandikizi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'progestogen_only_pills' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-15a-30-34" + description: "Waliopewa ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_counselling_after_delivery = 'yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15b-30-34" + description: "Wateja waliofunga kizazi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'tubal_litigation' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15c-30-34" + description: "Wateja waliowekewa kitanzi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'intrauterine_device' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15d-30-34" + description: "Wateja waliowekewa vipandikizi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'implants' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15e-30-34" + description: "Wateja waliowekewa vipandikizi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'progestogen_only_pills' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-15a-35+" + description: "Waliopewa ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_counselling_after_delivery = 'yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15b-35+" + description: "Wateja waliofunga kizazi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'tubal_litigation' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15c-35+" + description: "Wateja waliowekewa kitanzi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'intrauterine_device' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15d-35+" + description: "Wateja waliowekewa vipandikizi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'implants' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-15e-35+" + description: "Wateja waliowekewa vipandikizi" + indicatorQuery: " SELECT count(DISTINCT elpc.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + WHERE elpc.family_planning_methods_selected = 'progestogen_only_pills' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-16a-10-14-ME" + description: "Watoto Wachanga Waliofariki" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE ec.gender = 'Male' + AND ec.dod IS NOT NULL + AND elinbc.still_birth_choice IS NULL + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-16a-10-14-KE" + description: "Watoto Wachanga Waliofariki" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE ec.gender = 'Female' + AND ec.dod IS NOT NULL + AND elinbc.still_birth_choice IS NULL + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-16a-15-19-ME" + description: "Watoto Wachanga Waliofariki" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE ec.gender = 'Male' + AND ec.dod IS NOT NULL + AND elinbc.still_birth_choice IS NULL + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-16a-15-19-KE" + description: "Watoto Wachanga Waliofariki" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE ec.gender = 'Female' + AND ec.dod IS NOT NULL + AND elinbc.still_birth_choice IS NULL + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-16a-20-24-ME" + description: "Watoto Wachanga Waliofariki" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE ec.gender = 'Male' + AND ec.dod IS NOT NULL + AND elinbc.still_birth_choice IS NULL + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-16a-20-24-KE" + description: "Watoto Wachanga Waliofariki" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE ec.gender = 'Female' + AND ec.dod IS NOT NULL + AND elinbc.still_birth_choice IS NULL + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-16a-25-29-ME" + description: "Watoto Wachanga Waliofariki" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE ec.gender = 'Male' + AND ec.dod IS NOT NULL + AND elinbc.still_birth_choice IS NULL + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-16a-25-29-KE" + description: "Watoto Wachanga Waliofariki" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE ec.gender = 'Female' + AND ec.dod IS NOT NULL + AND elinbc.still_birth_choice IS NULL + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-16a-30-34-ME" + description: "Watoto Wachanga Waliofariki" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE ec.gender = 'Male' + AND ec.dod IS NOT NULL + AND elinbc.still_birth_choice IS NULL + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-16a-30-34-KE" + description: "Watoto Wachanga Waliofariki" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE ec.gender = 'Female' + AND ec.dod IS NOT NULL + AND elinbc.still_birth_choice IS NULL + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-16a-35+-ME" + description: "Watoto Wachanga Waliofariki" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE ec.gender = 'Male' + AND ec.dod IS NOT NULL + AND elinbc.still_birth_choice IS NULL + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-16a-35+-KE" + description: "Watoto Wachanga Waliofariki" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_ld_postpartum_care elpc + INNER JOIN ec_family_member efm ON efm.base_entity_id = elpc.base_entity_id + INNER JOIN ec_child ec ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN ec_ld_immediate_new_born_care elinbc ON ec.base_entity_id = elinbc.base_entity_id + WHERE ec.gender = 'Female' + AND ec.dod IS NOT NULL + AND elinbc.still_birth_choice IS NULL + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elpc.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "ld-13b-10-14" + description: "Idadi ya wamama waliopewa rufaa" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN task t on elc.base_entity_id = t.for + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE t.focus = 'Labour And Delivery Emergency' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || + '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + - key: "ld-13b-15-19" + description: "Idadi ya wamama waliopewa rufaa" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN task t on elc.base_entity_id = t.for + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE t.focus = 'Labour And Delivery Emergency' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || + '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + - key: "ld-13b-20-24" + description: "Idadi ya wamama waliopewa rufaa" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN task t on elc.base_entity_id = t.for + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE t.focus = 'Labour And Delivery Emergency' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || + '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + - key: "ld-13b-25-29" + description: "Idadi ya wamama waliopewa rufaa" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN task t on elc.base_entity_id = t.for + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE t.focus = 'Labour And Delivery Emergency' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || + '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + - key: "ld-13b-30-34" + description: "Idadi ya wamama waliopewa rufaa" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN task t on elc.base_entity_id = t.for + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE t.focus = 'Labour And Delivery Emergency' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || + '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + - key: "ld-13b-35+" + description: "Idadi ya wamama waliopewa rufaa" + indicatorQuery: " SELECT count(DISTINCT elc.base_entity_id) as count + FROM ec_ld_confirmation elc + INNER JOIN task t on elc.base_entity_id = t.for + INNER JOIN ec_family_member efm ON efm.base_entity_id = elc.base_entity_id + WHERE t.focus = 'Labour And Delivery Emergency' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || + '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "ld-13c-10-14" + description: "Idadi ya watoto waliopewa rufaa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN task t on ec.base_entity_id = t.for + WHERE t.focus = 'Labour And Delivery Child Emergency' + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || + '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "ld-13c-15-19" + description: "Idadi ya watoto waliopewa rufaa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN task t on ec.base_entity_id = t.for + WHERE t.focus = 'Labour And Delivery Child Emergency' + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || + '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "ld-13c-20-24" + description: "Idadi ya watoto waliopewa rufaa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN task t on ec.base_entity_id = t.for + WHERE t.focus = 'Labour And Delivery Child Emergency' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || + '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "ld-13c-25-29" + description: "Idadi ya watoto waliopewa rufaa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN task t on ec.base_entity_id = t.for + WHERE t.focus = 'Labour And Delivery Child Emergency' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || + '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "ld-13c-30-34" + description: "Idadi ya watoto waliopewa rufaa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN task t on ec.base_entity_id = t.for + WHERE t.focus = 'Labour And Delivery Child Emergency' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || + '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "ld-13c-35+" + description: "Idadi ya watoto waliopewa rufaa" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.mother_entity_id + INNER JOIN task t on ec.base_entity_id = t.for + WHERE t.focus = 'Labour And Delivery Child Emergency' + AND (date(efm.dob, '+35 years') <= date('now')) + AND date(substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || + substr(strftime('%Y-%m-%d', datetime(t.authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || + '01') = + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'))" + + - key: "ld-9h-10-14" + description: "Waliopata rufaa kwenda kliniki ya huduma na matibabu" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + INNER JOIN ec_ld_confirmation elc ON elc.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elgec.hiv = 'positive') + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9h-15-19" + description: "Waliopata rufaa kwenda kliniki ya huduma na matibabu" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + INNER JOIN ec_ld_confirmation elc ON elc.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elgec.hiv = 'positive') + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9h-20-24" + description: "Waliopata rufaa kwenda kliniki ya huduma na matibabu" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + INNER JOIN ec_ld_confirmation elc ON elc.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elgec.hiv = 'positive') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9h-25-29" + description: "Waliopata rufaa kwenda kliniki ya huduma na matibabu" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + INNER JOIN ec_ld_confirmation elc ON elc.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elgec.hiv = 'positive') + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9h-30-34" + description: "Waliopata rufaa kwenda kliniki ya huduma na matibabu" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + INNER JOIN ec_ld_confirmation elc ON elc.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elgec.hiv = 'positive') + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + - key: "ld-9h-35+" + description: "Waliopata rufaa kwenda kliniki ya huduma na matibabu" + indicatorQuery: " SELECT count(DISTINCT elgec.base_entity_id) as count + FROM ec_ld_general_examination_consultation elgec + INNER JOIN ec_family_member efm ON efm.base_entity_id = elgec.base_entity_id + INNER JOIN ec_ld_confirmation elc ON elc.base_entity_id = elgec.base_entity_id + LEFT JOIN ec_pnc_followup epf ON epf.entity_id = elgec.base_entity_id + WHERE (elgec.hiv = 'positive') + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(elgec.visit_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/config/mother_champion-reporting-indicator-definitions.yml b/opensrp-chw-hf/src/main/assets/config/mother_champion-reporting-indicator-definitions.yml new file mode 100644 index 000000000..4ad2aad27 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/config/mother_champion-reporting-indicator-definitions.yml @@ -0,0 +1,53 @@ +indicators: + - key: "b-1" + description: "Idadi ya wateja wa PMTCT waliounganishwa kwenye kikundi/vikundi vya IGA and Ushauri Nasaha" + indicatorQuery: " SELECT count(DISTINCT emcf.entity_id) as count + from ec_mother_champion_followup emcf + WHERE linked_to_psychosocial_group = 'yes' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "b-2" + description: "Idadi ya wateja wapya wa PMTCT waliofuatiliwa na mama vinara na kuanza kutumia dawa" + indicatorQuery: " SELECT count(DISTINCT emcf.entity_id) as count + from ec_mother_champion_followup emcf + WHERE visit_number = 0 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "b-3" + description: "Idadi ya wateja wa PMTCT waliopotea kwenye matumizi ya dawa (LTF) na kurudishwa/kufuatiliwa na mama vinara" + indicatorQuery: " SELECT count(DISTINCT epcf.entity_id) as count + from ec_pmtct_community_feedback epcf + WHERE date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "b-4" + description: "Idadi ya vipindi alivyofundisha mama kinara/vinara kwa wateja wa PMTCT" + indicatorQuery: " SELECT count(DISTINCT id) as count + from ec_sbcc es + WHERE date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(es.sbcc_date, 7, 4) || '-' || substr(es.sbcc_date, 4, 2) || '-' || '01')" + - key: "b-5" + description: "Idadi ya wateja wa PMTCT walioelimishwa na mama kinara/vinara" + indicatorQuery: " SELECT SUM(participants_number) as count + from ec_sbcc es + WHERE date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(es.sbcc_date, 7, 4) || '-' || substr(es.sbcc_date, 4, 2) || '-' || '01')" + - key: "b-7" + description: "Idadi ya wenza waliofuatiliwa/kuletwa kituoni kupima na kujua hali za afya zao kwa mara ya kwanza" + indicatorQuery: " SELECT COUNT(DISTINCT eapcf.entity_id) as count + from ec_anc_partner_community_feedback eapcf + INNER JOIN ec_anc_followup eaf on eaf.entity_id = eapcf.entity_id + WHERE (partner_hiv IS NOT NULL AND partner_hiv <> 'test_not_conducted') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/config/pmtct-reporting-indicator-definitions.yml b/opensrp-chw-hf/src/main/assets/config/pmtct-reporting-indicator-definitions.yml new file mode 100644 index 000000000..725c1d4b3 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/config/pmtct-reporting-indicator-definitions.yml @@ -0,0 +1,796 @@ +indicators: + - key: "B3a" + description: "pmtct_pnc_clients_with_age_10-14" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE (is_transfer_in_client IS NULL OR is_transfer_in_client = 'no') + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "B3b" + description: "pmtct_pnc_clients_with_age_15-19" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE (is_transfer_in_client IS NULL OR is_transfer_in_client = 'no') + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "B3c" + description: "pmtct_pnc_clients_with_age_20-24" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE (is_transfer_in_client IS NULL OR is_transfer_in_client = 'no') + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "B3d" + description: "pmtct_pnc_clients_with_age_25+" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE (is_transfer_in_client IS NULL OR is_transfer_in_client = 'no') + AND (date(fm.dob, '+25 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "C3a" + description: "pmtct_pnc_clients_who_are_new_on_art" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE (is_transfer_in_client IS NULL OR is_transfer_in_client = 'no') + AND known_on_art = 'no' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "C3b" + description: "pmtct_pnc_clients_who_are_known_on_art" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE (is_transfer_in_client IS NULL OR is_transfer_in_client = 'no') + AND known_on_art = 'yes' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "D3" + description: "pmtct_transfer_in_client_TI" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE is_transfer_in_client = 'yes' + AND known_on_art = 'yes' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "E3" + description: "pmtct_transfer_out_clients_TO" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN (SELECT t2.base_entity_id, + substr(t2.grouped_followp_status, 0, + instr(t2.grouped_followp_status, ',')) as followup_status + from ( + SELECT T1.base_entity_id, + GROUP_CONCAT(T1.followup_status, ',') grouped_followp_status + FROM (SELECT ec_pmtct_registration.base_entity_id, ec_pmtct_followup.followup_status, visit_number + FROM ec_pmtct_registration + INNER JOIN ec_pmtct_followup + on ec_pmtct_registration.base_entity_id = ec_pmtct_followup.entity_id + ORDER BY visit_number DESC) as T1 + group by T1.base_entity_id + ) as t2) as t3 on t3.base_entity_id = epmtc.base_entity_id + WHERE t3.followup_status = 'transfer_out' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + + - key: "G3" + description: "pmtct_clients_continuing_with_services" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN ec_pmtct_followup epf on epmtc.base_entity_id = epf.entity_id + WHERE epf.followup_status = 'continuing_with_services' + AND epf.visit_number <> '0' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "H3" + description: "pmtct_clients_with_three_consecutive_missed_appointments" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE epmtc.base_entity_id NOT IN (SELECT DISTINCT epmtc.base_entity_id as base_entity_id + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN ec_pmtct_followup epf on epmtc.base_entity_id = epf.entity_id + WHERE (epf.followup_status = 'continuing_with_services' OR + epf.followup_status = 'transfer_out') + AND epf.visit_number <> '0' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), + '-3 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || + substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "I3" + description: "pmtct_clients_that_died" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN ec_pmtct_followup epf on epmtc.base_entity_id = epf.entity_id + WHERE fm.dod IS NOT NULL + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + + - key: "J3" + description: "pmtct_clients_that_exited_to_ctc" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE epmtc.is_closed = '1' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "A12" + description: "pmtct_clients_registered_month(0)_12_months_report" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE (is_transfer_in_client IS NULL OR is_transfer_in_client = 'no') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "A24" + description: "pmtct_clients_registered_month(0)_24_months_report" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE (is_transfer_in_client IS NULL OR is_transfer_in_client = 'no') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-24 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "B12" + description: "pmtct_transfer_in_client_TI_since_month(0)_12_months_report" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE is_transfer_in_client = 'yes' + AND known_on_art = 'yes' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "B24" + description: "pmtct_transfer_in_client_TI_since_month(0)_24_months_report" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE is_transfer_in_client = 'yes' + AND known_on_art = 'yes' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-24 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "C12" + description: "pmtct_transfer_out_clients_since_month(0)_12_months_report" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN (SELECT t2.base_entity_id, + substr(t2.grouped_followp_status, 0, + instr(t2.grouped_followp_status, ',')) as followup_status + from ( + SELECT T1.base_entity_id, + GROUP_CONCAT(T1.followup_status, ',') grouped_followp_status + FROM (SELECT ec_pmtct_registration.base_entity_id, ec_pmtct_followup.followup_status, visit_number + FROM ec_pmtct_registration + INNER JOIN ec_pmtct_followup + on ec_pmtct_registration.base_entity_id = ec_pmtct_followup.entity_id + ORDER BY visit_number DESC) as T1 + group by T1.base_entity_id + ) as t2) as t3 on t3.base_entity_id = epmtc.base_entity_id + WHERE t3.followup_status = 'transfer_out' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "C24" + description: "pmtct_transfer_out_clients_since_month(0)_24_months_report" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN (SELECT t2.base_entity_id, + substr(t2.grouped_followp_status, 0, + instr(t2.grouped_followp_status, ',')) as followup_status + from ( + SELECT T1.base_entity_id, + GROUP_CONCAT(T1.followup_status, ',') grouped_followp_status + FROM (SELECT ec_pmtct_registration.base_entity_id, ec_pmtct_followup.followup_status, visit_number + FROM ec_pmtct_registration + INNER JOIN ec_pmtct_followup + on ec_pmtct_registration.base_entity_id = ec_pmtct_followup.entity_id + ORDER BY visit_number DESC) as T1 + group by T1.base_entity_id + ) as t2) as t3 on t3.base_entity_id = epmtc.base_entity_id + WHERE t3.followup_status = 'transfer_out' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-24 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "E12" + description: "pmtct_clients_continuing_with_services_with_visits_M10_or_M11_or_M12" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN ec_pmtct_followup epf on epmtc.base_entity_id = epf.entity_id + WHERE epf.followup_status = 'continuing_with_services' + AND (date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01') OR + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-2 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01') OR + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-3 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "E24" + description: "pmtct_clients_continuing_with_services_with_visits_M24" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN ec_pmtct_followup epf on epmtc.base_entity_id = epf.entity_id + WHERE epf.followup_status = 'continuing_with_services' + AND (date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-1 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-24 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "F12" + description: "pmtct_clients_with_hvl_test_in_the_last_6_months" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN ec_pmtct_followup epf on epmtc.base_entity_id = epf.entity_id + WHERE epf.followup_status = 'continuing_with_services' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-6 months') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01') + AND epf.hvl_sample_id IS NOT NULL + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "G12" + description: "pmtct_clients_with_hvl_test_in_the_last_6_months_with_results_less_than_50_per_ul" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN ec_pmtct_followup epf on epmtc.base_entity_id = epf.entity_id + INNER JOIN ec_pmtct_hvl_results ephr on epf.base_entity_id = ephr.hvl_pmtct_followup_form_submission_id + WHERE epf.followup_status = 'continuing_with_services' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-6 months') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01') + AND epf.hvl_sample_id IS NOT NULL + AND CAST(hvl_result as INT) <= 50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + + - key: "H12" + description: "pmtct_clients_who_are_ltf" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN (SELECT t2.base_entity_id, + substr(t2.grouped_followp_status, 0, + instr(t2.grouped_followp_status, ',')) as followup_status + from ( + SELECT T1.base_entity_id, + GROUP_CONCAT(T1.followup_status, ',') grouped_followp_status + FROM (SELECT ec_pmtct_registration.base_entity_id, ec_pmtct_registration.followup_status, visit_number + FROM ec_pmtct_registration + INNER JOIN ec_pmtct_followup + on ec_pmtct_registration.base_entity_id = ec_pmtct_followup.entity_id + ORDER BY visit_number DESC) as T1 + group by T1.base_entity_id + ) as t2) as t3 on t3.base_entity_id = epmtc.base_entity_id + WHERE t3.followup_status = 'lost_to_followup' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + + - key: "F24" + description: "pmtct_clients_who_are_ltf_24_months_report" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN (SELECT t2.base_entity_id, + substr(t2.grouped_followp_status, 0, + instr(t2.grouped_followp_status, ',')) as followup_status + from ( + SELECT T1.base_entity_id, + GROUP_CONCAT(T1.followup_status, ',') grouped_followp_status + FROM (SELECT ec_pmtct_registration.base_entity_id, ec_pmtct_registration.followup_status, visit_number + FROM ec_pmtct_registration + INNER JOIN ec_pmtct_followup + on ec_pmtct_registration.base_entity_id = ec_pmtct_followup.entity_id + ORDER BY visit_number DESC) as T1 + group by T1.base_entity_id + ) as t2) as t3 on t3.base_entity_id = epmtc.base_entity_id + WHERE t3.followup_status = 'lost_to_followup' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-24 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "I12" + description: "pmtct_clients_who_are_diseased_since_month(0)_12_months_report" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE fm.dod IS NOT NULL + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "G24" + description: "pmtct_clients_who_are_diseased_since_month(0)_24_months_report" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN ec_pmtct_followup epf on epmtc.base_entity_id = epf.entity_id + WHERE fm.dod IS NOT NULL + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-24 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "J12" + description: "pmtct_clients_that_exited_to_ctc_since_month(0)_12_months_report" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE epmtc.is_closed = '1' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + + - key: "H24" + description: "pmtct_clients_that_exited_to_ctc_since_month(0)_24_months_report" + indicatorQuery: " SELECT count(DISTINCT epmtc.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + WHERE epmtc.is_closed = '1' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-24 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "L12" + description: "children_born_by_pmtctc_mothers_since_moonth(0)_12_months_report" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN ec_hei eh on fm.base_entity_id = eh.mother_entity_id + WHERE date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "J24" + description: "children_born_by_pmtctc_mothers_since_moonth(0)_24_months_report" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN ec_hei eh on fm.base_entity_id = eh.mother_entity_id + WHERE date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-24 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "M12" + description: "children_who_are_ltfs_since_month(0)_12_months_report" + indicatorQuery: " SELECT count(DISTINCT t3.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN (SELECT t2.base_entity_id, t2.mother_entity_id, + substr(t2.grouped_followp_status, 0, + instr(t2.grouped_followp_status, ',')) as followup_status + from ( + SELECT T1.base_entity_id, T1.mother_entity_id, + GROUP_CONCAT(T1.followup_status, ',') grouped_followp_status + FROM (SELECT ec_hei.base_entity_id, followup_status, mother_entity_id + FROM ec_hei + INNER JOIN ec_hei_followup + on ec_hei.base_entity_id = ec_hei_followup.entity_id + ORDER BY visit_number DESC) as T1 + group by T1.base_entity_id, T1.mother_entity_id + ) as t2) as t3 on t3.mother_entity_id = epmtc.base_entity_id + WHERE t3.followup_status = 'lost_to_followup' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "Q24" + description: "children_who_are_ltfs_since_month(0)_24_months_report" + indicatorQuery: " SELECT count(DISTINCT t3.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN (SELECT t2.base_entity_id, t2.mother_entity_id, + substr(t2.grouped_followp_status, 0, + instr(t2.grouped_followp_status, ',')) as followup_status + from ( + SELECT T1.base_entity_id, T1.mother_entity_id, + GROUP_CONCAT(T1.followup_status, ',') grouped_followp_status + FROM (SELECT ec_hei.base_entity_id, followup_status, mother_entity_id + FROM ec_hei + INNER JOIN ec_hei_followup + on ec_hei.base_entity_id = ec_hei_followup.entity_id + ORDER BY visit_number DESC) as T1 + group by T1.base_entity_id, T1.mother_entity_id + ) as t2) as t3 on t3.mother_entity_id = epmtc.base_entity_id + WHERE t3.followup_status = 'lost_to_followup' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-24 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + + - key: "K24" + description: "children_who_transfered_out_since_month(0)_24_months_report" + indicatorQuery: " SELECT count(DISTINCT t3.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_family_member fm on fm.base_entity_id = epmtc.base_entity_id + INNER JOIN (SELECT t2.base_entity_id, t2.mother_entity_id, + substr(t2.grouped_followp_status, 0, + instr(t2.grouped_followp_status, ',')) as followup_status + from ( + SELECT T1.base_entity_id, T1.mother_entity_id, + GROUP_CONCAT(T1.followup_status, ',') grouped_followp_status + FROM (SELECT ec_hei.base_entity_id, ec_hei_followup.followup_status, mother_entity_id + FROM ec_hei + INNER JOIN ec_hei_followup + on ec_hei.base_entity_id = ec_hei_followup.entity_id + ORDER BY visit_number DESC) as T1 + group by T1.base_entity_id, T1.mother_entity_id + ) as t2) as t3 on t3.mother_entity_id = epmtc.base_entity_id + WHERE t3.followup_status = 'transfer_out' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-24 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "N12" + description: "children_who_are_ltfs_since_month(0)_12_months_report" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_hei eh on epmtc.base_entity_id = eh.mother_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + WHERE + fm.dod IS NOT NULL AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "P24" + description: "children_who_are_ltfs_since_month(0)_24_months_report" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_hei eh on epmtc.base_entity_id = eh.mother_entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + WHERE + fm.dod IS NOT NULL AND + date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-24 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "O12" + description: "children_who_started_prophylaxis" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_hei eh on epmtc.base_entity_id = eh.mother_entity_id + INNER JOIN ec_hei_followup ehf on ehf.entity_id = eh.base_entity_id + WHERE (ehf.prophylaxis_arv_for_high_and_low_risk_given IS NOT NULL OR + ehf.prophylaxis_arv_for_high_risk_given IS NOT NULL) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "P12" + description: "children_who_started_ctx_within_2_months" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_hei eh on epmtc.base_entity_id = eh.mother_entity_id + INNER JOIN ec_hei_followup ehf on ehf.entity_id = eh.base_entity_id + INNER JOIN ec_family_member efm on efm.base_entity_id = eh.base_entity_id + WHERE ehf.prescribed_ctx = 'yes' + AND date(efm.dob, '+2 months') >= + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "Q12a" + description: "children_who_were_tested_for_hiv_within_2_months" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_hei eh on epmtc.base_entity_id = eh.mother_entity_id + INNER JOIN ec_hei_followup ehf on ehf.entity_id = eh.base_entity_id + INNER JOIN ec_family_member efm on efm.base_entity_id = eh.base_entity_id + WHERE ehf.sample_id IS NOT NULL + AND date(efm.dob, '+2 months') >= + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "Q12b" + description: "children_who_were_tested_for_hiv_and_found_positive_within_2_months" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_hei eh on epmtc.base_entity_id = eh.mother_entity_id + INNER JOIN ec_hei_followup ehf on ehf.entity_id = eh.base_entity_id + INNER JOIN ec_hei_hiv_results ehhr on ehhr.hei_followup_form_submission_id = ehf.base_entity_id + INNER JOIN ec_family_member efm on efm.base_entity_id = eh.base_entity_id + WHERE ehf.sample_id IS NOT NULL + AND date(efm.dob, '+2 months') >= + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01') + AND ehhr.hiv_test_result = 'positive' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-12 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "M24" + description: "children_who_tested_negative_after_confimation_test_24_months_report" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_hei eh on epmtc.base_entity_id = eh.mother_entity_id + WHERE eh.hiv_status = 'negative' + AND eh.is_closed = '1' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-24 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "N24" + description: "children_who_tested_negative_but_have_not_completed_hei_24_months_report" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_hei eh on epmtc.base_entity_id = eh.mother_entity_id + WHERE eh.hiv_status = 'negative' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-24 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "O24" + description: "children_who_were_found_positive_24_months_report" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_pmtct_registration epmtc + INNER JOIN ec_hei eh on epmtc.base_entity_id = eh.mother_entity_id + WHERE eh.hiv_status = 'positive' + AND eh.is_closed = '1' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-24 months') = + date(substr(epmtc.pmtct_register_date, 7, 4) || '-' || substr(epmtc.pmtct_register_date, 4, 2) || '-' || '01')" + + - key: "A" + description: "children_who_were_tested_for_hiv_at_birth" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + WHERE eh.risk_category = 'high' + AND ehf.test_at_age = 'At Birth' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "B" + description: "children_who_were_tested_for_hiv_at_less_than_2_months" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + WHERE + ehf.test_at_age IS NOT NULL + AND date(substr(fm.dob, 1, 4) || '-' || substr(fm.dob, 6, 2) || '-' || substr(fm.dob, 9, 2), '+3 months') > + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || substr(ehf.followup_visit_date, 1, 2)) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "C" + description: "children_who_were_tested_for_hiv_at_2_months_to_12_months" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + WHERE + ehf.test_at_age IS NOT NULL + AND date(substr(fm.dob, 1, 4) || '-' || substr(fm.dob, 6, 2) || '-' || substr(fm.dob, 9, 2), '+3 months') < + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || substr(ehf.followup_visit_date, 1, 2)) + AND date(substr(fm.dob, 1, 4) || '-' || substr(fm.dob, 6, 2) || '-' || substr(fm.dob, 9, 2), '+12 months') >= + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || substr(ehf.followup_visit_date, 1, 2)) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "D" + description: "children_who_were_tested_for_hiv_at_13_months_and_greater" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + WHERE + ehf.test_at_age IS NOT NULL + AND date(substr(fm.dob, 1, 4) || '-' || substr(fm.dob, 6, 2) || '-' || substr(fm.dob, 9, 2), '+12 months') < + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || substr(ehf.followup_visit_date, 1, 2)) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "A1" + description: "children_who_were_tested_for_hiv_at_birth_and_found_positive" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_hei_hiv_results ehhr on ehf.base_entity_id = ehhr.hei_followup_form_submission_id + WHERE eh.risk_category = 'high' + AND ehf.test_at_age = 'At Birth' + AND ehhr.hiv_test_result = 'positive' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "B1" + description: "children_who_were_tested_for_hiv_at_less_than_2_months_and_found_positive" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + INNER JOIN ec_hei_hiv_results ehhr on ehf.base_entity_id = ehhr.hei_followup_form_submission_id + WHERE + ehf.test_at_age IS NOT NULL + AND ehhr.hiv_test_result = 'positive' + AND date(substr(fm.dob, 1, 4) || '-' || substr(fm.dob, 6, 2) || '-' || substr(fm.dob, 9, 2), '+3 months') > + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || substr(ehf.followup_visit_date, 1, 2)) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "C1" + description: "children_who_were_first_tested_for_hiv_at_2_months_to_12_months_and_found_positive" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + INNER JOIN ec_hei_hiv_results ehhr on ehf.base_entity_id = ehhr.hei_followup_form_submission_id + WHERE + ehf.test_at_age IS NOT NULL + AND ehhr.hiv_test_result = 'positive' + AND date(substr(fm.dob, 1, 4) || '-' || substr(fm.dob, 6, 2) || '-' || substr(fm.dob, 9, 2), '+3 months') < + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || substr(ehf.followup_visit_date, 1, 2)) + AND date(substr(fm.dob, 1, 4) || '-' || substr(fm.dob, 6, 2) || '-' || substr(fm.dob, 9, 2), '+12 months') >= + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || substr(ehf.followup_visit_date, 1, 2)) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "D1" + description: "children_who_were_tested_for_hiv_at_13_months_and_greater_and_found_positive" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + INNER JOIN ec_hei_hiv_results ehhr on ehf.base_entity_id = ehhr.hei_followup_form_submission_id + WHERE + ehf.test_at_age IS NOT NULL + AND ehhr.hiv_test_result = 'positive' + AND date(substr(fm.dob, 1, 4) || '-' || substr(fm.dob, 6, 2) || '-' || substr(fm.dob, 9, 2), '+12 months') < + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || substr(ehf.followup_visit_date, 1, 2)) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "E1" + description: "children_who_were_tested_for_hiv_at_13_months_and_greater_and_found_positive" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + INNER JOIN ec_hei_hiv_results ehhr on ehf.base_entity_id = ehhr.hei_followup_form_submission_id + LEFT JOIN ec_hiv_register ehr on ehr.base_entity_id = eh.base_entity_id + WHERE ehf.test_at_age IS NOT NULL + AND ehhr.hiv_test_result = 'positive' + AND (ehr.ctc_number IS NOT NULL OR ehr.ctc_number != '' OR ehhr.ctc_number IS NOT NULL OR ehhr.ctc_number != '') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "F" + description: "children_who_were_given_proprophylactic_therapy" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + WHERE (ehf.prophylaxis_arv_for_high_risk_given IS NOT NULL OR + ehf.prophylaxis_arv_for_high_and_low_risk_given IS NOT NULL) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "G" + description: "children_who_were_given_ctx_therapy" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on ehf.entity_id = eh.base_entity_id + INNER JOIN ec_family_member efm on efm.base_entity_id = eh.base_entity_id + WHERE ehf.prescribed_ctx = 'yes' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "H" + description: "children_who_were_tested_for_hiv_at_9_months_to_12_months" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + INNER JOIN ec_hei_hiv_results ehhr on ehf.base_entity_id = ehhr.hei_followup_form_submission_id + WHERE ehf.test_at_age IS NOT NULL + AND date(substr(fm.dob, 1, 4) || '-' || substr(fm.dob, 6, 2) || '-' || substr(fm.dob, 9, 2), '+9 months') <= + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || + substr(ehf.followup_visit_date, 1, 2)) + AND date(substr(fm.dob, 1, 4) || '-' || substr(fm.dob, 6, 2) || '-' || substr(fm.dob, 9, 2), '+13 months') > + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || + substr(ehf.followup_visit_date, 1, 2)) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "I" + description: "children_who_were_tested_for_hiv_at_15_months" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + INNER JOIN ec_hei_hiv_results ehhr on ehf.base_entity_id = ehhr.hei_followup_form_submission_id + WHERE ehf.test_at_age = '15 Months' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "J" + description: "children_who_were_tested_for_hiv_at_18_months" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + INNER JOIN ec_hei_hiv_results ehhr on ehf.base_entity_id = ehhr.hei_followup_form_submission_id + WHERE ehf.test_at_age = '18 Months' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "H1" + description: "children_who_were_tested_for_hiv_at_9_months_to_12_months" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + INNER JOIN ec_hei_hiv_results ehhr on ehf.base_entity_id = ehhr.hei_followup_form_submission_id + WHERE ehf.test_at_age IS NOT NULL + AND ehhr.hiv_test_result = 'positive' + AND date(substr(fm.dob, 1, 4) || '-' || substr(fm.dob, 6, 2) || '-' || substr(fm.dob, 9, 2), '+9 months') <= + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || + substr(ehf.followup_visit_date, 1, 2)) + AND date(substr(fm.dob, 1, 4) || '-' || substr(fm.dob, 6, 2) || '-' || substr(fm.dob, 9, 2), '+13 months') > + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || + substr(ehf.followup_visit_date, 1, 2)) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "I1" + description: "children_who_were_tested_for_hiv_at_15_months" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + INNER JOIN ec_hei_hiv_results ehhr on ehf.base_entity_id = ehhr.hei_followup_form_submission_id + WHERE ehf.test_at_age = '15 Months' + AND ehhr.hiv_test_result = 'positive' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "J1" + description: "children_who_were_tested_for_hiv_at_18_months" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + INNER JOIN ec_hei_hiv_results ehhr on ehf.base_entity_id = ehhr.hei_followup_form_submission_id + WHERE ehf.test_at_age = '18 Months' + AND ehhr.hiv_test_result = 'positive' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "K" + description: "children_found_positive_and_linked_to_ctc" + indicatorQuery: " SELECT count(DISTINCT eh.base_entity_id) as count + FROM ec_hei eh + INNER JOIN ec_hei_followup ehf on eh.base_entity_id = ehf.entity_id + INNER JOIN ec_family_member fm on fm.base_entity_id = eh.base_entity_id + INNER JOIN ec_hei_hiv_results ehhr on ehf.base_entity_id = ehhr.hei_followup_form_submission_id + WHERE + ehhr.hiv_test_result = 'positive' + AND ehhr.ctc_number IS NOT NULL + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/config/pnc-reporting-indicator-definitions.yml b/opensrp-chw-hf/src/main/assets/config/pnc-reporting-indicator-definitions.yml new file mode 100644 index 000000000..cd16e15ec --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/config/pnc-reporting-indicator-definitions.yml @@ -0,0 +1,2785 @@ +indicators: + - key: "pnc-1a-10-14" + description: "Waliohudhuria Ndani ya saa 48" + indicatorQuery: "SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-1a-15-19" + description: "Waliohudhuria Ndani ya saa 48" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-1a-20-24" + description: "Waliohudhuria Ndani ya saa 48" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-1a-25-29" + description: "Waliohudhuria Ndani ya saa 48" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-1a-30-34" + description: "Waliohudhuria Ndani ya saa 48" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-1a-35+" + description: "Waliohudhuria Ndani ya saa 48" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-1b-10-14" + description: "Waliohudhuria kati ya siku ya 3-7" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+7 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-1b-15-19" + description: "Waliohudhuria kati ya siku ya 3-7" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+7 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-1b-20-24" + description: "Waliohudhuria kati ya siku ya 3-7" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+7 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-1b-25-29" + description: "Waliohudhuria kati ya siku ya 3-7" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+7 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-1b-30-34" + description: "Waliohudhuria kati ya siku ya 3-7" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+7 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-1b-35+" + description: "Waliohudhuria kati ya siku ya 3-7" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+7 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-2a-10-14" + description: "Waliomaliza mahudhurio yote ( saa 48, siku 3-7, siku 8-28, siku 29-42)" + indicatorQuery: " SELECT count(DISTINCT base_entity_id) as count + FROM ( + (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T1 + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T2 using (base_entity_id) + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T3 using (base_entity_id) + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+42 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+10 years') <= date('now')) + AND (date(efm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || '01')) T4 using (base_entity_id) + )" + - key: "pnc-2a-15-19" + description: "Waliomaliza mahudhurio yote ( saa 48, siku 3-7, siku 8-28, siku 29-42)" + indicatorQuery: " SELECT count(DISTINCT base_entity_id) as count + FROM ( + (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T1 + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T2 using (base_entity_id) + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T3 using (base_entity_id) + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+42 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+15 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || '01')) T4 using (base_entity_id) + )" + - key: "pnc-2a-20-24" + description: "Waliomaliza mahudhurio yote ( saa 48, siku 3-7, siku 8-28, siku 29-42)" + indicatorQuery: " SELECT count(DISTINCT base_entity_id) as count + FROM ( + (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T1 + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T2 using (base_entity_id) + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T3 using (base_entity_id) + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+42 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || '01')) T4 using (base_entity_id) + )" + - key: "pnc-2a-25-29" + description: "Waliomaliza mahudhurio yote ( saa 48, siku 3-7, siku 8-28, siku 29-42)" + indicatorQuery: " SELECT count(DISTINCT base_entity_id) as count + FROM ( + (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T1 + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T2 using (base_entity_id) + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T3 using (base_entity_id) + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+42 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || '01')) T4 using (base_entity_id) + )" + - key: "pnc-2a-30-34" + description: "Waliomaliza mahudhurio yote ( saa 48, siku 3-7, siku 8-28, siku 29-42)" + indicatorQuery: " SELECT count(DISTINCT base_entity_id) as count + FROM ( + (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T1 + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T2 using (base_entity_id) + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T3 using (base_entity_id) + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+42 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || '01')) T4 using (base_entity_id) + )" + - key: "pnc-2a-35+" + description: "Waliomaliza mahudhurio yote ( saa 48, siku 3-7, siku 8-28, siku 29-42)" + indicatorQuery: " SELECT count(DISTINCT base_entity_id) as count + FROM ( + (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T1 + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T2 using (base_entity_id) + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + ) T3 using (base_entity_id) + INNER JOIN (SELECT DISTINCT epo.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member efm ON efm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf ON epf.entity_id = epo.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+42 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND (date(efm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || '01')) T4 using (base_entity_id) + )" + + - key: "pnc-3-10-14" + description: "Wenye upungufu mkubwa wa damu (Hb < 8.5 g/dl)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE CAST(epf.hb_level AS FLOAT) < 8.5 + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-3-15-19" + description: "Wenye upungufu mkubwa wa damu (Hb < 8.5 g/dl)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE CAST(epf.hb_level AS FLOAT) < 8.5 + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-3-20-24" + description: "Wenye upungufu mkubwa wa damu (Hb < 8.5 g/dl)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE CAST(epf.hb_level AS FLOAT) < 8.5 + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-3-25-29" + description: "Wenye upungufu mkubwa wa damu (Hb < 8.5 g/dl)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE CAST(epf.hb_level AS FLOAT) < 8.5 + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-3-30-34" + description: "Wenye upungufu mkubwa wa damu (Hb < 8.5 g/dl)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE CAST(epf.hb_level AS FLOAT) < 8.5 + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-3-35+" + description: "Wenye upungufu mkubwa wa damu (Hb < 8.5 g/dl)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE CAST(epf.hb_level AS FLOAT) < 8.5 + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-4-10-14" + description: "Waliopata matatizo ya akili baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE (epf.puerperal_psychosis = 'yes' OR epf.mental_illness_symptom = 'yes') + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-4-15-19" + description: "Waliopata matatizo ya akili baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE (epf.puerperal_psychosis = 'yes' OR epf.mental_illness_symptom = 'yes') + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-4-20-24" + description: "Waliopata matatizo ya akili baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE (epf.puerperal_psychosis = 'yes' OR epf.mental_illness_symptom = 'yes') + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-4-25-29" + description: "Waliopata matatizo ya akili baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE (epf.puerperal_psychosis = 'yes' OR epf.mental_illness_symptom = 'yes') + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-4-30-34" + description: "Waliopata matatizo ya akili baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE (epf.puerperal_psychosis = 'yes' OR epf.mental_illness_symptom = 'yes') + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-4-35+" + description: "Waliopata matatizo ya akili baada ya kujifungua" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE (epf.puerperal_psychosis = 'yes' OR epf.mental_illness_symptom = 'yes') + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-5-10-14" + description: "Waliopata Vit. A" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.vitamin_a = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-5-15-19" + description: "Waliopata Vit. A" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.vitamin_a = 'yes' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-5-20-24" + description: "Waliopata Vit. A" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.vitamin_a = 'yes' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-5-25-29" + description: "Waliopata Vit. A" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.vitamin_a = 'yes' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-5-30-34" + description: "Waliopata Vit. A" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.vitamin_a = 'yes' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-5-35+" + description: "Waliopata Vit. A" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.vitamin_a = 'yes' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-6-10-14" + description: "Wenye msamba ulioambukizwa/Ulioachia" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.perineum_infection = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-6-15-19" + description: "Wenye msamba ulioambukizwa/Ulioachia" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.perineum_infection = 'yes' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-6-20-24" + description: "Wenye msamba ulioambukizwa/Ulioachia" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.perineum_infection = 'yes' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-6-25-29" + description: "Wenye msamba ulioambukizwa/Ulioachia" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.perineum_infection = 'yes' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-6-30-34" + description: "Wenye msamba ulioambukizwa/Ulioachia" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.perineum_infection = 'yes' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-6-35+" + description: "Wenye msamba ulioambukizwa/Ulioachia" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.perineum_infection = 'yes' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-7-10-14" + description: "Wenye fistula" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.fistula = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-7-15-19" + description: "Wenye fistula" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.fistula = 'yes' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-7-20-24" + description: "Wenye fistula" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.fistula = 'yes' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-7-25-29" + description: "Wenye fistula" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.fistula = 'yes' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-7-30-34" + description: "Wenye fistula" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.fistula = 'yes' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-7-35+" + description: "Wenye fistula" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.fistula = 'yes' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-8a-10-14" + description: "BBA" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'Birth before Arrival (BBA)' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8a-15-19" + description: "BBA" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'Birth before Arrival (BBA)' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8a-20-24" + description: "BBA" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'Birth before Arrival (BBA)' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8a-25-29" + description: "BBA" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epo.delivery_place = 'Birth before Arrival (BBA)' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8a-30-34" + description: "BBA" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'Birth before Arrival (BBA)' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8a-35+" + description: "BBA" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'Birth before Arrival (BBA)' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8b-10-14" + description: "TBA" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'Traditional birth attendant' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8b-15-19" + description: "TBA" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'Traditional birth attendant' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8b-20-24" + description: "TBA" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'Traditional birth attendant' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8b-25-29" + description: "TBA" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'Traditional birth attendant' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8b-30-34" + description: "TBA" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'Traditional birth attendant' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8b-35+" + description: "TBA" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'Traditional birth attendant' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8c-10-14" + description: "Idadi ya waliojifungulia nyumbani" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'At home' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8c-15-19" + description: "Idadi ya waliojifungulia nyumbani" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'At home' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8c-20-24" + description: "Idadi ya waliojifungulia nyumbani" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'At home' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8c-25-29" + description: "Idadi ya waliojifungulia nyumbani" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'At home' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8c-30-34" + description: "Idadi ya waliojifungulia nyumbani" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'At home' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-8c-35+" + description: "Idadi ya waliojifungulia nyumbani" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + WHERE epo.delivery_place = 'At home' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-9a-10-14" + description: "Waliopata ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.education_counselling_given = 'yes' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9a-15-19" + description: "Waliopata ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.education_counselling_given = 'yes' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9a-20-24" + description: "Waliopata ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.education_counselling_given = 'yes' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9a-25-29" + description: "Waliopata ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.education_counselling_given = 'yes' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9a-30-34" + description: "Waliopata ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.education_counselling_given = 'yes' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9a-35+" + description: "Waliopata ushauri wa uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.education_counselling_given = 'yes' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9b-10-14" + description: "Waliopata kondomu" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_condom' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9b-15-19" + description: "Waliopata kondomu" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_condom' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9b-20-24" + description: "Waliopata kondomu" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_condom' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9b-25-29" + description: "Waliopata kondomu" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_condom' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9b-30-34" + description: "Waliopata kondomu" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_condom' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9b-35+" + description: "Waliopata kondomu" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_condom' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9c-10-14" + description: "Waliopata vidonge (POP)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_pills' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9c-15-19" + description: "Waliopata vidonge (POP)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_pills' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9c-20-24" + description: "Waliopata vidonge (POP)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_pills' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9c-25-29" + description: "Waliopata vidonge (POP)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_pills' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9c-30-34" + description: "Waliopata vidonge (POP)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_pills' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9c-35+" + description: "Waliopata vidonge (POP)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_pills' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9d1-10-14" + description: "Waliopata vipandikizi (Implants)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_implants' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9d1-15-19" + description: "Waliopata vipandikizi (Implants)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_implants' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9d1-20-24" + description: "Waliopata vipandikizi (Implants)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_implants' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9d1-25-29" + description: "Waliopata vipandikizi (Implants)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_implants' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9d1-30-34" + description: "Waliopata vipandikizi (Implants)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_implants' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9d1-35+" + description: "Waliopata vipandikizi (Implants)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_implants' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9d2-10-14" + description: "Waliopata vipandikizi ( Jadelle)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_jadelle' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9d2-15-19" + description: "Waliopata vipandikizi ( Jadelle)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_jadelle' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9d2-20-24" + description: "Waliopata vipandikizi ( Jadelle)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_jadelle' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9d2-25-29" + description: "Waliopata vipandikizi ( Jadelle)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_jadelle' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9d2-30-34" + description: "Waliopata vipandikizi ( Jadelle)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_jadelle' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9d2-35+" + description: "Waliopata vipandikizi ( Jadelle)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_jadelle' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9e-10-14" + description: "Waliopata kitanzi" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_iucd' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9e-15-19" + description: "Waliopata kitanzi" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_iucd' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9e-20-24" + description: "Waliopata kitanzi" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_iucd' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9e-25-29" + description: "Waliopata kitanzi" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_iucd' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9e-30-34" + description: "Waliopata kitanzi" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_iucd' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9e-35+" + description: "Waliopata kitanzi" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_iucd' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9f-10-14" + description: "Kufunga uzazi (BTL)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_tubal_ligation' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9f-15-19" + description: "Kufunga uzazi (BTL)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_tubal_ligation' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9f-20-24" + description: "Kufunga uzazi (BTL)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_tubal_ligation' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9f-25-29" + description: "Kufunga uzazi (BTL)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_tubal_ligation' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9f-30-34" + description: "Kufunga uzazi (BTL)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_tubal_ligation' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9f-35+" + description: "Kufunga uzazi (BTL)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_tubal_ligation' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9g-10-14" + description: "Rufaa kupata njia ya uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_referred_fp_services' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9g-15-19" + description: "Rufaa kupata njia ya uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_referred_fp_services' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9g-20-24" + description: "Rufaa kupata njia ya uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_referred_fp_services' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9g-25-29" + description: "Rufaa kupata njia ya uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_referred_fp_services' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9g-30-34" + description: "Rufaa kupata njia ya uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_referred_fp_services' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-9g-35+" + description: "Rufaa kupata njia ya uzazi wa mpango" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on fm.base_entity_id = epf.entity_id + WHERE epf.method_provided = 'chk_referred_fp_services' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10a-10-14" + description: "Waliokuja postnatal wakiwa positive" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pmtct_registration epr on epo.base_entity_id = epr.base_entity_id + WHERE ((date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2)) > + date(substr(epr.pmtct_register_date, 7, 4) || '-' || substr(epr.pmtct_register_date, 4, 2) || '-' || + substr(epr.pmtct_register_date, 1, 2))) OR (epo.hiv_status_question = 'positive')) + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-10a-15-19" + description: "Waliokuja postnatal wakiwa positive" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pmtct_registration epr on epo.base_entity_id = epr.base_entity_id + WHERE ((date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2)) > + date(substr(epr.pmtct_register_date, 7, 4) || '-' || substr(epr.pmtct_register_date, 4, 2) || '-' || + substr(epr.pmtct_register_date, 1, 2))) OR (epo.hiv_status_question = 'positive')) + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-10a-20-24" + description: "Waliokuja postnatal wakiwa positive" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pmtct_registration epr on epo.base_entity_id = epr.base_entity_id + WHERE ((date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2)) > + date(substr(epr.pmtct_register_date, 7, 4) || '-' || substr(epr.pmtct_register_date, 4, 2) || '-' || + substr(epr.pmtct_register_date, 1, 2))) OR (epo.hiv_status_question = 'positive')) + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-10a-25-29" + description: "Waliokuja postnatal wakiwa positive" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pmtct_registration epr on epo.base_entity_id = epr.base_entity_id + WHERE ((date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2)) > + date(substr(epr.pmtct_register_date, 7, 4) || '-' || substr(epr.pmtct_register_date, 4, 2) || '-' || + substr(epr.pmtct_register_date, 1, 2))) OR (epo.hiv_status_question = 'positive')) + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-10a-30-34" + description: "Waliokuja postnatal wakiwa positive" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pmtct_registration epr on epo.base_entity_id = epr.base_entity_id + WHERE ((date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2)) > + date(substr(epr.pmtct_register_date, 7, 4) || '-' || substr(epr.pmtct_register_date, 4, 2) || '-' || + substr(epr.pmtct_register_date, 1, 2))) OR (epo.hiv_status_question = 'positive')) + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-10a-35+" + description: "Waliokuja postnatal wakiwa positive" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pmtct_registration epr on epo.base_entity_id = epr.base_entity_id + WHERE ((date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2)) > + date(substr(epr.pmtct_register_date, 7, 4) || '-' || substr(epr.pmtct_register_date, 4, 2) || '-' || + substr(epr.pmtct_register_date, 1, 2))) OR (epo.hiv_status_question = 'positive')) + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01')" + + - key: "pnc-10b-10-14" + description: "Waliopima VVU wakati wa postnatal (ndani ya siku 42 tangu ya kujifungua)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + WHERE epf.hiv IS NOT NULL + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10b-15-19" + description: "Waliopima VVU wakati wa postnatal (ndani ya siku 42 tangu ya kujifungua)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + WHERE epf.hiv IS NOT NULL + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10b-20-24" + description: "Waliopima VVU wakati wa postnatal (ndani ya siku 42 tangu ya kujifungua)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + WHERE epf.hiv IS NOT NULL + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10b-25-29" + description: "Waliopima VVU wakati wa postnatal (ndani ya siku 42 tangu ya kujifungua)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + WHERE epf.hiv IS NOT NULL + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10b-30-34" + description: "Waliopima VVU wakati wa postnatal (ndani ya siku 42 tangu ya kujifungua)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + WHERE epf.hiv IS NOT NULL + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10b-35+" + description: "Waliopima VVU wakati wa postnatal (ndani ya siku 42 tangu ya kujifungua)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + WHERE epf.hiv IS NOT NULL + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10c-10-14" + description: "Waliogundulika wana VVU wakati wa postnatal (ndani ya siku 42 tangu ya kujifungua)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + WHERE epf.hiv = 'positive' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10c-15-19" + description: "Waliogundulika wana VVU wakati wa postnatal (ndani ya siku 42 tangu ya kujifungua)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + WHERE epf.hiv = 'positive' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10c-20-24" + description: "Waliogundulika wana VVU wakati wa postnatal (ndani ya siku 42 tangu ya kujifungua)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + WHERE epf.hiv = 'positive' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10c-25-29" + description: "Waliogundulika wana VVU wakati wa postnatal (ndani ya siku 42 tangu ya kujifungua)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + WHERE epf.hiv = 'positive' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10c-30-34" + description: "Waliogundulika wana VVU wakati wa postnatal (ndani ya siku 42 tangu ya kujifungua)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + WHERE epf.hiv = 'positive' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10c-35+" + description: "Waliogundulika wana VVU wakati wa postnatal (ndani ya siku 42 tangu ya kujifungua)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + WHERE epf.hiv = 'positive' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10d-10-14" + description: "Wenye VVU waliochagua kunyonyesha maziwa ya mama pekee (EBF)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + WHERE epo.hiv = 'positive' + AND epcf.feeding_options = 'ebf' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10d-15-19" + description: "Wenye VVU waliochagua kunyonyesha maziwa ya mama pekee (EBF)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + WHERE epo.hiv = 'positive' + AND epcf.feeding_options = 'ebf' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10d-20-24" + description: "Wenye VVU waliochagua kunyonyesha maziwa ya mama pekee (EBF)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + WHERE epo.hiv = 'positive' + AND epcf.feeding_options = 'ebf' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10d-25-29" + description: "Wenye VVU waliochagua kunyonyesha maziwa ya mama pekee (EBF)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + WHERE epo.hiv = 'positive' + AND epcf.feeding_options = 'ebf' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10d-30-34" + description: "Wenye VVU waliochagua kunyonyesha maziwa ya mama pekee (EBF)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + WHERE epo.hiv = 'positive' + AND epcf.feeding_options = 'ebf' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10d-35+" + description: "Wenye VVU waliochagua kunyonyesha maziwa ya mama pekee (EBF)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + WHERE epo.hiv = 'positive' + AND epcf.feeding_options = 'ebf' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10e-10-14" + description: "Wenye VVU waliochagua kunywesha maziwa mbadala (RF)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + WHERE epo.hiv = 'positive' + AND epcf.feeding_options = 'rf' + AND (date(fm.dob, '+10 years') <= date('now')) + AND (date(fm.dob, '+15 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10e-15-19" + description: "Wenye VVU waliochagua kunywesha maziwa mbadala (RF)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + WHERE epo.hiv = 'positive' + AND epcf.feeding_options = 'rf' + AND (date(fm.dob, '+15 years') <= date('now')) + AND (date(fm.dob, '20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10e-20-24" + description: "Wenye VVU waliochagua kunywesha maziwa mbadala (RF)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + WHERE epo.hiv = 'positive' + AND epcf.feeding_options = 'rf' + AND (date(fm.dob, '+20 years') <= date('now')) + AND (date(fm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10e-25-29" + description: "Wenye VVU waliochagua kunywesha maziwa mbadala (RF)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + WHERE epo.hiv = 'positive' + AND epcf.feeding_options = 'rf' + AND (date(fm.dob, '+25 years') <= date('now')) + AND (date(fm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10e-30-34" + description: "Wenye VVU waliochagua kunywesha maziwa mbadala (RF)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + WHERE epo.hiv = 'positive' + AND epcf.feeding_options = 'rf' + AND (date(fm.dob, '+30 years') <= date('now')) + AND (date(fm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-10e-35+" + description: "Wenye VVU waliochagua kunywesha maziwa mbadala (RF)" + indicatorQuery: " SELECT count(DISTINCT epo.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_family_member fm on fm.base_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + WHERE epo.hiv = 'positive' + AND epcf.feeding_options = 'rf' + AND (date(fm.dob, '+35 years') <= date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-11a-ME" + description: "Waliohudhuria Ndani ya saa 48" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-11a-KE" + description: "Waliohudhuria Ndani ya saa 48" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-11b-ME" + description: "Waliohudhuria kati ya siku ya 3-7" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+7 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-11b-KE" + description: "Waliohudhuria kati ya siku ya 3-7" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_pregnancy_outcome epo + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+7 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-11c-ME" + description: "Waliomaliza mahudhurio yote ( saa 48, siku 3- 7, siku 8-28, siku 29-42)" + indicatorQuery: " SELECT count(DISTINCT base_entity_id) as count + FROM ( + (SELECT DISTINCT ec.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || + substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), + '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || '01')) T1 + INNER JOIN (SELECT DISTINCT ec.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || + substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || + substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), + '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || '01')) T2 using (base_entity_id) + INNER JOIN (SELECT DISTINCT ec.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || + substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || + substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), + '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || '01')) T3 using (base_entity_id) + INNER JOIN (SELECT DISTINCT ec.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || + substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || + substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '42 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), + '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || '01')) T4 using (base_entity_id) + )" + + - key: "pnc-11c-KE" + description: "Waliomaliza mahudhurio yote ( saa 48, siku 3- 7, siku 8-28, siku 29-42)" + indicatorQuery: " SELECT count(DISTINCT base_entity_id) as count + FROM ( + (SELECT DISTINCT ec.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE epf.visit_number = 0 + AND date(substr(epo.delivery_date, 7, 4) || '-' || + substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+48 hours') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), + '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || '01')) T1 + INNER JOIN (SELECT DISTINCT ec.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || + substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+3 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || + substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), + '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || '01')) T2 using (base_entity_id) + INNER JOIN (SELECT DISTINCT ec.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || + substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+8 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || + substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') > + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), + '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || '01')) T3 using (base_entity_id) + INNER JOIN (SELECT DISTINCT ec.base_entity_id + FROM ec_pregnancy_outcome epo + INNER JOIN ec_pnc_followup epf on epf.entity_id = epo.base_entity_id + INNER JOIN ec_child ec on ec.mother_entity_id = epo.base_entity_id + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE date(substr(epo.delivery_date, 7, 4) || '-' || + substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '+29 days') <= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND date(substr(epo.delivery_date, 7, 4) || '-' || + substr(epo.delivery_date, 4, 2) || '-' || + substr(epo.delivery_date, 1, 2), '42 days') >= + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || + substr(epf.followup_visit_date, 1, 2)) + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), + '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || + substr(epf.followup_visit_date, 4, 2) || '-' || '01')) T4 using (base_entity_id) + )" + + + - key: "pnc-12a-ME" + description: "Idadi ya watoto waliopewa BCG" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + WHERE (epcf.child_bcg_vaccination = 'yes') + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + + - key: "pnc-12a-KE" + description: "Idadi ya watoto waliopewa BCG" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + WHERE (epcf.child_bcg_vaccination = 'yes') + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-12b-ME" + description: "Idadi ya watoto waliopewa OPV 0" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + WHERE epcf.child_opv0_vaccination = 'yes' + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + + - key: "pnc-12b-KE" + description: "Idadi ya watoto waliopewa OPV 0" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + WHERE epcf.child_opv0_vaccination = 'yes' + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-12c-ME" + description: "Idadi ya watoto waliozaliwa na uzito wa < 2.5kg wakapatiwa KMC" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + WHERE CAST(epcf.weight AS FLOAT) < 2.5 + AND epcf.kangaroo_enrollment = 'yes' + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-12c-KE" + description: "Idadi ya watoto waliozaliwa na uzito wa < 2.5kg wakapatiwa KMC" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + WHERE CAST(epcf.weight AS FLOAT) < 2.5 + AND epcf.kangaroo_enrollment = 'yes' + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-12d-ME" + description: "Idadi ya watoto waliozaliwa nyumbani chini ya 2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = epf.entity_id + WHERE CAST(epcf.weight AS FLOAT) < 2.5 + AND epo.delivery_place = 'At home' + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-12d-KE" + description: "Idadi ya watoto waliozaliwa nyumbani chini ya 2.5kg" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = epf.entity_id + WHERE CAST(epcf.weight AS FLOAT) < 2.5 + AND epo.delivery_place = 'At home' + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + - key: "pnc-12e-ME" + description: "Idadi ya watoto waliozaliwa nyumbani walioanzishiwa huduma ya kangaroo (KMC)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = epf.entity_id + WHERE CAST(epcf.weight AS FLOAT) < 2.5 + AND epo.delivery_place = 'At home' + AND epcf.kangaroo_enrollment = 'yes' + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + - key: "pnc-12e-KE" + description: "Idadi ya watoto waliozaliwa nyumbani walioanzishiwa huduma ya kangaroo (KMC)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = epf.entity_id + WHERE CAST(epcf.weight AS FLOAT) < 2.5 + AND epo.delivery_place = 'At home' + AND epcf.kangaroo_enrollment = 'yes' + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-12f-ME" + description: "Wenye upungufu mkubwa wa damu (Hb < 10 g/dl au viganja vyeupe sana)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = epf.entity_id + WHERE CAST(epcf.hb_level AS FLOAT) < 10 + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-12f-KE" + description: "Wenye upungufu mkubwa wa damu (Hb < 10 g/dl au viganja vyeupe sana)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = epf.entity_id + WHERE CAST(epcf.hb_level AS FLOAT) < 10 + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-13a-ME" + description: "Watoto wenye uambukizo mkali (septicaemia)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = epf.entity_id + WHERE epcf.septicaemia = 'yes' + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-13a-KE" + description: "Watoto wenye uambukizo mkali (septicaemia)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = epf.entity_id + WHERE epcf.septicaemia = 'yes' + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-13b-ME" + description: "Watoto wenye uambukizo kwenye kitovu" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = epf.entity_id + WHERE epcf.umbilical_cord LIKE '%chk_infection%' + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-13b-KE" + description: "Watoto wenye uambukizo kwenye kitovu" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = epf.entity_id + WHERE epcf.umbilical_cord LIKE '%chk_infection%' + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-13c-ME" + description: "Watoto wenye uambukizo kwenye ngozi" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = epf.entity_id + WHERE epcf.skin_infection = 'yes' + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-13c-KE" + description: "Watoto wenye uambukizo kwenye ngozi" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = epf.entity_id + WHERE epcf.skin_infection = 'yes' + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-13d-ME" + description: "Idadi ya watoto wenye jaundice" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = epf.entity_id + WHERE epcf.jaundice = 'yes' + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-13d-KE" + description: "Idadi ya watoto wenye jaundice" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pnc_followup epf on epf.entity_id = ec.mother_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = epf.entity_id + WHERE epcf.jaundice = 'yes' + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epf.followup_visit_date, 7, 4) || '-' || substr(epf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-14-ME" + description: "Vifo vya watoto wachanga waliozaliwa nyumbani (perinatal); neonatal" + indicatorQuery: " SELECT SUM(T1.count) as count + FROM ( + + SELECT 'from_ld' as source, count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = ec.mother_entity_id + WHERE epo.delivery_place = 'At home' + AND (preg_outcome = 'born_alive_died') + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01') + + UNION + + SELECT 'from_pregnancy_outcome' as source, count(DISTINCT epo.base_entity_id) as count + FROm ec_pregnancy_outcome epo + WHERE epo.delivery_place = 'At home' + AND preg_outcome = 'born_alive_died' + AND sex_of_the_deceased_child = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01') + + ) as T1" + + - key: "pnc-14-KE" + description: "Vifo vya watoto wachanga waliozaliwa nyumbani (perinatal); neonatal" + indicatorQuery: " SELECT SUM(T1.count) as count + FROM ( + + SELECT 'from_ld' as source, count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_pregnancy_outcome epo on epo.base_entity_id = ec.mother_entity_id + WHERE epo.delivery_place = 'At home' + AND (preg_outcome = 'born_alive_died') + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01') + + UNION + + SELECT 'from_pregnancy_outcome' as source, count(DISTINCT epo.base_entity_id) as count + FROm ec_pregnancy_outcome epo + WHERE epo.delivery_place = 'At home' + AND preg_outcome = 'born_alive_died' + AND sex_of_the_deceased_child = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(epo.delivery_date, 7, 4) || '-' || substr(epo.delivery_date, 4, 2) || '-' || '01') + + ) as T1" + + - key: "pnc-15-ME" + description: "Waliopewa dawa ya ARV" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_hei_followup ehf on ehf.entity_id = ec.base_entity_id + WHERE (ehf.prophylaxis_arv_for_high_and_low_risk_given = 'true' OR ehf.prophylaxis_arv_for_high_risk_given = 'true') + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-15-KE" + description: "Waliopewa dawa ya ARV" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + INNER JOIN ec_hei_followup ehf on ehf.entity_id = ec.base_entity_id + WHERE (ehf.prophylaxis_arv_for_high_and_low_risk_given = 'true' OR ehf.prophylaxis_arv_for_high_risk_given = 'true') + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(ehf.followup_visit_date, 7, 4) || '-' || substr(ehf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-16a-ME" + description: "Watoto wachanga wanaonyonya maziwa ya mama pekee (EBF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE epcf.feeding_options = 'ebf' + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epcf.followup_visit_date, 7, 4) || '-' || substr(epcf.followup_visit_date, 4, 2) || '-' || '01')" + - key: "pnc-16a-KE" + description: "Watoto wachanga wanaonyonya maziwa ya mama pekee (EBF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE epcf.feeding_options = 'ebf' + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epcf.followup_visit_date, 7, 4) || '-' || substr(epcf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-16b-ME" + description: "Watoto wachanga wanaonyweshwa maziwa mbadala (RF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE epcf.feeding_options = 'rf' + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epcf.followup_visit_date, 7, 4) || '-' || substr(epcf.followup_visit_date, 4, 2) || '-' || '01')" + - key: "pnc-16b-KE" + description: "Watoto wachanga wanaonyweshwa maziwa mbadala (RF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE epcf.feeding_options = 'rf' + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epcf.followup_visit_date, 7, 4) || '-' || substr(epcf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-16c-ME" + description: "Watoto wachanga wanaonyweshwa maziwa ya mama na kupatiwa chakula kingine (MF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE epcf.feeding_options = 'mf' + AND efm.gender = 'Male' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epcf.followup_visit_date, 7, 4) || '-' || substr(epcf.followup_visit_date, 4, 2) || '-' || '01')" + + - key: "pnc-16c-KE" + description: "Watoto wachanga wanaonyweshwa maziwa ya mama na kupatiwa chakula kingine (MF)" + indicatorQuery: " SELECT count(DISTINCT ec.base_entity_id) as count + FROM ec_child ec + INNER JOIN ec_pnc_child_followup epcf on epcf.entity_id = ec.base_entity_id + INNER JOIN ec_family_member efm ON efm.base_entity_id = ec.base_entity_id + WHERE epcf.feeding_options = 'mf' + AND efm.gender = 'Female' + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01'), '-0 months') = + date(substr(epcf.followup_visit_date, 7, 4) || '-' || substr(epcf.followup_visit_date, 4, 2) || '-' || '01')" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/config/self-testing-monthly-report.yml b/opensrp-chw-hf/src/main/assets/config/self-testing-monthly-report.yml new file mode 100644 index 000000000..8e5bdc49b --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/config/self-testing-monthly-report.yml @@ -0,0 +1,6582 @@ +indicators: + - key: "hivst-8-18-19-ME" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-20-24-ME" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-25-29-ME" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-30-34-ME" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-35-39-ME" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-40-44-ME" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-45-49-ME" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8->50-ME" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri >=50" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date('now')-date(efm.dob))>=50 + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i-18-19-ME" + description: "Wajidunga dawa za kulevya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i-20-24-ME" + description: "Wajidunga dawa za kulevya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i-25-29-ME" + description: "Wajidunga dawa za kulevya Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i-30-34-ME" + description: "Wajidunga dawa za kulevya Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i-35-39-ME" + description: "Wajidunga dawa za kulevya Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i-40-44-ME" + description: "Wajidunga dawa za kulevya Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i-45-49-ME" + description: "Wajidunga dawa za kulevya Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i->50-ME" + description: "Wajidunga dawa za kulevya Umri >=50" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii-18-19-ME" + description: "Wafungwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii-20-24-ME" + description: "Wafungwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii-25-29-ME" + description: "Wafungwa Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii-30-34-ME" + description: "Wafungwa Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii-35-39-ME" + description: "Wafungwa Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii-40-44-ME" + description: "Wafungwa Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii-45-49-ME" + description: "Wafungwa Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii->50-ME" + description: "Wafungwa Umri >=50" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iv-18-19-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 15-19" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iv-20-24-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 20-24" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iv-25-29-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 25-29" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iv-30-34-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 30-34" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iv-35-39-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 35-39" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iv-40-44-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 40-44" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iv-45-49-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 45-49" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iv->50-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri >=50" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi-18-19-ME" + description: "Makundi Mengine Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi-20-24-ME" + description: "Makundi Mengine Umri 20-24" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi-25-29-ME" + description: "Makundi Mengine Umri 25-29" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi-30-34-ME" + description: "Makundi Mengine Umri 30-34" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi-35-39-ME" + description: "Makundi Mengine Umri 35-39" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi-40-44-ME" + description: "Makundi Mengine Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi-45-49-ME" + description: "Makundi Mengine Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi->50-ME" + description: "Makundi Mengine Umri >=50" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-9-18-19-ME" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-20-24-ME" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-25-29-ME" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-30-34-ME" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-35-39-ME" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-40-44-ME" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-45-49-ME" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9->50-ME" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU zaidi ya 50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i-18-19-ME" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='pwid') + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i-20-24-ME" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='pwid') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i-25-29-ME" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='pwid') + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i-30-34-ME" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='pwid') + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i-35-39-ME" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='pwid') + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i-40-44-ME" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='pwid') + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i-45-49-ME" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='pwid') + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i->50-ME" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='pwid') + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii-18-19-ME" + description: "Rufaa kwa Wafungwa Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='prisoners') + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii-20-24-ME" + description: "Rufaa kwa Wafungwa Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='prisoners') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii-25-29-ME" + description: "Rufaa kwa Wafungwa Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='prisoners') + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii-30-34-ME" + description: "Rufaa kwa Wafungwa Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='prisoners') + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii-35-39-ME" + description: "Rufaa kwa Wafungwa Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='prisoners') + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii-40-44-ME" + description: "Rufaa kwa Wafungwa Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='prisoners') + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii-45-49-ME" + description: "Rufaa kwa Wafungwa Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='prisoners') + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii->50-ME" + description: "Rufaa kwa Wafungwa Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='prisoners') + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iv-18-19-ME" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='msm') + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iv-20-24-ME" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='msm') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iv-25-29-ME" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='msm') + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iv-30-34-ME" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='msm') + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iv-35-39-ME" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='msm') + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iv-40-44-ME" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='msm') + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iv-45-49-ME" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='msm') + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iv->50-ME" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='msm') + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi-18-19-ME" + description: "Rufaa kwa Makundi Mengine Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='others') + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi-20-24-ME" + description: "Rufaa kwa Makundi Mengine Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='others') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi-25-29-ME" + description: "Rufaa kwa Makundi Mengine Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='others') + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi-30-34-ME" + description: "Rufaa kwa Makundi Mengine Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='others') + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi-35-39-ME" + description: "Rufaa kwa Makundi Mengine Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='others') + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi-40-44-ME" + description: "Rufaa kwa Makundi Mengine Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='others') + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi-45-49-ME" + description: "Rufaa kwa Makundi Mengine Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='others') + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi->50-ME" + description: "Rufaa kwa Makundi Mengine Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Male') + AND (client_group='others') + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-8-18-19-KE" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-20-24-KE" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-25-29-KE" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-30-34-KE" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-35-39-KE" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-40-44-KE" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-45-49-KE" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8->50-KE" + description: "Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU Umri >=50" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date('now')-date(efm.dob))>=50 + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i-18-19-KE" + description: "Wajidunga dawa za kulevya Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i-20-24-KE" + description: "Wajidunga dawa za kulevya Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i-25-29-KE" + description: "Wajidunga dawa za kulevya Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i-30-34-KE" + description: "Wajidunga dawa za kulevya Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i-35-39-KE" + description: "Wajidunga dawa za kulevya Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i-40-44-KE" + description: "Wajidunga dawa za kulevya Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i-45-49-KE" + description: "Wajidunga dawa za kulevya Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-i->50-KE" + description: "Wajidunga dawa za kulevya Umri >=50" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii-18-19-KE" + description: "Wafungwa Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii-20-24-KE" + description: "Wafungwa Umri 20-24" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii-25-29-KE" + description: "Wafungwa Umri 25-29" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii-30-34-KE" + description: "Wafungwa Umri 30-34" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii-35-39-KE" + description: "Wafungwa Umri 35-39" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii-40-44-KE" + description: "Wafungwa Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii-45-49-KE" + description: "Wafungwa Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-ii->50-KE" + description: "Wafungwa Umri >=50" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iii-18-19-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 15-19" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iii-20-24-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 20-24" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iii-25-29-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 25-29" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iii-30-34-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 30-34" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iii-35-39-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 35-39" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iii-40-44-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 40-44" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iii-45-49-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 45-49" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-iii->50-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri >=50" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-v-18-19-KE" + description: "Vijana rika la balehe 15-19" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='agyw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-v-20-24-KE" + description: "Vijana Rika La Balehe Umri 20-24" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='agyw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi-18-19-KE" + description: "Makundi Mengine Umri 15-19" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi-20-24-KE" + description: "Makundi Mengine Umri 20-24" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi-25-29-KE" + description: "Makundi Mengine Umri 25-29" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi-30-34-KE" + description: "Makundi Mengine Umri 30-34" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi-35-39-KE" + description: "Makundi Mengine Umri 35-39" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi-40-44-KE" + description: "Makundi Mengine Umri 40-44" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi-45-49-KE" + description: "Makundi Mengine Umri 45-49" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-8-vi->50-KE" + description: "Makundi Mengine Umri >=50" + indicatorQuery: " SELECT count(DISTINCT efm.base_entity_id) as count FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE hivst_result='reactive' + AND kit_for='client' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehr.result_date, 7, 4) || '-' || substr(ehr.result_date, 4, 2) || '-' || '01')" + - key: "hivst-9-18-19-KE" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-20-24-KE" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-25-29-KE" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-30-34-KE" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-35-39-KE" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-40-44-KE" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-45-49-KE" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9->50-KE" + description: "Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi ya VVU zaidi ya 50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i-18-19-KE" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='pwid') + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i-20-24-KE" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='pwid') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i-25-29-KE" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='pwid') + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i-30-34-KE" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='pwid') + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i-35-39-KE" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='pwid') + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i-40-44-KE" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='pwid') + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i-45-49-KE" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='pwid') + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-i->50-KE" + description: "Rufaa kwa Wajidunga dawa za kulevya Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='pwid') + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii-18-19-KE" + description: "Rufaa kwa Wafungwa Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='prisoners') + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii-20-24-KE" + description: "Rufaa kwa Wafungwa Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='prisoners') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii-25-29-KE" + description: "Rufaa kwa Wafungwa Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='prisoners') + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii-30-34-KE" + description: "Rufaa kwa Wafungwa Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='prisoners') + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii-35-39-KE" + description: "Rufaa kwa Wafungwa Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='prisoners') + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii-40-44-KE" + description: "Rufaa kwa Wafungwa Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='prisoners') + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii-45-49-KE" + description: "Rufaa kwa Wafungwa Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='prisoners') + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-ii->50-KE" + description: "Rufaa kwa Wafungwa Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='prisoners') + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iii-18-19-KE" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='fsw') + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iii-20-24-KE" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='fsw') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iii-25-29-KE" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='fsw') + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iii-30-34-KE" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='fsw') + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iii-35-39-KE" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='fsw') + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iii-40-44-KE" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='fsw') + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iii-45-49-KE" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='fsw') + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-iii->50-KE" + description: "Rufaa kwa Wanaume wanaofanya ngono na wanaume wenzao Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='fsw') + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-v-18-19-KE" + description: "Vijana Rika La Balehe Umri(KE) 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='agyw') + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-v-20-24-KE" + description: "Vijana Rika La Balehe Umri(KE) 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='agyw') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi-18-19-KE" + description: "Rufaa kwa Makundi Mengine Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='others') + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi-20-24-KE" + description: "Rufaa kwa Makundi Mengine Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='others') + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi-25-29-KE" + description: "Rufaa kwa Makundi Mengine Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='others') + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi-30-34-KE" + description: "Rufaa kwa Makundi Mengine Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='others') + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi-35-39-KE" + description: "Rufaa kwa Makundi Mengine Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='others') + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi-40-44-KE" + description: "Rufaa kwa Makundi Mengine Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='others') + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi-45-49-KE" + description: "Rufaa kwa Makundi Mengine Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='others') + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + - key: "hivst-9-vi->50-KE" + description: "Rufaa kwa Makundi Mengine Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM task + INNER JOIN ec_family_member efm ON efm.base_entity_id = task.for + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE focus='Conventional HIV Test' + AND (efm.gender='Female') + AND (client_group='others') + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 1, 4) ||'-' || + substr(strftime('%Y-%m-%d', datetime(authored_on / 1000, 'unixepoch', 'localtime')), 6, 2) ||'-' || '01')" + + - key: "hivst-3-18-19-ME" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-20-24-ME" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-25-29-ME" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-30-34-ME" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-35-39-ME" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-40-44-ME" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-45-49-ME" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3->50-ME" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date('now')-date(efm.dob))>=50 + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i-18-19-ME" + description: "Wajidunga dawa za kulevya Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i-20-24-ME" + description: "Wajidunga dawa za kulevya Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i-25-29-ME" + description: "Wajidunga dawa za kulevya Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i-30-34-ME" + description: "Wajidunga dawa za kulevya Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i-35-39-ME" + description: "Wajidunga dawa za kulevya Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i-40-44-ME" + description: "Wajidunga dawa za kulevya Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i-45-49-ME" + description: "Wajidunga dawa za kulevya Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i->50-ME" + description: "Wajidunga dawa za kulevya Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='pwid') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii-18-19-ME" + description: "Wafungwa Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii-20-24-ME" + description: "Wafungwa Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii-25-29-ME" + description: "Wafungwa Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii-30-34-ME" + description: "Wafungwa Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii-35-39-ME" + description: "Wafungwa Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii-40-44-ME" + description: "Wafungwa Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii-45-49-ME" + description: "Wafungwa Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii->50-ME" + description: "Wafungwa Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='prisoners') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iv-18-19-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iv-20-24-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iv-25-29-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iv-30-34-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iv-35-39-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iv-40-44-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iv-45-49-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iv->50-ME" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='msm') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi-18-19-ME" + description: "Makundi Mengine Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi-20-24-ME" + description: "Makundi Mengine Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi-25-29-ME" + description: "Makundi Mengine Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi-30-34-ME" + description: "Makundi Mengine Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi-35-39-ME" + description: "Makundi Mengine Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi-40-44-ME" + description: "Makundi Mengine Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi-45-49-ME" + description: "Makundi Mengine Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi->50-ME" + description: "Makundi Mengine Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='others') + AND (efm.gender='Male') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + + + - key: "hivst-3-18-19-KE" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-20-24-KE" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-25-29-KE" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-30-34-KE" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-35-39-KE" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-40-44-KE" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-45-49-KE" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3->50-KE" + description: "JUMLA YA KUTENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BiNAFSI) Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date('now')-date(efm.dob))>=50 + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i-18-19-KE" + description: "Wajidunga dawa za kulevya Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i-20-24-KE" + description: "Wajidunga dawa za kulevya Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i-25-29-KE" + description: "Wajidunga dawa za kulevya Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i-30-34-KE" + description: "Wajidunga dawa za kulevya Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i-35-39-KE" + description: "Wajidunga dawa za kulevya Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i-40-44-KE" + description: "Wajidunga dawa za kulevya Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i-45-49-KE" + description: "Wajidunga dawa za kulevya Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-i->50-KE" + description: "Wajidunga dawa za kulevya Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='pwid') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii-18-19-KE" + description: "Wafungwa Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii-20-24-KE" + description: "Wafungwa Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii-25-29-KE" + description: "Wafungwa Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii-30-34-KE" + description: "Wafungwa Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii-35-39-KE" + description: "Wafungwa Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii-40-44-KE" + description: "Wafungwa Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii-45-49-KE" + description: "Wafungwa Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-ii->50-KE" + description: "Wafungwa Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='prisoners') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iii-18-19-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iii-20-24-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iii-25-29-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iii-30-34-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iii-35-39-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iii-40-44-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iii-45-49-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-iii->50-KE" + description: "Wanaume wanaofanya ngono na wanaume wenzao Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='fsw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-v-18-19-KE" + description: "Vijana Rika La Balehe Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='agyw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-v-20-24-KE" + description: "Vijana Rika La Balehe Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='agyw') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi-18-19-KE" + description: "Makundi Mengine Umri 15-19" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+18 years') <= date('now')) + AND (date(efm.dob, '+20 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi-20-24-KE" + description: "Makundi Mengine Umri 20-24" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+20 years') <= date('now')) + AND (date(efm.dob, '+25 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi-25-29-KE" + description: "Makundi Mengine Umri 25-29" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+25 years') <= date('now')) + AND (date(efm.dob, '+30 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi-30-34-KE" + description: "Makundi Mengine Umri 30-34" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+30 years') <= date('now')) + AND (date(efm.dob, '+35 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi-35-39-KE" + description: "Makundi Mengine Umri 35-39" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+35 years') <= date('now')) + AND (date(efm.dob, '+40 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi-40-44-KE" + description: "Makundi Mengine Umri 40-44" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+40 years') <= date('now')) + AND (date(efm.dob, '+45 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi-45-49-KE" + description: "Makundi Mengine Umri 45-49" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date(efm.dob, '+45 years') <= date('now')) + AND (date(efm.dob, '+50 years') > date('now')) + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + - key: "hivst-3-vi->50-KE" + description: "Makundi Mengine Umri >=50" + indicatorQuery: " SELECT count(efm.base_entity_id) as count FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + INNER JOIN ec_hivst_register ON efm.base_entity_id = ec_hivst_register.base_entity_id + WHERE self_test_kit_given='yes' + AND (date('now')-date(efm.dob))>=50 + AND (client_group='others') + AND (efm.gender='Female') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(collection_date, 7, 4) || '-' || substr(collection_date, 4, 2) || '-' || '01')" + + + # // 2 and age 15-19 + - key: "hivst-2-18-19-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 15 - 19" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Male' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2 and age 20-24 + - key: "hivst-2-20-24-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 20 - 24" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Male' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2 and age 25-29 + - key: "hivst-2-25-29-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 25 - 29" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Male' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2 and age 30-34 + - key: "hivst-2-30-34-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 30 - 34" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Male' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2 and age 35-39 + - key: "hivst-2-35-39-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 35 - 39" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Male' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2 and age 40-44 + - key: "hivst-2-40-44-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 40 - 44" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Male' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2 and age 45-49 + - key: "hivst-2-45-49-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 45 - 49" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Male' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2 and age ->50 + - key: "hivst-2->50-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 50 kuendelea" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Male' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + + # // 2-i and age 15-19 + - key: "hivst-2-i-18-19-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 15 - 19 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age 20-24 + - key: "hivst-2-i-20-24-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 20 - 24 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age 25-29 + - key: "hivst-2-i-25-29-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 25 - 29 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age 30-34 + - key: "hivst-2-i-30-34-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 30 - 34 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age 35-39 + - key: "hivst-2-i-35-39-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 35 - 39 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age 40-44 + - key: "hivst-2-i-40-44-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 40 - 44 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age 45-49 + - key: "hivst-2-i-45-49-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 45 - 49 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age ->50 + - key: "hivst-2-i->50-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka ->50 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + + # // 2-ii and age 15-19 + - key: "hivst-2-ii-18-19-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 15 - 19 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-ii and age 20-24 + - key: "hivst-2-ii-20-24-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 20 - 24 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-ii and age 25-29 + - key: "hivst-2-ii-25-29-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 25 - 29 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-ii and age 30-34 + - key: "hivst-2-ii-30-34-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 30 - 34 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-ii and age 35-39 + - key: "hivst-2-ii-35-39-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 35 - 39 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-ii and age 40-44 + - key: "hivst-2-ii-40-44-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 40 - 44 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-ii and age 45-49 + - key: "hivst-2-ii-45-49-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 45 - 49 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-ii and age ->50 + - key: "hivst-2-ii->50-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka ->50 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + + # // 2-iii and age 15-19 + - key: "hivst-2-iii-18-19-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 15 - 19 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='fsw' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iii and age 20-24 + - key: "hivst-2-iii-20-24-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 20 - 24 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='fsw' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iii and age 25-29 + - key: "hivst-2-iii-25-29-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 25 - 29 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='fsw' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iii and age 30-34 + - key: "hivst-2-iii-30-34-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 30 - 34 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='fsw' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iii and age 35-39 + - key: "hivst-2-iii-35-39-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 35 - 39 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='fsw' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age 40-44 + - key: "hivst-2-iii-40-44-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 40 - 44 na ni fsw" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='fsw' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + + + # // 2-iv and age 15-19 + - key: "hivst-2-iv-18-19-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 15 - 19 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 20-24 + - key: "hivst-2-iv-20-24-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 20 - 24 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 25-29 + - key: "hivst-2-iv-25-29-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 25 - 29 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 30-34 + - key: "hivst-2-iv-30-34-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 30 - 34 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 35-39 + - key: "hivst-2-iv-35-39-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 35 - 39 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 40-44 + - key: "hivst-2-iv-40-44-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 40 - 44 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 45-49 + - key: "hivst-2-iv-45-49-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 45 - 49 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 20-24 + - key: "hivst-2-iv->50-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka ->50 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + + # // 2-v and age 15-19 + - key: "hivst-2-v-18-19-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 15 - 19 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-v and age 20-24 + - key: "hivst-2-v-20-24-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 20 - 24 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-v and age 25-29 + - key: "hivst-2-v-25-29-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 25 - 29 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-v and age 30-34 + - key: "hivst-2-v-30-34-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 30 - 34 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-v and age 35-39 + - key: "hivst-2-v-35-39-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 35 - 39 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-v and age 40-44 + - key: "hivst-2-v-40-44-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 40 - 44 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-v and age 45-49 + - key: "hivst-2-v-45-49-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 45 - 49 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-v and age ->50 + - key: "hivst-2-v->50-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka ->50 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + + # // 2-vi and age 15-19 + - key: "hivst-2-vi-18-19-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 15 - 19 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-vi and age 20-24 + - key: "hivst-2-vi-20-24-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 20 - 24 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-vi and age 25-29 + - key: "hivst-2-vi-25-29-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 25 - 29 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-vi and age 30-34 + - key: "hivst-2-vi-30-34-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 30 - 34 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-vi and age 35-39 + - key: "hivst-2-vi-35-39-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 35 - 39 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-vi and age 40-44 + - key: "hivst-2-vi-40-44-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 40 - 44 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-vi and age 45-49 + - key: "hivst-2-vi-45-49-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka 45 - 49 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-vi and age ->50 + - key: "hivst-2-vi->50-ME" + description: "Idadi ya wateja wa kiume waliopewa condom kwa umri wa miaka ->50 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Male' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + + + #Question 7 + + # // 7 and age 15-19 + - key: "hivst-7-18-19-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 15 - 19" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Male' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7 and age 20-24 + - key: "hivst-7-20-24-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 20 - 24" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Male' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7 and age 25-29 + - key: "hivst-7-25-29-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 25 - 29" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Male' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7 and age 30-34 + - key: "hivst-7-30-34-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 30 - 34" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Male' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7 and age 35-39 + - key: "hivst-7-35-39-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 35 - 39" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Male' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7 and age 40-44 + - key: "hivst-7-40-44-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 40 - 44" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Male' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7 and age 45-49 + - key: "hivst-7-45-49-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 45 - 49" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Male' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7 and age ->50 + - key: "hivst-7->50-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 50 kuendelea" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Male' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + # // 7-i and age 15-19 + - key: "hivst-7-i-18-19-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 15 - 19 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Male' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-i and age 20-24 + - key: "hivst-7-i-20-24-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 20 - 24 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Male' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-i and age 25-29 + - key: "hivst-7-i-25-29-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 25 - 29 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Male' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-i and age 30-34 + - key: "hivst-7-i-30-34-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 30 - 34 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Male' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-i and age 35-39 + - key: "hivst-7-i-35-39-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 35 - 39 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Male' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-i and age 40-44 + - key: "hivst-7-i-40-44-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 40 - 44 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Male' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "hivst-7-i-45-49-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 40 - 44 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Male' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-i and age ->50 + - key: "hivst-7-i->50-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka ->50 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Male' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + # // 7-ii and age 15-19 + - key: "hivst-7-ii-18-19-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 15 - 19 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Male' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-ii and age 20-24 + - key: "hivst-7-ii-20-24-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 20 - 24 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Male' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-ii and age 25-29 + - key: "hivst-7-ii-25-29-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 25 - 29 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Male' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-ii and age 30-34 + - key: "hivst-7-ii-30-34-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 30 - 34 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Male' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-ii and age 35-39 + - key: "hivst-7-ii-35-39-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 35 - 39 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Male' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-ii and age 40-44 + - key: "hivst-7-ii-40-44-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 40 - 44 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Male' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-ii and age 45-49 + - key: "hivst-7-ii-45-49-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 45 - 49 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Male' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-ii and age ->50 + - key: "hivst-7-ii->50-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka ->50 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Male' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + # // 7-iii and age 15-19 + - key: "hivst-7-iii-18-19-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 15 - 19 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='fsw' + AND efm.gender = 'Male' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iii and age 20-24 + - key: "hivst-7-iii-20-24-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 20 - 24 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='fsw' + AND efm.gender = 'Male' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iii and age 25-29 + - key: "hivst-7-iii-25-29-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 25 - 29 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='fsw' + AND efm.gender = 'Male' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iii and age 30-34 + - key: "hivst-7-iii-30-34-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 30 - 34 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='fsw' + AND efm.gender = 'Male' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iii and age 35-39 + - key: "hivst-7-iii-35-39-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 35 - 39 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='fsw' + AND efm.gender = 'Male' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + # // 7-iv and age 15-19 + - key: "hivst-7-iv-18-19-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 15 - 19 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Male' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iv and age 20-24 + - key: "hivst-7-iv-20-24-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 20 - 24 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Male' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iv and age 25-29 + - key: "hivst-7-iv-25-29-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 25 - 29 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Male' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iv and age 30-34 + - key: "hivst-7-iv-30-34-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 30 - 34 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Male' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iv and age 35-39 + - key: "hivst-7-iv-35-39-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 35 - 39 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Male' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iv and age 40-44 + - key: "hivst-7-iv-40-44-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 40 - 44 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Male' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iv and age 45-49 + - key: "hivst-7-iv-45-49-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 45 - 49 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Male' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iv and age 20-24 + - key: "hivst-7-iv->50-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka ->50 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Male' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + # // 7-v and age 15-19 + - key: "hivst-7-v-18-19-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 15 - 19 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Male' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age 20-24 + - key: "hivst-7-v-20-24-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 20 - 24 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Male' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age 25-29 + - key: "hivst-7-v-25-29-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 25 - 29 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Male' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age 30-34 + - key: "hivst-7-v-30-34-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 30 - 34 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Male' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age 35-39 + - key: "hivst-7-v-35-39-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 35 - 39 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Male' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age 40-44 + - key: "hivst-7-v-40-44-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 40 - 44 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Male' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age 45-49 + - key: "hivst-7-v-45-49-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 45 - 49 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Male' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age ->50 + - key: "hivst-7-v->50-ME" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka ->50 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Male' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + # // 7-vi and age 15-19 + - key: "hivst-7-vi-18-19-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 15 - 19 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Male' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-vi and age 20-24 + - key: "hivst-7-vi-20-24-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 20 - 24 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Male' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-vi and age 25-29 + - key: "hivst-7-vi-25-29-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 25 - 29 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Male' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-vi and age 30-34 + - key: "hivst-7-vi-30-34-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 30 - 34 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Male' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-vi and age 35-39 + - key: "hivst-7-vi-35-39-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 35 - 39 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Male' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-vi and age 40-44 + - key: "hivst-7-vi-40-44-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 40 - 44 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Male' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-vi and age 45-49 + - key: "hivst-7-vi-45-49-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 45 - 49 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Male' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-vi and age ->50 + - key: "hivst-7-vi->50-ME" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka ->50 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Male' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + # wanawake Qns 2 and 7 + #start with question 2 + # // 2 and age 15-19 + - key: "hivst-2-18-19-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 15 - 19" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Female' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2 and age 20-24 + - key: "hivst-2-20-24-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 20 - 24" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Female' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2 and age 25-29 + - key: "hivst-2-25-29-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 25 - 29" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Female' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2 and age 30-34 + - key: "hivst-2-30-34-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 30 - 34" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Female' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2 and age 35-39 + - key: "hivst-2-35-39-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 35 - 39" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Female' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2 and age 40-44 + - key: "hivst-2-40-44-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 40 - 44" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Female' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2 and age 45-49 + - key: "hivst-2-45-49-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 45 - 49" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Female' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2 and age ->50 + - key: "hivst-2->50-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 50 kuendelea" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_followup ehf + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehf.entity_id + WHERE condoms_given='yes' + AND efm.gender = 'Female' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + + + # // 2-i and age 15-19 + - key: "hivst-2-i-18-19-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 15 - 19 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age 20-24 + - key: "hivst-2-i-20-24-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 20 - 24 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age 25-29 + - key: "hivst-2-i-25-29-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 25 - 29 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age 30-34 + - key: "hivst-2-i-30-34-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 30 - 34 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age 35-39 + - key: "hivst-2-i-35-39-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 35 - 39 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age 40-44 + - key: "hivst-2-i-40-44-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 40 - 44 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age 45-49 + - key: "hivst-2-i-45-49-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 45 - 49 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-i and age ->50 + - key: "hivst-2-i->50-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka ->50 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='pwid' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + + # // 2-ii and age 15-19 + - key: "hivst-2-ii-18-19-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 15 - 19 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-ii and age 20-24 + - key: "hivst-2-ii-20-24-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 20 - 24 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-ii and age 25-29 + - key: "hivst-2-ii-25-29-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 25 - 29 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-ii and age 30-34 + - key: "hivst-2-ii-30-34-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 30 - 34 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-ii and age 35-39 + - key: "hivst-2-ii-35-39-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 35 - 39 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-ii and age 40-44 + - key: "hivst-2-ii-40-44-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 40 - 44 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-ii and age 45-49 + - key: "hivst-2-ii-45-49-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 45 - 49 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-ii and age ->50 + - key: "hivst-2-ii->50-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka ->50 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='prisoners' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + + # // 2-iii and age 15-19 + - key: "hivst-2-iii-18-19-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 15 - 19 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='fsw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iii and age 20-24 + - key: "hivst-2-iii-20-24-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 20 - 24 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='fsw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iii and age 25-29 + - key: "hivst-2-iii-25-29-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 25 - 29 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='fsw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iii and age 30-34 + - key: "hivst-2-iii-30-34-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 30 - 34 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='fsw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iii and age 35-39 + - key: "hivst-2-iii-35-39-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 35 - 39 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='fsw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iii and age 40-44 + - key: "hivst-2-iii-40-44-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 40 - 44 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='fsw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iii and age 45-49 + - key: "hivst-2-iii-45-49-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 45 - 49 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='fsw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iii and age ->50 + - key: "hivst-2-iii->50-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka ->50 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='fsw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 15-19 + - key: "hivst-2-iv-18-19-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 15 - 19 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 20-24 + - key: "hivst-2-iv-20-24-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 20 - 24 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 25-29 + - key: "hivst-2-iv-25-29-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 25 - 29 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 30-34 + - key: "hivst-2-iv-30-34-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 30 - 34 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 35-39 + - key: "hivst-2-iv-35-39-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 35 - 39 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 40-44 + - key: "hivst-2-iv-40-44-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 40 - 44 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 45-49 + - key: "hivst-2-iv-45-49-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 45 - 49 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-iv and age 20-24 + - key: "hivst-2-iv->50-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka ->50 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='msm' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + + # // 2-v and age 15-19 + - key: "hivst-2-v-18-19-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 15 - 19 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-v and age 20-24 + - key: "hivst-2-v-20-24-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 20 - 24 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-v and age 25-29 + - key: "hivst-2-v-25-29-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 25 - 29 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-v and age 30-34 + - key: "hivst-2-v-30-34-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 30 - 34 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-v and age 35-39 + - key: "hivst-2-v-35-39-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 35 - 39 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-v and age 40-44 + - key: "hivst-2-v-40-44-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 40 - 44 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-v and age 45-49 + - key: "hivst-2-v-45-49-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 45 - 49 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-v and age ->50 + - key: "hivst-2-v->50-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka ->50 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='agyw' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + + + # // 2-vi and age 15-19 + - key: "hivst-2-vi-18-19-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 15 - 19 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-vi and age 20-24 + - key: "hivst-2-vi-20-24-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 20 - 24 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-vi and age 25-29 + - key: "hivst-2-vi-25-29-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 25 - 29 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-vi and age 30-34 + - key: "hivst-2-vi-30-34-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 30 - 34 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-vi and age 35-39 + - key: "hivst-2-vi-35-39-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 35 - 39 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-vi and age 40-44 + - key: "hivst-2-vi-40-44-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 40 - 44 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-vi and age 45-49 + - key: "hivst-2-vi-45-49-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 45 - 49 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + # // 2-vi and age ->50 + - key: "hivst-2-vi->50-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka ->50 na ni makundi ya others" + indicatorQuery: "SELECT count(efm.base_entity_id) as count + FROM ec_hivst_register ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.base_entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id = ehr.base_entity_id + WHERE client_group='others' + AND condoms_given='yes' + AND efm.gender = 'Female' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(ehf.collection_date, 7, 4) || '-' || substr(ehf.collection_date, 4, 2) || '-' || '01')" + + #Question 7 + # // 7 and age 15-19 + - key: "hivst-7-18-19-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 15 - 19" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Female' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7 and age 20-24 + - key: "hivst-7-20-24-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 20 - 24" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Female' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7 and age 25-29 + - key: "hivst-7-25-29-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 25 - 29" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Female' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7 and age 30-34 + - key: "hivst-7-30-34-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 30 - 34" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Female' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7 and age 35-39 + - key: "hivst-7-35-39-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 35 - 39" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Female' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7 and age 40-44 + - key: "hivst-7-40-44-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 40 - 44" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Female' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7 and age 45-49 + - key: "hivst-7-45-49-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 45 - 49" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Female' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7 and age ->50 + - key: "hivst-7->50-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 50 kuendelea" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND efm.gender = 'Female' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + # // 7-i and age 15-19 + - key: "hivst-7-i-18-19-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 15 - 19 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Female' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-i and age 20-24 + - key: "hivst-7-i-20-24-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 20 - 24 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Female' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-i and age 25-29 + - key: "hivst-7-i-25-29-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 25 - 29 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Female' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-i and age 30-34 + - key: "hivst-7-i-30-34-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 30 - 34 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Female' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-i and age 35-39 + - key: "hivst-7-i-35-39-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 35 - 39 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Female' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-i and age 40-44 + - key: "hivst-7-i-40-44-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 40 - 44 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Female' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "hivst-7-i-45-49-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 40 - 44 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Female' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-i and age ->50 + - key: "hivst-7-i->50-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka ->50 na ni wajidunga madawa ya kulevya" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='pwid' + AND efm.gender = 'Female' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + # // 7-ii and age 15-19 + - key: "hivst-7-ii-18-19-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 15 - 19 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Female' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-ii and age 20-24 + - key: "hivst-7-ii-20-24-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 20 - 24 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Female' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-ii and age 25-29 + - key: "hivst-7-ii-25-29-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 25 - 29 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Female' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-ii and age 30-34 + - key: "hivst-7-ii-30-34-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 30 - 34 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Female' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-ii and age 35-39 + - key: "hivst-7-ii-35-39-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 35 - 39 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Female' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-ii and age 40-44 + - key: "hivst-7-ii-40-44-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 40 - 44 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Female' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-ii and age 45-49 + - key: "hivst-7-ii-45-49-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 45 - 49 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Female' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-ii and age ->50 + - key: "hivst-7-ii->50-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka ->50 na ni wafungwa wa mahabusu" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='prisoners' + AND efm.gender = 'Female' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + # // 7-iii and age 15-19 + - key: "hivst-7-iii-18-19-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 15 - 19 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='fsw' + AND efm.gender = 'Female' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iii and age 20-24 + - key: "hivst-7-iii-20-24-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 20 - 24 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='fsw' + AND efm.gender = 'Female' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iii and age 25-29 + - key: "hivst-7-iii-25-29-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 25 - 29 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='fsw' + AND efm.gender = 'Female' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iii and age 30-34 + - key: "hivst-7-iii-30-34-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 30 - 34 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='fsw' + AND efm.gender = 'Female' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + # // 7-iii and age 35-39 + - key: "hivst-7-iii-35-39-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 35 - 39 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='fsw' + AND efm.gender = 'Female' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iii and age 40-44 + - key: "hivst-7-iii-40-44-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 40 - 44 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='fsw' + AND efm.gender = 'Female' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iii and age 45-49 + - key: "hivst-7-iii-45-49-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 45 - 49 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='fsw' + AND efm.gender = 'Female' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iii and age ->50 + - key: "hivst-7-iii->50-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka ->50 na ni fsw (wanawake wanaojiuza)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='fsw' + AND efm.gender = 'Female' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + # // 7-iv and age 15-19 + - key: "hivst-7-iv-18-19-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 15 - 19 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Female' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iv and age 20-24 + - key: "hivst-7-iv-20-24-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 20 - 24 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Female' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iv and age 25-29 + - key: "hivst-7-iv-25-29-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 25 - 29 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Female' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iv and age 30-34 + - key: "hivst-7-iv-30-34-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 30 - 34 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Female' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iv and age 35-39 + - key: "hivst-7-iv-35-39-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 35 - 39 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Female' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iv and age 40-44 + - key: "hivst-7-iv-40-44-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 40 - 44 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Female' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iv and age 45-49 + - key: "hivst-7-iv-45-49-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 45 - 49 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Female' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-iv and age 20-24 + - key: "hivst-7-iv->50-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka ->50 na ni msm (male sex with male)" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='msm' + AND efm.gender = 'Female' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age 15-19 + - key: "hivst-7-v-18-19-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 15 - 19 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Female' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age 20-24 + - key: "hivst-7-v-20-24-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 20 - 24 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Female' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age 25-29 + - key: "hivst-7-v-25-29-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 25 - 29 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Female' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age 30-34 + - key: "hivst-7-v-30-34-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 30 - 34 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Female' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age 35-39 + - key: "hivst-7-v-35-39-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 35 - 39 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Female' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age 40-44 + - key: "hivst-7-v-40-44-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 40 - 44 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Female' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age 45-49 + - key: "hivst-7-v-45-49-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka 45 - 49 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Female' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-v and age ->50 + - key: "hivst-7-v->50-KE" + description: "Idadi ya wateja wa kike waliopewa condom kwa umri wa miaka ->50 na ni vijana rila la balehe" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='agyw' + AND efm.gender = 'Female' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + + + + + # // 7-vi and age 15-19 + - key: "hivst-7-vi-18-19-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 15 - 19 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Female' + AND 15<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=19 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-vi and age 20-24 + - key: "hivst-7-vi-20-24-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 20 - 24 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Female' + AND 20<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=24 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-vi and age 25-29 + - key: "hivst-7-vi-25-29-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 25 - 29 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Female' + AND 25<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=29 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-vi and age 30-34 + - key: "hivst-7-vi-30-34-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 30 - 34 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Female' + AND 30<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=34 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-vi and age 35-39 + - key: "hivst-7-vi-35-39-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 35 - 39 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Female' + AND 35<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=39 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-vi and age 40-44 + - key: "hivst-7-vi-40-44-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 40 - 44 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Female' + AND 40<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=44 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-vi and age 45-49 + - key: "hivst-7-vi-45-49-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka 45 - 49 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Female' + AND 45<=(date('Now')-date(efm.dob)) AND (date('Now')-date(efm.dob))<=49 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + # // 7-vi and age ->50 + - key: "hivst-7-vi->50-KE" + description: "waliojipima wenyewe na kurudisha majibu kwa umri wa miaka ->50 na ni makundi ya others" + indicatorQuery: "SELECT count(DISTINCT efm.base_entity_id) as count + FROM ec_hivst_results ehr + INNER JOIN ec_family_member efm ON efm.base_entity_id = ehr.entity_id + INNER JOIN ec_hivst_followup ehf ON ehf.entity_id=ehr.entity_id + INNER JOIN ec_hivst_register ehreg ON ehreg.base_entity_id=ehf.entity_id + WHERE ehr.hivst_result!='client_did_not_disclose' + AND ehr.kit_for='client' + AND ehf.self_test_kit_given='yes' + AND ehreg.client_group='others' + AND efm.gender = 'Female' + AND (date('now')-date(efm.dob))>=50 + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || + substr(strftime('%Y-%m-%d', datetime(ehr.collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || + '-' || '01')" + - key: "hivst-4-a" + description: "Jumla ya vitendanishi vya kujipima VVU vilivyosambazwa (Washirika wa Ngono, Rafiki Rika)" + indicatorQuery: " SELECT count(id) as count FROM ec_hivst_results + WHERE (kit_for='peer_friend' OR kit_for='sexual_partner') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + - key: "hivst-5-a" + description: "Jumla ya vitendanishi vya kujipima VVU vilivyosambazwa (Binafsi, Washrika wa Ngono, Rafiki rika)" + indicatorQuery: " SELECT count(id) as count FROM ec_hivst_results + WHERE (kit_for='client' OR kit_for='peer_friend' OR kit_for='sexual_partner') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + - key: "hivst-6-a" + description: "Jumla ya wateja (Washrika wa ngono, Rafiki rika) waliotumia vitendanishi vya kujipima VVU na kurudisha majibu" + indicatorQuery: " SELECT count(id) as count FROM ec_hivst_results + WHERE (kit_for='peer_friend' OR kit_for='sexual_partner' ) + AND (hivst_result !='not_returned') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(result_date, 7, 4) || '-' || substr(result_date, 4, 2) || '-' || '01')" + - key: "hivst-4-b" + description: "B- Jumla ya vitendanishi vya kujipima VVU vilivyosambazwa (Washirika wa Ngono, Rafiki Rika)" + indicatorQuery: " SELECT count(base_entity_id) as count FROM ec_hivst_results + WHERE (kit_for='peer_friend' OR kit_for='sexual_partner') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + - key: "hivst-5-b" + description: "B- Jumla ya vitendanishi vya kujipima VVU vilivyosambazwa (Binafsi, Washrika wa Ngono, Rafiki rika)" + indicatorQuery: " SELECT count(base_entity_id) as count FROM ec_hivst_results + WHERE (kit_for='client' OR kit_for='peer_friend' OR kit_for='sexual_partner') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(strftime('%Y-%m-%d', datetime(collection_date / 1000, 'unixepoch', 'localtime')), 1, 4) || + '-' || substr(strftime('%Y-%m-%d', datetime(collection_date / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01')" + - key: "hivst-6-b" + description: "B- Jumla ya wateja (Washrika wa ngono, Rafiki rika) waliotumia vitendanishi vya kujipima VVU na kurudisha majibu" + indicatorQuery: "SELECT count(id) as count FROM ec_hivst_results + WHERE kit_for!='client' + AND (hivst_result !='not_returned') + AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) = + date(substr(result_date, 7, 4) || '-' || substr(result_date, 4, 2) || '-' || '01')" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/ec_client_classification.json b/opensrp-chw-hf/src/main/assets/ec_client_classification.json index 3c39f4c53..7a712db3d 100644 --- a/opensrp-chw-hf/src/main/assets/ec_client_classification.json +++ b/opensrp-chw-hf/src/main/assets/ec_client_classification.json @@ -93,6 +93,13 @@ "ec_child_activity" ] }, + { + "field": "eventType", + "field_value": "PNC Child Followup", + "creates_case": [ + "ec_child" + ] + }, { "field": "eventType", "field_value": "Visit not done", @@ -115,21 +122,60 @@ "ec_child" ] }, + { + "field": "eventType", + "field_value": "Pregnancy Confirmation", + "creates_case": [ + "ec_anc_register", + "ec_anc_log", + "ec_anc_pregnancy_lookup" + ] + }, + { + "field": "eventType", + "field_value": "ANC Followup Client Registration", + "creates_case": [ + "ec_anc_register", + "ec_anc_log", + "ec_anc_followup", + "ec_anc_birth_emergency_plan", + "ec_anc_pregnancy_lookup" + ] + }, { "field": "eventType", "field_value": "ANC Registration", "creates_case": [ "ec_anc_register", + "ec_anc_pregnancy_lookup", "ec_anc_log" ] }, { "field": "eventType", - "field_value": "ANC Home Visit", + "field_value": "ANC First Facility Visit", "creates_case": [ + "ec_anc_register", + "ec_anc_followup", + "ec_anc_birth_emergency_plan" + ] + }, + { + "field": "eventType", + "field_value": "ANC Close Followup Visits", + "closes_case": [ "ec_anc_register" ] }, + { + "field": "eventType", + "field_value": "ANC Recurring Facility Visit", + "creates_case": [ + "ec_anc_register", + "ec_anc_followup", + "ec_anc_birth_emergency_plan" + ] + }, { "field": "eventType", "field_value": "Malaria Confirmation", @@ -155,7 +201,8 @@ "field": "eventType", "field_value": "Pregnancy Outcome", "closes_case": [ - "ec_anc_register" + "ec_anc_register", + "ec_ld_confirmation" ] }, { @@ -218,7 +265,8 @@ "field": "eventType", "field_value": "Referral Registration", "creates_case": [ - "ec_referral" + "ec_referral", + "ec_hts_register" ] }, { @@ -248,6 +296,675 @@ "creates_case": [ "ec_family_planning_update" ] + }, + { + "field": "eventType", + "field_value": "Hiv Registration", + "creates_case": [ + "ec_hiv_register" + ] + }, + { + "field": "eventType", + "field_value": "Hiv Registration", + "creates_case": [ + "ec_hts_register" + ] + }, + { + "field": "eventType", + "field_value": "Tb Registration", + "creates_case": [ + "ec_tb_register" + ] + }, + { + "field": "eventType", + "field_value": "TB Case Closure", + "creates_case": [ + "ec_tb_register" + ] + }, + { + "field": "eventType", + "field_value": "HIV Outcome", + "creates_case": [ + "ec_hiv_register", + "ec_hiv_outcome", + "ec_hts_register" + ] + }, + { + "field": "eventType", + "field_value": "Update CTC Number", + "creates_case": [ + "ec_hiv_register" + ] + }, + { + "field": "eventType", + "field_value": "TB Outcome", + "creates_case": [ + "ec_tb_register", + "ec_tb_outcome" + ] + }, + { + "field": "eventType", + "field_value": "HIV Community Followup", + "creates_case": [ + "ec_hiv_community_followup" + ] + }, + { + "field": "eventType", + "field_value": "TB Community Followup", + "creates_case": [ + "ec_tb_community_followup" + ] + }, + { + "field": "eventType", + "field_value": "HIV Community Followup Feedback", + "creates_case": [ + "ec_hiv_community_feedback" + ] + }, + { + "field": "eventType", + "field_value": "TB Community Followup Feedback", + "creates_case": [ + "ec_tb_community_feedback" + ] + }, + { + "field": "eventType", + "field_value": "Close Hiv Feedback", + "creates_case": [ + "ec_hiv_community_feedback" + ] + }, + { + "field": "eventType", + "field_value": "Close Tb Feedback", + "creates_case": [ + "ec_tb_community_feedback" + ] + }, + { + "field": "eventType", + "field_value": "Hiv Index Contact Registration", + "creates_case": [ + "ec_hiv_index_hf", + "ec_hiv_index" + ] + }, + { + "field": "eventType", + "field_value": "HIV Index Contact Testing Followup", + "creates_case": [ + "ec_hiv_index_hf", + "ec_hiv_index" + ] + }, + { + "field": "eventType", + "field_value": "HIV Index Contact CHW Followup", + "creates_case": [ + "ec_hiv_index_chw_followup" + ] + }, + { + "field": "eventType", + "field_value": "HIV Index Contact Community Followup Referral", + "creates_case": [ + "ec_hiv_index_hf", + "ec_hiv_index" + ] + }, + { + "field": "eventType", + "field_value": "PMTCT Registration", + "creates_case": [ + "ec_pmtct_registration", + "ec_hiv_register" + ] + }, + { + "field": "eventType", + "field_value": "PMTCT TI Registration", + "creates_case": [ + "ec_pmtct_registration", + "ec_pmtct_followup" + ] + }, + { + "field": "eventType", + "field_value": "PMTCT Post PNC Registration", + "creates_case": [ + "ec_pmtct_registration", + "ec_hiv_register" + ] + }, + { + "field": "eventType", + "field_value": "PMTCT Follow-up Visit", + "creates_case": [ + "ec_pmtct_followup", + "ec_pmtct_registration" + ] + }, + { + "field": "eventType", + "field_value": "Mark PMTCT Client As LTF", + "creates_case": [ + "ec_pmtct_followup" + ] + }, + { + "field": "eventType", + "field_value": "PMTCT HVL Results", + "creates_case": [ + "ec_pmtct_hvl_results" + ] + }, + { + "field": "eventType", + "field_value": "PMTCT Close Visits", + "closes_case": [ + "ec_pmtct_registration" + ] + }, + { + "field": "eventType", + "field_value": "PMTCT CD4 Test Results", + "creates_case": [ + "ec_pmtct_cd4_results" + ] + }, + { + "field": "eventType", + "field_value": "PMTCT EAC Visit", + "creates_case": [ + "ec_pmtct_eac_visit" + ] + }, + { + "field": "eventType", + "field_value": "Pregnancy Unconfirmed", + "closes_case": [ + "ec_anc_register" + ] + }, + { + "field": "eventType", + "field_value": "Partner Registration", + "creates_case": [ + "ec_anc_register" + ] + }, + { + "field": "eventType", + "field_value": "Partner Testing", + "creates_case": [ + "ec_anc_register", + "ec_anc_followup" + ] + }, + { + "field": "eventType", + "field_value": "Update HIV Index Contact Testing Followup", + "creates_case": [ + "ec_hiv_index_hf", + "ec_hiv_index" + ] + }, + { + "field": "eventType", + "field_value": "PMTCT Community Followup Feedback", + "creates_case": [ + "ec_pmtct_community_feedback" + ] + }, + { + "field": "eventType", + "field_value": "Close PMTCT Feedback", + "creates_case": [ + "ec_pmtct_community_feedback" + ] + }, + { + "field": "eventType", + "field_value": "HEI Registration", + "creates_case": [ + "ec_hei" + ] + }, + { + "field": "eventType", + "field_value": "HEI Number Registration", + "creates_case": [ + "ec_hei" + ] + }, + { + "field": "eventType", + "field_value": "HEI Followup", + "creates_case": [ + "ec_hei_followup", + "ec_hei" + ] + }, + { + "field": "eventType", + "field_value": "Mark HEI Client As LTF", + "creates_case": [ + "ec_hei_followup" + ] + }, + { + "field": "eventType", + "field_value": "HEI HIV Test Results", + "creates_case": [ + "ec_hei_hiv_results", + "ec_hei" + ] + }, + { + "field": "eventType", + "field_value": "HEI Positive Infant", + "closes_case": [ + "ec_hei" + ], + "creates_case": [ + "ec_hiv_register", + "ec_hei_followup" + ] + }, + { + "field": "eventType", + "field_value": "HEI Negative Infant", + "creates_case": [ + "ec_hei_followup" + ], + "closes_case": [ + "ec_hei" + ] + }, + { + "field": "eventType", + "field_value": "PNC No Mother Registration", + "creates_case": [ + "ec_no_mother_pnc", + "ec_child" + ] + }, + { + "field": "eventType", + "field_value": "PNC VISIT", + "creates_case": [ + "ec_pregnancy_outcome", + "ec_pnc_followup" + ] + }, + { + "field": "eventType", + "field_value": "PNC Child Followup", + "creates_case": [ + "ec_pnc_child_followup" + ] + }, + { + "field": "eventType", + "field_value": "Close PNC Visits", + "closes_case": [ + "ec_pregnancy_outcome" + ] + }, + { + "field": "eventType", + "field_value": "LD Registration", + "creates_case": [ + "ec_ld_confirmation" + ] + }, + { + "field": "eventType", + "field_value": "LD Registration", + "closes_case": [ + "ec_anc_register" + ] + }, + { + "field": "eventType", + "field_value": "Labour Stage Assessment", + "creates_case": [ + "ec_ld_confirmation" + ] + }, + { + "field": "eventType", + "field_value": "LD General Examination", + "creates_case": [ + "ec_ld_confirmation", + "ec_ld_general_examination_consultation" + ] + }, + { + "field": "eventType", + "field_value": "Cervix Dilation Monitoring", + "creates_case": [ + "ec_ld_confirmation", + "ec_ld_general_examination_consultation" + ] + }, + { + "field": "eventType", + "field_value": "LD Partograph", + "creates_case": [ + "ec_ld_confirmation", + "ec_ld_partograph" + ] + }, + { + "field": "eventType", + "field_value": "Mode of Delivery", + "creates_case": [ + "ec_ld_confirmation" + ] + }, + { + "field": "eventType", + "field_value": "LD Active Management of 3rd Stage Of Labour", + "creates_case": [ + "ec_ld_confirmation", + "ec_ld_placenta_and_membrane" + ] + }, + { + "field": "eventType", + "field_value": "Close LD", + "closes_case": [ + "ec_ld_confirmation" + ] + }, + { + "field": "eventType", + "field_value": "Post Delivery Mother Management", + "creates_case": [ + "ec_pregnancy_outcome" + ] + }, + { + "field": "eventType", + "field_value": "Post Delivery Mother Management", + "creates_case": [ + "ec_ld_confirmation", + "ec_ld_postpartum_care" + ] + }, + { + "field": "eventType", + "field_value": "LND 1st Newborn", + "creates_case": [ + "ec_ld_immediate_new_born_care" + ] + }, + { + "field": "eventType", + "field_value": "LND 2nd Newborn", + "creates_case": [ + "ec_ld_immediate_new_born_care" + ] + }, + { + "field": "eventType", + "field_value": "LND 3rd Newborn", + "creates_case": [ + "ec_ld_immediate_new_born_care" + ] + }, + { + "field": "eventType", + "field_value": "LND 4th Newborn", + "creates_case": [ + "ec_ld_immediate_new_born_care" + ] + }, + { + "field": "eventType", + "field_value": "LND 5th Newborn", + "creates_case": [ + "ec_ld_immediate_new_born_care" + ] + }, + { + "field": "eventType", + "field_value": "LND 6th Newborn", + "creates_case": [ + "ec_ld_immediate_new_born_care" + ] + }, + { + "field": "eventType", + "field_value": "LTFU Feedback", + "creates_case": [ + "ec_ltfu_feedback" + ] + }, + { + "field": "eventType", + "field_value": "LD Child Registration", + "creates_case": [ + "ec_child", + "ec_family_member" + ] + }, + { + "field": "eventType", + "field_value": "CBHS Registration", + "creates_case": [ + "ec_cbhs_register" + ] + }, + { + "field": "eventType", + "field_value": "Update CBHS Registration", + "creates_case": [ + "ec_cbhs_register" + ] + }, + { + "field": "eventType", + "field_value": "CBHS Registration", + "creates_case": [ + "ec_cbhs_register" + ] + }, + { + "field": "eventType", + "field_value": "Update CBHS Registration", + "creates_case": [ + "ec_cbhs_register" + ] + }, + { + "field": "eventType", + "field_value": "CBHS Followup", + "creates_case": [ + "ec_cbhs_register", + "ec_cbhs_followup" + ] + }, + { + "field": "eventType", + "field_value": "Mother Champion Community Services Referral", + "creates_case": [ + "ec_mother_champion" + ] + }, + { + "field": "eventType", + "field_value": "Mother Champion Followup", + "creates_case": [ + "ec_mother_champion_followup" + ] + }, + { + "field": "eventType", + "field_value": "Mother Champion SBCC Sessions", + "creates_case": [ + "ec_sbcc" + ] + }, + { + "field": "eventType", + "field_value": "ANC Partner Community Followup Feedback", + "creates_case": [ + "ec_anc_partner_community_feedback" + ] + }, + { + "field": "eventType", + "field_value": "Self Testing Registration", + "creates_case": [ + "ec_hivst_register" + ] + }, + { + "field": "eventType", + "field_value": "Self Testing Kits Issue", + "creates_case": [ + "ec_hivst_followup" + ] + }, + { + "field": "eventType", + "field_value": "Self Testing Results Registration", + "creates_case": [ + "ec_hivst_results" + ] + }, + { + "field": "eventType", + "field_value": "Self Testing Results", + "creates_case": [ + "ec_hivst_results" + ] + }, + { + "field": "eventType", + "field_value": "HIVST Mobilization Session", + "creates_case":[ + "ec_hivst_mobilization" + ] + }, + { + "field": "eventType", + "field_value": "HTS Registration", + "creates_case":[ + "ec_hts_register" + ] + }, + { + "field": "eventType", + "field_value": "Transfer to PNC", + "creates_case": [ + "ec_pregnancy_outcome" + ] + }, + { + "field": "eventType", + "field_value": "CDP Condom Order", + "creates_case": [ + "ec_cdp_orders_receive" + ] + }, + { + "field": "eventType", + "field_value": "CDP Order From Facility", + "creates_case": [ + "ec_cdp_orders_sent" + ] + }, + { + "field": "eventType", + "field_value": "CDP Distribution Within Facility", + "creates_case": [ + "ec_cdp_issuing_hf" + ] + }, + { + "field": "eventType", + "field_value": "CDP Distribution Outside Facility", + "creates_case": [ + "ec_cdp_issuing_hf" + ] + }, + { + "field": "eventType", + "field_value": "KVP Registration", + "creates_case": [ + "ec_kvp_register" + ] + }, + { + "field": "eventType", + "field_value": "KVP Behavioral Service Visit", + "creates_case": [ + "ec_kvp_behavioral_services" + ] + }, + { + "field": "eventType", + "field_value": "KVP Structural Service Visit", + "creates_case": [ + "ec_kvp_structural_services" + ] + }, + { + "field": "eventType", + "field_value": "KVP Bio Medical Service Visit", + "creates_case": [ + "ec_kvp_register", + "ec_kvp_bio_medical_services" + ] + }, + { + "field": "eventType", + "field_value": "KVP Other Service Visit", + "creates_case": [ + "ec_kvp_other_services" + ] + }, + { + "field": "eventType", + "field_value": "PrEP Registration", + "creates_case": [ + "ec_prep_register" + ] + }, + { + "field": "eventType", + "field_value": "PrEP Follow-up Visit", + "creates_case": [ + "ec_prep_register" + ] + }, + { + "field": "eventType", + "field_value": "PrEP Client Not Eligible", + "closes_case": [ + "ec_prep_register" + ] + }, + { + "field": "eventType", + "field_value": "PrEP Follow-up Visit", + "creates_case": [ + "ec_prep_register", + "ec_prep_followup" + ] } ] } diff --git a/opensrp-chw-hf/src/main/assets/ec_client_fields.json b/opensrp-chw-hf/src/main/assets/ec_client_fields.json index 01422b419..cf917e269 100644 --- a/opensrp-chw-hf/src/main/assets/ec_client_fields.json +++ b/opensrp-chw-hf/src/main/assets/ec_client_fields.json @@ -1,7 +1,7 @@ { "bindobjects": [ { - "name": "ec_family", + "name": "ec_pmtct_registration", "columns": [ { "column_name": "base_entity_id", @@ -11,434 +11,6510 @@ } }, { - "column_name": "unique_id", - "type": "Client", + "column_name": "pmtct_register_date", + "type": "Event", "json_mapping": { - "field": "identifiers.opensrp_id" + "field": "obs.fieldCode", + "concept": "pmtct_register_date" } }, { - "column_name": "first_name", - "type": "Client", + "column_name": "hiv_status", + "type": "Event", "json_mapping": { - "field": "firstName" + "field": "obs.fieldCode", + "concept": "test_results" } }, { - "column_name": "last_name", - "type": "Client", + "column_name": "ctc_number", + "type": "Event", "json_mapping": { - "field": "lastName" + "field": "obs.fieldCode", + "concept": "ctc_number" } }, { - "column_name": "village_town", - "type": "Client", + "column_name": "known_on_art", + "type": "Event", "json_mapping": { - "field": "addresses.cityVillage" + "field": "obs.fieldCode", + "concept": "known_on_art" } }, { - "column_name": "landmark", - "type": "Client", + "column_name": "is_transfer_in_client", + "type": "Event", "json_mapping": { - "field": "addresses.landmark" + "field": "obs.fieldCode", + "concept": "is_transfer_in_client" } }, { - "column_name": "gps", + "column_name": "next_facility_visit_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "next_facility_visit_date" } }, { - "column_name": "nearest_facility", + "column_name": "followup_status", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "162724AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "followup_status" + } + } + ] + }, + { + "name": "ec_pmtct_followup", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" } }, { - "column_name": "family_head", - "type": "Client", + "column_name": "base_entity_id", + "type": "Event", "json_mapping": { - "field": "relationships.family_head" + "field": "formSubmissionId" } }, { - "column_name": "primary_caregiver", - "type": "Client", + "column_name": "followup_status", + "type": "Event", "json_mapping": { - "field": "relationships.primary_caregiver" + "field": "obs.fieldCode", + "concept": "followup_status" } }, { - "column_name": "last_interacted_with", + "column_name": "followup_visit_date", "type": "Event", "json_mapping": { - "field": "version" + "field": "obs.fieldCode", + "concept": "followup_visit_date" } }, { - "column_name": "date_removed", - "type": "Client", + "column_name": "liver_function_test_conducted", + "type": "Event", "json_mapping": { - "field": "attributes.dateRemoved" + "field": "obs.fieldCode", + "concept": "liver_function_test_conducted" } }, { - "column_name": "event_date", + "column_name": "receive_liver_function_test_results", "type": "Event", "json_mapping": { - "field": "eventDate", - "event_type": "Family Registration" + "field": "obs.fieldCode", + "concept": "receive_liver_function_test_results" + } + }, + { + "column_name": "renal_function_test_conducted", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "renal_function_test_conducted" + } + }, + { + "column_name": "receive_renal_function_test_results", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "receive_renal_function_test_results" + } + }, + { + "column_name": "hvl_sample_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hvl_sample_id" + } + }, + { + "column_name": "hvl_collection_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hvl_collection_date" + } + }, + { + "column_name": "cd4_sample_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "cd4_sample_id" + } + }, + { + "column_name": "cd4_collection_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "cd4_collection_date" + } + }, + { + "column_name": "arv_line", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "arv_line" + } + }, + { + "column_name": "arv_regimen", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "arv_regimen" + } + }, + { + "column_name": "has_been_provided_with_tpt_before", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "has_been_provided_with_tpt_before" + } + }, + { + "column_name": "is_client_provided_with_tpt", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "is_client_provided_with_tpt" + } + }, + { + "column_name": "completed_tpt", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "completed_tpt" + } + }, + { + "column_name": "prescribed_regimes", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "prescribed_regimes" + } + }, + { + "column_name": "visit_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "visit_number" + } + }, + { + "column_name": "next_facility_visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "next_facility_visit_date" } } ] }, { - "name": "ec_family_member", + "name": "ec_pmtct_hvl_results", "columns": [ { - "column_name": "base_entity_id", - "type": "Client", + "column_name": "entity_id", + "type": "Event", "json_mapping": { "field": "baseEntityId" } }, { - "column_name": "unique_id", - "type": "Client", + "column_name": "base_entity_id", + "type": "Event", "json_mapping": { - "field": "identifiers.opensrp_id" + "field": "formSubmissionId" } }, { - "column_name": "relational_id", - "type": "Client", + "column_name": "hvl_sample_id", + "type": "Event", "json_mapping": { - "field": "relationships.family" + "field": "obs.fieldCode", + "concept": "hvl_sample_id" } }, { - "column_name": "first_name", - "type": "Client", + "column_name": "hvl_pmtct_followup_form_submission_id", + "type": "Event", "json_mapping": { - "field": "firstName" + "field": "obs.fieldCode", + "concept": "hvl_pmtct_followup_form_submission_id" } }, { - "column_name": "middle_name", - "type": "Client", + "column_name": "hvl_result", + "type": "Event", "json_mapping": { - "field": "middleName" + "field": "obs.fieldCode", + "concept": "hvl_result" } }, { - "column_name": "last_name", - "type": "Client", + "column_name": "enroll_to_eac", + "type": "Event", "json_mapping": { - "field": "lastName" + "field": "obs.fieldCode", + "concept": "enroll_to_eac" } }, { - "column_name": "dob", - "type": "Client", + "column_name": "hvl_result_date", + "type": "Event", "json_mapping": { - "field": "birthdate" + "field": "obs.fieldCode", + "concept": "hvl_result_date" + } + } + ] + }, + { + "name": "ec_pmtct_cd4_results", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" } }, { - "column_name": "dod", - "type": "Client", + "column_name": "base_entity_id", + "type": "Event", "json_mapping": { - "field": "deathdate" + "field": "formSubmissionId" } }, { - "column_name": "dob_unknown", - "type": "Client", + "column_name": "cd4_sample_id", + "type": "Event", "json_mapping": { - "field": "birthdateApprox" + "field": "obs.fieldCode", + "concept": "cd4_sample_id" } }, { - "column_name": "gender", - "type": "Client", + "column_name": "cd4_pmtct_followup_form_submission_id", + "type": "Event", "json_mapping": { - "field": "gender" + "field": "obs.fieldCode", + "concept": "cd4_pmtct_followup_form_submission_id" } }, { - "column_name": "phone_number", + "column_name": "cd4_result", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "cd4_result" } }, { - "column_name": "other_phone_number", + "column_name": "cd4_result_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "cd4_result_date" } }, { - "column_name": "national_id", - "type": "Client", + "column_name": "started_ctx", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "started_ctx" + } + }, + { + "column_name": "reason_for_not_starting_ctx", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "reason_for_not_starting_ctx" + } + } + ] + }, + { + "name": "ec_pmtct_eac_visit", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "eac_visit_type", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "eac_visit_type" + } + }, + { + "column_name": "eac", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "eac" + } + }, + { + "column_name": "eac_visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "eac_visit_date" + } + }, + { + "column_name": "eac_visit_session", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "eac_visit_session" + } + }, + { + "column_name": "eac_completion_status", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "eac_completion_status" + } + }, + { + "column_name": "form_submission_timestamp", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "form_submission_timestamp" + } + } + ] + }, + { + "name": "ec_hei", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Client", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "unique_id", + "type": "Client", + "json_mapping": { + "field": "identifiers.opensrp_id" + } + }, + { + "column_name": "relational_id", + "type": "Client", + "json_mapping": { + "field": "relationships.family" + } + }, + { + "column_name": "mother_entity_id", + "type": "Client", + "json_mapping": { + "field": "relationships.mother" + } + }, + { + "column_name": "risk_category", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "risk_category" + } + }, + { + "column_name": "dob", + "type": "Client", + "json_mapping": { + "field": "birthdate" + } + }, + { + "column_name": "hiv_status", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv_status" + } + }, + { + "column_name": "hei_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hei_number" + } + }, + { + "column_name": "next_visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "next_facility_visit_date" + } + } + ] + }, + { + "name": "ec_hei_followup", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "followup_status", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "followup_status" + } + }, + { + "column_name": "followup_visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "followup_visit_date" + } + }, + { + "column_name": "sample_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "sample_id" + } + }, + { + "column_name": "sample_collection_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "sample_collection_date" + } + }, + { + "column_name": "type_of_hiv_test", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "type_of_hiv_test" + } + }, + { + "column_name": "test_at_age", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "test_at_age" + } + }, + { + "column_name": "prophylaxis_arv_for_high_risk_given", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "prophylaxis_arv_for_high_risk_given" + } + }, + { + "column_name": "prophylaxis_arv_for_high_and_low_risk_given", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "prophylaxis_arv_for_high_and_low_risk_given" + } + }, + { + "column_name": "prescribed_ctx", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "prescribed_ctx" + } + }, + { + "column_name": "visit_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "visit_number" + } + }, + { + "column_name": "next_visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "next_facility_visit_date" + } + } + ] + }, + { + "name": "ec_hei_hiv_results", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "hei_followup_form_submission_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hei_followup_form_submission_id" + } + }, + { + "column_name": "hiv_test_result", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv_status" + } + }, + { + "column_name": "hiv_test_result_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv_test_result_date" + } + }, + { + "column_name": "ctc_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "ctc_number" + } + } + ] + }, + { + "name": "ec_family", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Client", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "unique_id", + "type": "Client", + "json_mapping": { + "field": "identifiers.opensrp_id" + } + }, + { + "column_name": "first_name", + "type": "Client", + "json_mapping": { + "field": "firstName" + } + }, + { + "column_name": "last_name", + "type": "Client", + "json_mapping": { + "field": "lastName" + } + }, + { + "column_name": "village_town", + "type": "Client", + "json_mapping": { + "field": "addresses.cityVillage" + } + }, + { + "column_name": "landmark", + "type": "Client", + "json_mapping": { + "field": "addresses.landmark" + } + }, + { + "column_name": "gps", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "gps" + } + }, + { + "column_name": "nearest_facility", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "nearest_facility" + } + }, + { + "column_name": "family_head", + "type": "Client", + "json_mapping": { + "field": "relationships.family_head" + } + }, + { + "column_name": "primary_caregiver", + "type": "Client", + "json_mapping": { + "field": "relationships.primary_caregiver" + } + }, + { + "column_name": "sync_location_id", + "type": "Event", + "json_mapping": { + "field": "locationId" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + }, + { + "column_name": "date_removed", + "type": "Client", + "json_mapping": { + "field": "attributes.dateRemoved" + } + }, + { + "column_name": "entity_type", + "type": "Event", + "json_mapping": { + "field": "entityType" + } + }, + { + "column_name": "event_date", + "type": "Event", + "json_mapping": { + "field": "eventDate", + "event_type": "Family Registration" + } + } + ] + }, + { + "name": "ec_family_member", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Client", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "unique_id", + "type": "Client", + "json_mapping": { + "field": "identifiers.opensrp_id" + } + }, + { + "column_name": "relational_id", + "type": "Client", + "json_mapping": { + "field": "relationships.family" + } + }, + { + "column_name": "first_name", + "type": "Client", + "json_mapping": { + "field": "firstName" + } + }, + { + "column_name": "middle_name", + "type": "Client", + "json_mapping": { + "field": "middleName" + } + }, + { + "column_name": "last_name", + "type": "Client", + "json_mapping": { + "field": "lastName" + } + }, + { + "column_name": "dob", + "type": "Client", + "json_mapping": { + "field": "birthdate" + } + }, + { + "column_name": "dod", + "type": "Client", + "json_mapping": { + "field": "deathdate" + } + }, + { + "column_name": "dob_unknown", + "type": "Client", + "json_mapping": { + "field": "birthdateApprox" + } + }, + { + "column_name": "gender", + "type": "Client", + "json_mapping": { + "field": "gender" + } + }, + { + "column_name": "phone_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "phone_number" + } + }, + { + "column_name": "other_phone_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "other_phone_number" + } + }, + { + "column_name": "national_id", + "type": "Client", + "json_mapping": { + "field": "attributes.National_ID" + } + }, + { + "column_name": "voter_id", + "type": "Client", + "json_mapping": { + "field": "attributes.Voter_Registration_Number" + } + }, + { + "column_name": "driver_license", + "type": "Client", + "json_mapping": { + "field": "attributes.Driver_License_Number" + } + }, + { + "column_name": "passport", + "type": "Client", + "json_mapping": { + "field": "attributes.Passport_Number" + } + }, + { + "column_name": "insurance_provider", + "type": "Client", + "json_mapping": { + "field": "attributes.Health_Insurance_Type" + } + }, + { + "column_name": "insurance_provider_other", + "type": "Client", + "json_mapping": { + "field": "attributes.Other_Health_Insurance_Type" + } + }, + { + "column_name": "insurance_provider_number", + "type": "Client", + "json_mapping": { + "field": "attributes.Health_Insurance_Number" + } + }, + { + "column_name": "marital_status", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "marital_status" + } + }, + { + "column_name": "type_of_disability", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "type_of_disability" + } + }, + { + "column_name": "disabilities", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "disabilities" + } + }, + { + "column_name": "service_provider", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "service_provider" + } + }, + { + "column_name": "leader", + "type": "Client", + "json_mapping": { + "field": "attributes.Community_Leader" + } + }, + { + "column_name": "leader_other", + "type": "Client", + "json_mapping": { + "field": "attributes.Other_Community_Leader_Type_Name" + } + }, + { + "column_name": "reasons_for_registration", + "type": "Client", + "json_mapping": { + "field": "attributes.Registration_Reason" + } + }, + { + "column_name": "has_primary_caregiver", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "Has_Primary_Caregiver" + } + }, + { + "column_name": "primary_caregiver_name", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "Primary_Caregiver_Name" + } + }, + { + "column_name": "entity_type", + "type": "Event", + "json_mapping": { + "field": "entityType" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + }, + { + "column_name": "date_removed", + "type": "Client", + "json_mapping": { + "field": "attributes.dateRemoved" + } + }, + { + "column_name": "sync_location_id", + "type": "Event", + "json_mapping": { + "field": "locationId" + } + } + ] + }, + { + "name": "ec_child", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Client", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "unique_id", + "type": "Client", + "json_mapping": { + "field": "identifiers.opensrp_id" + } + }, + { + "column_name": "relational_id", + "type": "Client", + "json_mapping": { + "field": "relationships.family" + } + }, + { + "column_name": "mother_entity_id", + "type": "Client", + "json_mapping": { + "field": "relationships.mother" + } + }, + { + "column_name": "entry_point", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "entry_point" + } + }, + { + "column_name": "first_name", + "type": "Client", + "json_mapping": { + "field": "firstName" + } + }, + { + "column_name": "middle_name", + "type": "Client", + "json_mapping": { + "field": "middleName" + } + }, + { + "column_name": "last_name", + "type": "Client", + "json_mapping": { + "field": "lastName" + } + }, + { + "column_name": "dob", + "type": "Client", + "json_mapping": { + "field": "birthdate" + } + }, + { + "column_name": "dod", + "type": "Client", + "json_mapping": { + "field": "deathdate" + } + }, + { + "column_name": "dob_unknown", + "type": "Client", + "json_mapping": { + "field": "birthdateApprox" + } + }, + { + "column_name": "gender", + "type": "Client", + "json_mapping": { + "field": "gender" + } + }, + { + "column_name": "early_bf_1hr", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "early_bf_1hr" + } + }, + { + "column_name": "physically_challenged", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "disabilities" + } + }, + { + "column_name": "type_of_disability", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "type_of_disability" + } + }, + { + "column_name": "birth_cert", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "birth_cert_available" + } + }, + { + "column_name": "rhc_card", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "rhc_card" + } + }, + { + "column_name": "nutrition_status", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "nutrition_status" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + }, + { + "column_name": "last_home_visit", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "last_home_visit" + } + }, + { + "column_name": "visit_not_done", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "visit_not_done" + } + }, + { + "column_name": "date_removed", + "type": "Client", + "json_mapping": { + "field": "attributes.dateRemoved" + } + }, + { + "column_name": "date_created", + "type": "Client", + "json_mapping": { + "field": "dateCreated" + } + }, + { + "column_name": "birth_cert_issue_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "164129AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "birth_cert_num", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "birth_regist_number" + } + }, + { + "column_name": "birth_notification", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "birth_notification" + } + }, + { + "column_name": "date_of_illness", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "illness_description", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "1390AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "action_taken", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "vaccine_card", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "vaccine_card" + } + }, + { + "column_name": "insurance_provider", + "type": "Client", + "json_mapping": { + "field": "attributes.insurance_provider" + } + }, + { + "column_name": "insurance_provider_other", + "type": "Client", + "json_mapping": { + "field": "attributes.Other_Health_Insurance_Type" + } + }, + { + "column_name": "insurance_provider_number", + "type": "Client", + "json_mapping": { + "field": "attributes.Health_Insurance_Number" + } + }, + { + "column_name": "child_bcg_vaccination", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "child_bcg_vaccination" + } + }, + { + "column_name": "child_opv0_vaccination", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "child_opv0_vaccination" + } + }, + { + "column_name": "weight", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "weight" + } + }, + { + "column_name": "head_circumference", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "head_circumference" + } + }, + { + "column_name": "kangaroo_enrollment", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "kangaroo_enrollment" + } + } + ] + }, + { + "name": "ec_child_activity", + "columns": [ + { + "column_name": "event_id", + "type": "Event", + "json_mapping": { + "field": "eventId" + } + }, + { + "column_name": "relational_id", + "type": "Client", + "json_mapping": { + "field": "relationships.family" + } + }, + { + "column_name": "form_submission_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "base_entity_id", + "type": "Client", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "event_type", + "type": "Event", + "json_mapping": { + "field": "eventType" + } + }, + { + "column_name": "last_home_visit", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "last_home_visit" + } + }, + { + "column_name": "visit_not_done", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "visit_not_done" + } + }, + { + "column_name": "event_date", + "type": "Event", + "json_mapping": { + "field": "eventDate" + } + }, + { + "column_name": "date_removed", + "type": "Client", + "json_mapping": { + "field": "attributes.dateRemoved" + } + } + ] + }, + { + "name": "ec_anc_register", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "relational_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "relational_id" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + }, + { + "column_name": "confirmation_status", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "pregnancy_confirmation_status" + } + }, + { + "column_name": "confirmation_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "pregnancy_confirmation_date" + } + }, + { + "column_name": "known_on_art", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "known_on_art" + } + }, + { + "column_name": "ctc_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "ctc_number" + } + }, + { + "column_name": "task_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "task_id" + } + }, + { + "column_name": "last_menstrual_period", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "last_menstrual_period" + } + }, + { + "column_name": "gest_age", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "gest_age" + } + }, + { + "column_name": "edd", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "edd" + } + }, + { + "column_name": "no_prev_preg", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "no_prev_preg" + } + }, + { + "column_name": "parity", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "parity" + } + }, + { + "column_name": "gravida", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "gravida" + } + }, + { + "column_name": "fundal_height", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "fundal_height" + } + }, + { + "column_name": "no_surv_children", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "no_surv_children" + } + }, + { + "column_name": "phone_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "phone_number" + } + }, + { + "column_name": "marital_status", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "marital_status" + } + }, + { + "column_name": "medical_surgical_history", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "medical_surgical_history" + } + }, + { + "column_name": "other_medical_surgical_history", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "other_medical_surgical_history" + } + }, + { + "column_name": "blood_group", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "blood_group" + } + }, + { + "column_name": "rh_factor", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "rh_factor" + } + }, + { + "column_name": "tb_status", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "tb_status" + } + }, + { + "column_name": "tt_vaccination_type", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "tt_vaccination_type" + } + }, + { + "column_name": "partner_base_entity_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_base_entity_id" + } + }, + { + "column_name": "partner_hiv", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_hiv" + } + }, + { + "column_name": "reason_for_not_conducting_partner_hiv_test", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "reason_for_not_conducting_partner_hiv_test" + } + }, + { + "column_name": "partner_hiv_test_at_32", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_hiv_test_at_32" + } + }, + { + "column_name": "partner_hiv_test_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_hiv_test_number" + } + }, + { + "column_name": "partner_syphilis", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_syphilis" + } + }, + { + "column_name": "partner_syphilis_treatment", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_syphilis_treatment" + } + }, + { + "column_name": "partner_hepatitis", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_hepatitis" + } + }, + { + "column_name": "partner_other_stds", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_other_stds" + } + }, + { + "column_name": "partner_other_stds_treatment", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_other_stds_treatment" + } + }, + { + "column_name": "last_home_visit", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "anc_visit_date" + } + }, + { + "column_name": "visit_not_done", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "anc_visit_not_done_date" + } + }, + { + "column_name": "couple_testing", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "couple_testing" + } + }, + { + "column_name": "name_of_hf", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "name_of_hf" + } + }, + { + "column_name": "hiv", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv" + } + }, + { + "column_name": "syphilis", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "syphilis" + } + }, + { + "column_name": "mRDT_for_malaria", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "mRDT_for_malaria" + } + }, + { + "column_name": "llin_provision", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "llin_provision" + } + }, + { + "column_name": "syphilis_treatment", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "syphilis_treatment" + } + }, + { + "column_name": "hepatitis", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hepatitis" + } + }, + { + "column_name": "height", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "height" + } + }, + { + "column_name": "date_anc_hiv_test", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "date_anc_hiv_test" + } + }, + { + "column_name": "hiv_test_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv_test_number" + } + }, + { + "column_name": "hiv_test_at_32", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv_test_at_32" + } + }, + { + "column_name": "malaria_preventive_therapy", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "malaria_preventive_therapy" + } + }, + { + "column_name": "mRDT_for_malaria", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "mRDT_for_malaria" + } + }, + { + "column_name": "malaria_preventive_therapy_ipt1", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "malaria_preventive_therapy_ipt1" + } + }, + { + "column_name": "malaria_preventive_therapy_ipt2", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "malaria_preventive_therapy_ipt2" + } + }, + { + "column_name": "malaria_preventive_therapy_ipt3", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "malaria_preventive_therapy_ipt3" + } + }, + { + "column_name": "malaria_preventive_therapy_ipt4", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "malaria_preventive_therapy_ipt4" + } + }, + { + "column_name": "confirmed_visits", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "confirmed_visits" + } + }, + { + "column_name": "tb_status", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "tb_status" + } + }, + { + "column_name": "other_stds", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "other_stds" + } + }, + { + "column_name": "other_stds_treatment", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "other_stds_treatment" + } + }, + { + "column_name": "is_transfer_in", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "is_transfer_in" + } + }, + { + "column_name": "visit_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "visit_number" + } + }, + { + "column_name": "next_facility_visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "next_facility_visit_date" + } + }, + { + "column_name": "last_contact_visit", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "anc_visit_date" + } + } + ] + }, + { + "name": "ec_anc_followup", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "visit_date", + "type": "Event", + "json_mapping": { + "field": "version" + } + }, + { + "column_name": "gest_age", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "gest_age" + } + }, + { + "column_name": "hb_level", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hb_level" + } + }, + { + "column_name": "systolic", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "systolic" + } + }, + { + "column_name": "diastolic", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "diastolic" + } + }, + { + "column_name": "tb_status", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "tb_status" + } + }, + { + "column_name": "other_stds", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "other_stds" + } + }, + { + "column_name": "other_stds_treatment", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "other_stds_treatment" + } + }, + { + "column_name": "partner_other_stds", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_other_stds" + } + }, + { + "column_name": "partner_other_stds_treatment", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_other_stds_treatment" + } + }, + { + "column_name": "protein_in_urine", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "protein_in_urine" + } + }, + { + "column_name": "glucose_in_urine", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "glucose_in_urine" + } + }, + { + "column_name": "hiv", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv" + } + }, + { + "column_name": "hiv_test_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv_test_number" + } + }, + { + "column_name": "hiv_test_at_32", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv_test_at_32" + } + }, + { + "column_name": "partner_hiv", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_hiv" + } + }, + { + "column_name": "partner_hiv_test_at_32", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_hiv_test_at_32" + } + }, + { + "column_name": "partner_hiv_test_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_hiv_test_number" + } + }, + { + "column_name": "hiv_counselling_before_testing", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv_counselling_before_testing" + } + }, + { + "column_name": "hiv_counselling_after_testing", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv_counselling_after_testing" + } + }, + { + "column_name": "couple_testing", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "couple_testing" + } + }, + { + "column_name": "mRDT_for_malaria", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "mRDT_for_malaria" + } + }, + { + "column_name": "llin_provision", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "llin_provision" + } + }, + { + "column_name": "malaria_preventive_therapy", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "malaria_preventive_therapy" + } + }, + { + "column_name": "malaria_preventive_therapy_ipt1", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "malaria_preventive_therapy_ipt1" + } + }, + { + "column_name": "malaria_preventive_therapy_ipt2", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "malaria_preventive_therapy_ipt2" + } + }, + { + "column_name": "malaria_preventive_therapy_ipt3", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "malaria_preventive_therapy_ipt3" + } + }, + { + "column_name": "malaria_preventive_therapy_ipt4", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "malaria_preventive_therapy_ipt4" + } + }, + { + "column_name": "iron_folate_supplements", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "iron_folate_supplements" + } + }, + { + "column_name": "tt_vaccination_type", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "tt_vaccination_type" + } + }, + { + "column_name": "syphilis", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "syphilis" + } + }, + { + "column_name": "syphilis_treatment", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "syphilis_treatment" + } + }, + { + "column_name": "partner_syphilis", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_syphilis" + } + }, + { + "column_name": "partner_syphilis_treatment", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "partner_syphilis_treatment" + } + }, + { + "column_name": "deworming", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "deworming" + } + }, + { + "column_name": "given_counselling", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "given_counselling" + } + }, + { + "column_name": "visit_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "visit_number" + } + } + ] + }, + { + "name": "ec_anc_birth_emergency_plan", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "visit_date", + "type": "Event", + "json_mapping": { + "field": "version" + } + }, + { + "column_name": "visit_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "visit_number" + } + }, + { + "column_name": "delivery_place", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "delivery_place" + } + }, + { + "column_name": "name_of_hf", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "name_of_hf" + } + }, + { + "column_name": "transport", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "transport" + } + }, + { + "column_name": "birth_companion", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "birth_companion" + } + }, + { + "column_name": "emergency_funds", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "emergency_funds" + } + }, + { + "column_name": "household_support", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "household_support" + } + }, + { + "column_name": "blood_donor", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "blood_donor" + } + } + ] + }, + { + "name": "ec_anc_pregnancy_lookup", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "pregnancy_number", + "type": "Event", + "json_mapping": { + "field": "pregnancy_number" + } + } + ] + }, + { + "name": "ec_anc_log", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "date_created", + "type": "Event", + "json_mapping": { + "field": "eventDate" + } + } + ] + }, + { + "name": "ec_malaria_confirmation", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "date_chw_malaria_test", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "162869AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "fever_malaria_chw", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "fever_malaria_chw" + } + }, + { + "column_name": "fever_duration", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "1731AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "malaria_results", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "1643AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "date_hf_malaria_test", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "date_hf_malaria_test" + } + }, + { + "column_name": "malaria_test_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "163724AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "malaria", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "163725AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "malaria_treat", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "malaria_treat" + } + }, + { + "column_name": "fam_llin", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "fam_llin" + } + }, + { + "column_name": "llin_2days", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "llin_2days" + } + }, + { + "column_name": "llin_condition", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "llin_condition" + } + }, + { + "column_name": "malaria_edu_chw", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "1379AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + } + ] + }, + { + "name": "ec_family_planning", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "fp_reg_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "fp_reg_date" + } + }, + { + "column_name": "using_method", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "using_method" + } + }, + { + "column_name": "couselling_fp_methods", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "1382AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "couselling_HIV_STI", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "couselling_HIV_STI" + } + }, + { + "column_name": "pill", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "pill" + } + }, + { + "column_name": "breast_lump", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "breast_lump" + } + }, + { + "column_name": "abnormal_vaginal", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "abnormal_vaginal" + } + }, + { + "column_name": "pregnant", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "pregnant" + } + }, + { + "column_name": "difficultly_breathing", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "difficultly_breathing" + } + }, + { + "column_name": "headaches", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "headaches" + } + }, + { + "column_name": "frequent_urge", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "frequent_urge" + } + }, + { + "column_name": "falling_loss_unconsciousness", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "falling_loss_unconsciousness" + } + }, + { + "column_name": "breastfeed", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "breastfeed" + } + }, + { + "column_name": "COC_POP", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "COC_POP" + } + }, + { + "column_name": "POP", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "POP" + } + }, + { + "column_name": "no_pill", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "no_pill" + } + }, + { + "column_name": "fp_method_chw", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "160576AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "fp_method_already", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "374AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "fp_method_accepted", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "fp_method_accepted" + } + }, + { + "column_name": "ecp", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "ecp" + } + }, + { + "column_name": "no_condoms", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "no_condoms" + } + }, + { + "column_name": "no_pillcycles", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "163171AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "counselling_use", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "counselling_use" + } + }, + { + "column_name": "next_injection_due_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "5096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "fp_start_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "163526AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "referral_given", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "referral_given" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + } + ] + }, + { + "name": "ec_pregnancy_outcome", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "relational_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "relational_id" + } + }, + { + "column_name": "preg_outcome", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "preg_outcome" + } + }, + { + "column_name": "miscarriage_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "miscarriage_date" + } + }, + { + "column_name": "delivery_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "delivery_date" + } + }, + { + "column_name": "delivery_place", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "delivery_place" + } + }, + { + "column_name": "last_visit_date", + "type": "Event", + "data_type": "date", + "source_format": "dd-MM-yyyy", + "save_format": "yyyy-MM-dd", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "last_visit_date" + } + }, + { + "column_name": "next_visit_date", + "type": "Event", + "data_type": "date", + "source_format": "dd-MM-yyyy", + "save_format": "yyyy-MM-dd", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "next_visit_date" + } + }, + { + "column_name": "next_facility_visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "next_facility_visit_date" + } + }, + { + "column_name": "last_health_facility_visit_date", + "type": "Event", + "data_type": "date", + "source_format": "dd-MM-yyyy", + "save_format": "yyyy-MM-dd", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "last_health_facility_visit_date" + } + }, + { + "column_name": "confirmed_health_facility_visits", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "confirmed_health_facility_visits" + } + }, + { + "column_name": "hiv", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv" + } + }, + { + "column_name": "hiv_status_question", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv_status_question" + } + }, + { + "column_name": "hepatitis_b_vaccination", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hepatitis_b_vaccination" + } + }, + { + "column_name": "tetanus_vaccination", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "tetanus_vaccination" + } + }, + { + "column_name": "sex_of_the_deceased_child", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "sex_of_the_deceased_child" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + } + ] + }, + { + "name": "ec_no_mother_pnc", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "relational_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "relational_id" + } + }, + { + "column_name": "caregiver_name", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "caregiver_name" + } + }, + { + "column_name": "caregiver_phone_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "caregiver_phone_number" + } + }, + { + "column_name": "caregiver_location", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "caregiver_location" + } + }, + { + "column_name": "dob", + "type": "Client", + "json_mapping": { + "field": "birthdate" + } + }, + { + "column_name": "delivery_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "delivery_date" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + } + ] + }, + { + "name": "ec_pnc_followup", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "followup_visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "followup_visit_date" + } + }, + { + "column_name": "visit_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "visit_number" + } + }, + { + "column_name": "hb_level", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hb_level" + } + }, + { + "column_name": "puerperal_psychosis", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "puerperal_psychosis" + } + }, + { + "column_name": "mental_illness_symptom", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "mental_illness_symptom" + } + }, + { + "column_name": "iron_and_folic_acid", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "iron_and_folic_acid" + } + }, + { + "column_name": "vitamin_a", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "vitamin_a" + } + }, + { + "column_name": "perineum_infection", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "perineum_infection" + } + }, + { + "column_name": "fistula", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "fistula" + } + }, + { + "column_name": "education_counselling_given", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "education_counselling_given" + } + }, + { + "column_name": "method_provided", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "method_provided" + } + }, + { + "column_name": "hiv", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv" + } + } + ] + }, + { + "name": "ec_pnc_child_followup", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "followup_visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "followup_visit_date" + } + }, + { + "column_name": "child_activeness", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "child_activeness" + } + }, + { + "column_name": "hb_level", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hb_level" + } + }, + { + "column_name": "feeding_options", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "feeding_options" + } + }, + { + "column_name": "umbilical_cord", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "umbilical_cord" + } + }, + { + "column_name": "kangaroo_enrollment", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "kangaroo_enrollment" + } + }, + { + "column_name": "child_bcg_vaccination", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "child_bcg_vaccination" + } + }, + { + "column_name": "child_opv0_vaccination", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "child_opv0_vaccination" + } + }, + { + "column_name": "septicaemia", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "septicaemia" + } + }, + { + "column_name": "weight", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "weight" + } + }, + { + "column_name": "jaundice", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "jaundice" + } + }, + { + "column_name": "skin_infection", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "skin_infection" + } + }, + { + "column_name": "hiv_antibody_test", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hiv_antibody_test" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + } + ] + }, + { + "name": "ec_malaria_follow_up_visit", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "date_chw_mfollowup", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "date_chw_mfollowup" + } + }, + { + "column_name": "hf_chw_mfollowup", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hf_chw_mfollowup" + } + }, + { + "column_name": "treat_given_chw_mfollowup", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "treat_given_chw_mfollowup" + } + }, + { + "column_name": "reason_no_treat", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "reason_no_treat" + } + }, + { + "column_name": "fever_still", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "fever_still" + } + }, + { + "column_name": "fever_duration", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "fever_duration" + } + } + ] + }, + { + "name": "ec_child_referral", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "chw_referral_hf_child", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "1759AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "referral_problem_child", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "163182AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "referral_problem_child_other", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "service_before_child", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "service_before_child_other", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "referral_date_child", + "type": "Event", + "data_type": "date", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "163181AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "referral_time_child", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "referral_task_previous_status" + } + } + ] + }, + { + "name": "ec_anc_referral", + "columns": [ + { + "column_name": "chw_referral_hf_anc", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "1759AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "problem_hf_anc", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "problem" + } + }, + { + "column_name": "problem_hf_anc_other", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "problem_other" + } + }, + { + "column_name": "service_before_anc", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "service_before_referral" + } + }, + { + "column_name": "service_before_anc_other", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "service_before_referral_other" + } + }, + { + "column_name": "referral_date_anc", + "type": "Event", + "data_type": "date", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "referral_appointment_date" + } + }, + { + "column_name": "referral_time_anc", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "referral_task_previous_status" + } + } + ] + }, + { + "name": "ec_pnc_referral", + "columns": [ + { + "column_name": "chw_referral_hf_pnc", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "1759AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "problem_hf_pnc", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "163182AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "problem_hf_pnc_other", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "service_before_pnc", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "service_before_pnc_other", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "referral_date_pnc", + "type": "Event", + "data_type": "date", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "163181AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "referral_time_pnc", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "referral_task_previous_status" + } + } + ] + }, + { + "name": "ec_fp_referral", + "columns": [ + { + "column_name": "fp_method_accepted_referral", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "374AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "fp_side_effects", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "165273AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "fp_side_effects_other", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "referral_date_fp", + "type": "Event", + "data_type": "date", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "163181AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "referral_time_fp", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "referral_task_previous_status" + } + } + ] + }, + { + "name": "ec_referral", + "columns": [ + { + "column_name": "chw_referral_service", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "chw_referral_service" + } + }, + { + "column_name": "chw_referral_hf", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "chw_referral_hf" + } + }, + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "problem", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "problem" + } + }, + { + "column_name": "problem_other", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "problem_other" + } + }, + { + "column_name": "service_before_referral", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "service_before_referral" + } + }, + { + "column_name": "service_before_referral_other", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "service_before_referral_other" + } + }, + { + "column_name": "referral_date", + "type": "Event", + "data_type": "date", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "referral_date" + } + }, + { + "column_name": "referral_time", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "formSubmissionField": "referral_time" + } + }, + { + "column_name": "referral_appointment_date", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "referral_appointment_date" + } + }, + { + "column_name": "referral_type", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "referral_type" + } + }, + { + "column_name": "referral_status", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "referral_status" + } + }, + { + "column_name": "on_art", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "on_art" + } + } + ] + }, + { + "name": "ec_referral_followup", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "chw_followup_feedback_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "chw_followup_feedback_id" + } + }, + { + "column_name": "other_followup_feedback_information", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "other_followup_feedback_information" + } + }, + { + "column_name": "chw_followup_date", + "type": "Event", + "data_type": "date", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "chw_followup_date" + } + } + ] + }, + { + "name": "ec_referral_service", + "columns": [ + { + "column_name": "name_en", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode" + } + }, + { + "column_name": "name_sw", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode" + } + }, + { + "column_name": "identifier", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode" + } + }, + { + "column_name": "is_active", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode" + } + } + ] + }, + { + "name": "ec_ltfu_feedback", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "referral_task_id", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "referral_task" + } + }, + { + "column_name": "followup_status", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "followup_status" + } + }, + { + "column_name": "reasons_for_missed_appointment", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "reasons_for_missed_appointment" + } + }, + { + "column_name": "referral_appointment_date", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "referral_appointment_date" + } + }, + { + "column_name": "date_of_death", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "date_of_death" + } + }, + { + "column_name": "reason_client_not_found", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "reason_client_not_found" + } + }, + { + "column_name": "feedback_date", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "referral_date" + } + } + ] + }, + { + "name": "ec_referral_service_indicator", + "columns": [ + { + "column_name": "name_en", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode" + } + }, + { + "column_name": "name_sw", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode" + } + }, + { + "column_name": "is_active", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode" + } + } + ] + }, + { + "name": "ec_sick_child_followup", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "date_sickchild" + } + }, + { + "column_name": "weight", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "height", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "has_diarrhea", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "142412AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "diarrhea_duration", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "5984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "dehydration_status", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "1497AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "other_symptoms", + "type": "Event", + "save_format": "json_array", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "other_sympt_sick_child" + } + }, + { + "column_name": "test_ordered", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "1271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "other_test_ordered", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "test_results", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "161577AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "diagnosis", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "161602AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "diarrhea_treatment", + "type": "Event", + "save_format": "json_array", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "diarrhea_treat" + } + }, + { + "column_name": "amount_of_ors", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "diarrhea_treat_ors" + } + }, + { + "column_name": "amount_rehydration_infusion", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "diarrhea_treat_rehydration" + } + }, + { + "column_name": "amount_zinc", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "diarrhea_treat_zinc" + } + }, + { + "column_name": "drugs_taken_home", + "type": "Event", + "save_format": "json_array", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "diarrhea_treat_walkaway" + } + }, + { + "column_name": "non_diarrhea_treatment", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "dtc_period", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "1785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "results", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "160433AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "date_marked_as_done", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "date_marked_as_done" + } + } + ] + }, + { + "name": "ec_anc_danger_signs_outcome", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "anc_danger_signs_visitdate" + } + }, + { + "column_name": "danger_signs_present", + "type": "Event", + "save_format": "json_array", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "danger_signs_present" + } + }, + { + "column_name": "other_danger_signs", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "other_anc_danger_signs" + } + }, + { + "column_name": "action_taken", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "action_taken_anc_danger_signs" + } + }, + { + "column_name": "status_visit", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "status_visit" + } + }, + { + "column_name": "managed_signs", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "managed_signs" + } + }, + { + "column_name": "comment", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "comment_anc_danger_signs" + } + }, + { + "column_name": "date_marked_as_done", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "date_marked_as_done" + } + } + ] + }, + { + "name": "ec_pnc_danger_signs_outcome", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "pnc_danger_signs_visitdate" + } + }, + { + "column_name": "danger_signs_present", + "type": "Event", + "save_format": "json_array", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "danger_signs_present" + } + }, + { + "column_name": "other_danger_signs", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + }, + { + "column_name": "action_taken", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "action_taken_pnc_danger_signs" + } + }, + { + "column_name": "status_visit", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "status_visit" + } + }, + { + "column_name": "managed_signs", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "managed_signs" + } + }, + { + "column_name": "comment", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "comment_pnc_danger_signs" + } + }, + { + "column_name": "date_marked_as_done", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "date_marked_as_done" + } + } + ] + }, + { + "name": "ec_malaria_followup_hf", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "date_malaria_visit_hf" + } + }, + { + "column_name": "weight", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "weight_malaria_hf" + } + }, + { + "column_name": "height", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "height_malaria_hf" + } + }, + { + "column_name": "tests_ordered", + "type": "Event", + "save_format": "json_array", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "test_malaria_hf" + } + }, + { + "column_name": "no_mrdt_reason", + "type": "Event", + "save_format": "json_array", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "no_mrdt_malaria_hf" + } + }, + { + "column_name": "other_tests", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "other_test_malaria_hf" + } + }, + { + "column_name": "test_results", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "test_results_malaria_hf" + } + }, + { + "column_name": "other_test_results", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "other_test_results_malaria_hf" + } + }, + { + "column_name": "diagnosis", + "type": "Event", + "save_format": "json_array", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "diagnosis_malaria_hf" + } + }, + { + "column_name": "other_diagnosis", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "other_diagnosis_malaria_hf" + } + }, + { + "column_name": "treatment_prescribed", + "type": "Event", + "save_format": "json_array", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "treat_malaria_hf" + } + }, + { + "column_name": "other_treatment_prescribed", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "treat_other_malaria_hf" + } + }, + { + "column_name": "outcomes", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "outcome_malaria_hf" + } + }, + { + "column_name": "remarks", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "remark_malaria_hf" + } + }, + { + "column_name": "hcp_attending", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "hcp_attending" + } + }, + { + "column_name": "date_marked_as_done", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "date_marked_as_done" + } + } + ] + }, + { + "name": "ec_family_planning_update", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "fp_method_accepted", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "fp_method_accepted" + } + }, + { + "column_name": "fp_reg_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "fp_reg_date" + } + }, + { + "column_name": "fp_reg_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "fp_change_or_stop_date" + } + }, + { + "column_name": "date_marked_as_done", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "date_marked_as_done" + } + } + ] + }, + { + "name": "ec_hiv_register", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "relational_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "relational_id" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + }, + { + "column_name": "ctc_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "ctc_number" + } + }, + { + "column_name": "cbhs_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "cbhs_number" + } + }, + { + "column_name": "client_hiv_status_during_registration", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "client_hiv_status_during_registration" + } + }, + { + "column_name": "client_hiv_status_after_testing", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "test_results" + } + }, + { + "column_name": "hiv_registration_date", + "type": "Event", + "data_type": "date", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "hiv_registration_date" + } + } + ] + }, + { + "name": "ec_hts_register", + "columns": [ + { + "column_name": "chw_referral_service", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "chw_referral_service" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "relational_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "relational_id" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + }, + { + "column_name": "ctc_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "ctc_number" + } + }, + { + "column_name": "cbhs_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "cbhs_number" + } + }, + { + "column_name": "client_hiv_status_during_registration", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "client_hiv_status_during_registration" + } + }, + { + "column_name": "client_hiv_status_after_testing", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "test_results" + } + }, + { + "column_name": "hiv_registration_date", + "type": "Event", + "data_type": "date", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "hiv_registration_date" + } + } + ] + }, + { + "name": "ec_hiv_outcome", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "action_taken_hiv_problems", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "action_taken_hiv_problems" + } + }, + { + "column_name": "test_results", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "test_results" + } + }, + { + "column_name": "hiv_facility_visit_date", + "type": "Event", + "data_type": "date", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "hiv_facility_visit_date" + } + }, + { + "column_name": "enrolled_to_clinic", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "formSubmissionField": "enrolled_to_clinic" + } + }, + { + "column_name": "ctc_number", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "ctc_number" + } + }, + { + "column_name": "comment_hiv_problems", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "comment_hiv_problems" + } + } + ] + }, + { + "name": "ec_hiv_community_followup", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "reasons_for_issuing_community_referral", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "reasons_for_issuing_community_referral" + } + }, + { + "column_name": "reason_for_issuing_community_referral_other", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "reason_for_issuing_community_referral_other" + } + }, + { + "column_name": "last_client_visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "last_client_visit_date" + } + }, + { + "column_name": "comment", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "comment_hiv_community_followup" + } + }, + { + "column_name": "hiv_community_referral_date", + "type": "Event", + "data_type": "date", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "hiv_community_referral_date" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + } + ] + }, + { + "name": "ec_tb_register", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "relational_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "relational_id" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + }, + { + "column_name": "community_client_tb_registration_number", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "community_client_tb_registration_number" + } + }, + { + "column_name": "client_tb_status_during_registration", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "client_tb_status_during_registration" + } + }, + { + "column_name": "client_tb_status_after_testing", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "test_results" + } + }, + { + "column_name": "place_of_domicile", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "place_of_domicile" + } + }, + { + "column_name": "client_tb_screening_results", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "client_tb_screening_results" + } + }, + { + "column_name": "tb_registration_date", + "type": "Event", + "data_type": "date", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "tb_registration_date" + } + }, + { + "column_name": "tb_case_closure_date", + "type": "Event", + "data_type": "date", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "tb_case_closure_date" + } + } + ] + }, + { + "name": "ec_tb_outcome", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "problem", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "problem" + } + }, + { + "column_name": "problem_other", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "problem_other" + } + }, + { + "column_name": "action_taken_tb_problems", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "action_taken_tb_problems" + } + }, + { + "column_name": "test_results", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "test_results" + } + }, + { + "column_name": "tb_facility_visit_date", + "type": "Event", + "data_type": "date", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "tb_facility_visit_date" + } + }, + { + "column_name": "enrolled_to_clinic", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "formSubmissionField": "enrolled_to_clinic" + } + }, + { + "column_name": "tb_clinic_number", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "tb_clinic_number" + } + }, + { + "column_name": "comment_tb_problems", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "comment_tb_problems" + } + } + ] + }, + { + "name": "ec_tb_community_followup", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "reasons_for_issuing_community_referral", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "reasons_for_issuing_community_referral" + } + }, + { + "column_name": "reason_for_issuing_community_referral_other", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "reason_for_issuing_community_referral_other" + } + }, + { + "column_name": "last_client_visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "last_client_visit_date" + } + }, + { + "column_name": "comment", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "comment_tb_community_followup" + } + }, + { + "column_name": "tb_community_referral_date", + "type": "Event", + "data_type": "date", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "tb_community_referral_date" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + } + ] + }, + { + "name": "ec_hiv_community_feedback", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "relational_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "relational_id" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + }, + { + "column_name": "hiv_community_followup_visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "hiv_community_followup_visit_date" + } + }, + { + "column_name": "followup_status", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "followup_status" + } + }, + { + "column_name": "community_referral_form_id", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "community_referral_form_id" + } + }, + { + "column_name": "chw_name", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "chw_name" + } + }, + { + "column_name": "mark_as_done", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "mark_as_done" + } + } + ] + }, + { + "name": "ec_pmtct_community_feedback", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "relational_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "relational_id" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + }, + { + "column_name": "pmtct_community_followup_visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "pmtct_community_followup_visit_date" + } + }, + { + "column_name": "followup_status", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "followup_status" + } + }, + { + "column_name": "community_referral_form_id", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "community_referral_form_id" + } + }, + { + "column_name": "provider_id", + "type": "Event", + "json_mapping": { + "field": "providerId" + } + }, + { + "column_name": "chw_name", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "chw_name" + } + }, + { + "column_name": "mark_as_done", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "mark_as_done" + } + } + ] + }, + { + "name": "ec_hiv_index_chw_followup", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "relational_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "relational_id" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + }, + { + "column_name": "followed_by_chw", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "client_followed_up_by_chw" + } + }, + { + "column_name": "agreed_to_be_tested", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "has_the_client_agreed_to_be_tested" + } + }, + { + "column_name": "client_found", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "has_the_contact_client_been_found" + } + }, + { + "column_name": "test_location", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "place_where_test_will_be_conducted" + } + } + ] + }, + { + "name": "ec_tb_community_feedback", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "relational_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "relational_id" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + }, + { + "column_name": "tb_community_followup_visit_date", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "tb_community_followup_visit_date" + } + }, + { + "column_name": "followup_status", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "followup_status" + } + }, + { + "column_name": "community_referral_form_id", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "community_referral_form_id" + } + }, + { + "column_name": "chw_name", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "chw_name" + } + }, + { + "column_name": "mark_as_done", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "mark_as_done" + } + } + ] + }, + { + "name": "ec_hiv_index_hf", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "hiv_client_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "index_client_base_entity_id" + } + }, + { + "column_name": "relationship", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "relationship" + } + }, + { + "column_name": "hiv_status", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "hiv_status" + } + }, + { + "column_name": "has_started_medication", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "has_started_medication" + } + }, + { + "column_name": "hiv_test_eligibility", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "hiv_test_eligibility" + } + }, + { + "column_name": "how_to_notify_the_contact_client", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "how_to_notify_the_contact_client" + } + }, + { + "column_name": "has_the_contact_client_been_tested", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "has_the_contact_client_been_tested" + } + }, + { + "column_name": "test_results", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "test_results" + } + }, + { + "column_name": "place_where_test_was_conducted", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "place_where_test_was_conducted" + } + }, + { + "column_name": "enrolled_to_clinic", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "enrolled_to_clinic" + } + }, + { + "column_name": "ctc_number", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "ctc_number" + } + }, + { + "column_name": "refer_to_chw", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "refer_to_chw" + } + }, + { + "column_name": "hiv_index_contact_community_followup_referral_date", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "hiv_index_contact_community_followup_referral_date" + } + }, + { + "column_name": "client_followed_up_by_chw", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "client_followed_up_by_chw" + } + }, + { + "column_name": "comment", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "comment" + } + }, + { + "column_name": "hiv_index_registration_date", + "type": "Event", + "json_mapping": { + "field": "eventDate" + } + } + ] + }, + { + "name": "ec_hiv_index", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "hiv_client_id", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "index_client_base_entity_id" + } + }, + { + "column_name": "relationship", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "relationship" + } + }, + { + "column_name": "hiv_status", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "hiv_status" + } + }, + { + "column_name": "has_started_medication", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "has_started_medication" + } + }, + { + "column_name": "hiv_test_eligibility", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "hiv_test_eligibility" + } + }, + { + "column_name": "how_to_notify_the_contact_client", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "how_to_notify_the_contact_client" + } + }, + { + "column_name": "has_the_contact_client_been_tested", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "has_the_contact_client_been_tested" + } + }, + { + "column_name": "test_results", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "test_results" + } + }, + { + "column_name": "place_where_test_was_conducted", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "place_where_test_was_conducted" + } + }, + { + "column_name": "enrolled_to_clinic", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "enrolled_to_clinic" + } + }, + { + "column_name": "ctc_number", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "ctc_number" + } + }, + { + "column_name": "refer_to_chw", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "refer_to_chw" + } + }, + { + "column_name": "hiv_index_contact_community_followup_referral_date", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "hiv_index_contact_community_followup_referral_date" + } + }, + { + "column_name": "client_followed_up_by_chw", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "client_followed_up_by_chw" + } + }, + { + "column_name": "comment", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "comment" + } + }, + { + "column_name": "hiv_index_registration_date", + "type": "Event", + "json_mapping": { + "field": "eventDate" + } + } + ] + }, + { + "name": "ec_ld_confirmation", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "labour_confirmation", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "labour_confirmation" + } + }, + { + "column_name": "reasons_for_admission", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "reasons_for_admission" + } + }, + { + "column_name": "gravida", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "gravida" + } + }, + { + "column_name": "para", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "para" + } + }, + { + "column_name": "anc_hiv_status", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "anc_hiv_status" + } + }, + { + "column_name": "membrane", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "membrane" + } + }, + { + "column_name": "amniotic_fluid", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "amniotic_fluid" + } + }, + { + "column_name": "hiv", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "hiv" + } + }, + { + "column_name": "admission_date", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "admission_date" + } + }, + { + "column_name": "admission_time", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "admission_time" + } + }, + { + "column_name": "labour_onset_date", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "labour_onset_date" + } + }, + { + "column_name": "labour_onset_time", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "labour_onset_time" + } + }, + { + "column_name": "moulding", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "moulding" + } + }, + { + "column_name": "moulding_options", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "moulding_options" + } + }, + { + "column_name": "cervix_dilation", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "cervix_dilation" + } + }, + { + "column_name": "descent_presenting_part", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "descent_presenting_part" + } + }, + { + "column_name": "labour_stage", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "labour_stage" + } + }, + { + "column_name": "mode_of_delivery", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "mode_of_delivery" + } + }, + { + "column_name": "delivery_mode_reason", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "delivery_mode_reason" + } + }, + { + "column_name": "pmtct_test_date", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "pmtct_test_date" + } + }, + { + "column_name": "hb_test_date", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "hb_test_date" + } + }, + { + "column_name": "syphilis", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "syphilis" + } + }, + { + "column_name": "malaria", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "malaria" + } + }, + { + "column_name": "blood_group", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "blood_group" + } + }, + { + "column_name": "rh_factor", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "rh_factor" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + } + ] + }, + { + "name": "ec_ld_follow_up_visit", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + } + ] + }, + { + "name": "ec_ld_general_examination_consultation", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "form_submission_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "event_id", + "type": "Event", + "json_mapping": { + "field": "eventId" + } + }, + { + "column_name": "event_date", + "type": "Event", + "json_mapping": { + "field": "eventDate" + } + }, + { + "column_name": "pulse_rate", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "pulse_rate" + } + }, + { + "column_name": "temperature", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "temperature" + } + }, + { + "column_name": "systolic", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "systolic" + } + }, + { + "column_name": "diastolic", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "diastolic" + } + }, + { + "column_name": "urine", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "urine" + } + }, + { + "column_name": "fundal_height", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "fundal_height" + } + }, + { + "column_name": "lie", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "lie" + } + }, + { + "column_name": "presentation", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "presentation" + } + }, + { + "column_name": "contraction_in_ten_minutes", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "contraction_in_ten_minutes" + } + }, + { + "column_name": "fetal_heart_rate", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "fetal_heart_rate" + } + }, + { + "column_name": "vaginal_exam_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "vaginal_exam_date" + } + }, + { + "column_name": "vaginal_exam_time", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "vaginal_exam_time" + } + }, + { + "column_name": "cervix_state", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "cervix_state" + } + }, + { + "column_name": "cervix_dilation", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "cervix_dilation" + } + }, + { + "column_name": "presenting_part", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "presenting_part" + } + }, + { + "column_name": "occiput_position", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "occiput_position" + } + }, + { + "column_name": "amniotic_fluid", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "amniotic_fluid" + } + }, + { + "column_name": "hiv", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "hiv" + } + }, + { + "column_name": "forecasted_svd_time", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "forecasted_svd_time" + } + }, + { + "column_name": "visit_date", + "type": "Event", + "json_mapping": { + "field": "version" + } + } + ] + }, + { + "name": "ec_ld_partograph", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "name_of_the_health_care_provider", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "name_of_the_health_care_provider" + } + }, + { + "column_name": "partograph_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "partograph_date" + } + }, + { + "column_name": "partograph_time", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "partograph_time" + } + }, + { + "column_name": "fetal_heart_rate", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "fetal_heart_rate" + } + }, + { + "column_name": "moulding", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "moulding" + } + }, + { + "column_name": "moulding_options", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "moulding_options" + } + }, + { + "column_name": "membrane", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "membrane" + } + }, + { + "column_name": "amniotic_fluid", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "amniotic_fluid" + } + }, + { + "column_name": "cervix_dilation", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "cervix_dilation" + } + }, + { + "column_name": "descent_presenting_part", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "descent_presenting_part" + } + }, + { + "column_name": "contraction_every_half_hour_frequency", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "contraction_every_half_hour_frequency" + } + }, + { + "column_name": "contraction_every_half_hour_time", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "contraction_every_half_hour_time" + } + }, + { + "column_name": "pulse_rate", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "pulse_rate" + } + }, + { + "column_name": "temperature", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "temperature" + } + }, + { + "column_name": "urine_protein", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "urine_protein" + } + }, + { + "column_name": "urine_acetone", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "urine_acetone" + } + }, + { + "column_name": "urine_volume", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "urine_volume" + } + }, + { + "column_name": "oral_intake", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "oral_intake" + } + }, + { + "column_name": "moulding_options", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "moulding_options" + } + }, + { + "column_name": "caput", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "caput" + } + }, + { + "column_name": "amniotic_fluid", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "amniotic_fluid" + } + }, + { + "column_name": "systolic", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "systolic" + } + }, + { + "column_name": "diastolic", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "diastolic" + } + }, + { + "column_name": "oxytocin_units_per_liter", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "oxytocin_units_per_liter" + } + }, + { + "column_name": "oxytocin_drops_per_minute", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "oxytocin_drops_per_minute" + } + }, + { + "column_name": "drugs_provided", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "drugs_provided" + } + }, + { + "column_name": "iv_fluid_provided", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "iv_fluid_provided" + } + }, + { + "column_name": "last_interacted_with", + "type": "Event", + "json_mapping": { + "field": "version" + } + } + ] + }, + { + "name": "ec_ld_placenta_and_membrane", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "uterotonic", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "uterotonic" + } + }, + { + "column_name": "method_used_to_remove_the_placenta", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "method_used_to_remove_the_placenta" + } + }, + { + "column_name": "placenta_and_membrane_expulsion", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "placenta_and_membrane_expulsion" + } + }, + { + "column_name": "type_of_incomplete_placenta", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "type_of_incomplete_placenta" + } + }, + { + "column_name": "placenta_removed_by_hand", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "placenta_removed_by_hand" + } + }, + { + "column_name": "prompt_for_placenta_and_membrane_expulsion", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "prompt_for_placenta_and_membrane_expulsion" + } + }, + { + "column_name": "conducted_mva", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "conducted_mva" + } + }, + { + "column_name": "administered_antibiotics", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "administered_antibiotics" + } + }, + { + "column_name": "administered_magnesium_sulphate", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "administered_magnesium_sulphate" + } + }, + { + "column_name": "removal_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "removal_date" + } + }, + { + "column_name": "removal_duration", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "removal_duration" + } + }, + { + "column_name": "estimated_blood_loss", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "estimated_blood_loss" + } + }, + { + "column_name": "prompt_for_excessive_blood_loss", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "prompt_for_excessive_blood_loss" + } + }, + { + "column_name": "provided_blood_transfusion", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "provided_blood_transfusion" + } + }, + { + "column_name": "name_of_the_provider_who_removed_the_placenta", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "name_of_the_provider_who_removed_the_placenta" + } + }, + { + "column_name": "uterus_massage_after_delivery", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "uterus_massage_after_delivery" + } + }, + { + "column_name": "reason_for_not_massaging_uterus_after_delivery", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "reason_for_not_massaging_uterus_after_delivery" + } + }, + { + "column_name": "visit_date", + "type": "Event", + "json_mapping": { + "field": "version" + } + } + ] + }, + { + "name": "ec_ld_immediate_new_born_care", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "delivery_date", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "delivery_date" + } + }, + { + "column_name": "delivery_time", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "delivery_time" + } + }, + { + "column_name": "newborn_status", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "newborn_status" + } + }, + { + "column_name": "still_birth_choice", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "still_birth_choice" + } + }, + { + "column_name": "sex", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "formSubmissionField": "sex" + } + }, + { + "column_name": "apgar_score_at_1_minute", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "formSubmissionField": "apgar_score_at_1_minute" + } + }, + { + "column_name": "apgar_score_at_5_minutes", + "type": "Event", "json_mapping": { - "field": "attributes.National_ID" + "field": "obs.formSubmissionField", + "formSubmissionField": "apgar_score_at_5_minutes" } }, { - "column_name": "voter_id", - "type": "Client", + "column_name": "resuscitation", + "type": "Event", "json_mapping": { - "field": "attributes.Voter_Registration_Number" + "field": "obs.fieldCode", + "formSubmissionField": "resuscitation" } }, { - "column_name": "driver_license", - "type": "Client", + "column_name": "weight", + "type": "Event", "json_mapping": { - "field": "attributes.Driver_License_Number" + "field": "obs.fieldCode", + "formSubmissionField": "weight" } }, { - "column_name": "passport", - "type": "Client", + "column_name": "keep_warm", + "type": "Event", "json_mapping": { - "field": "attributes.Passport_Number" + "field": "obs.fieldCode", + "formSubmissionField": "keep_warm" } }, { - "column_name": "insurance_provider", - "type": "Client", + "column_name": "early_bf_1hr", + "type": "Event", "json_mapping": { - "field": "attributes.Health_Insurance_Type" + "field": "obs.fieldCode", + "formSubmissionField": "early_bf_1hr" } }, { - "column_name": "insurance_provider_other", - "type": "Client", + "column_name": "reason_for_not_breast_feeding_within_one_hour", + "type": "Event", "json_mapping": { - "field": "attributes.Other_Health_Insurance_Type" + "field": "obs.fieldCode", + "formSubmissionField": "reason_for_not_breast_feeding_within_one_hour" } }, { - "column_name": "insurance_provider_number", - "type": "Client", + "column_name": "risk_category", + "type": "Event", "json_mapping": { - "field": "attributes.Health_Insurance_Number" + "field": "obs.fieldCode", + "formSubmissionField": "risk_category" } }, { - "column_name": "type_of_disability", + "column_name": "provided_azt_nvp_syrup", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "formSubmissionField": "provided_azt_nvp_syrup" } }, { - "column_name": "disabilities", + "column_name": "provided_other_combinations", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "162558AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "formSubmissionField": "provided_other_combinations" } }, { - "column_name": "service_provider", + "column_name": "provided_nvp_syrup", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "1542AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "formSubmissionField": "provided_nvp_syrup" } }, { - "column_name": "leader", - "type": "Client", + "column_name": "collect_dbs", + "type": "Event", "json_mapping": { - "field": "attributes.Community_Leader" + "field": "obs.fieldCode", + "formSubmissionField": "collect_dbs" } }, { - "column_name": "leader_other", - "type": "Client", + "column_name": "prophylaxis_arv_for_high_risk_given", + "type": "Event", "json_mapping": { - "field": "attributes.Other_Community_Leader_Type_Name" + "field": "obs.fieldCode", + "formSubmissionField": "prophylaxis_arv_for_high_risk_given" } }, { - "column_name": "entity_type", + "column_name": "name_of_the_provider_who_removed_the_placenta", "type": "Event", "json_mapping": { - "field": "entityType" + "field": "obs.fieldCode", + "formSubmissionField": "name_of_the_provider_who_removed_the_placenta" } }, { - "column_name": "last_interacted_with", + "column_name": "uterus_massage_after_delivery", "type": "Event", "json_mapping": { - "field": "version" + "field": "obs.fieldCode", + "formSubmissionField": "uterus_massage_after_delivery" } }, { - "column_name": "date_removed", - "type": "Client", + "column_name": "reason_for_not_massaging_uterus_after_delivery", + "type": "Event", "json_mapping": { - "field": "attributes.dateRemoved" + "field": "obs.fieldCode", + "formSubmissionField": "reason_for_not_massaging_uterus_after_delivery" } }, { - "column_name": "sync_location_id", + "column_name": "visit_date", "type": "Event", "json_mapping": { - "field": "locationId" + "field": "version" } } ] }, { - "name": "ec_child", + "name": "ec_ld_postpartum_care", "columns": [ { "column_name": "base_entity_id", - "type": "Client", + "type": "Event", "json_mapping": { "field": "baseEntityId" } }, { - "column_name": "unique_id", - "type": "Client", + "column_name": "status", + "type": "Event", "json_mapping": { - "field": "identifiers.opensrp_id" + "field": "obs.formSubmissionField", + "concept": "status" } }, { - "column_name": "relational_id", - "type": "Client", + "column_name": "cause_of_death", + "type": "Event", "json_mapping": { - "field": "relationships.family" + "field": "obs.fieldCode", + "formSubmissionField": "cause_of_death" } }, { - "column_name": "mother_entity_id", - "type": "Client", + "column_name": "time_of_death", + "type": "Event", "json_mapping": { - "field": "relationships.mother" + "field": "obs.fieldCode", + "formSubmissionField": "time_of_death" } }, { - "column_name": "entry_point", + "column_name": "delivery_place", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "entry_point" + "formSubmissionField": "delivery_place" } }, { - "column_name": "first_name", - "type": "Client", + "column_name": "delivered_by_occupation", + "type": "Event", "json_mapping": { - "field": "firstName" + "field": "obs.fieldCode", + "formSubmissionField": "delivered_by_occupation" } }, { - "column_name": "middle_name", - "type": "Client", + "column_name": "number_of_children_born", + "type": "Event", "json_mapping": { - "field": "middleName" + "field": "obs.fieldCode", + "formSubmissionField": "number_of_children_born" } }, { - "column_name": "last_name", - "type": "Client", + "column_name": "delivery_date", + "type": "Event", "json_mapping": { - "field": "lastName" + "field": "obs.fieldCode", + "formSubmissionField": "delivery_date" } }, { - "column_name": "dob", - "type": "Client", + "column_name": "delivery_time", + "type": "Event", "json_mapping": { - "field": "birthdate" + "field": "obs.fieldCode", + "formSubmissionField": "delivery_time" } }, { - "column_name": "dod", - "type": "Client", + "column_name": "labour_duration", + "type": "Event", "json_mapping": { - "field": "deathdate" + "field": "obs.fieldCode", + "formSubmissionField": "labour_duration" } }, { - "column_name": "dob_unknown", - "type": "Client", + "column_name": "maternal_complications_before_delivery", + "type": "Event", "json_mapping": { - "field": "birthdateApprox" + "field": "obs.fieldCode", + "formSubmissionField": "maternal_complications_before_delivery" } }, { - "column_name": "gender", - "type": "Client", + "column_name": "maternal_complications_during_and_after_delivery", + "type": "Event", "json_mapping": { - "field": "gender" + "field": "obs.fieldCode", + "formSubmissionField": "maternal_complications_during_and_after_delivery" } }, { - "column_name": "early_bf_1hr", + "column_name": "family_planning_counselling_after_delivery", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "161543AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "formSubmissionField": "family_planning_counselling_after_delivery" } }, { - "column_name": "physically_challenged", + "column_name": "family_planning_methods_selected", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "162558AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "formSubmissionField": "family_planning_methods_selected" } }, { - "column_name": "type_of_disability", + "column_name": "visit_date", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "version" } - }, + } + ] + }, + { + "name": "ec_cbhs_register", + "columns": [ { - "column_name": "birth_cert", + "column_name": "base_entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "165406AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "baseEntityId" } }, { - "column_name": "rhc_card", + "column_name": "relational_id", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "164147AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "relational_id" } }, { - "column_name": "nutrition_status", + "column_name": "provider_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "163301AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "providerId" } }, { @@ -449,657 +6525,691 @@ } }, { - "column_name": "last_home_visit", + "column_name": "ctc_number", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "formSubmissionField": "last_home_visit" + "concept": "ctc_number" } }, { - "column_name": "visit_not_done", + "column_name": "tb_number", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "formSubmissionField": "visit_not_done" - } - }, - { - "column_name": "date_removed", - "type": "Client", - "json_mapping": { - "field": "attributes.dateRemoved" + "concept": "tb_number" } }, { - "column_name": "date_created", - "type": "Client", + "column_name": "rch_number", + "type": "Event", "json_mapping": { - "field": "dateCreated" + "field": "obs.formSubmissionField", + "concept": "rch_number" } }, { - "column_name": "birth_cert_issue_date", + "column_name": "mat_number", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "164129AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "mat_number" } }, { - "column_name": "birth_cert_num", + "column_name": "cbhs_number", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "162052AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "cbhs_number" } }, { - "column_name": "birth_notification", + "column_name": "registration_or_followup_status", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "formSubmissionField": "birth_notification" + "concept": "registration_or_followup_status", + "value_field": "obs.fieldCode" } }, { - "column_name": "date_of_illness", + "column_name": "client_tb_status_during_registration", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "1730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "client_tb_status_during_registration" } }, { - "column_name": "illness_description", + "column_name": "client_hiv_status_during_registration", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "1390AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "client_hiv_status_during_registration" } }, { - "column_name": "action_taken", + "column_name": "client_hiv_status_after_testing", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "client_hiv_status_after_testing" } }, { - "column_name": "vaccine_card", + "column_name": "client_tb_status_after_testing", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "formSubmissionField": "vaccine_card" + "field": "obs.formSubmissionField", + "concept": "client_tb_status_after_testing" } }, { - "column_name": "insurance_provider", - "type": "Client", + "column_name": "next_appointment_date", + "type": "Event", "json_mapping": { - "field": "attributes.insurance_provider" + "field": "obs.formSubmissionField", + "concept": "next_appointment_date" } }, { - "column_name": "insurance_provider_other", - "type": "Client", + "column_name": "hiv_registration_date", + "type": "Event", + "data_type": "date", "json_mapping": { - "field": "attributes.Other_Health_Insurance_Type" + "field": "obs.formSubmissionField", + "concept": "hiv_registration_date" } }, { - "column_name": "insurance_provider_number", - "type": "Client", + "column_name": "reasons_for_registration", + "type": "Event", + "data_type": "date", "json_mapping": { - "field": "attributes.Health_Insurance_Number" + "field": "obs.formSubmissionField", + "concept": "reasons_for_registration" } } ] }, { - "name": "ec_child_activity", + "name": "ec_cbhs_followup", "columns": [ { - "column_name": "event_id", + "column_name": "entity_id", "type": "Event", "json_mapping": { - "field": "eventId" + "field": "baseEntityId" + } + }, + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" } }, { "column_name": "relational_id", - "type": "Client", + "type": "Event", "json_mapping": { - "field": "relationships.family" + "field": "obs.fieldCode", + "concept": "relational_id" } }, { - "column_name": "form_submission_id", + "column_name": "last_interacted_with", "type": "Event", "json_mapping": { - "field": "formSubmissionId" + "field": "version" } }, { - "column_name": "base_entity_id", - "type": "Client", + "column_name": "registration_or_followup_status", + "type": "Event", "json_mapping": { - "field": "baseEntityId" + "field": "obs.formSubmissionField", + "concept": "registration_or_followup_status" } }, { - "column_name": "event_type", + "column_name": "client_condition", "type": "Event", "json_mapping": { - "field": "eventType" + "field": "obs.formSubmissionField", + "concept": "client_condition" } }, { - "column_name": "last_home_visit", + "column_name": "health_problem", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "formSubmissionField": "last_home_visit" + "field": "obs.formSubmissionField", + "concept": "health_problem" } }, { - "column_name": "visit_not_done", + "column_name": "health_problem_other", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "formSubmissionField": "visit_not_done" + "field": "obs.formSubmissionField", + "concept": "health_problem_other" } }, { - "column_name": "event_date", + "column_name": "prompt_for_health_challenges", "type": "Event", "json_mapping": { - "field": "eventDate" + "field": "obs.formSubmissionField", + "concept": "prompt_for_health_challenges" } }, { - "column_name": "date_removed", - "type": "Client", + "column_name": "social_problem", + "type": "Event", "json_mapping": { - "field": "attributes.dateRemoved" + "field": "obs.formSubmissionField", + "concept": "social_problem" } - } - ] - }, - { - "name": "ec_anc_register", - "columns": [ + }, + { + "column_name": "social_problem_other", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "social_problem_other" + } + }, + { + "column_name": "supplies_provided", + "type": "Event", + "json_mapping": { + "field": "obs.formSubmissionField", + "concept": "supplies_provided" + } + }, { - "column_name": "base_entity_id", + "column_name": "supplies_provided_other", "type": "Event", "json_mapping": { - "field": "baseEntityId" + "field": "obs.formSubmissionField", + "concept": "supplies_provided_other" } }, { - "column_name": "relational_id", + "column_name": "medicine_provided", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "relational_id" + "field": "obs.formSubmissionField", + "concept": "medicine_provided" } }, { - "column_name": "last_interacted_with", + "column_name": "next_appointment_date", "type": "Event", + "data_type": "date", "json_mapping": { - "field": "version" + "field": "obs.formSubmissionField", + "concept": "next_appointment_date" } }, { - "column_name": "last_menstrual_period", + "column_name": "hiv_services_provided", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "hiv_services_provided" } }, { - "column_name": "gest_age", + "column_name": "hiv_services_provided_other", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "1438AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "hiv_services_provided_other" } }, { - "column_name": "edd", + "column_name": "referrals_issued_to_other_services", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "referrals_issued_to_other_services" } }, { - "column_name": "no_prev_preg", + "column_name": "referrals_issued_to_other_services_other", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "1438AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "referrals_issued_to_other_services_other" } }, { - "column_name": "gravida", + "column_name": "referrals_to_other_services_completed", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "5624AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "referrals_to_other_services_completed" } }, { - "column_name": "no_surv_children", + "column_name": "referrals_to_other_services_completed_other", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "164894AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "referrals_to_other_services_completed_other" } }, { - "column_name": "phone_number", + "column_name": "state_of_hiv_care_and_treatment", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "state_of_hiv_care_and_treatment" } }, { - "column_name": "marital_status", + "column_name": "state_of_registration_in_tb_and_pwid_clinics", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "1054AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "state_of_registration_in_tb_and_pwid_clinics" } }, { - "column_name": "last_home_visit", + "column_name": "client_moved_location", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "anc_visit_date" + "field": "obs.formSubmissionField", + "concept": "client_moved_location" } }, { - "column_name": "visit_not_done", + "column_name": "client_moved_location_other", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "anc_visit_not_done_date" + "field": "obs.formSubmissionField", + "concept": "client_moved_location_other" } }, { - "column_name": "confirmed_visits", + "column_name": "client_hiv_status_after_testing", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "confirmed_visits" + "field": "obs.formSubmissionField", + "concept": "client_hiv_status_after_testing" } }, { - "column_name": "last_contact_visit", + "column_name": "client_tb_status_after_testing", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "159590AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "client_tb_status_after_testing" } } ] }, { - "name": "ec_anc_log", + "name": "ec_mother_champion", "columns": [ { - "column_name": "base_entity_id", + "column_name": "entity_id", "type": "Event", "json_mapping": { "field": "baseEntityId" } }, { - "column_name": "date_created", + "column_name": "base_entity_id", "type": "Event", "json_mapping": { - "field": "eventDate" + "field": "formSubmissionId" } - } - ] - }, - { - "name": "ec_malaria_confirmation", - "columns": [ + }, { - "column_name": "base_entity_id", + "column_name": "relational_id", "type": "Event", "json_mapping": { - "field": "baseEntityId" + "field": "obs.fieldCode", + "concept": "relational_id" } }, { - "column_name": "date_chw_malaria_test", + "column_name": "last_interacted_with", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "162869AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "version" } }, { - "column_name": "fever_malaria_chw", + "column_name": "last_client_visit_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "fever_malaria_chw" + "concept": "last_client_visit_date" } }, { - "column_name": "fever_duration", + "column_name": "pmtct_community_referral_date", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "1731AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "pmtct_community_referral_date" } }, { - "column_name": "malaria_results", + "column_name": "comment", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "1643AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "comment_pmtct_community_followup" } }, { - "column_name": "date_hf_malaria_test", + "column_name": "reasons_for_issuing_community_referral", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "formSubmissionField": "date_hf_malaria_test" + "field": "obs.formSubmissionField", + "concept": "reasons_for_issuing_community_referral" } }, { - "column_name": "malaria_test_date", + "column_name": "mother_champion_location", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "163724AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "obs.formSubmissionField", + "concept": "mother_champion_location" + } + } + ] + }, + { + "name": "ec_mother_champion_followup", + "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" } }, { - "column_name": "malaria", + "column_name": "base_entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "163725AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "formSubmissionId" } }, { - "column_name": "malaria_treat", + "column_name": "relational_id", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "formSubmissionField": "malaria_treat" + "concept": "relational_id" } }, { - "column_name": "fam_llin", + "column_name": "last_interacted_with", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "formSubmissionField": "fam_llin" + "field": "version" } }, { - "column_name": "llin_2days", + "column_name": "type_of_service", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "formSubmissionField": "llin_2days" + "concept": "type_of_service" } }, { - "column_name": "llin_condition", + "column_name": "linked_to_psychosocial_group", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "formSubmissionField": "llin_condition" + "concept": "linked_to_psychosocial_group" } }, { - "column_name": "malaria_edu_chw", + "column_name": "counselling_given", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "1379AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "counselling_given" } }, { - "column_name": "last_interacted_with", + "column_name": "referrals_issued_other_services", "type": "Event", "json_mapping": { - "field": "version" + "field": "obs.fieldCode", + "concept": "referrals_issued_other_services" } - } - ] - }, - { - "name": "ec_family_planning", - "columns": [ + }, { - "column_name": "base_entity_id", + "column_name": "provider_id", "type": "Event", "json_mapping": { - "field": "baseEntityId" + "field": "providerId" } }, { - "column_name": "fp_reg_date", + "column_name": "chw_name", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "fp_reg_date" + "concept": "chw_name" } }, { - "column_name": "using_method", + "column_name": "visit_number", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "using_method" + "concept": "visit_number" } - }, + } + ] + }, + { + "name": "ec_sbcc", + "columns": [ { - "column_name": "couselling_fp_methods", + "column_name": "base_entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "1382AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "baseEntityId" } }, { - "column_name": "couselling_HIV_STI", + "column_name": "relational_id", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "couselling_HIV_STI" + "concept": "relational_id" } }, { - "column_name": "pill", + "column_name": "last_interacted_with", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "pill" + "field": "version" } }, { - "column_name": "breast_lump", + "column_name": "sbcc_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "breast_lump" + "concept": "sbcc_date" } }, { - "column_name": "abnormal_vaginal", + "column_name": "location_type", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "abnormal_vaginal" + "concept": "location_type" } }, { - "column_name": "pregnant", + "column_name": "participants_number", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "pregnant" + "concept": "participants_number" } }, { - "column_name": "difficultly_breathing", + "column_name": "provider_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "difficultly_breathing" + "field": "providerId" } }, { - "column_name": "headaches", + "column_name": "chw_name", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "headaches" + "concept": "chw_name" } - }, + } + ] + }, + { + "name": "ec_anc_partner_community_feedback", + "columns": [ { - "column_name": "frequent_urge", + "column_name": "entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "frequent_urge" + "field": "baseEntityId" } }, { - "column_name": "falling_loss_unconsciousness", + "column_name": "base_entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "falling_loss_unconsciousness" + "field": "formSubmissionId" } }, { - "column_name": "breastfeed", + "column_name": "relational_id", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "breastfeed" + "concept": "relational_id" } }, { - "column_name": "COC_POP", + "column_name": "last_interacted_with", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "COC_POP" + "field": "version" } }, { - "column_name": "POP", + "column_name": "referral_form_id", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "POP" + "concept": "referral_form_id" } }, { - "column_name": "no_pill", + "column_name": "partner_agree_attending_hf", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "no_pill" + "concept": "partner_agree_attending_hf" } }, { - "column_name": "fp_method_chw", + "column_name": "client_found", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "160576AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "is_partner_found" } }, { - "column_name": "fp_method_already", + "column_name": "partner_base_entity_id", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "374AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "partner_base_entity_id" } }, { - "column_name": "fp_method_accepted", + "column_name": "provider_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "fp_method_accepted" + "field": "providerId" } }, { - "column_name": "ecp", + "column_name": "chw_name", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "ecp" + "concept": "chw_name" } - }, + } + ] + }, + { + "name": "ec_hivst_register", + "columns": [ { - "column_name": "no_condoms", + "column_name": "base_entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "no_condoms" + "field": "baseEntityId" } }, { - "column_name": "no_pillcycles", + "column_name": "relational_id", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "163171AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "relational_id" } }, { - "column_name": "counselling_use", + "column_name": "registration_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "counselling_use" + "concept": "registration_date" } }, { - "column_name": "next_injection_due_date", + "column_name": "client_testing_history", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "5096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "client_testing_history" } }, { - "column_name": "fp_start_date", + "column_name": "client_group", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "163526AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "client_group" } }, { - "column_name": "referral_given", + "column_name": "known_positive_during_reg", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "referral_given" + "concept": "known_positive_during_reg" } }, { @@ -1112,107 +7222,126 @@ ] }, { - "name": "ec_pregnancy_outcome", + "name": "ec_hivst_followup", "columns": [ { - "column_name": "base_entity_id", + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" + } + }, + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "client_testing_approach", + "type": "Event", + "json_mapping": { + "field": "obs.fieldCode", + "concept": "client_testing_approach" + } + }, + { + "column_name": "self_test_kit_given", "type": "Event", "json_mapping": { - "field": "baseEntityId" + "field": "obs.fieldCode", + "concept": "self_test_kit_given" } }, { - "column_name": "relational_id", + "column_name": "extra_kits", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "relational_id" + "concept": "extra_kits_required" } }, { - "column_name": "preg_outcome", + "column_name": "collection_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "161033AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "collection_date" } }, { - "column_name": "miscarriage_date", + "column_name": "condoms_given", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "165248AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "condoms_given" } - }, + } + ] + }, + { + "name": "ec_hivst_results", + "columns": [ { - "column_name": "delivery_date", + "column_name": "base_entity_id", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "5599AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "result_reg_id" } }, { - "column_name": "delivery_place", + "column_name": "entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "1572AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "baseEntityId" } }, { - "column_name": "last_visit_date", + "column_name": "kit_for", "type": "Event", - "data_type": "date", - "source_format": "dd-MM-yyyy", - "save_format": "yyyy-MM-dd", "json_mapping": { "field": "obs.fieldCode", - "concept": "last_visit_date" + "concept": "kit_for" } }, { - "column_name": "next_visit_date", + "column_name": "kit_code", "type": "Event", - "data_type": "date", - "source_format": "dd-MM-yyyy", - "save_format": "yyyy-MM-dd", "json_mapping": { "field": "obs.fieldCode", - "concept": "next_visit_date" + "concept": "kit_code" } }, { - "column_name": "last_health_facility_visit_date", + "column_name": "hivst_result", "type": "Event", - "data_type": "date", - "source_format": "dd-MM-yyyy", - "save_format": "yyyy-MM-dd", "json_mapping": { "field": "obs.fieldCode", - "concept": "last_health_facility_visit_date" + "concept": "hivst_result" } }, { - "column_name": "confirmed_health_facility_visits", + "column_name": "collection_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "confirmed_health_facility_visits" + "concept": "collection_date" } }, { - "column_name": "last_interacted_with", + "column_name": "result_date", "type": "Event", "json_mapping": { - "field": "version" + "field": "obs.fieldCode", + "concept": "result_date" } } ] }, { - "name": "ec_malaria_follow_up_visit", + "name": "ec_hivst_mobilization", "columns": [ { "column_name": "base_entity_id", @@ -1222,57 +7351,49 @@ } }, { - "column_name": "date_chw_mfollowup", - "type": "Event", - "json_mapping": { - "field": "obs.fieldCode", - "concept": "date_chw_mfollowup" - } - }, - { - "column_name": "hf_chw_mfollowup", + "column_name": "mobilization_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "hf_chw_mfollowup" + "concept": "mobilization_date" } }, { - "column_name": "treat_given_chw_mfollowup", + "column_name": "female_clients_reached", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "treat_given_chw_mfollowup" + "concept": "female_clients_reached" } }, { - "column_name": "reason_no_treat", + "column_name": "male_clients_reached", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "reason_no_treat" + "concept": "male_clients_reached" } }, { - "column_name": "fever_still", + "column_name": "male_condoms_issued", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "fever_still" + "concept": "male_condoms_issued" } }, { - "column_name": "fever_duration", + "column_name": "female_condoms_issued", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "fever_duration" + "concept": "female_condoms_issued" } } ] }, { - "name": "ec_child_referral", + "name": "ec_cdp_register", "columns": [ { "column_name": "base_entity_id", @@ -1282,735 +7403,730 @@ } }, { - "column_name": "chw_referral_hf_child", - "type": "Event", - "json_mapping": { - "field": "obs.fieldCode", - "concept": "1759AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - }, - { - "column_name": "referral_problem_child", + "column_name": "relational_id", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "163182AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "relational_id" } }, { - "column_name": "referral_problem_child_other", + "column_name": "outlet_visit_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "outlet_visit_date" } }, { - "column_name": "service_before_child", + "column_name": "male_condoms_count", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "number_of_male_condoms" } }, { - "column_name": "service_before_child_other", + "column_name": "female_condoms_count", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "number_of_female_condoms" } }, { - "column_name": "referral_date_child", + "column_name": "visit_number", "type": "Event", - "data_type": "date", "json_mapping": { "field": "obs.fieldCode", - "concept": "163181AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "visit_number" } }, { - "column_name": "referral_time_child", + "column_name": "last_interacted_with", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "formSubmissionField": "referral_task_previous_status" + "field": "version" } } ] }, { - "name": "ec_anc_referral", + "name": "ec_cdp_orders", "columns": [ { - "column_name": "chw_referral_hf_anc", + "column_name": "location_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "1759AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "locationId" + } + }, + { + "column_name": "receiving_order_facility", + "type": "Event", + "json_mapping": { + "field": "receiving_order_facility" + } + }, + { + "column_name": "form_submission_id", + "type": "Event", + "json_mapping": { + "field": "form_submission_id" } }, { "column_name": "base_entity_id", "type": "Event", "json_mapping": { - "field": "baseEntityId" + "field": "formSubmissionId" } }, { - "column_name": "problem_hf_anc", + "column_name": "condom_type", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "163182AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "condom_type" } }, { - "column_name": "problem_hf_anc_other", + "column_name": "condom_brand", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "condom_brand" } }, { - "column_name": "service_before_anc", + "column_name": "quantity_requested", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "requested_condoms" } }, { - "column_name": "service_before_anc_other", + "column_name": "request_type", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "request_type" } }, { - "column_name": "referral_date_anc", + "column_name": "requested_at", "type": "Event", - "data_type": "date", "json_mapping": { "field": "obs.fieldCode", - "concept": "163181AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "requested_at" } }, { - "column_name": "referral_time_anc", + "column_name": "teamId", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "formSubmissionField": "referral_task_previous_status" + "field": "teamId" } } ] }, { - "name": "ec_pnc_referral", + "name": "ec_cdp_order_feedback", "columns": [ { - "column_name": "chw_referral_hf_pnc", + "column_name": "location_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "1759AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "locationId" } }, { "column_name": "base_entity_id", "type": "Event", "json_mapping": { - "field": "baseEntityId" + "field": "formSubmissionId" } }, { - "column_name": "problem_hf_pnc", + "column_name": "request_reference", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "163182AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "request_reference" } }, { - "column_name": "problem_hf_pnc_other", + "column_name": "response_status", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "response_status" } }, { - "column_name": "service_before_pnc", + "column_name": "condom_type", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "condom_type" } }, { - "column_name": "service_before_pnc_other", + "column_name": "condom_brand", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "condom_brand" } }, { - "column_name": "referral_date_pnc", + "column_name": "quantity_response", "type": "Event", - "data_type": "date", "json_mapping": { "field": "obs.fieldCode", - "concept": "163181AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "quantity_response" } }, { - "column_name": "referral_time_pnc", + "column_name": "response_at", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "formSubmissionField": "referral_task_previous_status" + "concept": "response_at" } } ] }, { - "name": "ec_fp_referral", + "name": "ec_cdp_stock_count", "columns": [ { - "column_name": "fp_method_accepted_referral", + "column_name": "base_entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "374AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "locationId" } }, { - "column_name": "base_entity_id", + "column_name": "form_submission_id", "type": "Event", "json_mapping": { - "field": "baseEntityId" + "field": "formSubmissionId" } }, { - "column_name": "fp_side_effects", + "column_name": "chw_name", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "165273AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "chw_name" } }, { - "column_name": "fp_side_effects_other", + "column_name": "female_condoms_count", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "female_condoms_count" } }, { - "column_name": "referral_date_fp", + "column_name": "male_condoms_count", "type": "Event", - "data_type": "date", "json_mapping": { "field": "obs.fieldCode", - "concept": "163181AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "male_condoms_count" } }, { - "column_name": "referral_time_fp", + "column_name": "date_updated", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "formSubmissionField": "referral_task_previous_status" + "field": "condom_restock_date" } + }, + { + "column_name": "processed_form_submission_ids" } ] }, { - "name": "ec_referral", + "name": "ec_cdp_stock_log", "columns": [ { - "column_name": "chw_referral_service", + "column_name": "entity_id", "type": "Event", "json_mapping": { - "field": "obs.formSubmissionField", - "concept": "chw_referral_service" + "field": "locationId" } }, { - "column_name": "chw_referral_hf", + "column_name": "base_entity_id", "type": "Event", "json_mapping": { - "field": "obs.formSubmissionField", - "concept": "chw_referral_hf" + "field": "formSubmissionId" } }, { - "column_name": "entity_id", + "column_name": "chw_name", "type": "Event", "json_mapping": { - "field": "baseEntityId" + "field": "obs.fieldCode", + "concept": "chw_name" } }, { - "column_name": "base_entity_id", + "column_name": "female_condoms_offset", "type": "Event", "json_mapping": { - "field": "formSubmissionId" + "field": "obs.fieldCode", + "concept": "female_condoms_offset" } }, { - "column_name": "problem", + "column_name": "male_condoms_offset", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "163182AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "male_condoms_offset" } }, { - "column_name": "problem_other", + "column_name": "event_type", "type": "Event", "json_mapping": { - "field": "obs.formSubmissionField", - "concept": "problem_other" + "field": "eventType" } }, { - "column_name": "service_before_referral", + "column_name": "stock_event_type", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - } - }, - { - "column_name": "service_before_referral_other", - "type": "Event", - "json_mapping": { - "field": "obs.formSubmissionField", - "concept": "service_before_referral_other" + "concept": "stock_event_type" } }, { - "column_name": "referral_date", + "column_name": "issuing_organization", "type": "Event", - "data_type": "date", "json_mapping": { - "field": "obs.formSubmissionField", - "concept": "referral_date" + "field": "obs.fieldCode", + "concept": "issuing_organization" } }, { - "column_name": "referral_time", + "column_name": "other_issuing_organization", "type": "Event", "json_mapping": { - "field": "obs.formSubmissionField", - "formSubmissionField": "referral_time" + "field": "other_issuing_organization" } }, { - "column_name": "referral_appointment_date", + "column_name": "male_condom_brand", "type": "Event", "json_mapping": { - "field": "obs.formSubmissionField", - "concept": "referral_appointment_date" + "field": "obs.fieldCode", + "concept": "male_condom_brand" } }, { - "column_name": "referral_type", + "column_name": "female_condom_brand", "type": "Event", "json_mapping": { - "field": "obs.formSubmissionField", - "concept": "referral_type" + "field": "obs.fieldCode", + "concept": "female_condom_brand" } }, { - "column_name": "referral_status", + "column_name": "date_updated", "type": "Event", "json_mapping": { - "field": "obs.formSubmissionField", - "concept": "referral_status" + "field": "condom_restock_date" } } ] }, { - "name": "ec_referral_followup", + "name": "ec_cdp_issuing_hf", "columns": [ + { + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "locationId" + } + }, { "column_name": "base_entity_id", "type": "Event", "json_mapping": { - "field": "baseEntityId" + "field": "formSubmissionId" } }, { - "column_name": "chw_followup_feedback_id", + "column_name": "male_condoms", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "chw_followup_feedback_id" + "concept": "male_condoms" } }, { - "column_name": "other_followup_feedback_information", + "column_name": "female_condoms", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "other_followup_feedback_information" + "concept": "female_condoms" } }, { - "column_name": "chw_followup_date", + "column_name": "condom_restock_date", "type": "Event", - "data_type": "date", "json_mapping": { "field": "obs.fieldCode", - "concept": "chw_followup_date" + "concept": "condom_restock_date" } - } - ] - }, - { - "name": "ec_referral_service", - "columns": [ + }, { - "column_name": "name_en", + "column_name": "condom_type", "type": "Event", "json_mapping": { - "field": "obs.fieldCode" + "field": "obs.fieldCode", + "concept": "condom_type" } }, { - "column_name": "name_sw", + "column_name": "condom_brand", "type": "Event", "json_mapping": { - "field": "obs.fieldCode" + "field": "obs.fieldCode", + "concept": "condom_brand" } }, { - "column_name": "identifier", + "column_name": "other_condom_brand", "type": "Event", "json_mapping": { - "field": "obs.fieldCode" + "field": "obs.fieldCode", + "concept": "other_condom_brand" } }, { - "column_name": "is_active", + "column_name": "point_of_service", "type": "Event", "json_mapping": { - "field": "obs.fieldCode" - } - } - ] - }, - { - "name": "ec_referral_service_indicator", - "columns": [ + "field": "obs.fieldCode", + "concept": "point_of_service" + } + }, { - "column_name": "name_en", + "column_name": "other_pos", "type": "Event", "json_mapping": { - "field": "obs.fieldCode" + "field": "obs.fieldCode", + "concept": "other_pos" } }, { - "column_name": "name_sw", + "column_name": "male_condoms_offset", "type": "Event", "json_mapping": { - "field": "obs.fieldCode" + "field": "obs.fieldCode", + "concept": "male_condoms_offset" } }, { - "column_name": "is_active", + "column_name": "female_condoms_offset", "type": "Event", "json_mapping": { - "field": "obs.fieldCode" + "field": "obs.fieldCode", + "concept": "female_condoms_offset" } } ] }, { - "name": "ec_sick_child_followup", + "name": "ec_kvp_register", "columns": [ { - "column_name": "entity_id", + "column_name": "base_entity_id", "type": "Event", "json_mapping": { "field": "baseEntityId" } }, { - "column_name": "base_entity_id", + "column_name": "relational_id", "type": "Event", "json_mapping": { - "field": "formSubmissionId" + "field": "obs.fieldCode", + "concept": "relational_id" } }, { - "column_name": "visit_date", + "column_name": "uic_id", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "date_sickchild" + "concept": "uic_id" } }, { - "column_name": "weight", + "column_name": "prep_qualified", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "5089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "prep_qualified" } }, { - "column_name": "height", + "column_name": "prep_assessment", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "prep_assessment" } }, { - "column_name": "has_diarrhea", + "column_name": "hiv_status", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "142412AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "hiv_status" } }, { - "column_name": "diarrhea_duration", + "column_name": "client_group", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "5984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "client_group" } }, { - "column_name": "dehydration_status", + "column_name": "last_interacted_with", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "1497AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "field": "version" + } + } + ] + }, + { + "name": "ec_kvp_bio_medical_services", + "columns": [ + { + "column_name": "base_entity_id", + "type": "Event", + "json_mapping": { + "field": "formSubmissionId" } }, { - "column_name": "other_symptoms", + "column_name": "entity_id", + "type": "Event", + "json_mapping": { + "field": "baseEntityId" + } + }, + { + "column_name": "client_status", "type": "Event", - "save_format": "json_array", "json_mapping": { "field": "obs.fieldCode", - "concept": "other_sympt_sick_child" + "concept": "client_status" } }, { - "column_name": "test_ordered", + "column_name": "other_kvp_category", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "1271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "other_kvp_category" } }, { - "column_name": "other_test_ordered", + "column_name": "previous_hiv_testing_method", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "previous_hiv_testing_method" } }, { - "column_name": "test_results", + "column_name": "testing_site", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "161577AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "testing_site" } }, { - "column_name": "diagnosis", + "column_name": "testing_approach", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "161602AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "testing_approach" } }, { - "column_name": "diarrhea_treatment", + "column_name": "tested_hiv", "type": "Event", - "save_format": "json_array", "json_mapping": { "field": "obs.fieldCode", - "concept": "diarrhea_treat" + "concept": "tested_hiv" } }, { - "column_name": "amount_of_ors", + "column_name": "hiv_status", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "diarrhea_treat_ors" + "concept": "hiv_status" } }, { - "column_name": "amount_rehydration_infusion", + "column_name": "ctc_services", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "diarrhea_treat_rehydration" + "concept": "ctc_services" } }, { - "column_name": "amount_zinc", + "column_name": "ctc_number", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "diarrhea_treat_zinc" + "concept": "ctc_number" } }, { - "column_name": "drugs_taken_home", + "column_name": "kits_distributed", "type": "Event", - "save_format": "json_array", "json_mapping": { "field": "obs.fieldCode", - "concept": "diarrhea_treat_walkaway" + "concept": "kits_distributed" } }, { - "column_name": "non_diarrhea_treatment", + "column_name": "enrolled_to_prep", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "enrolled_to_prep" } }, { - "column_name": "dtc_period", + "column_name": "pep_provision", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "1785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "pep_provision" } }, { - "column_name": "results", + "column_name": "number_of_male_condoms_issued", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "160433AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "number_of_male_condoms_issued" } }, { - "column_name": "date_marked_as_done", + "column_name": "number_of_female_condoms_issued", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "date_marked_as_done" + "concept": "number_of_female_condoms_issued" } - } - ] - }, - { - "name": "ec_anc_danger_signs_outcome", - "columns": [ + }, { - "column_name": "entity_id", + "column_name": "family_planning_service", "type": "Event", "json_mapping": { - "field": "baseEntityId" + "field": "obs.fieldCode", + "concept": "family_planning_service" } }, { - "column_name": "base_entity_id", + "column_name": "tb_screening", "type": "Event", "json_mapping": { - "field": "formSubmissionId" + "field": "obs.fieldCode", + "concept": "tb_screening" } }, { - "column_name": "visit_date", + "column_name": "sti_screening", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "anc_danger_signs_visitdate" + "concept": "sti_screening" } }, { - "column_name": "danger_signs_present", + "column_name": "treatment_provided", "type": "Event", - "save_format": "json_array", "json_mapping": { "field": "obs.fieldCode", - "formSubmissionField": "danger_signs_present" + "concept": "treatment_provided" } }, { - "column_name": "other_danger_signs", + "column_name": "hep_b_testing", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "hep_b_testing" } }, { - "column_name": "action_taken", + "column_name": "hep_c_testing", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "hep_c_testing" } }, { - "column_name": "status_visit", + "column_name": "vmcc_provided", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "status_visit" + "concept": "vmcc_provided" } }, { - "column_name": "managed_signs", + "column_name": "cervical_cancer_screening", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "managed_signs" + "concept": "cervical_cancer_screening" } }, { - "column_name": "comment", + "column_name": "mat_provided", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "comment_anc_danger_signs" + "concept": "mat_provided" } }, { - "column_name": "date_marked_as_done", + "column_name": "kvp_visit_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "date_marked_as_done" + "concept": "kvp_visit_date" } } ] }, { - "name": "ec_pnc_danger_signs_outcome", + "name": "ec_kvp_behavioral_services", "columns": [ - { - "column_name": "entity_id", - "type": "Event", - "json_mapping": { - "field": "baseEntityId" - } - }, { "column_name": "base_entity_id", "type": "Event", @@ -2019,82 +8135,76 @@ } }, { - "column_name": "visit_date", + "column_name": "entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "pnc_danger_signs_visitdate" + "field": "baseEntityId" } }, { - "column_name": "danger_signs_present", + "column_name": "iec_sbcc_materials", "type": "Event", - "save_format": "json_array", "json_mapping": { "field": "obs.fieldCode", - "concept": "danger_signs_present" + "concept": "iec_sbcc_materials" } }, { - "column_name": "other_danger_signs", + "column_name": "health_education_provided", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "concept": "health_education_provided" } }, { - "column_name": "action_taken", + "column_name": "kvp_visit_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "action_taken_pnc_danger_signs" + "concept": "kvp_visit_date" } - }, + } + ] + }, + { + "name": "ec_kvp_structural_services", + "columns": [ { - "column_name": "status_visit", + "column_name": "base_entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "status_visit" + "field": "formSubmissionId" } }, { - "column_name": "managed_signs", + "column_name": "entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "managed_signs" + "field": "baseEntityId" } }, { - "column_name": "comment", + "column_name": "gbv_screening", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "comment_pnc_danger_signs" + "concept": "gbv_screening" } }, { - "column_name": "date_marked_as_done", + "column_name": "kvp_visit_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "date_marked_as_done" + "concept": "kvp_visit_date" } } ] }, { - "name": "ec_malaria_followup_hf", + "name": "ec_kvp_other_services", "columns": [ - { - "column_name": "entity_id", - "type": "Event", - "json_mapping": { - "field": "baseEntityId" - } - }, { "column_name": "base_entity_id", "type": "Event", @@ -2103,186 +8213,168 @@ } }, { - "column_name": "visit_date", + "column_name": "entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "date_malaria_visit_hf" + "field": "baseEntityId" } }, { - "column_name": "weight", + "column_name": "other_services_referrals_provided", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "weight_malaria_hf" + "concept": "other_services_referrals_provided" } - }, + } + ] + }, + { + "name": "ec_prep_register", + "columns": [ { - "column_name": "height", + "column_name": "base_entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "height_malaria_hf" + "field": "baseEntityId" } }, { - "column_name": "tests_ordered", + "column_name": "relational_id", "type": "Event", - "save_format": "json_array", "json_mapping": { "field": "obs.fieldCode", - "concept": "test_malaria_hf" + "concept": "relational_id" } }, { - "column_name": "no_mrdt_reason", + "column_name": "prep_status", "type": "Event", - "save_format": "json_array", "json_mapping": { "field": "obs.fieldCode", - "concept": "no_mrdt_malaria_hf" + "concept": "prep_status" } }, { - "column_name": "other_tests", + "column_name": "prep_initiation_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "other_test_malaria_hf" + "concept": "prep_initiation_date" } }, { - "column_name": "test_results", + "column_name": "hbv_test_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "test_results_malaria_hf" + "concept": "hbv_test_date" } }, { - "column_name": "other_test_results", + "column_name": "hcv_test_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "other_test_results_malaria_hf" + "concept": "hcv_test_date" } }, { - "column_name": "diagnosis", + "column_name": "crcl_test_date", "type": "Event", - "save_format": "json_array", "json_mapping": { "field": "obs.fieldCode", - "concept": "diagnosis_malaria_hf" + "concept": "crcl_test_date" } }, { - "column_name": "other_diagnosis", + "column_name": "crcl_results", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "other_diagnosis_malaria_hf" + "concept": "crcl_results" } }, { - "column_name": "treatment_prescribed", + "column_name": "last_interacted_with", "type": "Event", - "save_format": "json_array", "json_mapping": { - "field": "obs.fieldCode", - "concept": "treat_malaria_hf" + "field": "version" } - }, + } + ] + }, + { + "name": "ec_prep_followup", + "columns": [ { - "column_name": "other_treatment_prescribed", + "column_name": "base_entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "treat_other_malaria_hf" + "field": "formSubmissionId" } }, { - "column_name": "outcomes", + "column_name": "entity_id", "type": "Event", "json_mapping": { - "field": "obs.fieldCode", - "concept": "outcome_malaria_hf" + "field": "baseEntityId" } }, { - "column_name": "remarks", + "column_name": "visit_type", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "remark_malaria_hf" + "concept": "visit_type" } }, { - "column_name": "hcp_attending", + "column_name": "prep_drug_offered", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "hcp_attending" + "concept": "prep_drug_offered" } }, { - "column_name": "date_marked_as_done", + "column_name": "prep_status", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "date_marked_as_done" - } - } - ] - }, - { - "name": "ec_family_planning_update", - "columns": [ - { - "column_name": "entity_id", - "type": "Event", - "json_mapping": { - "field": "baseEntityId" - } - }, - { - "column_name": "base_entity_id", - "type": "Event", - "json_mapping": { - "field": "formSubmissionId" + "concept": "prep_status" } }, { - "column_name": "fp_method_accepted", + "column_name": "reasons_stopping_prep", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "fp_method_accepted" + "concept": "reasons_stopping_prep" } }, { - "column_name": "fp_reg_date", + "column_name": "prep_status", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "fp_reg_date" + "concept": "prep_status" } }, { - "column_name": "fp_reg_date", + "column_name": "kvp_visit_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "fp_change_or_stop_date" + "concept": "kvp_visit_date" } }, { - "column_name": "date_marked_as_done", + "column_name": "next_visit_date", "type": "Event", "json_mapping": { "field": "obs.fieldCode", - "concept": "date_marked_as_done" + "concept": "next_visit_date" } } ] diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/all_clients_registration_form.json b/opensrp-chw-hf/src/main/assets/json.form-sw/all_clients_registration_form.json new file mode 100644 index 000000000..eac7d4a2c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/all_clients_registration_form.json @@ -0,0 +1,1089 @@ +{ + "count": "2", + "encounter_type": "Family Registration", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Taarifa za mteja", + "next": "step2", + "fields": [ + { + "key": "fam_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "fam_name", + "type": "edit_text", + "hint": "Jina la Ukoo", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Ukoo" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka Jina la Ukoo" + } + }, + { + "key": "client_first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "Jina la Kwanza", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kwanza" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + } + }, + { + "key": "client_middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Jina la Kati", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kati" + } + }, + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "hidden": "true", + "type": "edit_text", + "barcode_type": "qrcode", + "hint": "Nambari ya utambulisho", + "scanButtonText": "Scan QR Code", + "v_numeric": { + "value": "true", + "err": "Tafadhali weka kitambulisho halali" + } + }, + { + "key": "fam_village", + "openmrs_entity_parent": "", + "openmrs_entity": "person_address", + "openmrs_entity_id": "cityVillage", + "type": "edit_text", + "edit_type": "name", + "hint": "Jina la eneo", + "v_required": { + "value": "true", + "err": "Tafadhali weka jina la eneo au mji" + } + }, + { + "key": "landmark", + "openmrs_entity_parent": "", + "openmrs_entity": "person_address", + "openmrs_entity_id": "landmark", + "type": "edit_text", + "hint": "Alama/Maelezo ya eneo la nyumba", + "v_required": { + "value": true, + "err": "Tafadhali weka alama/maelezo ya eneo." + } + }, + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "15dp" + }, + { + "key": "sync_location_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "sync_location_id", + "type": "spinner", + "hint": "Chagua eneo la WAJA" + } + ] + }, + "step2": { + "title": "Taarifa za mteja", + "fields": [ + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "type": "edit_text", + "read_only": true, + "hint": "Kitambulisho cha Kituoni", + "v_numeric": { + "value": "true", + "err": "Tafadhali weka kitambulisho halali" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka kitambulisho cha KIPEKEE" + } + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "last_name", + "type": "edit_text", + "hint": "Jina la Ukoo", + "edit_type": "name", + "read_only": true, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Ukoo" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_calculation.yml" + } + } + } + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "Jina la Kwanza", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kwanza" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_calculation.yml" + } + } + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Jina la Kati", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kati" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_calculation.yml" + } + } + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "date_picker", + "hint": "Tarehe ya kuzaliwa (DOB)", + "expanded": false, + "duration": { + "label": "Umri" + }, + "min_date": "today-120y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza tarehe ya kuzaliwa (DOB)" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "age_calculated", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_calculation.yml" + } + } + } + }, + { + "key": "dob_unknown", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdateApprox", + "type": "check_box", + "label": "", + "options": [ + { + "key": "dob_unknown", + "text": "Tarehe ya kuzaliwa haijulikani", + "text_size": "18px", + "value": "false" + } + ] + }, + { + "key": "age", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "age", + "type": "edit_text", + "hint": "Umri", + "v_numeric_integer": { + "value": "true", + "err": "Must be a rounded number" + }, + "v_max_length": { + "value": "3", + "is_fixed_size": "true", + "err": "Please enter a valid age" + }, + "v_numeric": { + "value": "true", + "err": "Lazima iwe namba kamili" + }, + "v_min": { + "value": "0", + "err": "Umri lazima uwe sawa au zaidi ya 0" + }, + "v_max": { + "value": "120", + "err": "Umri lazima uwe sawa au chini ya 120" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Tafadhali weka umri" + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Jinsi", + "values": [ + "Me", + "Ke" + ], + "keys": [ + "Male", + "Female" + ], + "v_required": { + "value": "true", + "err": "Tafadhali ingiza jinsi" + } + }, + { + "key": "marital_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "marital_status", + "type": "spinner", + "hint": "Hali ya Ndoa ya Mteja?", + "values": [ + "Hajaoa/Kuolewa", + "Ameoa/Kuolewa", + "Ameachwa", + "Mjane/Mgane", + "Kuishi pamoja bila ndoa" + ], + "keys": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "openmrs_choice_ids": { + "Single": "Single", + "Married": "Married", + "Divorced": "Divorced", + "Widowed": "Widowed", + "Cohabitation": "Cohabitation" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "phone_number", + "type": "edit_text", + "hint": "Namba ya simu ya mteja", + "v_numeric": { + "value": "true", + "err": "Namba lazima iwe jumla ya tarakimu 10 kwa urefu" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Namba lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." + } + }, + { + "key": "id_avail", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "id_avail", + "type": "check_box", + "label": "Je, una kitambulisho chochote kati ya vifuatavyo?", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_national_id", + "text": "Kitambulisho cha Taifa", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_national_id" + }, + { + "key": "chk_voters_id", + "text": "Kitambulisho cha usajili wa mpiga kura", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_voters_id" + }, + { + "key": "chk_drivers_license", + "text": "Leseni ya udereva", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_drivers_license" + }, + { + "key": "chk_passport_number", + "text": "kitambulisho cha kusafiria (Passport)", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_passport_number" + }, + { + "key": "chk_none", + "text": "Hakuna", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_none" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "national_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "National_ID", + "type": "mask_edit_text", + "mask": "########-#####-#####-##", + "mask_hint": "12345678912345678912", + "allowed_chars": "0123456789", + "hint": "Namba ya kitambulisho cha taifa k.m 12345678-91234-56789-12", + "edit_type": "number", + "v_max_length": { + "value": "23", + "is_fixed_size": "true", + "err": "Tafadhali weka namba sahihi" + }, + "v_regex": { + "value": "^\\d{8}-\\d{5}-\\d{5}-\\d{2}$", + "err": "Namba ya kitambulisho cha kitaifa inapaswa kuwa ya umbizo (XXXXXXXX-XXXXX-XXXXX-XX)" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi" + }, + "relevance": { + "step2:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_national_id" + ] + } + ] + } + } + }, + { + "key": "voter_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Voter_Registration_Number", + "type": "mask_edit_text", + "mask": "T-####-####-###-#", + "mask_hint": "123456789123", + "allowed_chars": "0123456789", + "hint": "Namba ya kitambulisho cha mpiga kura k.m T-1234-5678-912-3", + "edit_type": "number", + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Tafadhali weka namba sahihi" + }, + "v_regex": { + "value": "^T-\\d{4}-\\d{4}-\\d{3}-\\d{1}$", + "err": "Namba ya kitambulosho cha mpiga kura inapaswa kuwa ya umbizo (T-XXXX-XXXX-XXX-X)" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi" + }, + "relevance": { + "step2:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_voters_id" + ] + } + ] + } + } + }, + { + "key": "driver_license", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Driver_License_Number", + "type": "mask_edit_text", + "mask": "##########", + "mask_hint": "1234567891", + "allowed_chars": "0123456789", + "hint": "Namba ya leseni ya udereva k.m 1234567891", + "edit_type": "number", + "v_max_length": { + "value": "10", + "is_fixed_size": "true", + "err": "Tafadhali weka namba sahihi" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi" + }, + "v_regex": { + "value": "^([0-9]{10})", + "err": "Namba ya leseni ya udereva inapaswa kuwa ya umbizo (XXXXXXXXX)" + }, + "relevance": { + "step2:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_drivers_license" + ] + } + ] + } + } + }, + { + "key": "passport_number", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Passport", + "type": "mask_edit_text", + "mask": "TAE-###-###", + "mask_hint": "123456", + "allowed_chars": "0123456789", + "hint": "Passport namba e.g TAE-123-456", + "edit_type": "number", + "v_max_length": { + "value": "11", + "is_fixed_size": "true", + "err": "Tafadhali weka namba sahihi" + }, + "v_regex": { + "value": "^TAE-\\d{3}-\\d{3}$", + "err": "Namba ya kitambulisho cha kusafiria inapaswa ijazwe hivi (TAE-XXX-XXX)" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi" + }, + "relevance": { + "step2:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_passport_number" + ] + } + ] + } + } + }, + { + "key": "insurance_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Health_Insurance_Type", + "type": "spinner", + "hint": "Mtoa huduma ya bima ya afya", + "values": [ + "Mfuko wa Afya ya Jamii (CHF)/(iCHF)", + "Mfuko wa Taifa wa Hifadhi ya Jamii - Manufaa ya Bima ya Afya ya Jamii (SHIB)", + "Mfuko wa Taifa wa Bima ya Afya (NHIF)", + "Tiba Kwa Kadi (TIKA)", + "AAR Huduma ya Afya", + "Bima ya afya Strategies", + "Milvik Tanzania Ltd (BIMA Mkononi)", + "Bima ya afya ya Britam Tanzania", + "Bima ya afya Jubilee", + "Bima ya afya ya Resolutions", + "Bima ya afya ya Reliance", + "Nyinginezo", + "Hakuna" + ], + "keys": [ + "Community Health Fund (CHF)", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", + "Tiba Kwa Kadi (TIKA)", + "AAR Healthcare", + "Strategies Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)", + "Britam Insurance Tanzania", + "Jubilee Insurance", + "Resolutions Insurance", + "Reliance Insurance", + "Other", + "None" + ], + "openmrs_choice_ids": { + "Community Health Fund (CHF)": "Community_Health_Fund", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)": "National_Social_Security_Fund", + "National Health Insurance Fund (NHIF)": "National_Health_Insurance_Fund", + "Tiba Kwa Kadi (TIKA)": "Tiba_kwa_Kadi", + "AAR Healthcare": "AAR_Healthcare", + "AAR Strategies Insurance": "Strategies_Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)": "BIMA_Mkononi", + "Britam Insurance Tanzania": "Britam_Insurance_Tanzania", + "Jubilee Insurance": "Jubilee_Insurance", + "Resolutions Insurance": "Resolutions_Insurance", + "Reliance Insurance": "Reliance_Insurance", + "Other": "Other_Health_Insurance_Type", + "None": "No_Health_Insurance" + }, + "v_required": { + "value": "true", + "err": "Tafadhali ingiza mtoa huduma wa bima" + } + }, + { + "key": "insurance_provider_other", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Health_Insurance_Type", + "type": "edit_text", + "hint": "Mtoa huduma mwingine wa bima ya afya", + "v_required": { + "value": "true", + "err": "Tafadhali bainisha mtoa huduma wa bima" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "insurance_provider_number", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Health_Insurance_Number", + "type": "edit_text", + "hint": "Namba ya bima ya afya ya mteja", + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba ya bima ya afya ya mteja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "wra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_calculation.yml" + } + } + } + }, + { + "key": "mra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_calculation.yml" + } + } + } + }, + { + "key": "preg_1yr", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "preg_1yr", + "type": "spinner", + "hint": "Je, mwanamke amejifungua katika mwaka 1 uliopita?", + "values": [ + "Ndio", + "Hapana" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua ikiwa mwanamke amejifungua katika mwaka 1 uliopita" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "disabilities", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabilities", + "type": "spinner", + "hint": "Ulemavu wa kimwili", + "values": [ + "Ndio ", + "Hapana" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + } + }, + { + "key": "type_of_disability", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Aina ya ulemavu", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Ulemavu wa kimwili", + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Ulemavu wa Uti wa Mgongo", + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Majeraha ya Kichwa - Ulemavu wa Ubongo", + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Ulemavu wa Maono", + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Ulemavu wa Kusikia", + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Ulemavu wa Utambuzi au Kujifunza", + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Matatizo ya Kisaikolojia", + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Ulemavu Usioonekana", + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Tafadhali chagua aina ya ulemavu wa kimwili" + } + }, + { + "key": "has_primary_caregiver", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "Has_Primary_Caregiver", + "type": "spinner", + "hint": "Je, una mlezi/msaidizi wa Tiba?", + "values": [ + "Ndio", + "Hapana" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + } + }, + { + "key": "primary_caregiver_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "Primary_Caregiver_Name", + "type": "edit_text", + "edit_type": "name", + "hint": "Jina la mlezi", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza jina sahihi" + }, + "v_required": { + "value": "true", + "err": "Tafadhali taja jina la mlezi." + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "other_phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_phone_number", + "type": "edit_text", + "hint": "Namba ya simu ya mlezi mkuu", + "v_numeric": { + "value": "true", + "err": "Namba lazima iwe jumla ya tarakimu 10 kwa urefu" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Namba lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "service_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "service_provider", + "type": "native_radio", + "label": "Kazi ya Mteja", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "chk_self_employed", + "text": "Amejiajiri", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_self_employed" + }, + { + "key": "chk_employed", + "text": "Ameajiriwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_employed" + }, + { + "key": "chk_unemployed", + "text": "Hajaajiriwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_unemployed" + }, + { + "key": "chk_farmer", + "text": "Mkulima", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_farmer" + }, + { + "key": "chk_traditional_healer", + "text": "Mtoa huduma ya Tiba Asili", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_traditional_healer" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua angalau moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "leader", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Community_Leader", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Una nafasi yoyote ya uongozi katika jamii?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_religious", + "text": "Kiongozi wa dini", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Religious_Leader" + }, + { + "key": "chk_traditional", + "text": "Kiongozi wa jadi", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Traditional_leader" + }, + { + "key": "chk_political", + "text": "Kiongozi wa kisiasa", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Political_leader" + }, + { + "key": "chk_influential", + "text": "Kiongozi mwenye ushawishi", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Influential_Leader" + }, + { + "key": "chk_other", + "text": "Nyingine", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Community_Leader_Type" + }, + { + "key": "chk_none", + "text": "Hakuna", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Not_a_Community_Leader" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua angalau moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "leader_other", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Community_Leader_Type_Name", + "type": "edit_text", + "hint": "Taja nafasi nyingine katika jamii", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali bainisha jukumu" + }, + "relevance": { + "step2:leader": { + "ex-checkbox": [ + { + "or": [ + "chk_other" + ] + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/all_clients_update_registration_info_form.json b/opensrp-chw-hf/src/main/assets/json.form-sw/all_clients_update_registration_info_form.json new file mode 100644 index 000000000..3af0f08bf --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/all_clients_update_registration_info_form.json @@ -0,0 +1,1301 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Family Registration", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Client details", + "fields": [ + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "type": "edit_text", + "read_only": true, + "hint": "Kitambulisho cha Kituoni", + "v_numeric": { + "value": "true", + "err": "Tafadhali Ingiza Kitambulisho" + }, + "v_required": { + "value": "true", + "err": "Tafadhali Ingiza Kitambulisho" + } + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "last_name", + "type": "edit_text", + "hint": "Jina la Ukoo", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza jina sahihi" + }, + "v_required": { + "value": "true", + "err": "Tafadhali ingiza Jina la Ukoo" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_calculation.yml" + } + } + } + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "Jina la Kwanza", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza Jina la Kwanza" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza jina sahihi" + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Jina la Kati", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali Ingiza jina sahihi" + }, + "v_required": { + "value": "true", + "err": "Tafadhali Ingiza Jina la Kati" + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "date_picker", + "hint": "Tarehe ya kuzaliwa", + "expanded": false, + "duration": { + "label": "Umri" + }, + "min_date": "today-120y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali Ingiza Tarehe ya kuzaliwa" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "age_calculated", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_calculation.yml" + } + } + } + }, + { + "key": "dob_unknown", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdateApprox", + "type": "check_box", + "label": "", + "options": [ + { + "key": "dob_unknown", + "text": "Tarehe ya kuzaliwa haijulikani", + "text_size": "18px", + "value": "false" + } + ] + }, + { + "key": "age", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "age", + "type": "edit_text", + "hint": "Umri", + "v_max_length": { + "value": "3", + "is_fixed_size": "true", + "err": "Please enter a valid age" + }, + "v_numeric_integer": { + "value": "true", + "err": "Must be a rounded number" + }, + "v_numeric": { + "value": "true", + "err": "lazima iwe namba kamili" + }, + "v_max": { + "value": "120", + "err": "Umri lazima uwe sawa au zaidi ya 120" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza umri" + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Jinsi", + "values": [ + "Me", + "Ke" + ], + "keys": [ + "Male", + "Female" + ], + "v_required": { + "value": "true", + "err": "Tafadhali ingiza jinsi ya mteja" + } + }, + { + "key": "marital_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "marital_status", + "type": "spinner", + "hint": "Hali ya Ndoa", + "values": [ + "Hajaoa/Hajaolewa", + "Ameoa/Ameolewa", + "Ameachwa", + "Mjane/Mgane", + "Kuishi pamoja bila ndoa" + ], + "keys": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "openmrs_choice_ids": { + "Single": "Single", + "Married": "Married", + "Divorced": "Divorced", + "Widowed": "Widowed", + "Cohabitation": "Cohabitation" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "phone_number", + "type": "edit_text", + "hint": "Namba ya simu", + "v_numeric": { + "value": "true", + "err": "namba lazima iwe na tarakimu 10" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Nambari lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." + } + }, + { + "key": "id_avail", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "id_avail", + "type": "check_box", + "label": "Je una vitambulisho kati ya hivi:", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_national_id", + "text": "Kitambulisho cha Taifa", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_national_id" + }, + { + "key": "chk_voters_id", + "text": "Kitambulisho cha Mpiga kura", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_voters_id" + }, + { + "key": "chk_drivers_license", + "text": "Leseni ya udereva", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_drivers_license" + }, + { + "key": "chk_passport_number", + "text": "kitambulisho cha kusafiria (Passport)", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_passport_number" + }, + { + "key": "chk_none", + "text": "Hakuna", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_none" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "national_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "National_ID", + "type": "mask_edit_text", + "mask": "########-#####-#####-##", + "mask_hint": "12345678912345678912", + "allowed_chars": "0123456789", + "hint": "Namba ya kitambulisho cha Taifa mfano: 12345678-91234-56789-12", + "edit_type": "number", + "v_max_length": { + "value": "23", + "is_fixed_size": "true", + "err": "Please enter a valid national id" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi" + }, + "v_regex": { + "value": "^\\d{8}-\\d{5}-\\d{5}-\\d{2}$", + "err": "Namba ya Kitambulisho cha Taifa inapaswa iwe hivi (XXXXXXXX-XXXXX-XXXXX-XX)" + }, + "relevance": { + "step1:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_national_id" + ] + } + ] + } + } + }, + { + "key": "voter_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Voter_Registration_Number", + "type": "mask_edit_text", + "mask": "T-####-####-###-#", + "mask_hint": "123456789123", + "allowed_chars": "0123456789", + "hint": "Namba ya kitambulisho cha mpiga kura mfano: T-1234-5678-912-3", + "edit_type": "number", + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid voters registration" + }, + "v_regex": { + "value": "^T-\\d{4}-\\d{4}-\\d{3}-\\d{1}$", + "err": "Namba ya mpiga kura inapaswa ijazwe hivi (T-XXXX-XXXX-XXX-X)" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi" + }, + "relevance": { + "step1:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_voters_id" + ] + } + ] + } + } + }, + { + "key": "driver_license", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Driver_License_Number", + "type": "mask_edit_text", + "mask": "##########", + "mask_hint": "1234567891", + "allowed_chars": "0123456789", + "hint": "Namba ya Leseni ya Udereva mfano: 1234567891", + "edit_type": "number", + "v_max_length": { + "value": "10", + "is_fixed_size": "true", + "err": "Please enter a valid drivers license number" + }, + "v_regex": { + "value": "^([0-9]{10})", + "err": "Namba ya leseni ya Udereva ijazwe hivi: (XXXXXXXXXX)" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi" + }, + "relevance": { + "step1:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_drivers_license" + ] + } + ] + } + } + }, + { + "key": "passport_number", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Passport", + "type": "mask_edit_text", + "mask": "TAE-###-###", + "mask_hint": "123456", + "allowed_chars": "0123456789", + "hint": "Passport namba e.g TAE-123-456", + "edit_type": "number", + "v_max_length": { + "value": "11", + "is_fixed_size": "true", + "err": "Tafadhali weka namba sahihi" + }, + "v_regex": { + "value": "^TAE-\\d{3}-\\d{3}$", + "err": "Namba ya kitambulisho cha kusafiria inapaswa ijazwe hivi (TAE-XXX-XXX)" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi" + }, + "relevance": { + "step1:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_passport_number" + ] + } + ] + } + } + }, + { + "key": "insurance_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Health_Insurance_Type", + "type": "spinner", + "hint": "Mtoa huduma za Bima ya Afya", + "values": [ + "Community Health Fund (CHF)/(iCHF)", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", + "Tiba Kwa Kadi (TIKA)", + "AAR Huduma ya Afya", + "Bima ya afya Strategies", + "Milvik Tanzania Ltd (BIMA Mkononi)", + "Bima ya afya ya Britam Tanzania", + "Bima ya afya Jubilee", + "Bima ya afya ya Resolutions", + "Bima ya afya ya Reliance", + "Nyingine", + "Hakuna" + ], + "keys": [ + "Community Health Fund (CHF)", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", + "Tiba Kwa Kadi (TIKA)", + "AAR Healthcare", + "Strategies Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)", + "Britam Insurance Tanzania", + "Jubilee Insurance", + "Resolutions Insurance", + "Reliance Insurance", + "Other", + "None" + ], + "openmrs_choice_ids": { + "Community Health Fund (CHF)": "Community_Health_Fund", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)": "National_Social_Security_Fund", + "National Health Insurance Fund (NHIF)": "National_Health_Insurance_Fund", + "Tiba Kwa Kadi (TIKA)": "Tiba_kwa_Kadi", + "AAR Healthcare": "AAR_Healthcare", + "AAR Strategies Insurance": "Strategies_Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)": "BIMA_Mkononi", + "Britam Insurance Tanzania": "Britam_Insurance_Tanzania", + "Jubilee Insurance": "Jubilee_Insurance", + "Resolutions Insurance": "Resolutions_Insurance", + "Reliance Insurance": "Reliance_Insurance", + "Other": "Other_Health_Insurance_Type", + "None": "No_Health_Insurance" + }, + "v_required": { + "value": "true", + "err": "Tafadhali ingiza mtoa huduma wa Bima za Afya" + } + }, + { + "key": "insurance_provider_other", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Health_Insurance_Type", + "type": "edit_text", + "hint": "Bima za Afya nyingine", + "v_required": { + "value": "true", + "err": "Tafadhali jaza jina la mtoa huduma wa Bima ya Afya" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "insurance_provider_number", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Health_Insurance_Number", + "type": "edit_text", + "hint": "Namba ya bima ya afya ya mteja", + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba ya bima ya afya ya mteja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "wra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_calculation.yml" + } + } + } + }, + { + "key": "mra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_calculation.yml" + } + } + } + }, + { + "key": "preg_1yr", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "preg_1yr", + "type": "spinner", + "hint": "Je Mama huyu amejifungua ndani ya mwaka mmoja uliopita?", + "values": [ + "Ndiyo", + "Hapana" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Je Mama huyu amejifungua ndani ya mwaka mmoja uliopita?" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "disabilities", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabilities", + "type": "spinner", + "hint": "Ulemavu wa Mwili", + "values": [ + "Ndiyo", + "Hapana" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + } + }, + { + "key": "type_of_disability", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Aina ya Ulemavu wa mwili", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Ulemavu wa Kimwili", + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Ulemavu wa Uti wa Mgongo", + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Ulemavu wa Akili", + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Ulemavu wa Macho", + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Ulemavu kwa kusikia", + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Ulemavu katika utambuzi au kujifunza", + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Matatizo ya Kisaikolojia", + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Ulemavu usioonekana", + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua aina ya Ulemavu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "has_primary_caregiver", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "has_primary_caregiver", + "type": "spinner", + "hint": "Je una msaidizi wa kimatatibu", + "values": [ + "Ndiyo", + "Hapana" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Chagua mojawapo:" + } + }, + { + "key": "primary_caregiver_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "Primary_Caregiver_Name", + "type": "edit_text", + "hint": "Jina la Msaidizi", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza jina sahihi" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza jina la Msaidizi" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "other_phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_phone_number", + "type": "edit_text", + "hint": "Namba ya simu ya msaidizi", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Namba lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "service_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "service_provider", + "type": "native_radio", + "label": "Kazi ya Mteja", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "chk_self_employed", + "text": "Amejiajiri", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_self_employed" + }, + { + "key": "chk_employed", + "text": "Ameajiriwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_employed" + }, + { + "key": "chk_unemployed", + "text": "Hajaajiriwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_unemployed" + }, + { + "key": "chk_farmer", + "text": "Mkulima", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_farmer" + }, + { + "key": "chk_traditional_healer", + "text": "Mtoa huduma ya Tiba Asili", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_traditional_healer" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "leader", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Community_Leader", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Je, ana uongozi wowote kwenye jamii?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_religious", + "text": "Kiongozi wa Dini", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Religious_Leader" + }, + { + "key": "chk_traditional", + "text": "Kiongozi wa Jadi", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Traditional_leader" + }, + { + "key": "chk_political", + "text": "Kiongozi wa Kisiasa", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Political_leader" + }, + { + "key": "chk_influential", + "text": "Mtu mwenye ushawishi katika jamii", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Influential_Leader" + }, + { + "key": "chk_other", + "text": "Nyingine", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Community_Leader_Type" + }, + { + "key": "chk_none", + "text": "Hakuna", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Not_a_Community_Leader" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "leader_other", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Community_Leader_Type_Name", + "type": "edit_text", + "hint": "Uongozi mwingine kwenye jamii", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali taja uongozi mwingine" + }, + "relevance": { + "step1:leader": { + "ex-checkbox": [ + { + "or": [ + "chk_other" + ] + } + ] + } + } + }, + { + "key": "reasons_for_registration", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Registration_Reason", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_calculation.yml" + } + } + } + }, + { + "key": "reasons_for_registration_male_15", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_registration_male_15", + "type": "check_box", + "label": "Sababu za usajili", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "hiv_aids", + "text": "Maambukizi ya VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_aids" + }, + { + "key": "tuberculosis", + "text": "Kifua Kikuu", + "openmrs_entity": "concept", + "openmrs_entity_id": "tuberculosis" + }, + { + "key": "homosexual", + "text": "Wanaume wanaofanya mapenzi na wanaume", + "openmrs_entity": "concept", + "openmrs_entity_id": "homosexual" + }, + { + "key": "gender_violence", + "text": "Unyanyasaji wa Kijinsia", + "openmrs_entity": "concept", + "openmrs_entity_id": "gender_violence" + }, + { + "key": "drug_abuse", + "text": "Matumizi mabaya ya dawa za kulevya", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_abuse" + }, + { + "key": "male_engagement", + "text": "Uwepo wa mwanaume husika", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_engagement" + } + ], + "v_required": { + "value": "true", + "err": "Sababu ya usajili inahitajika" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "reasons_for_registration_female_15", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_registration_female_15", + "type": "check_box", + "label": "Sababu za usajili", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "hiv_aids", + "text": "Maambukizi ya VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_aids" + }, + { + "key": "tuberculosis", + "text": "Kifua kikuu", + "openmrs_entity": "concept", + "openmrs_entity_id": "tuberculosis" + }, + { + "key": "sex_worker_woman", + "text": "Mfanyabiashara ya ngono", + "openmrs_entity": "concept", + "openmrs_entity_id": "sex_worker_woman" + }, + { + "key": "gender_violence", + "text": "Ukatili wa kijinsia", + "openmrs_entity": "concept", + "openmrs_entity_id": "gender_violence" + }, + { + "key": "drug_abuse", + "text": "Matumizi mabaya ya dawa za kulevya", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_abuse" + }, + { + "key": "pregnant_mother", + "text": "Mama mjamzito", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnant_mother" + }, + { + "key": "breastfeeding_mother", + "text": "Mama anayenyonyesha", + "openmrs_entity": "concept", + "openmrs_entity_id": "breastfeeding_mother" + } + ], + "v_required": { + "value": "true", + "err": "Sababu ya usajili inahitajika" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "reasons_for_registration_under_15", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_registration_under_15", + "type": "check_box", + "label": "Sababu za usajili", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "hiv_aids", + "text": "Maambukizi ya VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_aids" + }, + { + "key": "tuberculosis", + "text": "Kifua kikuu", + "openmrs_entity": "concept", + "openmrs_entity_id": "tuberculosis" + }, + { + "key": "hiv_infected_child", + "text": "Mtoto aliyezaliwa na mama mwenye VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_infected_child" + }, + { + "key": "untested_hiv_infected_child", + "text": "Mtoto ambaye hajapimwa VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "untested_hiv_infected_child" + }, + { + "key": "abused_child", + "text": "Unyanyasaji wa mtoto", + "openmrs_entity": "concept", + "openmrs_entity_id": "abused_child" + }, + { + "key": "gender_violence", + "text": "Unyanyasaji wa kijinsia", + "openmrs_entity": "concept", + "openmrs_entity_id": "gender_violence" + }, + { + "key": "drug_abuse", + "text": "Matumizi mabaya ya dawa za kulevya", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_abuse" + } + ], + "v_required": { + "value": "true", + "err": "Sababu ya usajili inahitajika" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "reasons_for_registration_female_under_10", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_registration_female_under_10", + "type": "check_box", + "label": "Sababu za usajili", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "hiv_aids", + "text": "Maambukizi ya VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_aids" + }, + { + "key": "tuberculosis", + "text": "Kifua kikuu", + "openmrs_entity": "concept", + "openmrs_entity_id": "tuberculosis" + }, + { + "key": "hiv_infected_child", + "text": "Mtoto aliyezaliwa na mama mwenye VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_infected_child" + }, + { + "key": "untested_hiv_infected_child", + "text": "Mtoto ambaye hajapimwa VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "untested_hiv_infected_child" + }, + { + "key": "abused_child", + "text": "Unyanyasaji wa mtoto", + "openmrs_entity": "concept", + "openmrs_entity_id": "abused_child" + }, + { + "key": "gender_violence", + "text": "Ukatili wa kijinsia", + "openmrs_entity": "concept", + "openmrs_entity_id": "gender_violence" + }, + { + "key": "drug_abuse", + "text": "Matumizi mabaya ya dawa za kulevya", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_abuse" + } + ], + "v_required": { + "value": "true", + "err": "Sababu ya usajili inahitajika" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "reasons_for_registration_female_10_to_15", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_registration_female_10_to_15", + "type": "check_box", + "label": "Sababu za usajili", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "hiv_aids", + "text": "Maambukizi ya VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_aids" + }, + { + "key": "tuberculosis", + "text": "Kifua kikuu", + "openmrs_entity": "concept", + "openmrs_entity_id": "tuberculosis" + }, + { + "key": "hiv_infected_child", + "text": "Mtoto aliyezaliwa na mama mwenye VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_infected_child" + }, + { + "key": "untested_hiv_infected_child", + "text": "Mtoto ambaye hajapimwa VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "untested_hiv_infected_child" + }, + { + "key": "abused_child", + "text": "Unyanyasaji wa mtoto", + "openmrs_entity": "concept", + "openmrs_entity_id": "abused_child" + }, + { + "key": "gender_violence", + "text": "Ukatili wa kijinsia", + "openmrs_entity": "concept", + "openmrs_entity_id": "gender_violence" + }, + { + "key": "drug_abuse", + "text": "Matumizi mabaya ya dawa za kulevya", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_abuse" + }, + { + "key": "pregnant_mother", + "text": "Mama mjamzito", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnant_mother" + }, + { + "key": "breastfeeding_mother", + "text": "Mama anayenyonyesha", + "openmrs_entity": "concept", + "openmrs_entity_id": "breastfeeding_mother" + } + ], + "v_required": { + "value": "true", + "err": "Sababu ya usajili inahitajika" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_counselling.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_counselling.json new file mode 100644 index 000000000..b4367d6ef --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_counselling.json @@ -0,0 +1,151 @@ +{ + "count": "1", + "encounter_type": "ANC Counselling", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Ushauri", + "fields": [ + { + "key": "given_counselling", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "given_counselling", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Chagua Ushauri uliyotolewa kwa mteja kwenye tembeleo hili", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ] + "options": [ + { + "key": "chk_sexual_relationship", + "text": "Uhusiano wa kimapenzi", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_sexual_relationship" + }, + { + "key": "chk_birth_emergency_plan", + "text": "Mpango wa kujifungua na wa dharura", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_birth_emergency_plan" + }, + { + "key": "chk_danger_signs", + "text": "Dalili hatarishi", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_danger_signs" + }, + { + "key": "chk_discussion_std_hiv", + "text": "Majadiliano juu ya STI/RTI/VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_discussion_std_hiv" + }, + { + "key": "chk_condom_use", + "text": "Maumizi ya kondomu", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_condom_use" + }, + { + "key": "chk_advice_gravid", + "text": "Ushauri juu ya usumbufu unaojitokeza wakati wa ujauzito", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_advice_gravid" + }, + { + "key": "chk_self_care", + "text": "Kujijali", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_self_care" + }, + { + "key": "chk_healthy_eating", + "text": "Lishe bora", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_healthy_eating" + }, + { + "key": "chk_physical_activity", + "text": "Shuguli za kimwili", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_physical_activity" + }, + { + "key": "chk_use_folic_acid", + "text": "Matumizi ya Madini Chuma (Iron) Foliki Asidi kila siku", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_use_folic_acid" + }, + { + "key": "chk_counsel_llin", + "text": "Utoaji na ushauri juu ya matumizi ya chandarua (LLIN)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_counsel_llin" + }, + { + "key": "chk_child_feeding", + "text": "Ulishaji wa mtoto", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_child_feeding" + }, + { + "key": "chk_none", + "text": "Ushauri haukutolewa", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_none" + } + ] + }, + { + "key": "counselling_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "counselling_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_danger_signs_outcome.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_danger_signs_outcome.json index e0c9f624c..70c5c3716 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_danger_signs_outcome.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_danger_signs_outcome.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -54,7 +49,7 @@ } }, "step1": { - "title": "Dalili za hatari wakati wa ujauzito", + "title": "Dalili za Hatari (ANC)", "fields": [ { "key": "anc_danger_signs_visitdate", @@ -92,12 +87,12 @@ "type": "hidden" }, { - "key": "anc_key_info", + "key": "anc_key_info_swahili", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "anc_key_info", + "openmrs_entity_id": "anc_key_info_swahili", "type": "toaster_notes", - "text": "Maelezo muhimu kwa kituo cha afya:\nSiku ya mwisho ya hedhi (LNMP): \nUmri wa mimba (GA): {gest_age}\nTarehe kwa kutarijia kujifungua (EDD): {edd}", + "text": "Taarifa muhimu kwa kituo cha afya: Kipindi cha mwisho cha kawaida cha hedhi: (LNMP) Umri wa ujauzito: {gest_age} EDD: {edd}", "toaster_type": "info", "calculation": { "rules-engine": { @@ -111,76 +106,65 @@ "key": "danger_signs_present", "type": "check_box", "openmrs_entity": "concept", - "openmrs_entity_id": "160939AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "danger_signs_present", "openmrs_entity_parent": "", - "label": "Je, mama alikuwa na dalili yoyote ya hatari ", + "label": "Mwanamke huyo alikuwa na dalili gani hatarishi?", "combine_checkbox_option_values": "true", "options": [ { "key": "Fever", - "openmrs_choice_id": "140238AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Homa", - "value": false + "openmrs_choice_id": "Fever", + "text": "Homa" }, { "key": "Bleeding_vaginally", - "openmrs_choice_id": "150802AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Damu kutoka ukeni", - "value": false + "openmrs_choice_id": "Bleeding_vaginally", + "text": "Kutokwa na damu ukeni" }, { "key": "Severe_headache", - "openmrs_choice_id": "139081AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Maumivu ya kichwa", - "value": false + "openmrs_choice_id": "Severe_headache", + "text": "Maumivu makali ya kichwa" }, { "key": "Convulsions", - "openmrs_choice_id": "164483AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Degedege", - "value": false + "openmrs_choice_id": "Convulsions", + "text": "degedege" }, { "key": "Difficulty_breathing", - "openmrs_choice_id": "142373AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Kushindwa kupumua", - "value": false + "openmrs_choice_id": "Difficulty_breathing", + "text": "Kupumua kwa shida" }, { "key": "Severe_abdominal_pain", - "openmrs_choice_id": "165271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Maumivu makali ya tumbo", - "value": false + "openmrs_choice_id": "Severe_abdominal_pain", + "text": "Maumivu makali ya tumbo" }, { "key": "Swelling_of_the_face_and/or_hands", - "openmrs_choice_id": "460AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Kuvimba uso na / au mikono", - "value": false + "openmrs_choice_id": "Swelling_of_the_face_and", + "text": "Kuvimba kwa uso na/au mikono" }, { "key": "Discoloured_or_watery_liquid_vaginal_discharge_with_a_bad_smell", - "openmrs_choice_id": "123395AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Kutoka uchafu / majimaji ukeni yenye harufu mbaya", - "value": false + "openmrs_choice_id": "Discoloured_or_watery_liquid_vaginal_discharge_with_a_bad_smell", + "text": "Kutowa na majimaji yenye rangirangi na harufu mbaya ukeni" }, { "key": "No_movement_unusual_movement_for_a_child_in_the_womb", - "openmrs_choice_id": "113377AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Kutocheza / kucheza kusiko kwa kawaida kwa mtoto aliye tumboni", - "value": false + "openmrs_choice_id": "No_movement_unusual_movement_for_a_child_in_the_womb", + "text": "Hakuna uchezaji/uchezaji usiyo wa kawaida wa mtoto tumboni" }, { "key": "Other", - "openmrs_choice_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Nyingine", - "value": false + "openmrs_choice_id": "Other", + "text": "Nyingine" }, { "key": "None", - "openmrs_choice_id": "", - "text": "None", - "value": false + "openmrs_choice_id": "None", + "text": "Hakuna" } ], "exclusive": [ @@ -188,17 +172,17 @@ ], "v_required": { "value": "true", - "err": "Tafadhali chagua ishara ya hatari" + "err": "Tafadhali chagua dalili hatarishi" } }, { "key": "other_anc_danger_signs", "type": "edit_text", "openmrs_entity": "concept", - "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "other_anc_danger_signs", "openmrs_entity_parent": "", "edit_type": "name", - "hint": "Dalili nyinginezo za hatari", + "hint": "Dalili hatarishi nyingine", "relevance": { "rules-engine": { "ex-rules": { @@ -208,37 +192,37 @@ }, "v_required": { "value": "true", - "err": "Tafadhali ingiza dalili nyinginezo za hatari" + "err": "Tafadhali ingiza dalili hatarishi nyingine" } }, { "key": "action_taken_anc_danger_signs", "type": "native_radio", "openmrs_entity": "concept", - "openmrs_entity_id": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "action_taken_anc_danger_signs", "openmrs_entity_parent": "", - "label": "Hatua zilizochukuliwa na kituo cha kutolea huduma", + "label": "Hatua zilizochukuliwa na Kituo cha Afya", "options": [ { "key": "No_action_taken", "openmrs_entity": "", - "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "No_action_taken", "openmrs_entity_parent": "", - "text": "Hakuna hatua zilizochukuliwa" + "text": "Hakuna hatua iliyochukuliwa" }, { "key": "Managed", "openmrs_entity": "", - "openmrs_entity_id": "1692AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "Managed", "openmrs_entity_parent": "", - "text": "Amefukuza" + "text": "Zinasimamiwa" }, { "key": "Referred", "openmrs_entity": "", - "openmrs_entity_id": "1648AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "Referred", "openmrs_entity_parent": "", - "text": "Amepewa rufaa" + "text": "Kutoa rufaa" } ], "v_required": { @@ -252,21 +236,21 @@ "openmrs_entity": "concept", "openmrs_entity_id": "status_visit", "openmrs_entity_parent": "", - "label": "Hali ya mama / mtoto", + "label": "Hali ya mama/mtoto", "options": [ { "key": "Discharged", "openmrs_entity": "", - "openmrs_entity_id": "1654AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "Discharged", "openmrs_entity_parent": "", - "text": "Amelazwa" + "text": "Wameruhusiwa kutoka hospitali" }, { "key": "Died", "openmrs_entity": "", - "openmrs_entity_id": "159AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "Died", "openmrs_entity_parent": "", - "text": "Amekufa" + "text": "Wamefariki" } ], "relevance": { @@ -278,7 +262,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali chagua hali ya mama / mtoto" + "err": "Tafadhali ingiza hali ya mama/mtoto" } }, { @@ -288,7 +272,7 @@ "openmrs_entity_id": "managed_signs", "openmrs_entity_parent": "", "edit_type": "name", - "hint": "Kituo cha kutolea huduma kilimuhudumiaje mama?", + "hint": "Je, kituo cha afya kilisimamia vipi hali ya mama?", "relevance": { "rules-engine": { "ex-rules": { @@ -298,7 +282,7 @@ }, "v_required": { "value": "false", - "err": null + "err": "null" } }, { @@ -308,12 +292,12 @@ "openmrs_entity_id": "comment_anc_danger_signs", "openmrs_entity_parent": "", "edit_type": "name", - "hint": "Toa maoni", + "hint": "Maoni", "v_required": { "value": "false", - "err": null + "err": "null" } } ] } -} +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_baseline_investigation.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_baseline_investigation.json new file mode 100644 index 000000000..1448f005b --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_baseline_investigation.json @@ -0,0 +1,1321 @@ +{ + "count": "1", + "encounter_type": "Baseline Investigation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Uchunguzi wa Vipimo vya Awali", + "fields": [ + { + "key": "glucose_in_urine", + "type": "native_radio", + "label": "Sukari kwenye mkojo", + "openmrs_entity": "concept", + "openmrs_entity_id": "glucose_in_urine", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha sukari kwenye mkojo haijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "prompt_for_glucose_in_urine", + "type": "toaster_notes", + "text": "Angalia kiasi cha sukari katika damu ili kumuepusha Mteja na Ugonjwa wa kisukari wakati wa Ujauzito", + "openmrs_entity_id": "prompt_for_glucose_in_urine", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:glucose_in_urine": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_glucose_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_glucose_in_urine_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha sukari kwenye mkojo", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu moja" + }, + "relevance": { + "step1:glucose_in_urine": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_glucose_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_glucose_in_urine_test", + "type": "edit_text", + "hint": "Bainisha sabau zingine za kutofanya kipimo cha sukari kwenye mkojo", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_glucose_in_urine_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "protein_in_urine", + "type": "native_radio", + "label": "Protini kwenye mkojo", + "openmrs_entity": "concept", + "openmrs_entity_id": "protein_in_urine", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha protini kwenye mkojo haijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "prompt_for_protein_in_urine", + "type": "toaster_notes", + "text": "Tafadhali fuatilia shinikizo la damu kwa Mteja ili uweze kuepusha na hatari ya Kifafa cha mimba, bainisha dalili za UTI dhibiti viashiria vya Proteinuria kulingana na mwongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_protein_in_urine", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:protein_in_urine": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_protein_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_protein_in_urine_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha protini kwenye mkojo ", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu moja" + }, + "relevance": { + "step1:protein_in_urine": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_protein_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_protein_in_urine_test", + "type": "edit_text", + "hint": "Bainisha sababu zingine za kutofanya kipimo chs protini kwenye mkojo", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu " + }, + "relevance": { + "step1:reason_for_not_conducting_protein_in_urine_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "blood_group", + "type": "spinner", + "hint": "Kundi la damu", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_group", + "openmrs_entity_parent": "", + "values": [ + "A", + "B", + "AB", + "O", + "Kipimo cha kundi la damu haijafanyika" + ], + "keys": [ + "A", + "B", + "AB", + "O", + "test_not_conducted" + ], + "openmrs_choice_ids": { + "A": "A", + "B": "B", + "AB": "AB", + "O": "O", + "test_not_conducted": "test_not_conducted" + } + }, + { + "key": "reason_for_not_conducting_blood_group_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_blood_group_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha kundi la damu", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja amekataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_are_out_of_stock": "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:blood_group": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_blood_group_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_blood_group_test", + "type": "edit_text", + "hint": "Bainisha sababu zingine za kutofanya kipimo cha kundi la damu", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_blood_group_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "rh_factor", + "type": "native_radio", + "label": "Rh", + "openmrs_entity": "concept", + "openmrs_entity_id": "rh_factor", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_rh_factor", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:rh_factor": { + "type": "string", + "ex": "equalTo(., \"negative\")" + } + } + }, + { + "key": "hb_level_test", + "type": "native_radio", + "label": "Kipimo cha kiwango cha damu (Hb)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "test_conducted", + "text": "Kipimo cha kiwango cha damu (Hb) kimefanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted", + "openmrs_entity_parent": "" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha kiwango cha damu (Hb) hakijafanyika", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "hb_level", + "type": "edit_text", + "hint": "Kiwango cha HB (g/dl)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza kiwango cha HB" + }, + "v_min": { + "value": "0", + "err": "Kiwango cha HB lazima kiwe sawasawa na au zaidi ya 0 (g/dl)" + }, + "v_max": { + "value": "20", + "err": "Kiwango cha HB lazima kiwe sawasawa na au chini ya 20 (g/dl)" + }, + "v_required": { + "value": "true", + "err": "Tafadhali ingiza kiwango cha HB" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_conducted\")" + } + } + }, + { + "key": "prompt_for_severe_anaemia_treatment", + "type": "toaster_notes", + "text": "Dhibiti hali hii ya upungufu mkubwa wa damu kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_severe_anaemia_treatment", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hb_level": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"8.5\")" + } + } + }, + { + "key": "prompt_for_moderate_anaemia_management", + "type": "toaster_notes", + "text": "Dhibiti hali hii ya ukosefu wa damu kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_moderate_anaemia_management", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hb_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha kiwango cha HB ", + "values": [ + "Cuvette Cartridges Hazipo Kituoni", + "Mashine ya Kupimwa wingi wa damu (Haemoque) haifanyi kazi", + "Mteja alikuwa katika hali ya dharura", + "Mteja amekataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "stock_out_of_cuvettes_cartridges": "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order": "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_hb_test_not_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_hb_test_not_conducted", + "type": "edit_text", + "hint": "Bainisha sababu zingine za kutofanya kipimo cha kiwango cha HB", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_hb_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "blood_for_glucose_test", + "type": "native_radio", + "label": "Kipimo cha sukari kwenye damu", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_for_glucose_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "test_conducted", + "text": "Kipimo cha sukari kwenye damu kimefanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted", + "openmrs_entity_parent": "" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha sukari kwenye damu hakijafanyika", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "type_of_blood_for_glucose_test", + "type": "native_radio", + "label": "Aina ya kipimo cha sukari kwenye damu kilichofanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_blood_for_glucose_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "rbg", + "text": "Kipimo cha wingi wa sukari mwilini (rbg)", + "openmrs_entity": "concept", + "openmrs_entity_id": "rbg", + "openmrs_entity_parent": "" + }, + { + "key": "gtt", + "text": "Kipimo cha kugundua jinsi sukari mwilini inavyoratibiwa (GTT)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gtt" + }, + { + "key": "fbg", + "text": "Kipimo cha sukari (asubuhi) kabla ya kula chochote", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fbg" + } + ], + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "step1:blood_for_glucose_test": { + "type": "string", + "ex": "equalTo(., \"test_conducted\")" + } + } + }, + { + "key": "blood_for_glucose", + "type": "edit_text", + "hint": "Sukari kwenye damu (mmol/L)", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_for_glucose", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza kiwango cha sukari kwenye damu (mmol/L)" + }, + "v_min": { + "value": "0", + "err": "Kiwango cha sukari kwenye damu lazima iwe sawasawa au zaidi ya 0 (mmol/L)" + }, + "v_max": { + "value": "45", + "err": "Kiwango cha sukari kwenye damu lazima iwe sawasawa au chini ya 45 (mmol/L)" + }, + "v_required": { + "value": "true", + "err": "Tafadhali ingiza kiwango cha sukari kwenye damu (mmol/L)" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_gestational_diabetes_mellitus", + "type": "toaster_notes", + "text": "Dhibiti hali hii ya Gestational diabetes mellitus kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_gestational_diabetes_mellitus", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_hypoglycaemia", + "type": "toaster_notes", + "text": "Dhibiti hali hii ya hypoglycaemia kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_hypoglycaemia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_blood_glucose_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_blood_glucose_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha sukari kwenye damu", + "values": [ + "Vifaa vya kupimia vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_are_out_of_stock": "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:blood_for_glucose_test": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_blood_glucose_test_not_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_blood_glucose_test_not_conducted", + "type": "edit_text", + "hint": "Bainisha sababu zingine za kutofanya kipimo cha sukari kwenye damu", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_blood_glucose_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "hiv", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_calculation.yml" + } + } + } + }, + { + "key": "hiv_qn", + "type": "native_radio", + "label": "Matokeo ya kipimo cha VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_qn", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha VVU hakijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hiv_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha VVU", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupima", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:hiv_qn": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_hiv_test", + "type": "edit_text", + "hint": "Bainisha sababu zingine za kutofanya kipimo cha VVU", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_hiv_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "register_pmtct", + "type": "toaster_notes", + "text": "Msajili Mteja kwenye PMTCT kwa ajili ya matunzo na ufuatiliaji", + "openmrs_entity_id": "register_pmtct", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hiv_qn": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "prescribe_arv", + "type": "toaster_notes", + "text": "Mpatie Mteja dawa za kufubaza virusi vya Ukimwi (ARV) kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prescribe_arv", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hiv_qn": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "hiv_counselling_before_testing", + "type": "native_radio", + "label": "Je, Mteja alipewa ushauri nasaha kabla ya kupima VVU?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_counselling_before_testing", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "hiv_counselling_after_testing", + "type": "native_radio", + "label": "Je, Mteja alipewa ushauri nasaha baada ya kupima VVU?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_counselling_after_testing", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "syphilis", + "type": "native_radio", + "label": "Matokeo ya kipimo cha Kaswende", + "openmrs_entity": "concept", + "openmrs_entity_id": "syphilis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha kaswende hakijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "prescribe_anti_sy", + "type": "toaster_notes", + "text": "Muagizie mteja dawa za antibiotiki (Kiuavijasumu)", + "openmrs_entity_id": "prescribe_anti_sy", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:syphilis": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_syphilis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_syphilis_test", + "type": "spinner", + "hint": "Sababu za kutofanya kipimo cha kaswende", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikkuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:syphilis": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_syphilis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_syphilis_test", + "type": "edit_text", + "hint": "Bainisha sababu zingine za kutofanya kipimo cha kaswende", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_syphilis_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "syphilis_treatment", + "type": "native_radio", + "label": "Je, matibabu ya Kaswende yalitolewa?", + "openmrs_entity": "concept", + "openmrs_entity_id": "syphilis_treatment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "step1:syphilis": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "hepatitis", + "type": "native_radio", + "label": "Matokeo ya kipimo cha homa ya ini", + "openmrs_entity": "concept", + "openmrs_entity_id": "hepatitis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha homa ya ini hakijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "prescribe_arv_hepb_at_above_twenty_eight", + "type": "toaster_notes", + "text": "Mpatie Mteja dawa za kufubaza virusi vya Ukimwi (ARV) kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prescribe_arv_hepb_at_above_twenty_eight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "counsel_arv_hepb_below_twenty_eight", + "type": "toaster_notes", + "text": "Toa ushauri kwa Mama mwenye ujauzito wa wiki 28 kuhusiana na matumizi ya dawa za kufubaza virusi vya Ukimwi (ARV)", + "openmrs_entity_id": "counsel_arv_hepb_below_twenty_eight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hepatitis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hepatitis_test", + "type": "spinner", + "hint": "Sababu za kutofanya kipimo cha homa ya ini", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:hepatitis": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_hepatitis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_hepatitis_test", + "type": "edit_text", + "hint": "Sababu zingine za kutofanya kipimo cha homa ya ini", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu " + }, + "relevance": { + "step1:reason_for_not_conducting_hepatitis_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "other_stds", + "type": "native_radio", + "label": "Je, Mteja anajulikana kuwa na magonjwa mengine ya ngono?", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_stds", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ] + }, + { + "key": "other_stds_treatment", + "type": "native_radio", + "label": "Je, matibabu yalitolewa kwa magonjwa mengine ya ngono?", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_stds_treatment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "step1:other_stds": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "reason_for_not_giving_medication_for_other_stds", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_medication_for_other_stds", + "type": "spinner", + "hint": "Sababu kwa nini matibabu hayakutolewa", + "values": [ + "Dawa zimeisha", + "Mteja amekataa kuchukua dawa", + "Anamzio na dawa (Allegy)", + "Nyingine" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:other_stds_treatment": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "other_reason_for_not_giving_medication_for_other_stds", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_giving_medication_for_other_stds", + "type": "edit_text", + "hint": "Bainisha sababu zingine za kutokutoa matibabu", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_for_not_giving_medication_for_other_stds": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "date_anc_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "date_anc_hiv_test", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_calculation.yml" + } + } + } + }, + { + "key": "hiv_test_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_number", + "type": "hidden" + }, + { + "key": "hiv_test_at_32", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_at_32", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_calculation.yml" + } + } + } + }, + { + "key": "baseline_investigation_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "baseline_investigation_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_malaria_investigation_form.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_malaria_investigation_form.json new file mode 100644 index 000000000..cef645f82 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_malaria_investigation_form.json @@ -0,0 +1,371 @@ +{ + "count": "1", + "encounter_type": "Malaria Investigation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": { + "llin_provided": false + }, + "step1": { + "title": "Uchunguzi wa Malaria", + "fields": [ + { + "key": "client_on_malaria_medication", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_on_malaria_medication", + "type": "native_radio", + "label": "Je, Mteja anatumia dawa za Malaria?", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "mRDT_for_malaria", + "type": "native_radio", + "label": "Majibu ya kipimo cha Malaria", + "openmrs_entity": "concept", + "openmrs_entity_id": "mRDT_for_malaria", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha Malaria hakijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "step1:client_on_malaria_medication": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + }, + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_mRDT", + "type": "toaster_notes", + "text": "Mpatie dawa za malaria na tibu kulingana na muongozo", + "openmrs_entity_id": "prompt_for_mRDT", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:mRDT_for_malaria": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_malaria_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_malaria_test", + "type": "spinner", + "hint": "Sababu ya kipimo cha malaria kutokufanyika", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:mRDT_for_malaria": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_malaria_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_malaria_test", + "type": "edit_text", + "hint": "Elezea sababu ya Kutokufanyika kwa kipimo cha Malaria", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_malaria_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "malaria_preventive_therapy", + "type": "hidden", + "openmrs_entity_id": "malaria_preventive_therapy", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_malaria_investigation_calculation.yml" + } + } + } + }, + { + "key": "malaria_preventive_therapy_ipt1", + "type": "native_radio", + "openmrs_entity_id": "malaria_preventive_therapy_ipt1", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Dawa za kinga za malaria", + "options": [ + { + "key": "ipt1", + "text": "IPT1", + "openmrs_entity_id": "ipt1", + "openmrs_entity": "concept" + }, + { + "key": "medication_not_given", + "text": "Hajapewa dawa za Malaria", + "openmrs_entity_id": "medication_not_given", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Chagua dawa kwa ajili ya kinga ya malaria" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_giving_malaria_medication", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_malaria_medication", + "type": "spinner", + "hint": "Sababu ya kutokupewa dawa za Malaria", + "values": [ + "Bidhaa zimeisha", + "Mteja amekataa kuchukua dawa", + "Anamzio na dawa (Allegy)", + "Nyingine (Bainisha)" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "other_reason_malaria_medication_not_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_malaria_medication_not_given", + "type": "edit_text", + "hint": "Elezea sababu ya mteja kutokupewa dawa za kujikinga na Malaria", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_for_not_giving_malaria_medication": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "llin_provision", + "type": "native_radio", + "openmrs_entity_id": "llin_provision", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Je, Mteja alipewa LLINs (vyandarua vya muda mrefu)?", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "reason_for_not_providing_llin", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_llin", + "type": "spinner", + "hint": "Sababu ya mteja kutokupewa chandarua cha muda mrefu (LLINs)", + "values": [ + "Bidhaa zimeisha", + "Mteja alikataa", + "Nyingine (Bainisha)" + ], + "keys": [ + "out_of_stock", + "the_client_refused", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "the_client_refused": "the_client_refused", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:llin_provision": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_llin_not_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_llin_not_given", + "type": "edit_text", + "hint": "Elezea sababu ya mteja kutokupewa chandarua cha muda mrefu (LLINs)", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_for_not_providing_llin": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "malaria_investigation_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "malaria_investigation_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_medical_and_surgical_history.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_medical_and_surgical_history.json new file mode 100644 index 000000000..7804b8d21 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_medical_and_surgical_history.json @@ -0,0 +1,476 @@ +{ + "count": "1", + "encounter_type": "Medical and Surgical History", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Historia ya Matibabu na Upasuaji", + "fields": [ + { + "key": "medical_surgical_history", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "medical_surgical_history", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Historia yoyote ya Matibabu na upasuaji ya Mgonjwa?", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "diabetes_mellitus", + "text": "Kisukari", + "openmrs_entity": "concept", + "openmrs_entity_id": "diabetes_mellitus" + }, + { + "key": "sickle_cell_disease", + "text": "Ugonjwa wa Seli mundu", + "openmrs_entity": "concept", + "openmrs_entity_id": "sickle_cell_disease" + }, + { + "key": "heart_diseases", + "text": "Magonjwa ya moyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "heart_diseases" + }, + { + "key": "thyroid_diseases", + "text": "Magonjwa ya tezi", + "openmrs_entity": "concept", + "openmrs_entity_id": "thyroid_diseases" + }, + { + "key": "blood_transfusion", + "text": "Kuongezewa damu", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_transfusion" + }, + { + "key": "known_on_art", + "text": "Mteja yupo kwenye ART tayari", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_on_art" + }, + { + "key": "epilepsy", + "text": "Kifafa", + "openmrs_entity": "concept", + "openmrs_entity_id": "epilepsy" + }, + { + "key": "previous_c_s", + "text": "Kujifungua kwa upasuaji", + "openmrs_entity": "concept", + "openmrs_entity_id": "previous_c_s" + }, + { + "key": "myomectomy", + "text": "Myomectomy", + "openmrs_entity": "concept", + "openmrs_entity_id": "myomectomy" + }, + { + "key": "third_degree_tear", + "text": "Kuchanika msamba hatua ya tatu", + "openmrs_entity": "concept", + "openmrs_entity_id": "third_degree_tear" + }, + { + "key": "repaired_fistula", + "text": "Fistula iliyotibiwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "repaired_fistula" + }, + { + "key": "female_genital_mutilation", + "text": "Tohara kwa wanawake", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_genital_mutilation" + }, + { + "key": "closely_spaced_pregnancy", + "text": "Mimba zilizokaribiana (chini ya miaka miwili)", + "openmrs_entity": "concept", + "openmrs_entity_id": "closely_spaced_pregnancy" + }, + { + "key": "pregnant_more_than_four", + "text": "Kuwa mjamzito mara nne au zaidi", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnant_more_than_four" + }, + { + "key": "hx_hemorrhage", + "text": "Historia ya kutokwa damu nyingi baada ya kujifungua", + "openmrs_entity": "concept", + "openmrs_entity_id": "hx_hemorrhage" + }, + { + "key": "history_of_high_blood_pressure", + "text": "Historia ya shinikizo la damu", + "openmrs_entity": "concept", + "openmrs_entity_id": "history_of_high_blood_pressure" + }, + { + "key": "anaemia", + "text": "Ugonjwa wa upungufu wa damu", + "openmrs_entity": "concept", + "openmrs_entity_id": "anaemia" + }, + { + "key": "difficult_delivery", + "text": "Kuzalishwa kwa kuvutwa na kifaa au kuongezewa njia (Vacuum, episiotomy)", + "openmrs_entity": "concept", + "openmrs_entity_id": "difficult_delivery" + }, + { + "key": "hx_abortions", + "text": "Historia ya kuharibika kwa mimba", + "openmrs_entity": "concept", + "openmrs_entity_id": "hx_abortions" + }, + { + "key": "other", + "text": "Others (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ] + }, + { + "key": "other_medical_surgical_history", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_medical_surgical_history", + "type": "edit_text", + "hint": "Specify other medical and surgical history", + "v_required": { + "value": "true", + "err": "Please specify the other medical surgical history" + }, + "relevance": { + "step1:medical_surgical_history": { + "ex-checkbox": [ + { + "or": [ + "other" + ] + } + ] + } + } + }, + { + "key": "ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "Namba ya CTC", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "Namba ya CTC inatakiwa kuwa (XX-XX-XXXX-XXXXXX)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Tafadhali jaza namba ya CTC ya mteja" + }, + "v_required": { + "value": true, + "err": "Tafadhali jaza namba ya CTC ya mteja" + }, + "relevance": { + "step1:medical_surgical_history": { + "ex-checkbox": [ + { + "or": [ + "known_on_art" + ] + } + ] + } + } + }, + { + "key": "gravida", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "gravida", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_calculation.yml" + } + } + } + }, + { + "key": "parity", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "parity", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_calculation.yml" + } + } + } + }, + { + "key": "no_surv_children", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_surv_children", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_calculation.yml" + } + } + } + }, + { + "key": "gravida_read_only", + "type": "edit_text", + "read_only": "true", + "hint": "Idadi ya ujauzito (Gravida)", + "openmrs_entity": "concept", + "openmrs_entity_id": "gravida_read_only", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_relevance.yml" + } + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_calculation.yml" + } + } + } + }, + { + "key": "parity_read_only", + "type": "edit_text", + "read_only": "true", + "hint": "Idadi ya mimba zilizofikia wiki 24 au zaidi (Parity)", + "openmrs_entity": "concept", + "openmrs_entity_id": "parity_read_only", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_relevance.yml" + } + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_calculation.yml" + } + } + } + }, + { + "key": "no_surv_children_read_only", + "type": "edit_text", + "read_only": "true", + "hint": "Idadi ya watoto walio hai", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_surv_children_read_only", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_relevance.yml" + } + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_calculation.yml" + } + } + } + }, + { + "key": "gravida_text", + "type": "edit_text", + "hint": "Idadi ya ujauzito (Gravida)", + "openmrs_entity": "concept", + "openmrs_entity_id": "gravida_text", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza idadi ya ujauzito" + }, + "v_max": { + "value": "35", + "err": "Idadi ya ujauzito lazima iwe sawa au chini ya 35" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "parity_text", + "type": "edit_text", + "hint": "Idadi ya mimba zilizofikia wiki 24 au zaidi (Parity)", + "openmrs_entity": "concept", + "openmrs_entity_id": "parity_text", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza namba halali" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:gravida_text)", + "err": "Namba lazima iwe chini ya idadi ya ujauzito" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_grand_multiparity", + "type": "toaster_notes", + "text": "Toa ushauri juu ya hatari ya kuchanika mfuko wa uzazi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_relevance.yml" + } + } + } + }, + { + "key": "no_surv_children_text", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_surv_children_text", + "type": "edit_text", + "edit_type": "number", + "hint": "Idadi ya watoto walio hai", + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_relevance.yml" + } + } + } + }, + { + "key": "known_on_art", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_on_art", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_calculation.yml" + } + } + } + }, + { + "key": "visit_number", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "openmrs_entity_parent": "", + "value": 1 + }, + { + "key": "medical_surgical_history_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "medical_surgical_history_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_obstetric_examination.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_obstetric_examination.json new file mode 100644 index 000000000..3d7052173 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_obstetric_examination.json @@ -0,0 +1,730 @@ +{ + "count": "1", + "encounter_type": "Obstetric Examination", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Uchunguzi wa Uzazi", + "fields": [ + { + "key": "gest_age", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gest_age", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_calculation.yml" + } + } + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Uzito (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza uzito" + }, + "v_min": { + "value": "20", + "err": "Uzito lazima uwe sawasawa au zaidi ya 20 (KG)" + }, + "v_max": { + "value": "300", + "err": "Uzito lazima uwe sawasawa au chini ya 300 (KG)" + } + }, + { + "key": "height", + "type": "edit_text", + "hint": "Urefu (CM)", + "openmrs_entity": "concept", + "openmrs_entity_id": "height", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza urefu" + }, + "v_min": { + "value": "60", + "err": "Urefu lazima uwe sawasawa au zaidi ya 60 (CM)" + }, + "v_max": { + "value": "200", + "err": "Urefu lazima uwe sawasawa au chini ya 200 (CM)" + } + }, + { + "key": "prompt_for_short_stature", + "type": "toaster_notes", + "text": "Mshauri mteja kujifungua kwenye Kituo cha Afya kutokana na hatari kubwa ya kupata uchungu pingamizi", + "openmrs_entity_id": "prompt_for_short_stature", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:height": { + "type": "numeric", + "ex": "lessThan(.,\"145\")" + } + } + }, + { + "key": "bmi", + "type": "edit_text", + "hint": "Kielezo cha Uzito wa Mwili (BMI)", + "read_only": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "bmi", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza urefu" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza urefu" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_underweight", + "type": "toaster_notes", + "text": "Mshauri Mteja kuhusiana na hali yake ya uzito mdogo kulingana na muongozo kutoka Wizara ya Afya", + "openmrs_entity_id": "prompt_for_underweight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:bmi": { + "type": "numeric", + "ex": "lessThan(.,\"18.5\")" + } + } + }, + { + "key": "prompt_for_overweight", + "type": "toaster_notes", + "text": "Mshauri Mteja kuhusiana na hali yake ya uzito mkubwa kulingana na muongozo kutoka Wizara ya Afya", + "openmrs_entity_id": "prompt_for_overweight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:bmi": { + "type": "numeric", + "ex": "greaterThanEqualTo(.,\"29\")" + } + } + }, + { + "key": "systolic", + "type": "edit_text", + "hint": "Systolic (Shinikizo la Damu)", + "openmrs_entity_id": "systolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza thamani ya systolic " + }, + "v_min": { + "value": "0", + "err": "Thamani ya systolic lazima iwe sawasawa au zaidi ya 0" + }, + "v_max": { + "value": "320", + "err": "Thamani ya systolic lazima iwe sawasawa au chini ya 320" + } + }, + { + "key": "diastolic", + "type": "edit_text", + "hint": "Diastolic (Shinikizo la Damu)", + "openmrs_entity_id": "diastolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza thamani ya diastolic" + }, + "v_min": { + "value": "0", + "err": "Thamani ya diastolic lazima iwe sawasawa au zaidi ya 0" + }, + "v_max": { + "value": "200", + "err": "Thamani ya diastolic lazima iwe sawasawa au chini ya 200" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:systolic)", + "err": "Thamani ya diastolic lazima iwe chini ya thamani ya systolic" + } + ] + }, + { + "key": "prompt_for_management_of_hypertension", + "type": "toaster_notes", + "text": "Dhibiti hali hii ya Shinikizo la damu ya juu kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_management_of_hypertension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_management_of_hypotension", + "type": "toaster_notes", + "text": "Bainisha sababu za Shinikizo la damu ya chini na udhibiti kulingana na muongozo kutoka Wizara ya Afya", + "openmrs_entity_id": "prompt_for_management_of_hypotension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "pulse_rate", + "type": "edit_text", + "hint": "Kiwango cha Mapigo ya moyo (midundo kwa dakika moja)", + "openmrs_entity_id": "pulse_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza kiwango cha mapigo ya moyo " + }, + "v_min": { + "value": "0", + "err": "Kiwango cha mapigo ya moyo lazima kiwe sawasawa au zaidi ya 0 (bpm)" + }, + "v_max": { + "value": "200", + "err": "Kiwango cha mapigo ya moyo lazima kiwe sawasawa au chini ya 200 (bpm)" + } + }, + { + "key": "prompt_for_Bradycardia", + "type": "toaster_notes", + "text": "Bainisha sababu za Mapigo hafifu ya moyo na udhibiti kulingana na muongozo kutoka Wizara ya Afya", + "openmrs_entity_id": "prompt_for_Bradycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "lessThan(.,\"60\")" + } + } + }, + { + "key": "prompt_for_Tachycardia", + "type": "toaster_notes", + "text": "Bainisha sababu za Tachycardia na njia za udhibiti kulingana na muongozo kutoka Wizara ya Afya", + "openmrs_entity_id": "prompt_for_Tachycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "greaterThan(.,\"100\")" + } + } + }, + { + "key": "temperature", + "type": "edit_text", + "hint": "Kiwango cha joto", + "openmrs_entity_id": "temperature", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza kiwango cha joto" + }, + "v_min": { + "value": "10", + "err": "Kiwango cha joto lazima kiwe sawasawa au zaidi ya 10" + }, + "v_max": { + "value": "50", + "err": "Kiwango cha joto lazima kiwe sawasawa au chini ya 50" + } + }, + { + "key": "notify_client_has_fever", + "type": "toaster_notes", + "text": "Mfanyie Mama vipimo kwa ajili ya kubainisha sababu ya Homa na dhibiti hali hii kulingana na mwongozo kutoka Wizara ya Afya", + "openmrs_entity_id": "notify_client_has_fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "greaterThan(.,\"37.8\")" + } + } + }, + { + "key": "notify_client_has_hypothermia", + "type": "toaster_notes", + "text": "Dhibiti hali hii ya Jotoridi la mwili la chini kuliko kawaida kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "notify_client_has_hypothermia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "lessThan(.,\"36.5\")" + } + } + }, + { + "key": "abdominal_scars", + "type": "native_radio", + "label": "Je, kuna kovu la upasuaji kwenye tumbo?", + "openmrs_entity_id": "abdominal_scars", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "prompt_for_abdominal_scars", + "type": "toaster_notes", + "text": "Mteja ashauriwe kujifungua Kituo cha Afya kwa sababu ya hatari ya kupasuka kwa mfuko wa uzazi", + "openmrs_entity_id": "prompt_for_abdominal_scars", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:abdominal_scars": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "abdominal_movement_with_respiration", + "type": "native_radio", + "label": "Je, tumbo linasogea wakati wa kupumua?", + "openmrs_entity_id": "abdominal_movement_with_respiration", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "prompt_for_abdominal_movement_with_respiration", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:abdominal_movement_with_respiration": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "abdominal_contour", + "type": "spinner", + "hint": "Umbo la Tumbo", + "label_info_title": "Umbo la Tumbo", + "label_info_text": "Chunguza umbo la tumbo", + "openmrs_entity_id": "abdominal_contour", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "Limevimba", + "Umbo la kawaida" + ], + "keys": [ + "distended", + "normal_contour" + ], + "openmrs_choice_ids": { + "distended": "distended", + "normal_contour": "normal_contour" + } + }, + { + "key": "fundal_height", + "type": "edit_text", + "openmrs_entity_id": "fundal_height", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Kimo cha mimba (CM)", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + }, + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza kimo cha mimba" + }, + "v_min": {}, + "v_max": { + "value": "50", + "err": "Kimo cha mimba lazima kiwe sawa au chini ya 50 CM" + } + }, + { + "key": "lie", + "type": "spinner", + "openmrs_entity_id": "lie", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Mlalo wa mtoto tumboni", + "values": [ + "Mlalo wa usawa", + "mlalo wa kiupande", + "Mlalo wa wima" + ], + "keys": [ + "transverse", + "oblique", + "longitudinal" + ], + "openmrs_choice_ids": { + "transverse": "transverse", + "oblique": "oblique", + "longitudinal": "longitudinal" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_lie", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "presentation", + "type": "spinner", + "openmrs_entity_id": "presentation", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Kitangulizi cha mtoto", + "values": [ + "Makalio", + "Kichwa" + ], + "keys": [ + "breech", + "cephalic" + ], + "openmrs_choice_ids": { + "breech": "breech", + "cephalic": "cephalic" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_presentation", + "type": "toaster_notes", + "text": "Toa rufaa kwa hudama zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "fetal_heart_rate", + "type": "edit_text", + "hint": "Hesabu kiwango cha mapigo ya moyo wa mtoto (bpm)", + "openmrs_entity_id": "fetal_heart_rate", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza kiawango cha mapigo ya moyo ya mtoto" + }, + "v_min": { + "value": "0", + "err": "Kiwango cha mapigo ya moyo wa mtoto lazima kiwe sawasawa au zaidi ya 0" + }, + "v_max": { + "value": "300", + "err": "Kiwango cha mapigo ya moyo wa mtoto lazima kiwe sawasawa au chini ya 300" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_fetal_distress", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "prompt_for_fetal_distress", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "abnormal_vaginal_discharge", + "type": "native_radio", + "label": "Kutokwa na uchafu usio wa kawaida ukeni", + "openmrs_entity_id": "abnormal_vaginal_discharge", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "prompt_for_vaginal_discharge", + "type": "toaster_notes", + "text": "Bainisha sababu za kutokwa na uchafu ukeni na dhibiti hali hii kulingana na Mouongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_vaginal_discharge", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:abnormal_vaginal_discharge": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "vaginal_sores", + "type": "native_radio", + "label": "Vidonda sehemu ya ukeni", + "openmrs_entity_id": "vaginal_sores", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "prompt_for_vaginal_sores", + "type": "toaster_notes", + "text": "Chunguza sababu ya vidonda ukeni na tibu kulingana na muongozo", + "openmrs_entity_id": "prompt_for_vaginal_sores", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:vaginal_sores": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "vaginal_swelling", + "type": "native_radio", + "label": "Kuvimba sehemu ya ukeni", + "openmrs_entity_id": "vaginal_swelling", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "prompt_for_vaginal_swelling", + "type": "toaster_notes", + "text": "Chunguza sababu ya uvimbe ukeni na tibu kulingana na muongozo", + "openmrs_entity_id": "prompt_for_vaginal_swelling", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:vaginal_swelling": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "obstetric_examination_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "obstetric_examination_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_tb_screening.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_tb_screening.json new file mode 100644 index 000000000..4a6b86243 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_tb_screening.json @@ -0,0 +1,315 @@ +{ + "count": "1", + "encounter_type": "ANC TB Screening", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Uchunguzi wa Awali wa Kifua Kikuu", + "fields": [ + { + "key": "on_tb_treatment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "on_tb_treatment", + "type": "native_radio", + "label": "Je, Mteja huyu yupo katika Matibabu ya Kifua kikuu?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ] + }, + { + "key": "tb_registration_number", + "type": "edit_text", + "openmrs_entity_id": "tb_registration_number", + "hint": "Namba ya Kliniki ya TB ya mteja", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "step1:on_tb_treatment": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba ya Kliniki ya TB" + } + }, + { + "key": "tb_symptoms_screening", + "type": "check_box", + "label": "Tafadhali chagua kama Mteja ana dalili zifuatazo za Kifua Kikuu?", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "tb_symptoms_screening", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_cough", + "text": "Mteja anakohoa kwa wiki 2 na zaidi", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_cough" + }, + { + "key": "chk_sputum", + "text": "Mteja anakohoa makohozi yaliyochanganyika na damu", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_sputum" + }, + { + "key": "chk_fevers", + "text": "Mteja amekuwa na Homa kwa zaidi ya wiki mbili", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_fevers" + }, + { + "key": "chk_weight_loss", + "text": "Mteja anapoteza Uzito", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_weight_loss" + }, + { + "key": "chk_weight_loss_subsequent_visit", + "text": "Mteja amepungua uzito katika mfululizo mahudhulio", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_weight_loss_subsequent_visit" + }, + { + "key": "chk_excessive_sweating", + "text": "Mteja amekuwa akitoka na jasho jingi sana usiku kwa wiki mbili au zaidi", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_excessive_sweating" + }, + { + "key": "chk_none", + "text": "Hakuna", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_none" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mada" + }, + "relevance": { + "step1:on_tb_treatment": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "investigate_for_tb", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "investigate_for_tb", + "type": "native_radio", + "label": "Fanya uchunguzi wa Kifua kikuu", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha TB hakijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo:" + }, + "relevance": { + "step1:tb_symptoms_screening": { + "ex-checkbox": [ + { + "or": [ + "chk_cough", + "chk_sputum", + "chk_fevers", + "chk_weight_loss", + "chk_weight_loss_subsequent_visit", + "chk_excessive_sweating" + ] + } + ] + } + } + }, + { + "key": "reason_for_not_conducting_tb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_tb_test", + "type": "spinner", + "hint": "Reason as to why the TB test was not conducted", + "values": [ + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:investigate_for_tb": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_tb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_tb_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting TB test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_tb_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "prompt_for_other_treatment", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:investigate_for_tb": { + "type": "string", + "ex": "equalTo(., \"negative\")" + } + } + }, + { + "key": "prompt_for_tb_treatment", + "type": "toaster_notes", + "text": "Mpe rufaa mteja kwa ajili ya Matibabu ya Kifua kikuu", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:investigate_for_tb": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "tb_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tb_status", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_tb_screening_calculation.yml" + } + } + } + }, + { + "key": "tb_screening_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "tb_screening_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_tt_vaccination.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_tt_vaccination.json new file mode 100644 index 000000000..db1a72a3f --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_fv_tt_vaccination.json @@ -0,0 +1,145 @@ +{ + "count": "1", + "encounter_type": "Vaccination", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Chanjo ya Pepopunda-Diphtheria", + "fields": [ + { + "key": "tt_vaccination", + "type": "native_radio", + "label": "Mama amepatiwa chanjo ya Pepopunda-Diphtheria (Td)?", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt_vaccination", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ] + }, + { + "key": "tt1_vaccination_prompt", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "toaster_notes", + "text": "Toa dozi ya kwanza ya pepopunda-diphtheria (Td1) na mpatie mteja tarehe ya marudio ya chanjo kulingana na muongozo wa chanjo", + "toaster_type": "warning", + "relevance": { + "step1:tt_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "tt_vaccination_type", + "type": "check_box", + "label": "Chanjo ipi ya pepopunda-diphtheria (Td) iliyotolewa?", + "combine_checkbox_option_values": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt_vaccination_type", + "openmrs_entity_parent": "", + "options": [ + { + "text": "Td1", + "key": "tt1", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt1" + }, + { + "key": "tt2", + "text": "Td2", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt2" + }, + { + "key": "tt3", + "text": "Td3", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt3" + }, + { + "key": "tt4", + "text": "Td4", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt4" + }, + { + "key": "tt5", + "text": "Td5", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt5" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja au zaidi" + }, + "relevance": { + "step1:tt_vaccination": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "tt_vaccination_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt_vaccination_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_counselling.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_counselling.json index d3245f8b9..e586668e5 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_counselling.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_counselling.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -53,133 +48,107 @@ "key": "counselling_given", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1379AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "counselling_given", "type": "check_box", "label": "Ushauri nasaa uliotolewa kwa mama na wanafamilia", "label_text_style": "normal", "text_color": "#C0C0C0", - "exclusive": [ - "chk_none" - ], "options": [ { "key": "chk_attended_anc_contacts", - "text": "1. Kuhudhuria kliniki ya wajawazito mapema", - "value": false, + "text": "Kuhudhuria kliniki ya wajawazito mapema", "openmrs_entity": "concept", - "openmrs_entity_id": "161013AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_attended_anc_contacts" }, { "key": "chk_anc_danger_signs", - "text": "2. Dalili za hatari wakati wa ujauzito", - "value": false, + "text": "Dalili za hatari wakati wa ujauzito", "openmrs_entity": "concept", - "openmrs_entity_id": "161050AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_anc_danger_signs" }, { "key": "chk_maternal_nutrition", - "text": "3. Lishe kwa mama wakati wa ujauzito na kunyonyesha", - "value": false, + "text": "Lishe kwa mama wakati wa ujauzito na kunyonyesha", "openmrs_entity": "concept", - "openmrs_entity_id": "1380AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_maternal_nutrition" }, { "key": "chk_personal_delivery", - "text": "4. Mpango binafsi wa kujifungua", - "value": false, + "text": "Mpango binafsi wa kujifungua", "openmrs_entity": "concept", - "openmrs_entity_id": "5630AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_personal_delivery" }, { "key": "chk_hiv_aids", - "text": "5. Umuhimu wa kupata ushauri nasaha na kupima VVU", - "value": false, + "text": "Umuhimu wa kupata ushauri nasaha na kupima VVU", "openmrs_entity": "concept", - "openmrs_entity_id": "1914AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_hiv_aids" }, { "key": "chk_pmtct_for_mother", - "text": "6. Kuzuia mambukizi ya VVU kutoka kwa mama kwenda kwa mtoto", - "value": false, + "text": "Kuzuia mambukizi ya VVU kutoka kwa mama kwenda kwa mtoto", "openmrs_entity": "concept", - "openmrs_entity_id": "160538AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_pmtct_for_mother" }, { "key": "chk_preventing_malaria", - "text": "7. Kuzuia malaria kwa wajawazito", - "value": false, + "text": "Kuzuia malaria kwa wajawazito", "openmrs_entity": "concept", - "openmrs_entity_id": "164884AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_preventing_malaria" }, { "key": "chk_physical_changes", - "text": "8. Mabadiliko ya kimwili kwa mama aliyejifungua", - "value": false, + "text": "Mabadiliko ya kimwili kwa mama aliyejifungua", "openmrs_entity": "concept", - "openmrs_entity_id": "162093AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_physical_changes" }, { "key": "chk_pnc_danger_signs", - "text": "10. Dalili za hatari mara baada ya kujifungua hadi arobaini ya uzazi", - "value": false, + "text": "Dalili za hatari mara baada ya kujifungua hadi arobaini ya uzazi", "openmrs_entity": "concept", - "openmrs_entity_id": "161541AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_pnc_danger_signs" }, { "key": "chk_care_of_infant", - "text": "11. Huduma kwa mtoto mchanga mara baada ya kuzaliwa", - "value": false, + "text": "Huduma kwa mtoto mchanga mara baada ya kuzaliwa", "openmrs_entity": "concept", - "openmrs_entity_id": "160413AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_care_of_infant" }, { "key": "chk_infant_danger_signs", - "text": "14. Dalili za hatari kwa mtoto mchanga", - "value": false, + "text": "Dalili za hatari kwa mtoto mchanga", "openmrs_entity": "concept", - "openmrs_entity_id": "161071AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_infant_danger_signs" }, { "key": "chk_hiv_exposed_infant", - "text": "15. Ufuatiliaji wa mtoto aliyezaliwa na mama mwenye VVU", - "value": false, + "text": "Ufuatiliaji wa mtoto aliyezaliwa na mama mwenye VVU", "openmrs_entity": "concept", - "openmrs_entity_id": "164818AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_hiv_exposed_infant" }, { "key": "chk_breastfeeding", - "text": "16. Unyonyeshaji wa maziwa ya mama", - "value": false, + "text": "Unyonyeshaji wa maziwa ya mama", "openmrs_entity": "concept", - "openmrs_entity_id": "1910AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_breastfeeding" }, { "key": "chk_exclusive_breast_feeding ", - "text": "17. Njia ya uzazi wa mpango ya unyonyeshaji maziwa ya mama pekee kwa kipindi cha miezi sita baada ya kujifungua (LAM)", - "value": false, + "text": "Njia ya uzazi wa mpango ya unyonyeshaji maziwa ya mama pekee kwa kipindi cha miezi sita baada ya kujifungua (LAM)", "openmrs_entity": "concept", - "openmrs_entity_id": "161096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_exclusive_breast_feeding" }, { "key": "chk_family_planning", - "text": "18. Uzazi wa mpango", - "value": false, + "text": "Uzazi wa mpango", "openmrs_entity": "concept", - "openmrs_entity_id": "1382AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_family_planning" }, { "key": "chk_infection_prevention", - "text": "24. Kuzuia maambukizi katika jamii", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "1906AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_none", - "text": "Hajatoa ushauri", - "value": false, + "text": "Kuzuia maambukizi katika jamii", "openmrs_entity": "concept", - "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_infection_prevention" } ], "v_required": { diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_danger_signs.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_danger_signs.json index da1368a7b..4a036c5b4 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_danger_signs.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_danger_signs.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -65,91 +60,78 @@ { "key": "chk_fever", "text": "Homa", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "140238AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_bleeding_vaginally", "text": "Damu kutoka ukeni", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "150802AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_server_headache", "text": "Maumivu ya kichwa", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "139081AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_blurred_vision", "text": "Kutoona vizuri", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "147104AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_convulsions", "text": "Degedege/Mtukutiko wa mwili", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164483AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_difficulty_breathing", "text": "Kushindwa kupumua", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "142373AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_severe_abdominal_pain", "text": "Maumivu makali ya tumbo", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "165271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_loss_consciousness", "text": "Kupoteza fahamu", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "135592AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_swelling", "text": "Kuvimba uso na / au mikonos", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "460AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_early_labour", "text": "Kupata uchungu mapema kabla ya miezi tisa", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "151687AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_vaginal_discharge", "text": "Kutoka uchafu / majimaji ukeni yenye harufu mbaya", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "123395AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_unusual_movement", "text": "Kutocheza / kucheza kusiko kwa kawaida kwa mtoto aliye tumboni", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "113377AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_none", "text": "Hakuna", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_family_planning.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_family_planning.json index 29e307012..aed34f8ce 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_family_planning.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_family_planning.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_health_facility_visit.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_health_facility_visit.json index 3b776cae3..5692ecc0e 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_health_facility_visit.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_health_facility_visit.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -122,63 +117,54 @@ { "key": "chk_haemoglobin", "text": "Wingi wa damu", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "21AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_urine_analysis_uti", "text": "Kipimo cha maambukizi kwenye njia ya mkojo", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "302AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_urine_analysis_protein", "text": "Kipimo cha kuangalia uwepo wa protini na sukari kwenye mkojo", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1875AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_hiv", "text": "Kipimo cha VVU", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1356AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_syphilis", "text": "Kipimo cha kaswende", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "299AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_malaria", "text": "Kipimo cha malaria", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1643AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_tb", "text": "Uchunguzi wa kifua kikuu", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164800AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_other", "text": "Vipimo vingine", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_none", "text": "Vipimo havijafanyika", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } @@ -210,49 +196,42 @@ { "key": "chk_tetanus", "text": "Chanjo ya pepopunda", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "84879AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_malaria", "text": "Tiba kinga ya malaria wakati wa ujauzito (IPTp-SP)", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "105232AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_iron", "text": "Dawa za kuongeza damu (FEFO)", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "773AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_albendazole", "text": "Albendazole / Medandozle", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "159922AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_calcuim", "text": "Calcium supplement", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "72650AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_other", "text": "Dawa nyingine au chanjo nyingine", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_none", "text": "Hajapewa dawa au chanjo yoyote", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_malaria.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_malaria.json index 0c06e1a88..048243851 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_malaria.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_malaria.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_nutrition_status.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_nutrition_status.json index 19cf849fc..92c56b185 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_nutrition_status.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_nutrition_status.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_observations.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_observations.json index 3d710b6d9..60e8d0b64 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_observations.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_observations.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -92,42 +87,36 @@ { "key": "chk_ors", "text": "ORS 5", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "351AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_zinc", "text": "Zinc 10", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "86672AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_paracetamol", "text": "Panadol", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "70116AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_referred", "text": "Amepewa rufaa", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "163762AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_other_treatment", "text": "Matibabu mengine", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_none", "text": "Hajapewa matibabu yoyote", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_remarks_and_comments.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_remarks_and_comments.json index f21ae1b0a..1309914ea 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_remarks_and_comments.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_hv_remarks_and_comments.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_member_registration.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_member_registration.json index e1c7f8a1e..06efef8e9 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_member_registration.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_member_registration.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -174,21 +169,18 @@ { "key": "chk_vaginally", "text": "Njia ya kawaida", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_cesarean_section", "text": "Njia ya upasuaji", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1171AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_miscarriage", "text": "Mimba kuharibika", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1171AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } @@ -218,21 +210,18 @@ { "key": "chk_vaginally", "text": "Njia ya kawaida", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_cesarean_section", "text": "Njia ya upasuaji", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1171AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_miscarriage", "text": "Mimba kuharibika", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1171AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_member_transfer_in_registration.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_member_transfer_in_registration.json new file mode 100644 index 000000000..bc0e0d00d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_member_transfer_in_registration.json @@ -0,0 +1,927 @@ +{ + "count": "2", + "skip_blank_steps": true, + "encounter_type": "ANC Followup Client Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Historia ya Matibabu na Upasuaji", + "next": "step2", + "fields": [ + { + "key": "is_transfer_in", + "type": "native_radio", + "label": "Client registration type", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_transfer_in", + "openmrs_entity_parent": "", + "options": [ + { + "key": "true", + "text": "On Transit", + "openmrs_entity": "concept", + "openmrs_entity_id": "true" + }, + { + "key": "false", + "text": "Continuing Client", + "openmrs_entity": "concept", + "openmrs_entity_id": "false" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "pregnancy_confirmation_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnancy_confirmation_status", + "type": "hidden", + "value": "Confirmed" + }, + { + "key": "pregnancy_confirmation_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnancy_confirmation_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "medical_surgical_history", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "medical_surgical_history", + "type": "check_box", + "label": "Historia yoyote ya Matibabu na upasuaji ya Mgonjwa?", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "known_on_art", + "text": "Mtumiaji wa dawa za kufubaza maambukizi ya virusi vya Ukimwi (ART) kabla ya mimba hii", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_on_art" + }, + { + "key": "diabetes_mellitus", + "text": "Kisukari", + "openmrs_entity": "concept", + "openmrs_entity_id": "diabetes_mellitus" + }, + { + "key": "sickle_cell_disease", + "text": "Ugonjwa wa Seli mundu", + "openmrs_entity": "concept", + "openmrs_entity_id": "sickle_cell_disease" + }, + { + "key": "heart_diseases", + "text": "Magonjwa ya moyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "heart_diseases" + }, + { + "key": "thyroid_diseases", + "text": "Magonjwa ya tezi", + "openmrs_entity": "concept", + "openmrs_entity_id": "thyroid_diseases" + }, + { + "key": "blood_transfusion", + "text": "Kuongezewa damu", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_transfusion" + }, + { + "key": "epilepsy", + "text": "Kifafa", + "openmrs_entity": "concept", + "openmrs_entity_id": "epilepsy" + }, + { + "key": "previous_c_s", + "text": "Kujifungua kwa upasuaji", + "openmrs_entity": "concept", + "openmrs_entity_id": "previous_c_s" + }, + { + "key": "myomectomy", + "text": "Myomectomy", + "openmrs_entity": "concept", + "openmrs_entity_id": "myomectomy" + }, + { + "key": "third_degree_tear", + "text": "Kuchanika msamba hatua ya tatu", + "openmrs_entity": "concept", + "openmrs_entity_id": "third_degree_tear" + }, + { + "key": "repaired_fistula", + "text": "Fistula iliyotibiwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "repaired_fistula" + }, + { + "key": "female_genital_mutilation", + "text": "Tohara kwa wanawake", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_genital_mutilation" + }, + { + "key": "closely_spaced_pregnancy", + "text": "Mimba zilizokaribiana (chini ya miaka miwili)", + "openmrs_entity": "concept", + "openmrs_entity_id": "closely_spaced_pregnancy" + }, + { + "key": "pregnant_more_than_four", + "text": "Kuwa mjamzito mara nne au zaidi", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnant_more_than_four" + }, + { + "key": "hx_hemorrhage", + "text": "Historia ya kutokwa damu nyingi baada ya kujifungua", + "openmrs_entity": "concept", + "openmrs_entity_id": "hx_hemorrhage" + }, + { + "key": "history_of_high_blood_pressure", + "text": "Historia ya shinikizo la damu", + "openmrs_entity": "concept", + "openmrs_entity_id": "history_of_high_blood_pressure" + }, + { + "key": "anaemia", + "text": "Ugonjwa wa upungufu wa damu", + "openmrs_entity": "concept", + "openmrs_entity_id": "anaemia" + }, + { + "key": "difficult_delivery", + "text": "Kuzalishwa kwa kuvutwa na kifaa au kuongezewa njia (Vacuum, episiotomy)", + "openmrs_entity": "concept", + "openmrs_entity_id": "difficult_delivery" + }, + { + "key": "hx_abortions", + "text": "Historia ya kuharibika kwa mimba", + "openmrs_entity": "concept", + "openmrs_entity_id": "hx_abortions" + }, + { + "key": "none", + "text": "Hakuna", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua angalau moja" + } + }, + { + "key": "ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "Namba ya Utambulisho CTC", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "Namba ya CTC inatakiwa kuwa (XX-XX-XXXX-XXXXXX)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Tafadhali jaza namba ya CTC ya mteja" + }, + "v_required": { + "value": true, + "err": "Tafadhali jaza namba ya CTC ya mteja" + }, + "relevance": { + "step1:medical_surgical_history": { + "ex-checkbox": [ + { + "or": [ + "known_on_art" + ] + } + ] + } + } + }, + { + "key": "gravida", + "type": "edit_text", + "hint": "Idadi ya ujauzito (Gravida)", + "openmrs_entity": "concept", + "openmrs_entity_id": "gravida", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza idadi ya ujauzito" + }, + "v_required": { + "value": true, + "err": "Tafadhali jaza idadi ya ujauzito" + }, + "v_max": { + "value": "35", + "err": "Idadi ya ujauzito lazima iwe sawa au chini ya 35" + } + }, + { + "key": "parity", + "type": "edit_text", + "hint": "Idadi ya mimba zilizofikia wiki 24 au zaidi", + "openmrs_entity": "concept", + "openmrs_entity_id": "parity", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza namba halali" + }, + "v_required": { + "value": true, + "err": "Tafadhali jaza namba halali" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:gravida)", + "err": "Namba lazima iwe chini ya idadi ya ujauzito" + } + ] + }, + { + "key": "prompt_for_grand_multiparity", + "type": "toaster_notes", + "text": "Toa ushauri juu ya hatari ya kuchanika mfuko wa uzazi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_relevance.yml" + } + } + } + }, + { + "key": "no_surv_children", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_surv_children", + "type": "edit_text", + "edit_type": "number", + "hint": "Idadi ya watoto walio hai", + "v_required": { + "value": "true", + "err": "Tafadhali jaza idadi ya watoto walio hai" + }, + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza idadi ya watoto walio hai" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_relevance.yml" + } + } + } + }, + { + "key": "visit_number", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "openmrs_entity_parent": "", + "value": 1 + }, + { + "key": "hiv", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "known_on_art", + "type": "hidden", + "openmrs_entity_id": "known_on_art", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + } + ] + }, + "step2": { + "title": "Usajili wa mahudhurio ya kliniki ya uzazi", + "fields": [ + { + "key": "known_last_menstrual_period", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_last_menstrual_period", + "type": "date_picker", + "hint": "Tarehe ya kwanza ya hedhi ya mara ya mwisho (LNMP)", + "label_info_title": "Tarehe ya kwanza ya hedhi ya mara ya mwisho (LNMP)", + "label_info_text": "Tarehe ya kwanza ya hedhi ya mara ya mwisho = siku ya kwanza ya kipindi cha mwisho cha hedhi. Ikiwa tarehe halisi haijulikani, lakini kipindi cha mwezi kinajulikana, tumia siku ya 5 kwa mwanzo wa mwezi, siku ya 15 katikati ya mwezi na siku ya 25 kwa mwisho wa mwezi.", + "expanded": false, + "max_date": "today", + "min_date": "today-50w", + "v_required": { + "value": "true", + "err": "Tarehe ya kwanza ya hedhi ya mara ya mwisho inahitajika kujazwa" + } + }, + { + "key": "last_menstrual_period", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_menstrual_period", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "gest_age_note", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Umri wa Mimba kwa Wiki", + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "edd", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "edd", + "type": "edit_text", + "hint": "Tarehe anayotazamia Kujifungua", + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "gest_age", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gest_age", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "height", + "type": "edit_text", + "hint": "Urefu (CM)", + "openmrs_entity": "concept", + "openmrs_entity_id": "height", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza urefu" + }, + "v_min": { + "value": "60", + "err": "Urefu lazima uwe sawasawa au zaidi ya 60 (CM)" + }, + "v_max": { + "value": "200", + "err": "Urefu lazima uwe sawasawa au chini ya 200 (CM)" + }, + "v_required": { + "value": true, + "err": "Tafadhali jaza urefu" + } + }, + { + "key": "prompt_for_short_stature", + "type": "toaster_notes", + "text": "Mshauri mteja kujifungua kwenye Kituo cha Afya kutokana na hatari kubwa ya kupata uchungu pingamizi", + "openmrs_entity_id": "prompt_for_short_stature", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step2:height": { + "type": "numeric", + "ex": "lessThan(.,\"145\")" + } + } + }, + { + "key": "has_the_client_received_ipt_doses_from_previous_facility", + "type": "native_radio", + "label": "Has the client has received any IPT doses in the previous clinic", + "openmrs_entity": "concept", + "openmrs_entity_id": "has_the_client_received_ipt_doses_from_previous_facility", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step2:gest_age_note": { + "type": "numeric", + "ex": "greaterThanEqualTo(.,\"13\")" + } + } + }, + { + "key": "malaria_preventive_therapy", + "type": "native_radio", + "label": "Please select the last IPT dose provided from the previous facility", + "openmrs_entity": "concept", + "openmrs_entity_id": "malaria_preventive_therapy", + "openmrs_entity_parent": "", + "options": [ + { + "key": "ipt1", + "text": "IPT1", + "openmrs_entity": "concept", + "openmrs_entity_id": "ipt1" + }, + { + "key": "ipt2", + "text": "IPT2", + "openmrs_entity": "concept", + "openmrs_entity_id": "ipt2" + }, + { + "key": "ipt3", + "text": "IPT3", + "openmrs_entity": "concept", + "openmrs_entity_id": "ipt3" + }, + { + "key": "ipt4", + "text": "IPT4", + "openmrs_entity": "concept", + "openmrs_entity_id": "ipt4" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step2:has_the_client_received_ipt_doses_from_previous_facility": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "hiv", + "type": "native_radio", + "label": "Majibu ya Virusi vya Ukimwi ya mteja kutoka katika kituo alichotoka", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Mteja hajapimwa maambukizi ya Virusi vya Ukimwi katika kituo alichotoka", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + } + }, + { + "key": "is_test_at_32", + "type": "native_radio", + "label": "Je, hichi ni kipimo cha pili cha maambukizi ya virusi vya ukimwi?", + "openmrs_entity_id": "is_test_at_32", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + } + }, + { + "key": "ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "Namba ya Utambulisho CTC", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "Namba ya CTC inatakiwa kuwa (XX-XX-XXXX-XXXXXX)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Tafadhali jaza namba ya CTC ya mteja" + }, + "v_required": { + "value": true, + "err": "Tafadhali jaza namba ya CTC ya mteja" + }, + "relevance": { + "step2:hiv": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "hiv_test_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_number", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "hiv_test_at_32", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_at_32", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "abdominal_scars", + "type": "native_radio", + "label": "Je, kuna kovu la upasuaji kwenye tumbo?", + "openmrs_entity_id": "abdominal_scars", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jbu swali hili" + } + }, + { + "key": "prompt_for_abdominal_scars", + "type": "toaster_notes", + "text": "Mteja ashauriwe kujifungua Kituo cha Afya kwa sababu ya hatari ya kupasuka kwa mfuko wa uzazi", + "openmrs_entity_id": "prompt_for_abdominal_scars", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step2:abdominal_scars": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "abdominal_movement_with_respiration", + "type": "native_radio", + "label": "Je, tumbo linasogea wakati wa kupumua?", + "openmrs_entity_id": "abdominal_movement_with_respiration", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_abdominal_movement_with_respiration", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step2:abdominal_movement_with_respiration": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "abnormal_vaginal_discharge", + "type": "native_radio", + "label": "Kutokwa na uchafu usio wa kawaida ukeni", + "openmrs_entity_id": "abnormal_vaginal_discharge", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_vaginal_discharge", + "type": "toaster_notes", + "text": "Bainisha sababu za kutokwa na uchafu ukeni na dhibiti hali hii kulingana na Mouongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_vaginal_discharge", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step2:abnormal_vaginal_discharge": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "vaginal_sores", + "type": "native_radio", + "label": "Vidonda sehemu ya ukeni", + "openmrs_entity_id": "vaginal_sores", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_vaginal_sores", + "type": "toaster_notes", + "text": "Chunguza sababu ya vidonda ukeni na tibu kulingana na muongozo", + "openmrs_entity_id": "prompt_for_vaginal_sores", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step2:vaginal_sores": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "vaginal_swelling", + "type": "native_radio", + "label": "Kuvimba sehemu ya ukeni", + "openmrs_entity_id": "vaginal_swelling", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_vaginal_swelling", + "type": "toaster_notes", + "text": "Chunguza sababu ya uvimbe ukeni na tibu kulingana na muongozo", + "openmrs_entity_id": "prompt_for_vaginal_swelling", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step2:vaginal_swelling": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_partner_community_followup_referral.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_partner_community_followup_referral.json new file mode 100644 index 000000000..8579a996e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_partner_community_followup_referral.json @@ -0,0 +1,100 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "ANC Partner Community Followup Referral", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Rufaa ya Ufuatiliaji wa Mwenza wa Mama Mjamzito katika Ngazi ya Jamii", + "fields": [ + { + "key": "toast_refer_to_chw", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "toaster_notes", + "text": "Mteja atapewa rufaa kwa Mtoa huduma ngazi ya jamii kwa ajili ya ufuatiliaji", + "toaster_info_text": "Mteja atapewa rufaa kwenda kwa mtoa huduma ngazi ya jamii aliye kwenye kijiji chake kwa ajili ya ufuatiliaji. Ongeza taarifa zozote ambazo zinahitajika kwa ajili ya rufaa hii.", + "toaster_type": "info" + }, + { + "key": "chw_location", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "chw_location", + "type": "spinner", + "hint": "Chagua Eneo la WAJA/Mama Kinara", + "v_required": { + "value": true, + "err": "Tafadhali chagua eneo alipo mama kinara" + } + }, + { + "key": "anc_partner_followup_comment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "anc_partner_followup_comment", + "type": "edit_text", + "hint": "Maoni yako", + "v_required": { + "value": "false", + "err": "Tafadhali jaza maoni yako hapa" + } + }, + { + "key": "anc_partner_community_referral_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "anc_partner_community_referral_date", + "type": "hidden", + "is_problem": false, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_community_followup_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_partner_registration.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_partner_registration.json new file mode 100644 index 000000000..208347d28 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_partner_registration.json @@ -0,0 +1,297 @@ +{ + "count": "1", + "encounter_type": "Partner Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Usajili wa Mwenza", + "fields": [ + { + "key": "partner_surname", + "type": "edit_text", + "hint": "Jina la mwisho la mwenza", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_surname", + "openmrs_entity_parent": "", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza jina la mwisho la mwenza" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza jina la mwisho la mwenza" + } + }, + { + "key": "partner_first_name", + "type": "edit_text", + "hint": "Jina la Kwanza la mwenza", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_first_name", + "openmrs_entity_parent": "", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza Jina la Kwanza la mwenza" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza Jina la Kwanza la mwenza" + } + }, + { + "key": "partner_middle_name", + "type": "edit_text", + "hint": "Jina la Kati la mwenza", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_middle_name", + "openmrs_entity_parent": "", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza Jina la Kati la mwenza" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza Jina la Kati la mwenza" + } + }, + { + "key": "partner_age", + "hint": "Umri wa mwenza", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_age", + "openmrs_entity_parent": "", + "type": "edit_text", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza umri wa mwenza" + }, + "v_min": { + "value": "11", + "err": "Umri lazima uwe sawasawa au zaidi ya 11" + }, + "v_max": { + "value": "120", + "err": "Umri lazima uwe sawasawa au chini ya 120" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza umri wa mwenza" + } + }, + { + "key": "partner_education", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_education", + "type": "native_radio", + "label": "Kiwango cha juu cha elimu mwenza alichokamilisha ", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "no_education", + "text": "Hajasoma", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_education" + }, + { + "key": "primary", + "text": "Elimu ya msingi", + "openmrs_entity": "concept", + "openmrs_entity_id": "primary" + }, + { + "key": "secondary", + "text": "Elimu ya sekondari", + "openmrs_entity": "concept", + "openmrs_entity_id": "secondary" + }, + { + "key": "tertiary", + "text": "Elimu ya juu", + "openmrs_entity": "concept", + "openmrs_entity_id": "tertiary" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua kiwango cha juu cha elimu mwenza alichokamilisha" + } + }, + { + "key": "partner_work", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_work", + "type": "check_box", + "label": "Kazi ya mwenza", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_farmer", + "text": "Mkulima", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_farmer" + }, + { + "key": "chk_cs", + "text": "Mtumishi wa Serikali", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_cs" + }, + { + "key": "chk_nurse", + "text": "Muuguzi", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_nurse" + }, + { + "key": "chk_teacher", + "text": "Mwalimu", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_teacher" + }, + { + "key": "chk_th", + "text": "Mganga wa tiba asili", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_th" + }, + { + "key": "chk_chw", + "text": "Muhudumu wa afya ngazi ya jamii (WAJA)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_chw" + }, + { + "key": "chk_tba", + "text": "Mkunga wa jadi", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_tba" + }, + { + "key": "chk_chmis", + "text": "Wakusanyaji takrimu za afya ngazi ya jamii", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_chmis" + }, + { + "key": "chk_cbd", + "text": "Msambazaji wa dawa na vifaa vya uzazi wa mpango ngazi ya Jamii", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_cbd" + }, + { + "key": "chk_hbc", + "text": "Watoa huduma kwa wagonjwa majumbani", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_hbc" + }, + { + "key": "chk_cimmci", + "text": "Watoa huduma za udhibiti wa magonjwa ya watoto ngazi ya jamii", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_cimmci" + }, + { + "key": "chk_other", + "text": "Nyinginezo", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_other" + }, + { + "key": "chk_none", + "text": "Hakuna", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_none" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua angalau moja" + } + }, + { + "key": "partner_work_other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_work_other", + "type": "edit_text", + "hint": "Kazi nyingine ya mwenza", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali bainisha kazi" + }, + "relevance": { + "step1:partner_work": { + "ex-checkbox": [ + { + "or": [ + "chk_other" + ] + } + ] + } + } + }, + { + "key": "partner_registered", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_registered", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_registration_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_partner_testing.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_partner_testing.json new file mode 100644 index 000000000..f7683770f --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_partner_testing.json @@ -0,0 +1,636 @@ +{ + "count": "1", + "encounter_type": "Partner Testing", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": { + "hiv_testing_done": false, + "syphilis_testing_done": false, + "hepatitis_testing_done": false, + "partner_hiv_status": "", + "partner_hiv_test_at_32_done": false + }, + "step1": { + "title": "Upimaji kwa Mwenza", + "fields": [ + { + "key": "partner_hiv", + "type": "native_radio", + "label": "Matokeo ya Kipimo cha VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_hiv", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha VVU hakijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_testing_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "reason_for_not_conducting_partner_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_partner_hiv_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha VVU", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Anajulikana ana maambukizi", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "known_on_art", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "known_on_art": "known_on_art", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:partner_hiv": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_partner_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_partner_hiv_test", + "type": "edit_text", + "hint": "Bainisha sababu zingine za kutofanya kipimo cha VVU", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_partner_hiv_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "register_for_hiv_services", + "type": "toaster_notes", + "text": "Mpe rufaa Mteja kwenda CTC kwa ajili ufuatiliaji na Matunzo", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:partner_hiv": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "partner_ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "Namba ya CTC", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "Namba ya CTC inatakiwa kuwa (XX-XX-XXXX-XXXXXX)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Tafadhali jaza namba ya CTC ya mteja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_testing_relevance.yml" + } + } + } + }, + { + "key": "couple_testing", + "type": "native_radio", + "label": "Je, mwenza alipima pamoja na Mama? (Couple testing)", + "openmrs_entity": "concept", + "openmrs_entity_id": "couple_testing", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_testing_relevance.yml" + } + } + } + }, + { + "key": "partner_syphilis", + "type": "native_radio", + "label": "Matokeo ya kipimo cha Kaswende", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_syphilis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha kaswende hakijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_testing_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prescribe_anti_sy", + "type": "toaster_notes", + "text": "Mpe mwenza wa mama mjamzito dawa za Antibiotic kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:partner_syphilis": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_partner_syphilis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_partner_syphilis_test", + "type": "spinner", + "hint": "Sababu ya kipimo cha kaswende kutofanyika", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:partner_syphilis": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_partner_syphilis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_partner_syphilis_test", + "type": "edit_text", + "hint": "Bainisha sababu zingine za kutofanya kipimo cha kaswende", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_partner_syphilis_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "partner_syphilis_treatment", + "type": "native_radio", + "label": "Je, matibabu ya Kaswende yalitolewa?", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_syphilis_treatment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "step1:partner_syphilis": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "partner_hepatitis", + "type": "native_radio", + "label": "Matokeo ya kipimo cha homa ya Ini", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_hepatitis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya ", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha homa ya ini haikufanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_testing_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_partner_hepatitis", + "type": "toaster_notes", + "text": "Mpatie Mteja dawa za kufubaza virusi vya Ukimwi (ARV) kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:partner_hepatitis": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_partner_hepatitis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_partner_hepatitis_test", + "type": "spinner", + "hint": "Sababu ya kipimo cha homa ya ini kutofanyika", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:partner_hepatitis": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_partner_hepatitis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_partner_hepatitis_test", + "type": "edit_text", + "hint": "Bainisha sababu zingine za kutofanya kipimo cha homa ya ini", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_partner_hepatitis_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "partner_other_stds", + "type": "native_radio", + "label": "Je, Mteja anajulikana kuwa na magonjwa mengine ya ngono?", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_other_stds", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_testing_relevance.yml" + } + } + } + }, + { + "key": "partner_other_stds_treatment", + "type": "native_radio", + "label": "Je, ARV zilitolewa kwa magonjwa mengine ya ngono?", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_other_stds_treatment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "step1:partner_other_stds": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "partner_reason_for_not_giving_medication_for_other_stds", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_reason_for_not_giving_medication_for_other_stds", + "type": "spinner", + "hint": "Sababu kwa nini matibabu hayakutolewa", + "values": [ + "Dawa zimeisha", + "Mteja amekataa kuchukua dawa", + "Anamzio na dawa (Allegy)", + "Nyingine" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:partner_other_stds_treatment": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "partner_other_reason_for_not_giving_medication_for_other_stds", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_other_reason_for_not_giving_medication_for_other_stds", + "type": "edit_text", + "hint": "Bainisha sababu zingine za kutokutoa matibabu", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:partner_reason_for_not_giving_medication_for_other_stds": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "partner_hiv_test_at_32", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_hiv_test_at_32", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_testing_calculation.yml" + } + } + } + }, + { + "key": "partner_hiv_test_number", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_hiv_test_number", + "openmrs_entity_parent": "" + }, + { + "key": "gest_age", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "gest_age", + "openmrs_entity_parent": "" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_pregnancy_confirmation.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_pregnancy_confirmation.json new file mode 100644 index 000000000..397c9db1a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_pregnancy_confirmation.json @@ -0,0 +1,567 @@ +{ + "count": "3", + "skip_blank_steps": true, + "encounter_type": "Pregnancy Confirmation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Uchambuzi wa wagonjwa au majeruhi", + "next": "step2", + "fields": [ + { + "key": "danger_signs", + "type": "check_box", + "label": "Mtoa huduma wa Afya atafanya uchunguzi ili kubaini wateja wenye dalili za hatari", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "danger_signs", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "bleeding_vag", + "text": "Kutokwa na damu ukeni", + "openmrs_entity": "concept", + "openmrs_entity_id": "bleeding_vag" + }, + { + "key": "headache_visual_disturbance", + "text": "Kichwa kuuma", + "openmrs_entity": "concept", + "openmrs_entity_id": "headache_visual_disturbance" + }, + { + "key": "severely_pale", + "text": "Kupauka sana", + "openmrs_entity": "concept", + "openmrs_entity_id": "severely_pale" + }, + { + "key": "dizziness", + "text": "Kizunguzungu", + "openmrs_entity": "concept", + "openmrs_entity_id": "dizziness" + }, + { + "key": "severe_vomiting", + "text": "Kutapika sana", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_vomiting" + }, + { + "key": "convulsion", + "text": "Degedege", + "openmrs_entity": "concept", + "openmrs_entity_id": "convulsion" + }, + { + "key": "looking_very_ill", + "text": "Kuwa mdhoofu", + "openmrs_entity": "concept", + "openmrs_entity_id": "looking_very_ill" + }, + { + "key": "fever", + "text": "Homa", + "openmrs_entity": "concept", + "openmrs_entity_id": "fever" + }, + { + "key": "unconscious", + "text": "Kupoteza fahamu", + "openmrs_entity": "concept", + "openmrs_entity_id": "unconscious" + }, + { + "key": "severe_pain", + "text": "Maumivu makali", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_pain" + }, + { + "key": "severe_breathing_difficulty", + "text": "Kupumua kwa shida", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_breathing_difficulty" + }, + { + "key": "in_labour", + "text": "Katika hali ya uchungu", + "openmrs_entity": "concept", + "openmrs_entity_id": "in_labour" + }, + { + "key": "imminent_labour", + "text": "Hali ya Uchungu inayokaribu", + "openmrs_entity": "concept", + "openmrs_entity_id": "imminent_labour" + }, + { + "key": "oedema_of_legs_and_sacrum", + "text": "Kuvimba kwa miguu", + "openmrs_entity": "concept", + "openmrs_entity_id": "oedema_of_legs_and_sacrum" + }, + { + "key": "none", + "text": "Hakuna", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali Chagua dalili za hatari" + } + }, + { + "key": "task_id", + "type": "hidden", + "openmrs_entity_id": "task_id", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "danger_signs_present_toaster", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "toaster_notes", + "text": "Dalili ya Hatari! Mpatie rufaa aende katika wodi ya dharura", + "text_color": "#CF0800", + "toaster_type": "problem", + "relevance": { + "step1:danger_signs": { + "ex-checkbox": [ + { + "or": [ + "bleeding_vag", + "headache_visual_disturbance", + "severely_pale", + "severe_vomiting", + "severe_breathing_difficulty", + "convulsion", + "looking_very_ill", + "fever", + "unconscious", + "severe_pain", + "in_labour", + "imminent_labour", + "oedema_of_legs_and_sacrum", + "dizziness" + ] + } + ] + } + } + } + ] + }, + "step2": { + "title": "Kuhakikisha ujauzito", + "next": "step3", + "fields": [ + { + "key": "type_of_pregnancy_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_pregnancy_test", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Chagua aina ya kipimo cha Ujauzito kilichofanyika", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "fundal_palpation" + ], + "options": [ + { + "key": "fundal_palpation", + "text": "Fundal Palpation", + "openmrs_entity": "concept", + "openmrs_entity_id": "fundal_palpation" + }, + { + "key": "upt", + "text": "Kipimo cha Mkojo", + "openmrs_entity": "concept", + "openmrs_entity_id": "upt" + }, + { + "key": "uss", + "text": "Kumulika kwa Mashine", + "openmrs_entity": "concept", + "openmrs_entity_id": "uss" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua aina ya kipimo cha Ujauzito kilichofanyika" + } + }, + { + "key": "upt", + "type": "native_radio", + "openmrs_entity_id": "upt", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "label": "Tafadhali chagua majibu ya kipimo cha mkojo", + "options": [ + { + "text": "Chanya", + "key": "positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "text": "Hasi", + "key": "negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua majibu ya kipimo cha mkojo" + } + }, + { + "key": "uss", + "type": "native_radio", + "openmrs_entity_id": "uss", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "label": "Tafadhali Chagua majibu ya Kumulika kwa mashine", + "options": [ + { + "key": "present_gestation_sac", + "text": "Mfuko wa uzazi upo", + "openmrs_entity": "concept", + "openmrs_entity_id": "present_gestation_sac" + }, + { + "key": "absent_gestation_sac", + "text": "Mfuko wa uzazi haupo", + "openmrs_entity": "concept", + "openmrs_entity_id": "absent_gestation_sac" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Tafadhali Chagua majibu ya Kumulika kwa mashine" + } + } + ] + }, + "step3": { + "title": "Mwisho", + "fields": [ + { + "key": "known_last_menstrual_period", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_last_menstrual_period", + "type": "date_picker", + "hint": "Tarehe ya kwanza ya hedhi ya mara ya mwisho (LNMP)", + "label_info_title": "Tarehe ya kwanza ya hedhi ya mara ya mwisho (LNMP)", + "label_info_text": "Tarehe ya kwanza ya hedhi ya mara ya mwisho = siku ya kwanza ya kipindi cha mwisho cha hedhi. Ikiwa tarehe halisi haijulikani, lakini kipindi cha mwezi kinajulikana, tumia siku ya 5 kwa mwanzo wa mwezi, siku ya 15 katikati ya mwezi na siku ya 25 kwa mwisho wa mwezi.", + "expanded": false, + "max_date": "today", + "min_date": "today-50w", + "v_required": { + "value": "true", + "err": "Tarehe ya kwanza ya hedhi ya mara ya mwisho inahitajika kujazwa" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + } + }, + { + "key": "last_menstrual_period_unknown", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_menstrual_period_unknown", + "openmrs_data_type": "text", + "type": "check_box", + "options": [ + { + "key": "lmp_unknown", + "text": "Tarehe ya kwanza ya hedhi ya mara ya mwisho haijulikani", + "text_size": "18px", + "value": "false", + "openmrs_entity": "concept", + "openmrs_entity_id": "lmp_unknown" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + } + }, + { + "key": "fundal_height", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fundal_height", + "type": "edit_text", + "hint": "Kimo cha mimba (CM)", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Tafadhali ingiza kimo cha mimba" + }, + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza kimo cha mimba" + }, + "v_min": { + "value": "12", + "err": "Kimo cha mimba lazima kiwe sawa au zaidi ya 12 CM" + }, + "v_max": { + "value": "50", + "err": "Kimo cha mimba lazima kiwe sawa au chini ya 50 CM" + } + }, + { + "key": "estimated_last_menstrual_period", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "estimated_last_menstrual_period", + "type": "edit_text", + "read_only": true, + "hint": "Makadirio ya hedhi ya mwisho ilionekana lini", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + } + }, + { + "key": "last_menstrual_period", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_menstrual_period", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + } + }, + { + "key": "gest_age_note", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Umri wa Mimba kwa Wiki", + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + } + }, + { + "key": "edd", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "edd", + "type": "edit_text", + "hint": "Tarehe anayotazamia Kujifungua", + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + } + }, + { + "key": "gest_age", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gest_age", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + } + }, + { + "key": "not_pregnant", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "toaster_notes", + "text": "Mteja sio mjamzito. \nTafadhali muunganishe kwenye huduma za Uzazi wa Mpango", + "toaster_info_text": "Mteja sio mjamzito. Tafadhali muunganishe kwenye huduma za Uzazi wa Mpango", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + } + }, + { + "key": "see_a_doctor", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "toaster_notes", + "text": "Mpatie rufaa aende kufanyiwa uchunguzi wa Uzazi", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + } + }, + { + "key": "pregnancy_confirmation_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnancy_confirmation_status", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + } + }, + { + "key": "pregnancy_confirmation_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnancy_confirmation_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_pregnancy_outcome.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_pregnancy_outcome.json index 1feab1a79..67835fb0e 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_pregnancy_outcome.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_pregnancy_outcome.json @@ -4,6 +4,7 @@ "count": "1", "encounter_type": "Pregnancy Outcome", "entity_id": "", + "global": {}, "metadata": { "start": { "openmrs_entity_parent": "", @@ -17,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -49,7 +45,7 @@ "encounter_location": "" }, "step1": { - "title": "Matokeo ya ujauzito", + "title": "Matokeo ya Ujauzito", "fields": [ { "key": "relational_id", @@ -58,11 +54,80 @@ "openmrs_entity_id": "relational_id", "type": "hidden" }, + { + "key": "mothers_condition", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mothers_condition", + "type": "native_radio", + "label": "Hali ya Mama ya ki Afya", + "label_text_style": "bold", + "text_color": "#000000", + "options": [ + { + "key": "alive", + "text": "Yupo Mzima", + "openmrs_entity": "concept", + "openmrs_entity_id": "alive", + "openmrs_entity_parent": "" + }, + { + "key": "deceased", + "text": "Amefariki", + "openmrs_entity": "concept", + "openmrs_entity_id": "deceased", + "openmrs_entity_parent": "" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua kipengele cha hali ya Mama" + } + }, + { + "key": "date_of_death", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "date_of_death", + "type": "date_picker", + "hint": "Tarehe mama kufariki ", + "expanded": false, + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali jaza tarehe ambayo mama kafariki" + }, + "relevance": { + "step1:mothers_condition": { + "type": "string", + "ex": "equalTo(., \"deceased\")" + } + } + }, + { + "key": "time_of_death", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "time_of_death", + "type": "time_picker", + "hint": "Muda mama kufariki ", + "expanded": false, + "v_required": { + "value": "true", + "err": "Tafadhali jaza saa ambayo mama kafariki" + }, + "relevance": { + "step1:mothers_condition": { + "type": "string", + "ex": "equalTo(., \"deceased\")" + } + } + }, { "key": "preg_outcome", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "161033AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "preg_outcome", "type": "native_radio", "label": "Matokeo ya ujauzito", "label_text_style": "bold", @@ -70,42 +135,37 @@ "options": [ { "key": "born_alive", - "text": "Mtoto amezaliwa hai", - "value": false, + "text": "Mtoto alizaliwa mzima", "openmrs_entity": "concept", - "openmrs_entity_id": "151849AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "born_alive", "openmrs_entity_parent": "" }, { "key": "born_alive_died", - "text": "Mtoto amezaliwa hai, lakini akafariki", - "value": false, + "text": "Mtoto alizaliwa hai, lakini akafariki baadaye", "openmrs_entity": "concept", - "openmrs_entity_id": "164816AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "born_alive_died", "openmrs_entity_parent": "" }, { "key": "still_born", - "text": "Mtoto amezaliwa mfu", - "value": false, + "text": "Mtoto alizaliwa akiwa amekwisha fariki", "openmrs_entity": "concept", - "openmrs_entity_id": "125872AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "still_born", "openmrs_entity_parent": "" }, { "key": "alive_with_problem", - "text": "Mtoto amezaliwa hai, lakini ana shida (mf. ulemavu, kupumua kwa shida, nk.)", - "value": false, + "text": "Mtoto alizaliwa hai, lakini aamekutwa na matatizo (i.e: ulemavu, matatizo ya kupumua)", "openmrs_entity": "concept", - "openmrs_entity_id": "161599AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "alive_with_problem", "openmrs_entity_parent": "" }, { "key": "miscarriage", - "text": "Mimba kuharibika", - "value": false, + "text": "Mimba iliharibika", "openmrs_entity": "concept", - "openmrs_entity_id": "48AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "miscarriage", "openmrs_entity_parent": "" } ], @@ -114,18 +174,123 @@ "err": "Tafadhali chagua matokeo ya ujauzito" } }, + { + "key": "prompt_for_child_with_problem", + "type": "toaster_notes", + "text": "Dhibiti hali hii kulingana na muongozo uliopo", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:preg_outcome": { + "type": "string", + "ex": "equalTo(., \"alive_with_problem\")" + } + } + }, + { + "key": "sex_of_the_deceased_child", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sex_of_the_deceased_child", + "type": "spinner", + "hint": "Jinsi ya mtoto aliyefariki", + "values": [ + "Me", + "Ke", + "Jinsi Tata" + ], + "keys": [ + "Male", + "Female", + "Ambiguous" + ], + "openmrs_choice_ids": { + "Male": "Male", + "Female": "Female", + "Ambiguous": "Ambiguous" + }, + "relevance": { + "step1:preg_outcome": { + "type": "string", + "ex": "equalTo(., \"born_alive_died\")" + } + }, + "v_required": { + "value": "true", + "err": "Please select the sex" + } + }, + { + "key": "reason_child_died", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_child_died", + "type": "spinner", + "hint": "Sababu Zilizopelekea Mtoto Kufariki", + "values": [ + "Birth Asphyxia", + "Neonatal Respiratory Distress", + "Prematurity", + "Early Neonatal Sepsis", + "Sababu nyinginezo" + ], + "keys": [ + "birth_asphyxia", + "neonatal_respiratory_distress", + "prematurity", + "early_neonatal_sepsis", + "others" + ], + "openmrs_choice_ids": { + "birth_asphyxia": "birth_asphyxia", + "neonatal_respiratory_distress": "neonatal_respiratory_distress", + "prematurity": "prematurity", + "early_neonatal_sepsis": "early_neonatal_sepsis", + "others": "others" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:preg_outcome": { + "type": "string", + "ex": "equalTo(., \"born_alive_died\")" + } + } + }, + { + "key": "other_reasons_for_child_death", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reasons_for_child_death", + "type": "edit_text", + "hint": "Sababu nyingine zilizopelekea mtoto kufariki", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_child_died": { + "type": "string", + "ex": "equalTo(., \"others\")" + } + } + }, { "key": "miscarriage_date", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "165248AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "miscarriage_date", "type": "date_picker", - "hint": "Tarehe ya kuharibika mimba", + "hint": "Tarehe ya mimba kuharibika", "expanded": false, "max_date": "today", "v_required": { "value": "true", - "err": "Tafadhali ingiza tarehe mwanamke ameharibika mimba." + "err": "Tafadhali jaza tarehe ambayo Mimba ya Mama iliharibika/ilitoka" }, "relevance": { "rules-engine": { @@ -136,17 +301,35 @@ } }, { - "key": "delivery_date", - "openmrs_entity_parent": "", + "key": "hiv_status_question", + "type": "native_radio", + "label": "Hali ya Mama ya maambukizi ya VVU", + "openmrs_entity_id": "hiv_status_question", "openmrs_entity": "concept", - "openmrs_entity_id": "5599AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "date_picker", - "hint": "Tarehe ya kujifungua", - "expanded": false, - "max_date": "today", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity_id": "positive", + "openmrs_entity": "concept" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity_id": "negative", + "openmrs_entity": "concept" + }, + { + "key": "unknown", + "text": "Haijulikani", + "openmrs_entity": "concept", + "openmrs_entity_id": "unknown" + } + ], "v_required": { - "value": "true", - "err": "Tafadhali ingiza tarehe mwanamke aliyejifungua" + "value": true, + "err": "Tafadhali jibu swali hili" }, "relevance": { "rules-engine": { @@ -157,28 +340,66 @@ } }, { - "key": "no_children", - "openmrs_entity_parent": "", + "key": "risk_category", + "type": "native_radio", + "label": "Hali ya Hatari ya Mtoto mchanga kuaambukizwa VVU", + "openmrs_entity_id": "risk_category", "openmrs_entity": "concept", - "openmrs_entity_id": "164894AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_data_type": "select one", - "type": "spinner", - "hint": "Idadi ya watoto waliozaliwa hai", - "values": [ - "1", - "2+" - ], - "keys": [ - "1", - "2+" + "openmrs_entity_parent": "", + "options": [ + { + "key": "high", + "text": "Ipo Juu", + "openmrs_entity_id": "high", + "openmrs_entity": "concept" + }, + { + "key": "low", + "text": "Ipo Chini", + "openmrs_entity_id": "low", + "openmrs_entity": "concept" + } ], - "openmrs_choice_ids": { - "1": "159913AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "2+": "159914AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_outcome_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_high_risk_results", + "type": "toaster_notes", + "text": "Mfanyie Mtoto kipimo cha VVU mara baada ya kuzaliwa. Mpe mtoto kinga ya ARV kwa wiki 6, ikifuatiwa na monoprophylaxis kwa kipindi cha wiki 6 nyingine, endelea kumfuatilia mtoto kulinganga na muongozo wa Wizara ya Afya.", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:risk_category": { + "type": "string", + "ex": "equalTo(., \"high\")" + } + } + }, + { + "key": "delivery_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_date", + "type": "date_picker", + "hint": "Tarehe ya Mama ya kujifungua", + "expanded": false, + "min_date": "today-42d", + "max_date": "today", "v_required": { "value": "true", - "err": "Tafadhali chagua chaguo moja" + "err": "Tafadhali ingiza tarehe ya kujifungua ya Mama" }, "relevance": { "rules-engine": { @@ -188,31 +409,38 @@ } } }, + { + "key": "no_children", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_children", + "type": "hidden" + }, { "key": "delivery_place", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1572AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "delivery_place", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Mahali alipojifungulia mama", + "hint": "Mahali ambapo Mama alijifungulia", "values": [ - "Nyumbani", - "Kituo cha kutolea huduma za afya", - "Njiani kabla ya kufika kituoni", - "Mahali pengine" + "Kwenye Kituo cha Afya", + "Amejifungua Njiani kabla ya kufika kwenye Kituo", + "Amejifungulia Nyumbani", + "Amejifungulia kwa Mkunga wa Jadi" ], "keys": [ - "At home", "At a health facility", - "On the way to the health facility", - "Other" + "Birth before Arrival (BBA)", + "At home", + "Traditional birth attendant" ], "openmrs_choice_ids": { - "At Home": "1536AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "At a health facility": "1588AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "On the way to the health facility": "1601AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "Other": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "At a health facility": "At a health facility", + "Birth before Arrival (BBA)": "Birth before Arrival (BBA)", + "At home": "At home", + "Traditional birth attendant": "Traditional birth attendant" }, "v_required": { "value": "true", @@ -230,14 +458,14 @@ "key": "delivery_home", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1573AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "delivery_home", "type": "native_radio", - "label": "Je, nani amemsaidia kujifungulia nyumbani?", + "label": "Nani alimsaidia Mama kujifungua nyumbani?", "label_text_style": "bold", "text_color": "#C0C0C0", "v_required": { "value": "true", - "err": "Tafadhali chagua chaguo moja" + "err": "Tafadhali chagua" }, "relevance": { "rules-engine": { @@ -249,27 +477,24 @@ "options": [ { "key": "gave_birth_alone", - "text": "Amejifungulia nyumbani pekee yake/bila mtu", - "value": false, + "text": "Alijifungua nyumbani akiwa peke yake", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "gave_birth_alone" }, { "key": "gave_birth_with_help", - "text": "Amejifungulia nyumbani akisaidiwa na mtu wa familia/rafiki/jirani", - "value": false, + "text": "Alijifungua nyumbani akisaidiiwa na mwanafamilia/rafiki/jirani", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1575AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "gave_birth_with_help" }, { "key": "midwife_help", - "text": "Amejifungulia nyumbani akisaidiwa na mkunga wa jadi", - "value": false, + "text": "Alijifungua nyumbani akisaidiwa na mkunga wa jadi", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "125872AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "midwife_help" } ] }, @@ -277,14 +502,14 @@ "key": "delivery_hf", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "159771AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "delivery_hf", "type": "native_radio", - "label": "Amejifungua kwenye kituo cha kutolea huduma ya afya. Je, amesindikizwa na nani?", + "label": "Mama alijifungua katika kituo cha afya. Nani aliongozana na mama hadi kituo cha afya?", "label_text_style": "bold", "text_color": "#C0C0C0", "v_required": { "value": "true", - "err": "Tafadhali chagua chaguo moja" + "err": "Tafadhali chagua" }, "relevance": { "rules-engine": { @@ -296,57 +521,51 @@ "options": [ { "key": "facility_family_member", - "text": "Amejifungulia  katika kituo cha kutolea huduma za afya, na amesindikizwa na mwanafamilia.", - "value": false, + "text": "Alisindikizwa na wanafamilia.", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "969AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "facility_family_member" }, { "key": "facility_midwife", - "text": "Amejifungulia katika kituo cha kutolea huduma za afya, na amesindikizwa na mkunga wa jadi", - "value": false, + "text": "Alisindikizwa na Mkunga wa Jadi", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1575AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "facility_midwife" }, { "key": "alone", - "text": "Amejifungulia katika kituo cha kutolea huduma za afya, na amekuja pekee yake", - "value": false, + "text": "Alikuja peke yake", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "alone" }, { "key": "other_pple", - "text": "Amejifungulia katika kituo cha kutolea huduma ya afya, na amesindikizwa na watu wengine", - "value": false, + "text": "Alisindikizwa na watu wengine", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1582AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "other_pple" }, { "key": "other_chw", - "text": "Amejifungulia katika kituo cha kutolea huduma ya afya, na amesindikizwa na CHW", - "value": false, + "text": "Alisindikizwa na Mtoa huduma ngazi ya Jamii", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "other_chw" } ] }, { "key": "baby_label", "type": "label", - "text": "MALEZO YA MTOTO", - "has_bg": true, + "text": "Taarifa za Mtoto", "left_padding": "20dp", "right_padding": "20dp", - "text_size": "5sp", + "text_size": "7sp", "text_color": "#000000", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "relevance": { "rules-engine": { @@ -357,317 +576,1046 @@ } }, { - "key": "temp_unique_id", + "key": "fam_name", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "temp_unique_id", + "openmrs_entity_id": "fam_name", "type": "hidden" }, { - "key": "unique_id", - "openmrs_entity_parent": "", - "openmrs_entity": "person_identifier", - "openmrs_entity_id": "opensrp_id", - "type": "barcode", - "barcode_type": "qrcode", - "hint": "Boresha Afya ID", - "scanButtonText": "Chukua QR code", - "v_numeric": { - "value": "true", - "err": "Tafadhali ingiza namba halali" - }, - "v_required": { - "value": "true", - "err": "Tafadhali ingiza namba cha KIPEKEE" - }, - "calculation": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_calculation.yml" - } - } - }, - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" - } - } - } - }, - { - "key": "surname", + "key": "no_immediate_new_born", + "type": "repeating_group", + "reference_edit_text_hint": "Idadi ya Wototo waliozaliwa", + "repeating_group_label": "Taarifa za Mtoto #", "openmrs_entity_parent": "", "openmrs_entity": "", "openmrs_entity_id": "", - "type": "edit_text", - "hint": "Jina la mwisho (ukoo)", - "edit_type": "name", - "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Tafadhali ingiza jina halali" - }, - "v_required": { - "value": "true", - "err": "Tafadhali ingiza jina la ukoo" - }, + "repeating_group_max": "4", + "expand_on_text_change": "true", "relevance": { "rules-engine": { "ex-rules": { "rules-file": "anc_pregnancy_outcome_relevance.yml" } } - } - }, - { - "key": "same_as_fam_name_chk", - "openmrs_entity_parent": "", - "openmrs_entity": "", - "openmrs_entity_id": "", - "openmrs_data_type": "text", - "type": "check_box", - "options": [ + }, + "value": [ + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "15dp" + }, + { + "key": "apgar_score_label", + "type": "label", + "text": "Alama ya APGAR ya Ujumla", + "text_size": "7sp", + "text_color": "#000000", + "label_info_title": "Alama ya APGAR ya Ujumlae", + "label_info_text": "0 - 6: Sio ya Kawaida \n7 - 10: Kawaida", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "" + }, + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp" + }, { - "key": "same_as_fam_name", - "text": "Surname sawa na jina la ukoo", + "key": "apgar_score", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "apgar_score", + "type": "numbers_selector", + "number_of_selectors": "11", + "start_number": "0", + "max_value": "10", "text_size": "18px", - "value": "false" - } - ], - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" + "text_color": "#000000", + "selected_text_color": "#ffffff", + "v_required": { + "value": true, + "err": "Tafadhali weka agpar score" } - } - } - }, - { - "key": "fam_name", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "fam_name", - "type": "hidden" - }, - { - "key": "surname_calculation", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "last_name", - "type": "hidden", - "hint": "Jina la ukoo ni saww kama jina la ukoo ya familia", - "calculation": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_calculation.yml" + }, + { + "key": "apgar_score_calculated", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "apgar_score_calculated", + "type": "edit_text", + "hidden": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } } - } - } - }, - { - "key": "first_name", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "first_name", - "type": "edit_text", - "hint": "Jina la kwanza", - "edit_type": "name", - "v_required": { - "value": "true", - "err": "Tafadhali ingiza jina la kwanza" - }, - "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Tafadhali ingiza jina halali" - }, - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" + }, + { + "key": "prompt_for_normal_apgar_score", + "type": "toaster_notes", + "text": "Alama ya APGAR ya Ujumla, Kawaida: {apgar_score}", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "positive", + "relevance": { + "step1:apgar_score": { + "type": "numeric", + "ex": "greaterThanEqualTo(.,\"7\")" + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } } - } - } - }, - { - "key": "middle_name", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "middle_name", - "type": "edit_text", - "hint": "Jina la kati", - "edit_type": "name", - "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Tafadhali ingiza jina halali" - }, - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" + }, + { + "key": "prompt_for_abnormal_apgar_score", + "type": "toaster_notes", + "text": "Alama ya APGAR ya Ujumla, Sio ya Kawaida: {apgar_score}. \nMtoto apewe huduma ya dharura", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:apgar_score": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"6\")" + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } } - } - } - }, - { - "key": "dob", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "birthdate", - "type": "hidden", - "calculation": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_calculation.yml" + }, + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "15dp" + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Jina la Ukoo", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka Jina la Ukoo" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Ukoo" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } } - } - } - }, - { - "key": "gender", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "gender", - "type": "spinner", - "hint": "Jinsi", - "values": [ - "Me", - "Ke" - ], - "keys": [ - "Male", - "Female" - ], - "v_required": { - "value": "true", - "err": "Tafadhali ingiza jinsia" - }, - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" + }, + { + "key": "same_as_fam_name_chk", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "openmrs_data_type": "text", + "type": "check_box", + "options": [ + { + "key": "same_as_fam_name", + "text": "Jina la mwisho ni sawa na Jina la Ukoo", + "text_size": "18px", + "value": "false" + } + ] + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "Jina la Kwanza", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kwanza" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Ingiza jina sahihi" + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Jina la Kati", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Ingiza jina sahihi" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kati" + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "hidden" + }, + { + "key": "gender", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Jinsi", + "values": [ + "Me", + "Ke", + "Jinsia Tata" + ], + "keys": [ + "Male", + "Female", + "Ambiguous" + ], + "v_required": { + "value": "true", + "err": "Jinsi inahitajika kujazwa" + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Uzito (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza uzito" + }, + "v_min": { + "value": "1.5", + "err": "Uzito lazima uwe sawasawa au zaidi ya 1.5 (KG)" + }, + "v_max": { + "value": "6", + "err": "Uzito lazima uwe sawasawa au chini ya 6 (KG)" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza uzito" + } + }, + { + "key": "disabilities", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabilities", + "type": "spinner", + "hint": "Ulemavu wa kimwili", + "values": [ + "Ndio", + "Hapana" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + } + }, + { + "key": "prompt_for_disabilities", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:disabilities": { + "type": "string", + "ex": "equalTo(.,\"Yes\")" + } + } + }, + { + "key": "type_of_disability", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Aina ya ulemavu wa kimwili", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Ulemavu wa Kimwili na utembeaji", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Ulemavu wa uti wa mgongo", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Majeraha ya kichwa - Ulemavu wa Ubongo", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Ulemavu wa Maono", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Ulemavu wa Kusikia ", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Ulemavu wa Utambuzi au Kujifunza", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Matatizo ya Kisaikolojia", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Ulemavu usioonekana", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } + } + }, + { + "key": "early_bf_1hr", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "early_bf_1hr", + "type": "spinner", + "hint": "Amenyonyeshwa ndani ya saa 1?", + "values": [ + "Ndio", + "Hapana" + ], + "keys": [ + "yes", + "no" + ], + "openmrs_choice_ids": { + "Yes": "yes", + "No": "no" + } + }, + { + "key": "reason_for_not_breast_feeding_within_one_hour", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_breast_feeding_within_one_hour", + "type": "spinner", + "hint": "Sababu za kwanini mtoto hakunyonyeshwa ndani ya saa 1", + "values": [ + "Mama alifariki", + "Mtoto hakuweza kunyonya", + "Mama alichagua kunywesha maziwa mbadala (RF)", + "Nyingine (Taja)" + ], + "keys": [ + "mother_died", + "baby_unable_to_breast_feed", + "replacement_feeding", + "other" + ], + "openmrs_choice_ids": { + "mother_died": "mother_died", + "baby_unable_to_breast_feed": "baby_unable_to_breast_feed", + "replacement_feeding": "replacement_feeding", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:early_bf_1hr": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_for_not_breast_feeding_within_one_hour", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_breast_feeding_within_one_hour", + "type": "edit_text", + "hint": "Sababu nyingine za kutokumnyonyesha mtoto", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali taja sababu" + }, + "relevance": { + "step1:reason_for_not_breast_feeding_within_one_hour": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "child_bcg_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_bcg_vaccination", + "type": "native_radio", + "label": "Je, Mtoto amepata chanjo ya BCG?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + } + }, + { + "key": "prompt_for_bcg_vacc_not_provided", + "type": "toaster_notes", + "text": "Mpatie Mtoto chanjo ya BCG wakati wa udhulio la kwanza la PNC, au mara tuu chanjo ya BCG ikiwepo. BCG haiwezi kutolewa kwa Mtoto ambaye amezidi miezi 12", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:child_bcg_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "reason_for_not_providing_bcg_vacc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_bcg_vacc", + "type": "spinner", + "hint": "Sababu ya chanjo ya BCG kutotolewa", + "values": [ + "Chanjo zimeisha", + "Amejifungua akiwa nyumbani" + ], + "keys": [ + "out_of_stock_vaccine", + "home_delivery" + ], + "openmrs_choice_ids": { + "out_of_stock_vaccine": "out_of_stock_vaccine", + "home_delivery": "home_delivery" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:child_bcg_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "child_opv0_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_opv0_vaccination", + "type": "native_radio", + "label": "Je, Mtoto amepata chanjo ya OPV0?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + } + }, + { + "key": "prompt_for_opv0_vacc_not_provided", + "type": "toaster_notes", + "text": "Mpatie chanjo ya OPV 0 mtoto kwenye udhurio la kwanza la baada ya kujifungua(PNC) au mara tu chanjo ya OPV 0 itakapo kuwepo.OPV 0 haitakiwi kutolewa baada ya mtoto kufikisha siku 14", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:child_opv0_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } } } - } - }, - { - "key": "disabilities", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "159522AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "spinner", - "hint": "Ulemavu", - "values": [ - "Ndiyo", - "Hapana" ], - "keys": [ - "Yes", - "No" - ], - "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, "v_required": { "value": "true", - "err": "Tafadhali chagua chaguo moja" - }, - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" - } - } + "err": "Tafadhali jaza idadi ya watoto waliozaliwa hai" } }, { - "key": "type_of_disability", + "key": "no_children_no", + "type": "repeating_group", + "reference_edit_text_hint": "Idadi ya watoto waliozaliwa Hai", + "repeating_group_label": "Taarifa ya Mtoto #", "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "hint": "Aina ya ulemavu", - "edit_type": "name", + "openmrs_entity": "", + "openmrs_entity_id": "", + "repeating_group_max": "4", + "expand_on_text_change": "true", "relevance": { "rules-engine": { "ex-rules": { "rules-file": "anc_pregnancy_outcome_relevance.yml" } } - } - }, - { - "key": "early_bf_1hr", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "164819AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "spinner", - "hint": "Unyonyeshaji wa mtoto ndani ya saa moja baada ya kujifungua?", - "values": [ - "Ndiyo", - "Hapana" - ], - "keys": [ - "Yes", - "No" - ], - "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" + "value": [ + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Jina la Ukoo", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "err": "Ingiza jina sahihi" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Ukoo" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } } - } - } - }, - { - "key": "vacc_birth", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "check_box", - "label": "Chanjo gani alizopata mtoto?", - "label_text_style": "normal", - "text_color": "#C0C0C0", - "exclusive": [ - "chk_none" - ], - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" + }, + { + "key": "same_as_fam_name_chk", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "openmrs_data_type": "text", + "type": "check_box", + "options": [ + { + "key": "same_as_fam_name", + "text": "Jina la mwisho ni sawa na Jina la Ukoo", + "text_size": "18px", + "value": "false" + } + ] + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "Jina la Kwanza", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kwanza" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "err": "Ingiza jina sahihi" } - } - }, - "options": [ + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Jina la Kati", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "err": "Ingiza jina sahihi" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kati" + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "hidden" + }, + { + "key": "gender", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Jinsi", + "values": [ + "Me", + "Ke", + "Jinsia Tata" + ], + "keys": [ + "Male", + "Female", + "Ambiguous" + ], + "v_required": { + "value": "true", + "err": "Jinsi inahitajika" + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Uzito (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza uzito" + }, + "v_min": { + "value": "1.5", + "err": "Uzito lazima uwe sawasawa au zaidi ya 1.5 (KG)" + }, + "v_max": { + "value": "6", + "err": "Uzito lazima uwe sawasawa au chini ya 6 (KG)" + } + }, + { + "key": "disabilities", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabilities", + "type": "spinner", + "hint": "Ulemavu wa kimwili", + "values": [ + "Ndio", + "Hapana" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + } + }, + { + "key": "prompt_for_disabilities", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:disabilities": { + "type": "string", + "ex": "equalTo(.,\"Yes\")" + } + } + }, + { + "key": "type_of_disability", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Aina ya ulemavu wa kimwili", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Ulemavu wa Kimwili na utembeaji", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Ulemavu wa uti wa mgongo", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Majeraha ya kichwa - Ulemavu wa Ubongo", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Ulemavu wa Maono", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Ulemavu wa Kusikia ", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Ulemavu wa Utambuzi au Kujifunza", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Matatizo ya Kisaikolojia", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Ulemavu usioonekana", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } + } + }, + { + "key": "early_bf_1hr", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "early_bf_1hr", + "type": "spinner", + "hint": "Amenyonyeshwa ndani ya saa 1?", + "values": [ + "Ndio", + "Hapana" + ], + "keys": [ + "yes", + "no" + ], + "openmrs_choice_ids": { + "Yes": "yes", + "No": "no" + } + }, + { + "key": "reason_for_not_breast_feeding_within_one_hour", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_breast_feeding_within_one_hour", + "type": "spinner", + "hint": "Sababu za kwanini mtoto hakunyonyeshwa ndani ya saa 1", + "values": [ + "Mama alifariki", + "Mtoto hakuweza kunyonya", + "Mama alichagua kunywesha maziwa mbadala (RF)", + "Nyingine (Taja)" + ], + "keys": [ + "mother_died", + "baby_unable_to_breast_feed", + "replacement_feeding", + "other" + ], + "openmrs_choice_ids": { + "mother_died": "mother_died", + "baby_unable_to_breast_feed": "baby_unable_to_breast_feed", + "replacement_feeding": "replacement_feeding", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:early_bf_1hr": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, { - "key": "chk_none", - "text": "Hajapata chanjo", - "value": false, + "key": "other_reason_for_not_breast_feeding_within_one_hour", + "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "other_reason_for_not_breast_feeding_within_one_hour", + "type": "edit_text", + "hint": "Sababu nyingine za kutokumnyonyesha mtoto", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali taja sababu" + }, + "relevance": { + "step1:reason_for_not_breast_feeding_within_one_hour": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } }, { - "key": "chk_opv_0", - "text": "OPV 0", - "value": false, + "key": "child_bcg_vaccination", + "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "child_bcg_vaccination", + "type": "native_radio", + "label": "Je, Mtoto amepata chanjo ya BCG?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + } }, { - "key": "chk_bcg", - "text": "BCG", - "value": false, + "key": "prompt_for_bcg_vacc_not_provided", + "type": "toaster_notes", + "text": "Mpatie Mtoto chanjo ya BCG wakati wa udhulio la kwanza la PNC, au mara tuu chanjo ya BCG ikiwepo. BCG haiwezi kutolewa kwa Mtoto ambaye amezidi miezi 12", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:child_bcg_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "reason_for_not_providing_bcg_vacc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_bcg_vacc", + "type": "spinner", + "hint": "Sababu ya chanjo ya BCG kutotolewa", + "values": [ + "Chanjo zimeisha", + "Amejifungua akiwa nyumbani" + ], + "keys": [ + "out_of_stock_vaccine", + "home_delivery" + ], + "openmrs_choice_ids": { + "out_of_stock_vaccine": "out_of_stock_vaccine", + "home_delivery": "home_delivery" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:child_bcg_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "child_opv0_vaccination", + "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "child_opv0_vaccination", + "type": "native_radio", + "label": "Je, Mtoto amepata chanjo ya OPV 0?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + } + }, + { + "key": "prompt_for_opv0_vacc_not_provided", + "type": "toaster_notes", + "text": "Mpatie chanjo ya OPV 0 mtoto kwenye udhurio la kwanza la baada ya kujifungua (PNC) au mara tu chanjo ya OPV 0 itakapo kuwepo.OPV 0 haitakiwi kutolewa baada ya mtoto kufikisha siku 14", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:child_opv0_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } } ], "v_required": { "value": "true", - "err": "Tafadhali chagua chaguo angalau moja" + "err": "Tafadhali jaza idadi ya watoto waliozaliwa hai" + } + }, + { + "key": "hiv", + "type": "hidden", + "openmrs_entity_id": "hiv", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_outcome_calculation.yml" + } + } } } ] diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_referral_form.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_referral_form.json new file mode 100644 index 000000000..42bf097ab --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_referral_form.json @@ -0,0 +1,421 @@ +{ + "count": "1", + "encounter_type": "ANC Referral", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "today": { + "openmrs_entity_parent": "", + "openmrs_entity": "encounter", + "openmrs_entity_id": "encounter_date" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "ANC referral form", + "fields": [ + { + "key": "chw_referral_hf_anc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "1759AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "type": "hidden", + "is_problem": false, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_referral_calculation.yml" + } + } + } + }, + { + "key": "problem_hf_anc", + "openmrs_entity_parent": "", + "openmrs_entity": "", + "openmrs_entity_id": "163182AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "type": "check_box", + "label": "Halai/tatizo la mteja", + "label_text_style": "bold", + "options": [ + { + "key": "Vaginal_bleeding", + "text": "Kutokwa na damu ukeni", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "147232AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Discoloured_or_watery_liquid_vaginal_discharge_with_a_bad_smell", + "text": "Kutokwa na majimaji yenye rangirangi na yenye harufu mbaya kutoka ukeni", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "123396AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "High_blood_pressure", + "text": "Sinikizo la juu la damu", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "113088AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Severe_abdominal_pain", + "text": "Maumivu makali ya tumbo", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "165271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Severe_anaemia", + "text": "Kupungukiwa kwa damu nyingi", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "162044AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Convulsions", + "text": "Degedege", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "113054AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "No_movement_unusual_movement_for_a_child_in_the_womb", + "text": "Hakuna uchezaji/uchezaji usio wakawaida wa mtoto tumboni", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "113377AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Pregnancy_pains_before_9_months", + "text": "Kujiskia uchungu kabla ya miezi 9", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "153316AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Early_age_pregnancy_below_18_years", + "text": "Mimba ya umri mdogo (chini ya miaka 18)", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "163119AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "A_severe_headache_dizziness", + "text": "Maumivu makali ya kichwa/kizunguzungu", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "139081AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Swelling_of_the_face_andor_hands", + "text": "Kuvimba uso na/au mikono", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "460AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Fever", + "text": "Homa", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "140238AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Shivering_trembling", + "text": "Kutetemeka ", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "158359AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Nausea_and_Vomiting", + "text": "Kichefuchefu na kutapika", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "133473AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Water_sack_broke_before_contractions", + "text": "Maji kupasuka kabla ya mkazo", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "129211AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Cord_prolapse", + "text": "Kutokeza kwa kamba ya kitovu", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "128419AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "HIV_care_and_support_services", + "text": "Huduma za matunzo na usaidizi wa VVU", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "159811AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Family_planning_services", + "text": "Huduma za uzazi wa mpango", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "5271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "PMTCT_for_mothers", + "text": "PMTCT kwa akina mama", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "160538AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Fistula", + "text": "Fistula", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "160854AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Difficultly_breathing", + "text": "Kupumua kwa shida", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "142373AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Breast_engorgement", + "text": "Matiti kujaa", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "118620AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Blurred_vision", + "text": "Uoni hafifu", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "147104AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Perineum_tear", + "text": "Kuchanika kwa msamba", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "136938AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Pregnancy_confirmation", + "text": "Uthibitisho wa ujauzito", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "152305AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Other_symptoms", + "text": "Dalili zingine", + "value": false, + "ignore": true, + "openmrs_entity": "", + "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + } + ], + "v_required": { + "value": true, + "err": "Tafadhali bainisha sababu ya kupata rufaa ya ANC" + } + }, + { + "key": "problem_hf_anc_other", + "type": "edit_text", + "openmrs_entity": "", + "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "", + "edit_type": "name", + "hint": "Dalili zingine", + "v_required": { + "value": "true", + "err": "Tafadhali bainisha dalili nyingine" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_referral_relevance.yml" + } + } + } + }, + { + "key": "service_before_anc", + "openmrs_entity_parent": "", + "openmrs_entity": "", + "openmrs_entity_id": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "type": "check_box", + "is_problem": false, + "label": "Usimamizi kabla ya rufaa uliyotolewa", + "label_text_style": "bold", + "exclusive": [ + "None" + ], + "options": [ + { + "key": "ORS", + "text": "ORS", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "351AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Panadol", + "text": "Panadol", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "70116AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Other_treatment", + "text": "Matibabu mengine", + "value": false, + "ignore": true, + "openmrs_entity": "", + "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "None", + "text": "Hakuna", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + } + ], + "v_required": { + "value": "true", + "err": "Sehemu ya usimamizi kabla ya rufaa inahitajika" + } + }, + { + "key": "service_before_anc_other", + "type": "edit_text", + "openmrs_entity": "", + "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "", + "is_problem": false, + "edit_type": "name", + "hint": "Matitabu mengine", + "v_required": { + "value": "true", + "err": "Tafadhali bainisha matibabu mengine" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_referral_relevance.yml" + } + } + } + }, + { + "key": "referral_date_anc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "163181AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "type": "hidden", + "is_problem": false, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_referral_calculation.yml" + } + } + } + }, + { + "key": "referral_time_anc", + "openmrs_entity_parent": "", + "openmrs_entity": "", + "openmrs_entity_id": "", + "type": "hidden", + "is_problem": false, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_referral_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_birth_review_and_emergency_plan.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_birth_review_and_emergency_plan.json new file mode 100644 index 000000000..8b2e38be3 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_birth_review_and_emergency_plan.json @@ -0,0 +1,291 @@ +{ + "count": "1", + "encounter_type": "Emergency Plan", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": { + "delivery_place_identified": false, + "transport_identified": false, + "birth_companion_identified": false, + "emergency_funds_identified": false, + "household_support_identified": false, + "blood_donor_identified": false + }, + "step1": { + "title": "Pitia na Hakiki Mpango wa Kujifungua na Dharura", + "fields": [ + { + "key": "delivery_place", + "type": "native_radio", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_place", + "openmrs_entity_parent": "", + "label": "Kituo cha Afya cha Kujifungulia Kimetambulika?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "text": "Kimetambulika na Kuandaliwa", + "key": "prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "prepared" + }, + { + "text": "Bado Hakijatabmulika", + "key": "not_prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_prepared" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_emergency_plan_relevance.yml" + } + } + } + }, + { + "key": "name_of_hf", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "name_of_hf", + "buttonText": "Select Health Facility", + "sort": true, + "maxSelectable": 1, + "dialogTitle": "Health Facility", + "searchHint": "Type Health Facility Name", + "options": [ + ], + "type": "multi_select_list", + "v_required": { + "value": true, + "err": "Please select the health facility" + }, + "relevance": { + "step1:delivery_place": { + "type": "string", + "ex": "equalTo(., \"prepared\")" + } + } + }, + { + "key": "transport", + "type": "native_radio", + "openmrs_entity": "concept", + "openmrs_entity_id": "transport", + "openmrs_entity_parent": "", + "label": "Andaa Njia ya Usafiri", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "text": "Njia ya Usafiri Imetambuliwa", + "key": "prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "prepared" + }, + { + "text": "Njia ya Usafiri Haijatambuliwa", + "key": "not_prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_prepared" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_emergency_plan_relevance.yml" + } + } + } + }, + { + "key": "birth_companion", + "type": "native_radio", + "openmrs_entity": "concept", + "openmrs_entity_id": "birth_companion", + "openmrs_entity_parent": "", + "label": "Andaa Mwenzi wa kujifungua na kuarifiwa", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "text": "Mwenzi wa kujifungua ametambulika na kuarifiwa", + "key": "prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "prepared" + }, + { + "text": "Hajatambulika na kuarifiwa", + "key": "not_prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_prepared" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_emergency_plan_relevance.yml" + } + } + } + }, + { + "key": "emergency_funds", + "type": "native_radio", + "openmrs_entity": "concept", + "openmrs_entity_id": "emergency_funds", + "openmrs_entity_parent": "", + "label": "Andaa hela kwa ajili ya kujifungua na mahitaji mengine", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "prepared", + "text": "Zimeandaliwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "prepared" + }, + { + "key": "not_prepared", + "text": "Bado Hazijaandaliwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_prepared" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_emergency_plan_relevance.yml" + } + } + } + }, + { + "key": "household_support", + "type": "native_radio", + "openmrs_entity": "concept", + "openmrs_entity_id": "household_support", + "openmrs_entity_parent": "", + "label": "Andaa Msaada wa Mlezi wa Kaya", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "text": "Ameandaliwa", + "key": "prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "prepared" + }, + { + "text": "Bado hajaandaliwa", + "key": "not_prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_prepared" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_emergency_plan_relevance.yml" + } + } + } + }, + { + "key": "blood_donor", + "type": "native_radio", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_donor", + "openmrs_entity_parent": "", + "label": "Tayarisha mtu wa kutoa damu", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "prepared", + "text": "Ametayarishwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "prepared" + }, + { + "key": "not_prepared", + "text": "Bado Hajatayarishwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_prepared" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_emergency_plan_relevance.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_consultation.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_consultation.json new file mode 100644 index 000000000..a5f3878fe --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_consultation.json @@ -0,0 +1,707 @@ +{ + "count": "1", + "encounter_type": "ANC Consultation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Mashauriano ya ANC", + "fields": [ + { + "key": "examination_findings", + "type": "check_box", + "label": "Matokeo ya Uchunguzi kwenye hudhurio la leo", + "combine_checkbox_option_values": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "examination_findings", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "puffy_face", + "text": "Uso umevimba", + "openmrs_entity": "concept", + "openmrs_entity_id": "puffy_face" + }, + { + "key": "pallor", + "text": "Kupauka (jicho, viganja, ncha ya ulimi, fizi)", + "openmrs_entity": "concept", + "openmrs_entity_id": "pallor" + }, + { + "key": "none", + "text": "Hakuna", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ] + }, + { + "key": "prompt_for_examination_findings", + "type": "toaster_notes", + "openmrs_entity": "concept", + "openmrs_entity_id": "prompt_for_examination_findings", + "openmrs_entity_parent": "", + "text": "Tafadhali mpatie Mteja huduma ya dharura kuhusiana na hali hii ya upungufu wa damu na moyo/figo kushindwa kufanya kazi vizuri. Bainisha sababu na dhibiti hali hii kulingana na mwongozo wa Wizara ya Afya.", + "toaster_type": "problem", + "relevance": { + "step1:examination_findings": { + "ex-checkbox": [ + { + "or": [ + "pallor", + "puffy_face" + ] + } + ] + } + } + }, + { + "key": "gest_age_consultation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gest_age_consultation", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_calculation.yml" + } + } + } + }, + { + "key": "height", + "type": "edit_text", + "hint": "Urefu (CM)", + "openmrs_entity": "concept", + "openmrs_entity_id": "height", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza urefu" + }, + "v_min": { + "value": "60", + "err": "Urefu lazima uwe sawasawa au zaidi ya 60 (CM)" + }, + "v_max": { + "value": "200", + "err": "Urefu lazima uwe sawasawa au chini ya 200 (CM)" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "height_calculated", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "height_calculated", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_calculation.yml" + } + } + } + }, + { + "key": "prompt_for_short_stature", + "type": "toaster_notes", + "text": "Mshauri mteja kujifungua kwenye Kituo cha Afya kutokana na hatari kubwa ya kupata uchungu pingamizi", + "openmrs_entity_id": "prompt_for_short_stature", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:height": { + "type": "numeric", + "ex": "lessThan(.,\"145\")" + } + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Uzito (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza uzito" + }, + "v_min": { + "value": "20", + "err": "Uzito lazima uwe sawasawa au zaidi ya 20 (KG)" + }, + "v_max": { + "value": "300", + "err": "Uzito lazima uwe sawasawa au chini ya 300 (KG)" + } + }, + { + "key": "bmi", + "type": "edit_text", + "hint": "Kielezo cha Uzito wa Mwili (BMI)", + "read_only": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "bmi", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza urefu" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza urefu" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_underweight", + "type": "toaster_notes", + "text": "Mshauri Mteja kuhusiana na hali yake ya uzito mdogo kulingana na muongozo kutoka Wizara ya Afya", + "openmrs_entity_id": "prompt_for_underweight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:bmi": { + "type": "numeric", + "ex": "lessThan(.,\"18.5\")" + } + } + }, + { + "key": "prompt_for_overweight", + "type": "toaster_notes", + "text": "Mshauri Mteja kuhusiana na hali yake ya uzito mkubwa kulingana na muongozo kutoka Wizara ya Afya", + "openmrs_entity_id": "prompt_for_overweight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:bmi": { + "type": "numeric", + "ex": "greaterThanEqualTo(.,\"29\")" + } + } + }, + { + "key": "fundal_height", + "type": "edit_text", + "openmrs_entity_id": "fundal_height", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Kimo cha mimba (CM)", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + }, + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza kimo cha mimba" + }, + "v_min": {}, + "v_max": { + "value": "50", + "err": "Kimo cha mimba lazima kiwe sawa au chini ya 50 CM" + } + }, + { + "key": "fetal_heart_rate", + "type": "edit_text", + "hint": "Hesabu kiwango cha mapigo ya moyo wa mtoto (bpm)", + "openmrs_entity_id": "fetal_heart_rate", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza kiwango cha mapigo ya moyo wa mtoto" + }, + "v_min": { + "value": "0", + "err": "Kiwango cha mapigo ya moyo wa mtoto lazima kiwe sawasawa au zaidi ya 0" + }, + "v_max": { + "value": "300", + "err": "Kiwango cha mapigo ya moyo wa mtoto lazima kiwe sawasawa au chini ya 300" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_fetal_distress", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "prompt_for_fetal_distress", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "lie", + "type": "spinner", + "openmrs_entity_id": "lie", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Mlalo wa mtoto", + "values": [ + "Usawa", + "Kiupande", + "Wima" + ], + "keys": [ + "transverse", + "oblique", + "longitudinal" + ], + "openmrs_choice_ids": { + "transverse": "transverse", + "oblique": "oblique", + "longitudinal": "longitudinal" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_lie", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "presentation", + "type": "spinner", + "openmrs_entity_id": "presentation", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Kitangulizi cha mtoto", + "values": [ + "Makalio", + "Kichwa" + ], + "keys": [ + "breech", + "cephalic" + ], + "openmrs_choice_ids": { + "breech": "breech", + "cephalic": "cephalic" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_presentation", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:presentation": { + "type": "string", + "ex": "equalTo(., \"breech\")" + } + } + }, + { + "key": "systolic", + "type": "edit_text", + "hint": "Systolic (Shinikizo la Damu)", + "openmrs_entity_id": "systolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza thamani ya systolic" + }, + "v_min": { + "value": "0", + "err": "Thamani ya systolic lazima iwe sawasawa au zaidi ya 0" + }, + "v_max": { + "value": "320", + "err": "Thamani ya systolic lazima iwe sawasawa au chini ya 320" + } + }, + { + "key": "diastolic", + "type": "edit_text", + "hint": "Diastolic (Shinikizo la Damu)", + "openmrs_entity_id": "diastolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza thamani ya diastoli" + }, + "v_min": { + "value": "0", + "err": "Thamani ya diastolic lazima iwe sawasawa au zaidi ya 0" + }, + "v_max": { + "value": "200", + "err": "Thamani ya diastolic lazima iwe sawasawa au chini ya 200" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:systolic)", + "err": "Thamani ya diastolic lazima iwe chini ya thamani ya systolic" + } + ] + }, + { + "key": "prompt_for_management_of_hypertension", + "type": "toaster_notes", + "text": "Dhibiti hali hii ya Shinikizo la damu ya juu kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_management_of_hypertension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_management_of_hypotension", + "type": "toaster_notes", + "text": "Bainisha sababu za Shinikizo la damu ya chini na udhibiti kulingana na muongozo kutoka Wizara ya Afya", + "openmrs_entity_id": "prompt_for_management_of_hypotension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "pulse_rate", + "type": "edit_text", + "hint": "Kiwango cha Mapigo ya moyo (Midundo kwa dakika)", + "openmrs_entity_id": "pulse_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza kasi ya mapigo ya moyo" + }, + "v_min": { + "value": "0", + "err": "Kiwango cha mpigo lazima kiwe sawasawa au zaidi ya 0 (bpm)" + }, + "v_max": { + "value": "200", + "err": "Kiwango cha mpigo lazima kiwe sawasawa au chini ya 200 (bpm)" + } + }, + { + "key": "prompt_for_Bradycardia", + "type": "toaster_notes", + "text": "Bainisha sababu za Mapigo hafifu ya moyo na udhibiti kulingana na muongozo kutoka Wizara ya Afya", + "openmrs_entity_id": "prompt_for_Bradycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "lessThan(.,\"60\")" + } + } + }, + { + "key": "prompt_for_Tachycardia", + "type": "toaster_notes", + "text": "Bainisha sababu za Tachycardia na njia za udhibiti kulingana na muongozo kutoka Wizara ya Afya", + "openmrs_entity_id": "prompt_for_Tachycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "greaterThan(.,\"100\")" + } + } + }, + { + "key": "temperature", + "type": "edit_text", + "hint": "Halijoto (\u2103)", + "openmrs_entity_id": "temperature", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza halijoto" + }, + "v_min": { + "value": "10", + "err": "Halijoto lazima liwe sawasawa au zaidi ya 10" + }, + "v_max": { + "value": "50", + "err": "Halijoto lazima liwe sawasawa au chini ya 50" + } + }, + { + "key": "notify_client_has_fever", + "type": "toaster_notes", + "text": "Mfanyie Mama vipimo kwa ajili ya kubainisha sababu ya Homa na dhibiti hali hii kulingana na mwongozo kutoka Wizara ya Afya", + "openmrs_entity_id": "notify_client_has_fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "greaterThan(.,\"37.8\")" + } + } + }, + { + "key": "notify_client_has_hypothermia", + "type": "toaster_notes", + "text": "Dhibiti hali hii ya Jotoridi la mwili la chini kuliko kawaida kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "notify_client_has_hypothermia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "lessThan(.,\"36.5\")" + } + } + }, + { + "key": "breast", + "type": "native_radio", + "label": "Matiti", + "openmrs_entity": "concept", + "openmrs_entity_id": "breast", + "openmrs_entity_parent": "", + "options": [ + { + "key": "normal", + "text": "Kawaida", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + }, + { + "key": "abnormal", + "text": "SIo kawaida", + "openmrs_entity": "concept", + "openmrs_entity_id": "abnormal" + } + ] + }, + { + "key": "prompt_for_breasts", + "type": "toaster_notes", + "text": "Mfanyie Mama uchunguzi wa matiti ilikuweza kugundua kama ana 'Mastitis' au 'Breast lump'. Mpatie Antibiotic kama ana 'Mastitis' na dhibiti hali hii kulingana na mwongozo wa Wizara ya Afya. Mpe rufaa kwa huduma/matibabu zaidi kama ana 'Breast lump'", + "openmrs_entity_id": "prompt_for_breasts", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:breast": { + "type": "string", + "ex": "equalTo(.,\"abnormal\")" + } + } + }, + { + "key": "lymph_node_under_arm", + "type": "native_radio", + "label": "Nodi ya limfu (kwenye kwapa)", + "openmrs_entity": "concept", + "openmrs_entity_id": "lymph_node_under_arm", + "openmrs_entity_parent": "", + "options": [ + { + "key": "normal", + "text": "Kawaida", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + }, + { + "key": "abnormal", + "text": "Sio kawaida", + "openmrs_entity": "concept", + "openmrs_entity_id": "abnormal" + } + ] + }, + { + "key": "prompt_for_lymph_under_the_arm", + "type": "toaster_notes", + "text": "Tafadhali mpe rufaa mteja kwa huduma/matibabu zaidi", + "openmrs_entity_id": "prompt_for_lymph_under_the_arm", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:lymph_node_under_arm": { + "type": "string", + "ex": "equalTo(.,\"abnormal\")" + } + } + }, + { + "key": "lymph_node_cervical", + "type": "native_radio", + "label": "Nodi ya limfu (Kwenye Shingo)", + "openmrs_entity": "concept", + "openmrs_entity_id": "lymph_node_cervical", + "openmrs_entity_parent": "", + "options": [ + { + "key": "normal", + "text": "Kawaida", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + }, + { + "key": "abnormal", + "text": "Sio kawaida", + "openmrs_entity": "concept", + "openmrs_entity_id": "abnormal" + } + ] + }, + { + "key": "prompt_for_lymph_cervical", + "type": "toaster_notes", + "text": "Tafadhali mpe rufaa mteja kwa huduma/matibabu zaidi", + "openmrs_entity_id": "prompt_for_lymph_cervical", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:lymph_node_cervical": { + "type": "string", + "ex": "equalTo(.,\"abnormal\")" + } + } + }, + { + "key": "consultation_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "consultation_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_lab_test.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_lab_test.json new file mode 100644 index 000000000..838e132d2 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_lab_test.json @@ -0,0 +1,1232 @@ +{ + "count": "1", + "encounter_type": "ANC Lab Tests", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "ANC Vipimo Vya Maabara", + "fields": [ + { + "key": "hb_level_test", + "type": "native_radio", + "label": "Kipimo wa Kiwango cha damu (HB)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "test_conducted", + "text": "Kipimo cha kiwango cha damu (HB) kimefanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted", + "openmrs_entity_parent": "" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha kiwango cha damu (HB) hakijafanyika", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "hb_level", + "type": "edit_text", + "hint": "Kiwango cha damu (HB) (g/dl)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza kiwango cha damu (HB)" + }, + "v_min": { + "value": "0", + "err": "Kiwango cha damu (HB) lazima kiwe sawasawa au zaidi ya 0 (g/dl)" + }, + "v_max": { + "value": "20", + "err": "Kiwango cha damu (HB) lazima kiwe sawasawa au chini ya20 (g/dl)" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka thamani" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_conducted\")" + } + } + }, + { + "key": "prompt_for_severe_anaemia_treatment", + "type": "toaster_notes", + "text": "Dhibiti hali hii ya upungufu mkubwa wa damu kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_severe_anaemia_treatment", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hb_level": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"8.5\")" + } + } + }, + { + "key": "prompt_for_moderate_anaemia_management", + "type": "toaster_notes", + "text": "Dhibiti hali hii ya ukosefu wa damu kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_moderate_anaemia_management", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hb_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha kiwango cha HB ", + "values": [ + "Cuvette Cartridges Hazipo Kituoni", + "Mashine ya Kupimwa wingi wa damu (Haemoque) haifanyi kazi", + "Mteja alikuwa katika hali ya dharura", + "Mteja amekataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "stock_out_of_cuvettes_cartridges": "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order": "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_hb_test_not_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_hb_test_not_conducted", + "type": "edit_text", + "hint": "Sababu nyingine ya kutofanya kipimo cha kiwango cha damu (HB)", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_hb_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "blood_for_glucose_test", + "type": "native_radio", + "label": "Kipimo cha sukari kwenye damu", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_for_glucose_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "test_conducted", + "text": "Kipimo cha sukari kwenye damu kimefanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted", + "openmrs_entity_parent": "" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha sukari kwenye damu hakijafanyika", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "type_of_blood_for_glucose_test", + "type": "native_radio", + "label": "Aina ya kipimo cha sikari kwenye damu kilichofanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_blood_for_glucose_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "rbg", + "text": "Kipimo cha wingi wa sukari mwilini (rbg)", + "openmrs_entity": "concept", + "openmrs_entity_id": "rbg", + "openmrs_entity_parent": "" + }, + { + "key": "gtt", + "text": "Kipimo cha kugundua jinsi sukari mwilini inavyoratibiwa (GTT)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gtt" + }, + { + "key": "fbg", + "text": "Kipimo cha sukari (asubuhi) kabla ya kula chochote", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fbg" + } + ], + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "step1:blood_for_glucose_test": { + "type": "string", + "ex": "equalTo(., \"test_conducted\")" + } + } + }, + { + "key": "blood_for_glucose", + "type": "edit_text", + "hint": "sukari kwenye damu (mmol/L)", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_for_glucose", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza sukari kwenye damu (mmol/L)" + }, + "v_min": { + "value": "0", + "err": "Sukari kwenye damu lazima iwe sawasawa au zaidi ya 0 (mmol/L)" + }, + "v_max": { + "value": "45", + "err": "Sukari kwenye damu lazima iwe sawasawa au chini ya 45 (mmol/L)" + }, + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sukari kwenye damu (mmol/L)" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_gestational_diabetes_mellitus", + "type": "toaster_notes", + "text": "Dhibiti hali hii ya Gestational diabetes mellitus kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_gestational_diabetes_mellitus", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_hypoglycaemia", + "type": "toaster_notes", + "text": "Dhibiti hali hii ya hypoglycaemia kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_hypoglycaemia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_blood_glucose_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_blood_glucose_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha sukari kwenye damu", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine" + ], + "keys": [ + "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_are_out_of_stock": "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:blood_for_glucose_test": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_blood_glucose_test_not_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_blood_glucose_test_not_conducted", + "type": "edit_text", + "hint": "Sababu nyingine ya kutofanya kipimo cha sukari kwenye damu", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_blood_glucose_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "glucose_in_urine", + "type": "native_radio", + "label": "Sukari kwenye mkojo", + "openmrs_entity": "concept", + "openmrs_entity_id": "glucose_in_urine", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive", + "openmrs_entity_parent": "" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha sukari kwenye mkojo hakijafanyika", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "prompt_for_glucose_in_urine", + "type": "toaster_notes", + "text": "Angalia kiasi cha sukari katika damu ili kumuepusha Mteja na Ugonjwa wa kisukari wakati wa Ujauzito", + "openmrs_entity_id": "prompt_for_glucose_in_urine", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:glucose_in_urine": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_glucose_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_glucose_in_urine_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha sukari kwenye mkojo", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine" + ], + "keys": [ + "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_are_out_of_stock": "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:glucose_in_urine": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_glucose_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_glucose_in_urine_test", + "type": "edit_text", + "hint": "Sababbu ya kutofanya kipimo cha sukari kwenye mkojo", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_glucose_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "protein_in_urine", + "type": "native_radio", + "label": "Protini kwenye mkojo", + "openmrs_entity": "concept", + "openmrs_entity_id": "protein_in_urine", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya ", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive", + "openmrs_entity_parent": "" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative", + "openmrs_entity_parent": "" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha protini kwenye mkojo hakijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted", + "openmrs_entity_parent": "" + } + ] + }, + { + "key": "prompt_for_protein_in_urine", + "type": "toaster_notes", + "text": "Tafadhali fuatilia shinikizo la damu kwa Mteja ili uweze kuepusha na hatari ya Kifafa cha mimba, bainisha dalili za UTI dhibiti viashiria vya Proteinuria kulingana na mwongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_protein_in_urine", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:protein_in_urine": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_protein_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_protein_in_urine_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha protini kwenye mkojo", + "values": [ + "Vifaa vuya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine" + ], + "keys": [ + "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_are_out_of_stock": "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:protein_in_urine": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_protein_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_protein_in_urine_test", + "type": "edit_text", + "hint": "Sababu nyingine ya kutofanya kipimo cha protini kwenye mkojo", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Taadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_protein_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "blood_group", + "type": "spinner", + "hint": "Kundi la damu", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_group", + "openmrs_entity_parent": "", + "values": [ + "A", + "B", + "AB", + "O", + "Kipimo cha kundi la damu haijafanyika" + ], + "keys": [ + "A", + "B", + "AB", + "O", + "test_not_conducted" + ], + "openmrs_choice_ids": { + "A": "A", + "B": "B", + "AB": "AB", + "O": "O", + "test_not_conducted": "test_not_conducted" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_blood_group_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_blood_group_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha kundi la damu", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja amekataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_are_out_of_stock": "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:blood_group": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_blood_group_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_blood_group_test", + "type": "edit_text", + "hint": "Bainisha sababu zingine za kutofanya kipimo cha kundi la damu", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_blood_group_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "rh_factor", + "type": "native_radio", + "label": "Rh", + "openmrs_entity": "concept", + "openmrs_entity_id": "rh_factor", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_rh_factor", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:rh_factor": { + "type": "string", + "ex": "equalTo(., \"negative\")" + } + } + }, + { + "key": "hiv", + "type": "native_radio", + "label": "Matokeo ya Kipimo cha VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha VVU hakijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hiv_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha VVU ", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:hiv": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_hiv_test", + "type": "edit_text", + "hint": "Bainisha sababu nyingine ya kutofanya kipimo cha VVU", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_hiv_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "register_pmtct", + "type": "toaster_notes", + "text": "Msajili Mteja kwenye PMTCT kwa ajili ya matunzo na ufuatiliaji", + "openmrs_entity_id": "register_pmtct", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hiv": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "prescribe_arv", + "type": "toaster_notes", + "text": "Mpatie Mteja dawa za kufubaza virusi vya Ukimwi (ARV) kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prescribe_arv", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hiv": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "hiv_counselling_before_testing", + "type": "native_radio", + "label": "Je, Mteja alipewa ushauri nasaha kabla ya kupima VVU?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_counselling_before_testing", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "hiv_counselling_after_testing", + "type": "native_radio", + "label": "Je, Mteja alipewa ushauri nasaha baada ya kupima VVU?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_counselling_after_testing", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "syphilis", + "type": "native_radio", + "label": "Matokeo ya kipimo cha kaswende", + "openmrs_entity": "concept", + "openmrs_entity_id": "syphilis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha kaswende hakijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "prescribe_anti_sy", + "type": "toaster_notes", + "text": "Muagizie mteja dawa za antibiotiki (Kiuavijasumu)", + "openmrs_entity_id": "prescribe_anti_sy", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:syphilis": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "syphilis_treatment", + "type": "native_radio", + "label": "Je, matibabu ya Kaswende yalitolewa?", + "openmrs_entity": "concept", + "openmrs_entity_id": "syphilis_treatment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "step1:syphilis": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_syphilis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_syphilis_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha kaswende", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:syphilis": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_syphilis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_syphilis_test", + "type": "edit_text", + "hint": "Bainisha sababu zingine za kutofanya kipimo cha kaswende", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_syphilis_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "hepatitis", + "type": "native_radio", + "label": "Matokeo ya kipimo cha homa ya ini", + "openmrs_entity": "concept", + "openmrs_entity_id": "hepatitis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha homa ya ini hakijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "prescribe_arv_hepb_at_above_twenty_eight", + "type": "toaster_notes", + "text": "Mpatie Mteja dawa za kufubaza virusi vya Ukimwi (ARV) kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prescribe_arv_hepb_at_above_twenty_eight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "counsel_arv_hepb_below_twenty_eight", + "type": "toaster_notes", + "text": "To ushauri kwa Mama mwenye ujauzito wa wiki 28 kuhusiana na matumizi ya dawa za kufubaza virusi vya Ukimwi (ARV)", + "openmrs_entity_id": "counsel_arv_hepb_below_twenty_eight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hepatitis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hepatitis_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha homa ya ini", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:hepatitis": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_hepatitis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_hepatitis_test", + "type": "edit_text", + "hint": "Bainisha sababu zingine za kutofanya kipimo cha kaswende", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_hepatitis_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "hiv_test_at_32", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_at_32", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_calculation.yml" + } + } + } + }, + { + "key": "hiv_test_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_number", + "type": "hidden" + }, + { + "key": "date_anc_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "date_anc_hiv_test", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "lab_test_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "lab_test_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_malaria_investigation_form.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_malaria_investigation_form.json new file mode 100644 index 000000000..a9b4d1cfd --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_malaria_investigation_form.json @@ -0,0 +1,606 @@ +{ + "count": "1", + "encounter_type": "Malaria Investigation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": { + }, + "step1": { + "title": "Uchunguzi wa Malaria", + "fields": [ + { + "key": "client_on_malaria_medication", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_on_malaria_medication", + "type": "native_radio", + "label": "Je, Mteja anatumia dawa za Malaria?", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "malaria_symptoms_screening", + "type": "check_box", + "label": "Tafadhali chagua kama mteja ana mojawapo ya dalili zifuatazo za Malaria", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "malaria_symptoms_screening", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "fever_and_chills", + "text": "Homa na baridi", + "openmrs_entity_id": "fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "headache", + "text": "Maumivu ya kichwa", + "openmrs_entity_id": "headache", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "pallor", + "text": "Kupauka", + "opemrs_entity_id": "pallor", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "diarrhea", + "text": "Kuhara", + "openmrs_entity_id": "diarrhea", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "nausea_and_vomiting", + "text": "Kichefuchefu na Kutapika", + "openmrs_entity_id": "nausea_and_vomiting", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "joint_pains", + "text": "Maumivu ya Viungo", + "openmrs_entity_id": "joint_pains", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "body_ache", + "text": "Maumivu ya Mwili", + "openmrs_entity_id": "body_ache", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "poor_appetite", + "text": "Hamu ya kula hafifu", + "openmrs_entity_id": "poor_appetite", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "body_weakness", + "text": "Udhaifu wa Mwili", + "openmrs_entity_id": "body_weakness", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "enlarged_spleen", + "text": "Wengu Uliopanuliwa", + "openmrs_entity_id": "enlarged_spleen", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "none", + "text": "Hakuna kati ya zilizo hapo juu", + "openmrs_entity_id": "none", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + } + ], + "relevance": { + "step1:client_on_malaria_medication": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + }, + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "mRDT_for_malaria", + "type": "native_radio", + "label": "Majibu ya kipimo cha Malaria", + "openmrs_entity": "concept", + "openmrs_entity_id": "mRDT_for_malaria", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha Malaria hakijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "step1:malaria_symptoms_screening": { + "ex-checkbox": [ + { + "or": [ + "fever_and_chills", + "headache", + "pallor", + "diarrhea", + "nausea_and_vomiting", + "joint_pains", + "body_ache", + "poor_appetite", + "body_weakness", + "enlarged_spleen" + ] + } + ] + } + }, + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_mRDT", + "type": "toaster_notes", + "text": "Mpatie dawa za malaria na tibu kulingana na muongozo", + "openmrs_entity_id": "prompt_for_mRDT", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:mRDT_for_malaria": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "prompt_for_further_management", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "prompt_for_mRDT", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:mRDT_for_malaria": { + "type": "string", + "ex": "equalTo(., \"negative\")" + } + } + }, + { + "key": "reason_for_not_conducting_malaria_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_malaria_test", + "type": "spinner", + "hint": "Sababu ya kipimo cha malaria kutokufanyika", + "values": [ + "Vifaa vya kupima vimeisha", + "Mteja alikuwa katika hali ya dharura", + "Mteja alikataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:mRDT_for_malaria": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_malaria_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_malaria_test", + "type": "edit_text", + "hint": "Elezea sababu ya Kutokufanyika kwa kipimo cha Malaria", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_malaria_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "malaria_preventive_therapy", + "type": "hidden", + "openmrs_entity_id": "malaria_preventive_therapy", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_malaria_investigation_calculation.yml" + } + } + } + }, + { + "key": "malaria_preventive_therapy_ipt1", + "type": "native_radio", + "openmrs_entity_id": "malaria_preventive_therapy_ipt1", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Dawa za kinga za malaria", + "options": [ + { + "key": "ipt1", + "text": "IPT1", + "openmrs_entity_id": "ipt1", + "openmrs_entity": "concept" + }, + { + "key": "medication_not_given", + "text": "Hajapewa dawa za Malaria", + "openmrs_entity_id": "medication_not_given", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Chagua dawa kwa ajili ya kinga ya malaria" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "malaria_preventive_therapy_ipt2", + "type": "native_radio", + "openmrs_entity_id": "malaria_preventive_therapy_ipt2", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Dawa za kinga za malaria", + "options": [ + { + "key": "ipt2", + "text": "IPT2", + "openmrs_entity_id": "ipt2", + "openmrs_entity": "concept" + }, + { + "key": "medication_not_given", + "text": "Hajapewa dawa za Malaria", + "openmrs_entity_id": "medication_not_given", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Chagua dawa kwa ajili ya kinga ya malaria" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "malaria_preventive_therapy_ipt3", + "type": "native_radio", + "openmrs_entity_id": "malaria_preventive_therapy_ipt3", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Dawa za kinga za malaria", + "options": [ + { + "key": "ipt3", + "text": "IPT3", + "openmrs_entity_id": "ipt3", + "openmrs_entity": "concept" + }, + { + "key": "medication_not_given", + "text": "Hajapewa dawa za Malaria", + "openmrs_entity_id": "medication_not_given", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Chagua dawa kwa ajili ya kinga ya malaria" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "malaria_preventive_therapy_ipt4", + "type": "native_radio", + "openmrs_entity_id": "malaria_preventive_therapy_ipt4", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Dawa za kinga za malaria", + "options": [ + { + "key": "ipt4", + "text": "IPT4", + "openmrs_entity_id": "ipt4", + "openmrs_entity": "concept" + }, + { + "key": "medication_not_given", + "text": "Hajapewa dawa za Malaria", + "openmrs_entity_id": "medication_not_given", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Chagua dawa kwa ajili ya kinga ya malaria" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_giving_malaria_medication", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_malaria_medication", + "type": "spinner", + "hint": "Sababu ya kutokupewa dawa za Malaria", + "values": [ + "Bidhaa zimeisha", + "Mteja amekataa kuchukua dawa", + "Anamzio na dawa (Allegy)", + "Nyingine (Bainisha)" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "other_reason_malaria_medication_not_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_malaria_medication_not_given", + "type": "edit_text", + "hint": "Elezea sababu ya mteja kutokupewa dawa za kujikinga na Malaria", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_for_not_giving_malaria_medication": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "llin_provision", + "type": "native_radio", + "openmrs_entity_id": "llin_provision", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Je, Mteja alipewa LLINs (vyandarua vya muda mrefu)?", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_providing_llin", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_llin", + "type": "spinner", + "hint": "Sababu ya mteja kutokupewa chandarua cha muda mrefu (LLINs)", + "values": [ + "Bidhaa zimeisha", + "Mteja alikataa", + "Nyingine (Bainisha)" + ], + "keys": [ + "out_of_stock", + "the_client_refused", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "the_client_refused": "the_client_refused", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:llin_provision": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_llin_not_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_llin_not_given", + "type": "edit_text", + "hint": "Elezea sababu ya mteja kutokupewa chandarua cha muda mrefu (LLINs)", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_for_not_providing_llin": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "malaria_investigation_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "malaria_investigation_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_pharmacy.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_pharmacy.json new file mode 100644 index 000000000..796ca0e52 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_pharmacy.json @@ -0,0 +1,305 @@ +{ + "count": "1", + "encounter_type": "Medication and Supplements", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Dawa na Virutubisho", + "fields": [ + { + "key": "pharmacy", + "type": "label", + "text": "Mtoa huduma ampatie dawa ya prophylactic na virutubishi", + "text_color": "#000000", + "openmrs_entity": "", + "openmrs_entity_id": "", + "openmrs_entity_parent": "" + }, + { + "key": "iron_folate_supplements", + "type": "native_radio", + "label": "Vidonge vya Madini ya chuma", + "openmrs_entity_id": "iron_folate_supplements", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "text": "FeFo", + "key": "FeFo", + "openmrs_entity": "concept", + "openmrs_entity_id": "FeFo" + }, + { + "text": "folic", + "key": "Foliki Asidi", + "openmrs_entity": "concept", + "openmrs_entity_id": "folic" + }, + { + "text": "Hajapewa dawa ya vidonge vya madini ya chuma", + "key": "medication_not_given", + "openmrs_entity": "concept", + "openmrs_entity_id": "medication_not_given" + } + ] + }, + { + "key": "reason_for_giving_folic_acid", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_giving_folic_acid", + "type": "spinner", + "hint": "Sababu kwanini amepewa Foliki Asidi badala ya FEFO", + "values": [ + "Bidhaa zimeisha", + "Selimundu", + "Nyingine (Taja)" + ], + "keys": [ + "out_of_stock", + "sickle_cell", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "sickle_cell": "sickle_cell", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:iron_folate_supplements": { + "type": "string", + "ex": "equalTo(., \"folic\")" + } + } + }, + { + "key": "other_reason_for_giving_folic_acid", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_giving_folic_acid", + "type": "edit_text", + "hint": "Elezea sababu nyingine ya kupewa dawa za Foliki Asidi ", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_for_giving_folic_acid": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "reason_for_not_giving_iron_folate_supplements", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_iron_folate_supplements", + "type": "spinner", + "hint": "Sababu ya kutopewa vidonge vya madini ya chuma", + "values": [ + "Bidhaa zimeisha", + "Mteja amekataa kuchukua dawa", + "Anamzio na dawa (Allegy)", + "Nyingine" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "step1:iron_folate_supplements": { + "type": "string", + "ex": "equalTo(., \"medication_not_given\")" + } + } + }, + { + "key": "other_reason_fefo_medication_not_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_fefo_medication_not_given", + "type": "edit_text", + "hint": "Elezea sababu nyingine yakutokupewa dawa ya FEFO", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_for_not_giving_fefo_medication": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "deworming", + "type": "check_box", + "label": "Dawa ya minyoo", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "deworming", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "mebendazole", + "albendazole", + "medication_not_given" + ], + "options": [ + { + "text": "Mebendazole(500Mg)", + "key": "mebendazole", + "openmrs_entity": "concept", + "openmrs_entity_id": "mebendazole" + }, + { + "text": "Albendazole(400Mg)", + "key": "albendazole", + "openmrs_entity": "concept", + "openmrs_entity_id": "albendazole" + }, + { + "text": "Hajapewa dawa ya minyoo", + "key": "medication_not_given", + "openmrs_entity": "concept", + "openmrs_entity_id": "medication_not_given" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_pharmacy_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_giving_deworming_medication", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_deworming_medication", + "type": "spinner", + "hint": "Sababu ya kutopewa dawa ya minyoo", + "values": [ + "Bidhaa zimeisha", + "Mteja amekataa kuchukua dawa", + "Anamzio na dawa (Allegy)", + "Nyingine" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:deworming": { + "ex-checkbox": [ + { + "or": [ + "medication_not_given" + ] + } + ] + } + } + }, + { + "key": "other_reason_deworming_medication_not_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_deworming_medication_not_given", + "type": "edit_text", + "hint": "Sababu nyingine", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_for_not_giving_deworming_medication": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "pharmacy_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "pharmacy_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_pregnancy_status.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_pregnancy_status.json new file mode 100644 index 000000000..ff2a9508d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_pregnancy_status.json @@ -0,0 +1,188 @@ +{ + "count": "1", + "encounter_type": "Pregnancy Status", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Hali ya Ujauzito", + "fields": [ + { + "key": "pregnancy_status", + "type": "native_radio", + "label": "Hali ya mimba", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnancy_status", + "openmrs_entity_parent": "", + "options": [ + { + "key": "viable", + "text": "Bado ana ujauzito", + "openmrs_entity": "concept", + "openmrs_entity_id": "viable" + }, + { + "key": "spontaneous_abortion", + "text": "Mimba imeharibika", + "openmrs_entity": "concept", + "openmrs_entity_id": "spontaneous_abortion" + }, + { + "key": "intrauterine_fetal_death", + "text": "Mtoto amefia tumboni", + "openmrs_entity": "concept", + "openmrs_entity_id": "intrauterine_fetal_death" + } + ] + }, + { + "key": "reg_cpac", + "type": "toaster_notes", + "text": "Tafadhali mpatie mteja matibabu stahiki kutokana na kuharibika/ kutoka kwa mimba kulingana na mwongozo wa Wizara ya Afya", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:pregnancy_status": { + "type": "string", + "ex": "equalTo(.,\"spontaneous_abortion\")" + } + } + }, + { + "key": "still_birth", + "type": "toaster_notes", + "text": "Mshauri Mteja kuhusiana na njia za Uzazi wa Mpango na mpatie njia ambayo amechagua mwenyewe", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:pregnancy_status": { + "type": "string", + "ex": "equalTo(.,\"intrauterine_fetal_death\")" + } + } + }, + { + "key": "pregnancy_status_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnancy_status_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + }, + { + "key": "delivery_place", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_place", + "openmrs_data_type": "select one", + "type": "spinner", + "hint": "Mahali ambapo Mama alijifungulia", + "values": [ + "Kwenye Kituo cha Afya", + "Amejifungua Njiani kabla ya kufika kwenye Kituo", + "Amejifungulia Nyumbani", + "Amejifungulia kwa Mkunga wa Jadi" + ], + "keys": [ + "At a health facility", + "Birth before Arrival (BBA)", + "At home", + "Traditional birth attendant" + ], + "openmrs_choice_ids": { + "At a health facility": "At a health facility", + "Birth before Arrival (BBA)": "Birth before Arrival (BBA)", + "At home": "At home", + "Traditional birth attendant": "Traditional birth attendant" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua chaguo moja" + }, + "relevance": { + "step1:pregnancy_status": { + "type": "string", + "ex": "equalTo(.,\"intrauterine_fetal_death\")" + } + } + }, + { + "key": "delivery_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_date", + "type": "date_picker", + "hint": "Tarehe ya Mama kujifungua", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "relevance": { + "step1:pregnancy_status": { + "type": "string", + "ex": "equalTo(.,\"intrauterine_fetal_death\")" + } + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua tarehe ya kujifungua" + } + }, + { + "key": "preg_outcome", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "type": "hidden", + "openmrs_entity_id": "preg_outcome", + "value": "still_born", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_pregnancy_status_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_triage.json b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_triage.json new file mode 100644 index 000000000..dfaddb613 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/anc_rv_triage.json @@ -0,0 +1,389 @@ +{ + "count": "1", + "encounter_type": "Triage", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Uchambuzi wa wagonjwa au majeruhi", + "fields": [ + { + "key": "gest_age", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gest_age", + "hint": "Umri wa Ujauzito kwa Wiki", + "type": "edit_text", + "editable": true, + "read_only": true + }, + { + "key": "edd", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "edd", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_triage_calculation.yml" + } + } + } + }, + { + "key": "last_menstrual_period", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_menstrual_period", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_triage_calculation.yml" + } + } + } + }, + { + "key": "rapid_examination", + "type": "check_box", + "label": "Tathmini hali ya jumla ya mwanamke mara tu unapofika kwenye kliniki ya ujauzito", + "combine_checkbox_option_values": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "rapid_examination", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "facial_expression", + "text": "Muonekano wa sura (muonekano wa maumivu)", + "openmrs_entity": "concept", + "openmrs_entity_id": "facial_expression" + }, + { + "key": "pallor", + "text": "Kupauka", + "openmrs_entity": "concept", + "openmrs_entity_id": "pallor" + }, + { + "key": "sweating", + "text": "Kutokwa jasho", + "openmrs_entity": "concept", + "openmrs_entity_id": "sweating" + }, + { + "key": "shivering", + "text": "Kutetemeka", + "openmrs_entity": "concept", + "openmrs_entity_id": "shivering" + }, + { + "key": "difficulty_in_breathing", + "text": "Kupumua kwa shida", + "openmrs_entity": "concept", + "openmrs_entity_id": "difficulty_in_breathing" + }, + { + "key": "none", + "text": "Hakuna", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ] + }, + { + "key": "prompt_for_rapid_examination", + "type": "toaster_notes", + "openmrs_entity": "concept", + "openmrs_entity_id": "prompt_for_rapid_examination", + "openmrs_entity_parent": "", + "text": "Tafadhali mpatie Mteja msaada na uangalizi wa karibu na mpe rufaa kwa ajili ya matibabu ya dharura", + "toaster_type": "problem", + "relevance": { + "step1:rapid_examination": { + "ex-checkbox": [ + { + "or": [ + "pallor", + "sweating", + "shivering", + "difficulty_in_breathing", + "facial_expression" + ] + } + ] + } + } + }, + { + "key": "reasons_to_clinic", + "type": "native_radio", + "label": "Kwa nini ulikuja kliniki leo?", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_to_clinic", + "openmrs_entity_parent": "", + "options": [ + { + "text": "Nimezingatia ratiba ya mahudhurio", + "key": "routine_visit", + "openmrs_entity": "concept", + "openmrs_entity_id": "routine_visit" + }, + { + "text": "Mgonjwa/Wasiwasi", + "key": "sick_concerned", + "openmrs_entity": "concept", + "openmrs_entity_id": "sick_concerned" + } + ] + }, + { + "key": "client_concern", + "type": "edit_text", + "edit_type": "text", + "hint": "Wasiwasi wako ni nini?", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_concern", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_triage_relevance.yml" + } + } + } + }, + { + "key": "danger_signs", + "type": "check_box", + "label": "Uliza, angalia, na uhisi kama mwanamke ana:", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "danger_signs", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "bleeding_vag", + "text": "Kutokwa na damu ukeni", + "openmrs_entity": "concept", + "openmrs_entity_id": "bleeding_vag" + }, + { + "key": "headache_visual_disturbance", + "text": "Maumivu ya kichwa na changamoto ya kuona", + "openmrs_entity": "concept", + "openmrs_entity_id": "headache_visual_disturbance" + }, + { + "key": "severely_pale", + "text": "Kupauka sana", + "openmrs_entity": "concept", + "openmrs_entity_id": "severely_pale" + }, + { + "key": "severe_vomiting", + "text": "Kutapika sana", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_vomiting" + }, + { + "key": "convulsion", + "text": "Degedege", + "openmrs_entity": "concept", + "openmrs_entity_id": "convulsion" + }, + { + "key": "looking_very_ill", + "text": "Kuonekana mgonjwa sana (mchovu, kusinzia), ", + "openmrs_entity": "concept", + "openmrs_entity_id": "looking_very_ill" + }, + { + "key": "fever", + "text": "Homa", + "openmrs_entity": "concept", + "openmrs_entity_id": "fever" + }, + { + "key": "unconscious", + "text": "Kupoteza fahamu", + "openmrs_entity": "concept", + "openmrs_entity_id": "unconscious" + }, + { + "key": "severe_pain", + "text": "Maumivu makali", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_pain" + }, + { + "key": "severe_breathing_difficulty", + "text": "Kupumua kwa shida sana", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_breathing_difficulty" + }, + { + "key": "in_labour", + "text": "Kusikia uchungu wa kujifungua", + "openmrs_entity": "concept", + "openmrs_entity_id": "in_labour" + }, + { + "key": "imminent_labour", + "text": "Kujifungua hivi karibuni", + "openmrs_entity": "concept", + "openmrs_entity_id": "imminent_labour" + }, + { + "key": "reduced_fetal_movement", + "text": "Kupungua au kutosikia mtoto akicheza", + "openmrs_entity": "concept", + "openmrs_entity_id": "reduced_fetal_movement" + }, + { + "key": "sacrum_oedema", + "text": "Edema ya uso na sacrum", + "openmrs_entity": "concept", + "openmrs_entity_id": "sacrum_oedema" + }, + { + "key": "other", + "text": "Nyingine (Bainisha)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + }, + { + "key": "none", + "text": "Hakuna", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ] + }, + { + "key": "is_emergency", + "type": "toaster_notes", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_emergency", + "openmrs_entity_parent": "", + "text": "Toa huduma ya dharura kwa Mteja", + "toaster_type": "warning", + "toaster_info": "Mteja anaonyesha ishara moja au zaidi ya dharura na anahitaji huduma ya dharura", + "relevance": { + "step1:danger_signs": { + "ex-checkbox": [ + { + "or": [ + "bleeding_vag", + "headache_visual_disturbance", + "severely_pale", + "severe_vomiting", + "severe_breathing_difficulty", + "convulsion", + "looking_very_ill", + "fever", + "unconscious", + "severe_pain", + "in_labour", + "imminent_labour", + "reduced_fetal_movement", + "sacrum_oedema" + ] + } + ] + } + } + }, + { + "key": "other_danger_signs", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_danger_signs", + "type": "edit_text", + "hint": "Dalili za hatari nyingine", + "v_required": { + "value": "true", + "err": "Tafadhali bainisha dalili za hatari nyingine" + }, + "relevance": { + "step1:danger_signs": { + "ex-checkbox": [ + { + "or": [ + "other" + ] + } + ] + } + } + }, + { + "key": "visit_number", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_triage_calculation.yml" + } + } + } + }, + { + "key": "triage_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "triage_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_condom_distribution_outside.json b/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_condom_distribution_outside.json new file mode 100644 index 000000000..e7792fe5d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_condom_distribution_outside.json @@ -0,0 +1,416 @@ +{ + "count": "1", + "encounter_type": "CDP Distribution Outside Facility", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Condom Distribution", + "fields": [ + { + "key": "number_of_condoms_available", + "type": "toaster_notes", + "text": "", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info" + }, + { + "key": "condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_brand", + "label": "Chagua chapa ya kondomu", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "public_sc", + "text": "Public sector condom", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "public_sc" + }, + { + "key": "dume", + "text": "Dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "dume" + }, + { + "key": "salama", + "text": "Salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "salama" + }, + { + "key": "familia", + "text": "Familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "familia" + }, + { + "key": "others", + "text": "Nyingine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua chapa ya kondomu" + } + }, + { + "key": "male_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condom_brand", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + }, + { + "key": "female_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condom_brand", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + }, + { + "key": "other_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_condom_brand", + "type": "edit_text", + "hint": "Chapa nyingine", + "v_required": { + "value": "true", + "err": "Tafadhali weka chapa nyingine ya kondomu" + }, + "relevance": { + "step1:condom_brand": { + "type": "string", + "ex": "equalTo(., \"others\")" + } + } + }, + { + "key": "condom_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + }, + { + "key": "provided_male_condoms_public_sc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_public_sc", + "type": "edit_text", + "hint": "Idadi ya kondomu za kiume zilizotolewa (vipande)", + "v_numeric": { "value": "true", "err": "Tafadhali weka namba" }, + "v_required": { "value": "true", "err": "Tafadhali weka namba" }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_public_sc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_public_sc", + "type": "edit_text", + "hint": "Idadi ya kondomu za kike zilizotolewa (vipande)", + "v_numeric": { "value": "true", "err": "Tafadhali weka namba" }, + "v_required": { "value": "true", "err": "Tafadhali weka namba" }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_dume", + "type": "edit_text", + "hint": "Idadi ya kondomu za kiume zilizotolewa (vipande)", + "v_numeric": { "value": "true", "err": "Tafadhali weka namba" }, + "v_required": { "value": "true", "err": "Tafadhali weka namba" }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_dume", + "type": "edit_text", + "hint": "Idadi ya kondomu za kike zilizotolewa (vipande)", + "v_numeric": { "value": "true", "err": "Tafadhali weka namba" }, + "v_required": { "value": "true", "err": "Tafadhali weka namba" }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_salama", + "type": "edit_text", + "hint": "Idadi ya kondomu za kiume zilizotolewa (vipande)", + "v_numeric": { "value": "true", "err": "Tafadhali weka namba" }, + "v_required": { "value": "true", "err": "Tafadhali weka namba" }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_salama", + "type": "edit_text", + "hint": "Idadi ya kondomu za kike zilizotolewa (vipande)", + "v_numeric": { "value": "true", "err": "Tafadhali weka namba" }, + "v_required": { "value": "true", "err": "Tafadhali weka namba" }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_familia", + "type": "edit_text", + "hint": "Idadi ya kondomu za kiume zilizotolewa (vipande)", + "v_numeric": { "value": "true", "err": "Tafadhali weka namba" }, + "v_required": { "value": "true", "err": "Tafadhali weka namba" }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_familia", + "type": "edit_text", + "hint": "Idadi ya kondomu za kike zilizotolewa (vipande)", + "v_numeric": { "value": "true", "err": "Tafadhali weka namba" }, + "v_required": { "value": "true", "err": "Tafadhali weka namba" }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_other", + "type": "edit_text", + "hint": "Idadi ya kondomu za kiume zilizotolewa (vipande)", + "v_numeric": { "value": "true", "err": "Tafadhali weka namba" }, + "v_required": { "value": "true", "err": "Tafadhali weka namba" }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_other", + "type": "hidden", + "hint": "Number of female condoms distributed (Pieces)", + "v_numeric": { "value": "true", "err": "Please enter the number" }, + "v_required": { "value": "true", "err": "Please enter the number" }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms_offset", + "type": "hidden", + "hint": "Number of male condoms distributed (Pieces)", + "v_numeric": { "value": "true", "err": "Please enter the number" }, + "v_required": { "value": "true", "err": "Please enter the number" }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + }, + { + "key": "provided_female_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms_offset", + "type": "hidden", + "hint": "Number of female condoms distributed (Pieces)", + "v_numeric": { "value": "true", "err": "Please enter the number" }, + "v_required": { "value": "true", "err": "Please enter the number" }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + }, + { + "key": "quantity_response", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "quantity_response", + "type": "hidden", + "hint": "Number of condoms distributed (Pieces)", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + }, + { + "key": "stock_event_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "stock_event_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + }, + { + "key": "condom_restock_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_restock_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + } + ] + } +} diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_condom_distribution_within.json b/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_condom_distribution_within.json new file mode 100644 index 000000000..dc56c2264 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_condom_distribution_within.json @@ -0,0 +1,651 @@ +{ + "count": "1", + "encounter_type": "CDP Distribution Within Facility", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Condom Distribution", + "fields": [ + { + "key": "condom_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_type", + "label": "Chagua aina ya kondomu", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "male_condom", + "text": "Male", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condom" + }, + { + "key": "female_condom", + "text": "Female", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condom" + } + ], + "v_required": { + "value": "true", + "err": "Please select the condom type" + } + }, + { + "key": "number_of_condoms_available", + "type": "toaster_notes", + "text": "", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info" + }, + { + "key": "condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_brand", + "label": "Chagua chapa ya kondomu", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "public_sc", + "text": "Public sector condom", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "public_sc" + }, + { + "key": "dume", + "text": "Dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "dume" + }, + { + "key": "salama", + "text": "Salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "salama" + }, + { + "key": "familia", + "text": "Familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "familia" + }, + { + "key": "others", + "text": "Others", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + } + ], + "v_required": { + "value": "true", + "err": "Please select the condom brand" + } + }, + { + "key": "male_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condom_brand", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "female_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condom_brand", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "other_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_condom_brand", + "type": "edit_text", + "hint": "Other condom brand", + "v_required": { + "value": "true", + "err": "Please enter the other condom brand" + }, + "relevance": { + "step1:condom_brand": { + "type": "string", + "ex": "equalTo(., \"others\")" + } + } + }, + { + "key": "provided_male_condoms_public_sc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_public_sc", + "type": "edit_text", + "hint": "Idadi ya Kondomu za kiume zilizosambazwa", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_public_sc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_public_sc", + "type": "edit_text", + "hint": "Idadi ya Kondomu za kike zilizosambazwa", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_dume", + "type": "edit_text", + "hint": "Idadi ya Kondomu za kiume zilizosambazwa", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_dume", + "type": "edit_text", + "hint": "Idadi ya Kondomu za kike zilizosambazwa", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_salama", + "type": "edit_text", + "hint": "Idadi ya Kondomu za kiume zilizosambazwa", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_salama", + "type": "edit_text", + "hint": "Idadi ya Kondomu za kike zilizosambazwa", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_familia", + "type": "edit_text", + "hint": "Idadi ya Kondomu za kiume zilizosambazwa", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_familia", + "type": "edit_text", + "hint": "Idadi ya Kondomu za kike zilizosambazwa", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_other", + "type": "edit_text", + "hint": "Idadi ya Kondomu za kiume zilizosambazwa", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_other", + "type": "hidden", + "hint": "Idadi ya Kondomu za kike zilizosambazwa", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms_offset", + "type": "hidden", + "hint": "Idadi ya Kondomu za kiume zilizosambazwa", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "provided_female_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms_offset", + "type": "hidden", + "hint": "Idadi ya Kondomu za kike zilizosambazwa", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "quantity_response", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "quantity_response", + "type": "hidden", + "hint": "Number of condoms distributed (Pieces)", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "stock_event_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "stock_event_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "condom_restock_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_restock_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "condom_restock_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_restock_date", + "type": "date_picker", + "hint": "Condom distribution date", + "expanded": false, + "min_date": "today-1m", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the distribution date" + } + }, + { + "key": "stock_event_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "stock_event_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "point_of_service", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "point_of_service", + "label": "Chagua kituo cha huduma", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "ctc", + "text": "kliniki ya tiba na matunzo(CTC)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc" + }, + { + "key": "rch_clinic", + "text": "kliniki ya mama na mtoto(RCH)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rch_clinic" + }, + { + "key": "opd", + "text": "idara ya wagonjwa wa nje(OPD)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "opd" + }, + { + "key": "tb_clinic", + "text": "Kliniki ya kifua kikuu(TB)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tb_clinic" + }, + { + "key": "outreach", + "text": "Ufatiliyaji(OUTREACH)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "outreach" + }, + { + "key": "other", + "text": "Nyingine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua kituo cha huduma" + } + }, + { + "key": "other_pos", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_pos", + "type": "edit_text", + "hint": "Sehemu nyingine ya huduma", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza chapa nyingine ya kondomu" + }, + "relevance": { + "step1:point_of_service": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "distributing_person_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "distributing_person_name", + "type": "edit_text", + "hint": "Jina la mtu aliyesambaza kondomu", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina sahihi" + }, + "v_required": { "value": "true", "err": "Tafadhali weka jina" } + }, + { + "key": "distributing_person_position", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "distributing_person_position", + "type": "edit_text", + "hint": "Cheo cha mtu anayesambaza ", + "v_required": { "value": "true", "err": "Tafadhali weka cheo" } + }, + { + "key": "distributing_person_phone", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "distributing_person_phone", + "type": "edit_text", + "hint": "Namba ya simu ya mtu anayesambaza", + "edit_type": "number", + "v_numeric": { + "value": "true", + "err": "Namba lazima iwe jumla ya tarakimu 10 kwa urefu" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Nambari lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka nambari ya simu" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_facility_order_form.json b/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_facility_order_form.json new file mode 100644 index 000000000..5d97dd54c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_facility_order_form.json @@ -0,0 +1,149 @@ +{ + "count": "1", + "encounter_type": "CDP Order From Facility", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Maombi Ya kondomu", + "fields": [ + { + "key": "condom_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_type", + "label": "Chagua aina ya kondomu", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "male_condom", + "text": "kiume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condom" + }, + { + "key": "female_condom", + "text": "kike", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condom" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua aina ya kondomu" + } + }, + { + "key": "other_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_condom_brand", + "type": "edit_text", + "hint": "Chapa nyingine ya kondomu", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza chapa nyingine ya kondomu" + }, + "relevance": { + "step1:condom_brand": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "requested_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "requested_condoms", + "type": "edit_text", + "hint": "Idadi ya kondomu zilizoagizwa", + "edit_type": "number", + "v_required": { "value": "true", "err": "Tafadhali weka nambari" }, + "v_numeric": { "value": "true", "err": "Tafadhali weka nambari" } + }, + { + "key": "receiving_order_facility", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receiving_order_facility", + "buttonText": "Chagua Kituo", + "sort": true, + "maxSelectable": 1, + "dialogTitle": "Chagua Kituo Cha Afya Kinachopokea Maombi", + "searchHint": "Ingiza Jina La Kituo Cha Afya", + "options": [], + "type": "multi_select_list", + "v_required": { + "value": true, + "err": "Tafadhali chagua kituo cha afya" + } + }, + { + "key": "request_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "request_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { "rules-file": "cdp_condom_order_calculation.yml" } + } + } + }, + { + "key": "condom_order_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_order_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { "rules-file": "cdp_condom_order_calculation.yml" } + } + } + } + ] + } +} diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_receive_condom_facility.json b/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_receive_condom_facility.json new file mode 100644 index 000000000..f39beeb20 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_receive_condom_facility.json @@ -0,0 +1,195 @@ +{ + "count": "1", + "encounter_type": "CDP Receive From Facility", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Kupokea kondomu kutoka kwenye kituo", + "fields": [ + { + "key": "condom_receive_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_receive_date", + "type": "date_picker", + "hint": "Tarehe ya kupokea kondomu", + "expanded": false, + "min_date": "today-1m", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali weka tarehe ya kupokea" + } + }, + { + "key": "receiving_person_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receiving_person_name", + "type": "edit_text", + "hint": "Jina la mtu aliyepokea kondomu", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + }, + "v_required": { "value": "true", "err": "Tafadhali weka jina" } + }, + { + "key": "receiving_person_position", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receiving_person_position", + "type": "edit_text", + "hint": "Cheo cha mtu aliyepokea kondomu", + "v_required": { "value": "true", "err": "Tafadhali jaza nafasi" } + }, + { + "key": "receiving_person_phone", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receiving_person_phone", + "type": "edit_text", + "hint": "Namba ya simu ya mtu aliyepokea Kondomu", + "edit_type": "number", + "v_numeric": { + "value": "true", + "err": "Nambari lazima iwe jumla ya tarakimu 10 kwa urefu" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Nambari lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka nambari ya simu" + } + }, + { + "key": "condom_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { "rules-file": "cdp_receive_condom_calculation.yml" } + } + } + }, + { + "key": "provided_male_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms_offset", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { "rules-file": "cdp_receive_condom_calculation.yml" } + } + } + }, + { + "key": "provided_female_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms_offset", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { "rules-file": "cdp_receive_condom_calculation.yml" } + } + } + }, + { + "key": "batch_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "batch_number", + "type": "edit_text", + "hint": "Namba ya kundi(batch number)", + "v_required": { + "value": "true", + "err": "Tafadhali weka nambari ya bachi" + } + }, + { + "key": "expiry_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "expiry_date", + "type": "date_picker", + "hint": "Tarehe ya mwisho wa matumizi", + "expanded": false, + "min_date": "today", + "v_required": { + "value": true, + "err": "Tarehe ya kumalizika muda inahitajika" + } + }, + { + "key": "stock_event_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "stock_event_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { "rules-file": "cdp_receive_condom_calculation.yml" } + } + } + }, + { + "key": "condom_restock_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_restock_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { "rules-file": "cdp_receive_condom_calculation.yml" } + } + } + } + ] + } +} diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_receive_condom_from_organizations.json b/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_receive_condom_from_organizations.json new file mode 100644 index 000000000..024e61080 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/cdp_receive_condom_from_organizations.json @@ -0,0 +1,449 @@ +{ + "count": "1", + "encounter_type": "CDP Restock", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Kupokea Kondomu Kutoka Kwenye Mashirika", + "fields": [ + { + "key": "condom_receive_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_receive_date", + "type": "date_picker", + "hint": "Tarehe ya kupokea kondomu", + "expanded": false, + "min_date": "today-1m", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali weka tarehe ya kupokea" + } + }, + { + "key": "condom_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_type", + "type": "check_box", + "label": "Chagua aina ya kondomu", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "male_condom", + "text": "Kiume", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condom" + }, + { + "key": "female_condom", + "text": "Kike", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condom" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua aina ya kondomu" + } + }, + { + "key": "male_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condom_brand", + "label": "Chagua chapa ya kondomu za kiume", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "public_sc", + "text": "Public sector condom", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "public_sc" + }, + { + "key": "dume", + "text": "Dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "dume" + }, + { + "key": "salama", + "text": "Salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "salama" + }, + { + "key": "familia", + "text": "Familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "familia" + }, + { + "key": "other", + "text": "Nyingine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua chapa ya kondomu" + }, + "relevance": { + "step1:condom_type": { "ex-checkbox": [{ "or": ["male_condom"] }] } + } + }, + { + "key": "other_male_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_male_condom_brand", + "type": "edit_text", + "hint": "Chapa nyingine ya kondomu", + "v_required": { "value": "true", "err": "Tafadhali weka chapa" }, + "relevance": { + "step1:male_condom_brand": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "restocked_male_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms_offset", + "type": "edit_text", + "hint": "Idadi ya kondomu za kiume zilizoongezwa (vipande)", + "edit_type": "number", + "v_required": { "value": "true", "err": "Tafadhali weka namba" }, + "v_numeric": { "value": "true", "err": "Tafadhali weka namba" }, + "relevance": { + "step1:condom_type": { "ex-checkbox": [{ "or": ["male_condom"] }] } + } + }, + { + "key": "female_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condom_brand", + "label": "Chagua chapa ya kondomu za kike", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "public_sc", + "text": "Public sector condom", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "public_sc" + }, + { + "key": "dume", + "text": "Dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "dume" + }, + { + "key": "salama", + "text": "Salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "salama" + }, + { + "key": "familia", + "text": "Familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "familia" + }, + { + "key": "other", + "text": "Nyingine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua chapa ya kondomu " + }, + "relevance": { + "step1:condom_type": { "ex-checkbox": [{ "or": ["female_condom"] }] } + } + }, + { + "key": "other_female_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_female_condom_brand", + "type": "edit_text", + "hint": "Chapa nyingine ya kondomu", + "v_required": { "value": "true", "err": "Tafadhali weka chapa" }, + "relevance": { + "step1:female_condom_brand": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "restocked_female_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms_offset", + "type": "edit_text", + "hint": "Idadi ya kondomu za kike zilizoongezwa (vipande)", + "edit_type": "number", + "v_required": { "value": "true", "err": "Tafadhali weka namba" }, + "v_numeric": { "value": "true", "err": "Tafadhali weka namba" }, + "relevance": { + "step1:condom_type": { "ex-checkbox": [{ "or": ["female_condom"] }] } + } + }, + { + "key": "issuing_organization", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "issuing_organization", + "label": "Chagua shirika linalotoa", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "MSD", + "text": "MSD", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "MSD" + }, + { + "key": "PSI", + "text": "PSI", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "PSI" + }, + { + "key": "T-MARC", + "text": "T-MARC", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "T-MARC" + }, + { + "key": "other", + "text": "Shirika Jingine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { "value": "true", "err": "Tafadhali chagua shirika" } + }, + { + "key": "other_issuing_organization", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_issuing_organization", + "type": "edit_text", + "hint": "Shirika jingine linalotoa", + "v_required": { "value": "true", "err": "Tafadhali weka jina" }, + "relevance": { + "step1:issuing_organization": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "batch_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "batch_number", + "type": "edit_text", + "hint": "Namba ya kundi (Batch number)", + "v_required": { + "value": "true", + "err": "Tafadhali weka namba ya kundi (Batch number)" + } + }, + { + "key": "expiry_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "expiry_date", + "type": "date_picker", + "hint": "Tarehe ya mwisho wa matumizi", + "expanded": false, + "min_date": "today", + "v_required": { + "value": true, + "err": "Tarehe ya mwisho wa matumizi inahitajika" + } + }, + { + "key": "delivering_person_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivering_person_name", + "type": "edit_text", + "hint": "Jina la mtu anayetoa kondomu", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + }, + "v_required": { "value": "true", "err": "Tafadhali weka jina" } + }, + { + "key": "delivering_person_position", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivering_person_position", + "type": "edit_text", + "hint": "Cheo cha mtu anayetoa kondomu", + "v_required": { "value": "true", "err": "Tafadhali weka cheo" } + }, + { + "key": "delivering_person_phone", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivering_person_phone", + "type": "edit_text", + "hint": "Namba ya simu ya mtu anayetoa kondomu", + "edit_type": "number", + "v_numeric": { + "value": "true", + "err": "Namba lazima iwe na tarakimu 10 " + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Namba lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." + }, + "v_required": { "value": "true", "err": "Tafadhali weka namba ya simu" } + }, + { + "key": "receiving_person_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receiving_person_name", + "type": "edit_text", + "hint": "Jina la mtu anayepokea kondomu", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + }, + "v_required": { "value": "true", "err": "Tafadhali weka jina" } + }, + { + "key": "receiving_person_position", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receiving_person_position", + "type": "edit_text", + "hint": "Cheo cha mtu anayepokea kondomu", + "v_required": { "value": "true", "err": "Tafadhali weka cheo" } + }, + { + "key": "receiving_person_phone", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receiving_person_phone", + "type": "edit_text", + "hint": "Namba ya simu ya mtu anayepokea kondomu", + "edit_type": "number", + "v_numeric": { + "value": "true", + "err": "Namba lazima iwe na tarakimu 10 " + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Namba lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." + }, + "v_required": { "value": "true", "err": "Tafadhali weka namba ya simu" } + }, + { + "key": "stock_event_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "stock_event_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_receive_condom_msd_calculation.yml" + } + } + } + }, + { + "key": "condom_restock_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_restock_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_receive_condom_msd_calculation.yml" + } + } + } + } + ] + } +} diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/child_enrollment.json b/opensrp-chw-hf/src/main/assets/json.form-sw/child_enrollment.json index bd7e9a982..abe3d7a08 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/child_enrollment.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/child_enrollment.json @@ -16,11 +16,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -52,61 +47,40 @@ } }, "step1": { - "title": "Ongeza mtoto chini ya miaki 5", + "title": "Sajili Mtoto chini ya miaka 5", "fields": [ - { - "key": "sync_location_id", - "openmrs_entity_parent": "", - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "sync_location_id", - "type": "spinner", - "hint": "Chagua eneo la CHW", - "v_required": { - "value": "true", - "err": "Tafadhali chagua eneo la CHW" - } - }, - { - "key": "photo", - "openmrs_entity_parent": "", - "openmrs_entity": "", - "openmrs_entity_id": "", - "type": "choose_image", - "uploadButtonText": "Chukua picha ya muhusika" - }, { "key": "unique_id", "openmrs_entity_parent": "", "openmrs_entity": "person_identifier", "openmrs_entity_id": "opensrp_id", - "type": "barcode", - "barcode_type": "qrcode", - "hint": "Boresha Afya ID", - "scanButtonText": "Chukua QR code", + "type": "edit_text", + "read_only": true, + "hint": "Namba ya Utambulisho ya Kituoni", "v_numeric": { "value": "true", - "err": "Tafadhali ingiza namba halali" + "err": "Tafadhali ingiza namba ya utambulisho iliyo sahihi" }, "v_required": { "value": "true", - "err": "Tafadhali ingiza namba ya kipekee" + "err": "Tafadhali ingiza namba ya kipekee ya utambulisho" } }, { "key": "surname", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "edit_text", - "hint": "Jina la mwisho (ukoo)", + "hint": "Jina la mwisho", "edit_type": "name", "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Tafadhali ingiza jina halali" + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza jina sahihi" }, "v_required": { "value": "true", - "err": "Tafadhali ingiza jina la ukoo" + "err": "Tafadhali ingiza jina la mwisho" }, "relevance": { "rules-engine": { @@ -119,7 +93,7 @@ { "key": "same_as_fam_name", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "openmrs_data_type": "text", "type": "check_box", @@ -130,7 +104,7 @@ "options": [ { "key": "same_as_fam_name", - "text": "Jina la ukoo ni sawa na jina la familia", + "text": "Jina la mwisho ni sawa na jina la familia", "text_size": "18px", "value": "false" } @@ -139,7 +113,7 @@ { "key": "fam_name", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "label", "hidden": "true" @@ -150,7 +124,7 @@ "openmrs_entity": "person", "openmrs_entity_id": "last_name", "type": "hidden", - "hint": "Jina la ukoo ni sawa na jina la famili", + "hint": "Surname as Family name", "calculation": { "rules-engine": { "ex-rules": { @@ -166,16 +140,16 @@ "openmrs_entity_id": "first_name", "openmrs_data_type": "text", "type": "edit_text", - "hint": "Jina la kwanza", + "hint": "Jina la Kwanza", "expanded": false, "edit_type": "name", "v_required": { "value": "true", - "err": "Tafadhali ingiza jina la kwanza" + "err": "Tafadhali ingiza Jina la Kwanza" }, "v_regex": { - "value": "[A-Za-z\\s\\-]*", - "err": "Tafadhali ingiza jina halali" + "value": "[A-Za-z\\s\\-\\']*", + "err": "Tafadhali ingiza jina sahihi" } }, { @@ -185,16 +159,16 @@ "openmrs_entity_id": "middle_name", "openmrs_data_type": "text", "type": "edit_text", - "hint": "Jina la kati", + "hint": "Jina la Kati", "expanded": false, "edit_type": "name", "v_required": { "value": "true", - "err": "Tafadhali ingiza jina la kati" + "err": "Tafadhali ingiza Jina la Kati" }, "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Tafadhali ingiza jina halali" + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza jina sahihi" } }, { @@ -206,7 +180,7 @@ "hint": "Tarehe ya kuzaliwa", "expanded": false, "duration": { - "label": "Age" + "label": "Umri" }, "min_date": "today-5y", "max_date": "today", @@ -233,11 +207,18 @@ "options": [ { "key": "dob_unknown", - "text": "Tarehe ya kuzaliwa haijulikani?", + "text": "Tarehe ya kuzaliwa haijulikani", "text_size": "18px", "value": "false" } - ] + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family-child-relevance.yml" + } + } + } }, { "key": "age", @@ -248,15 +229,15 @@ "hint": "Umri", "v_numeric": { "value": "true", - "err": "Nambari lazima ianze na 0 na lazima iwe jumla ya nambari 10 kwa urefu" + "err": "Namba lazima ianze na 0 na iwe na jumla ya tarakimu 10 kwa urefu" }, "v_min": { "value": "0", - "err": "Umri lazima uwe sawa au mkubwa kuliko 0" + "err": "Umri lazima uwe sawasawa au zaidi ya 0" }, "v_max": { "value": "5", - "err": "Umri lazima uwe sawa au chini ya 5" + "err": "Umri lazima uwe sawasawa au chini ya 5" }, "relevance": { "rules-engine": { @@ -276,29 +257,29 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "insurance_provider", "type": "spinner", - "hint": "Bima ya afya unaotumia", + "hint": "Mtoa huduma ya bima ya afya", "values": [ - "Bima ya afya ya jamii (CHF)", - "Bima ya afya ya jamii ulioboreshwa (iCHF)", - "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "Mfuko wa Afya ya Jamii (CHF)/(iCHF)", + "Mfuko wa Taifa wa Hifadhi ya Jamii - Manufaa ya Bima ya Afya ya Jamii (SHIB)", + "Mfuko wa Taifa wa Bima ya Afya (NHIF)", "Tiba Kwa Kadi (TIKA)", - "AAR Healthcare", - "Strategies Insurance", + "Huduma ya afya AAR", + "Bima ya Strategies", "Milvik Tanzania Ltd (BIMA Mkononi)", - "Britam Insurance Tanzania", - "Jubilee Insurance", - "Resolutions Insurance", - "Reliance Insurance", - "Bima ya afya nyingezo", + "Bima ya afya ya Britam", + "Bima ya afya ya Jubilee", + "Bima ya afya ya Resolutions", + "Bima ya afya ya Reliance", + "Nyingine", "Hakuna" ], "keys": [ "Community Health Fund (CHF)", - "iCHF", "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", "Tiba Kwa Kadi (TIKA)", - "AAR Healthcare", - "Strategies Insurance", + "Huduma ya afya AAR", + "Bima ya Strategies", "Milvik Tanzania Ltd (BIMA Mkononi)", "Britam Insurance Tanzania", "Jubilee Insurance", @@ -309,11 +290,11 @@ ], "openmrs_choice_ids": { "Community Health Fund (CHF)": "Community_Health_Fund", - "iCHF": "iCHF", "National Social Security Fund - Social Health Insurance Benefit (SHIB)": "National_Social_Security_Fund", + "National Health Insurance Fund (NHIF)": "National_Health_Insurance_Fund", "Tiba Kwa Kadi (TIKA)": "Tiba_kwa_Kadi", - "AAR Healthcare": "AAR_Healthcare", - "AAR Strategies Insurance": "Strategies_Insurance", + "Huduma ya afya AAR": "Huduma_ya_afya_AAR", + "Bima ya Strategies": "Bima_ya_Strategies", "Milvik Tanzania Ltd (BIMA Mkononi)": "BIMA_Mkononi", "Britam Insurance Tanzania": "Britam_Insurance_Tanzania", "Jubilee Insurance": "Jubilee_Insurance", @@ -324,7 +305,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali ingiza bima" + "err": "Tafadhali ingiza mtoa huduma ya bima ya afya" } }, { @@ -333,10 +314,10 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "Other_Health_Insurance_Type", "type": "edit_text", - "hint": "Bima ya afya mwingine unaotumia", + "hint": "Mtoa huduma ya bima ya afya mwingine", "v_required": { "value": "true", - "err": "Tafadhali taja bima" + "err": "Tafadhali bainisha mtoa huduma ya bima" }, "relevance": { "rules-engine": { @@ -352,10 +333,10 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "Health_Insurance_Number", "type": "edit_text", - "hint": "Namba ya bima ya afya umaotumia", + "hint": "Namba ya bima ya afya ya mteja", "v_required": { "value": "true", - "err": "Tafadhali ongeza nambari ya bima ya afya" + "err": "Tafadhali jaza namba ya bima ya afya ya mteja" }, "relevance": { "rules-engine": { @@ -389,9 +370,9 @@ "key": "disabilities", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "162558AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "disabilities", "type": "spinner", - "hint": "Hali ya ulemavu", + "hint": "Ulemavu wa kimwili", "values": [ "Ndiyo", "Hapana" @@ -401,8 +382,8 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" }, "v_required": { "value": "true", @@ -413,10 +394,62 @@ "key": "type_of_disability", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "edit_type": "name", - "hint": "Aina ya ulemavu", + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "label": "Aina ya Ulemavu", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Ulemavu wa Kimwili na utembeaji", + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Ulemavu wa uti wa mgongo", + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Majeraha ya kichwa - ulemavu wa ubongo", + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Ulemavu wa Kuona", + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Ulemavu wa Kusikia ", + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Ulemavu wa Utambuzi au Kujifunza", + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Matatizo ya Kisaikolojia", + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Ulemavu usioonekana", + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], "relevance": { "rules-engine": { "ex-rules": { @@ -426,16 +459,16 @@ }, "v_required": { "value": true, - "err": "Tafadhali ingiza aina ya ulemavu wa mwili" + "err": "Tafadhali chagua aina ya ulemavu wa kimwili" } }, { "key": "birth_cert_available", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "165406AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "birth_cert_available", "type": "spinner", - "hint": "Cheti cha kuzaliwa", + "hint": "Je, Mtoto amesajiliwa au ana cheti cha kuzaliwa", "values": [ "Ndiyo", "Hapana" @@ -445,17 +478,24 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family-child-relevance.yml" + } + } } }, { "key": "birth_regist_number", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "162052AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "birth_regist_number", "type": "edit_text", - "hint": "Namba ya cheti cha kuzaliwa", + "hint": "Namba ya cheti cha kuzaliwa cha mtoto", "relevance": { "rules-engine": { "ex-rules": { @@ -468,11 +508,11 @@ "key": "rhc_card", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "164147AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "rhc_card", "type": "spinner", - "hint": "Je, mtoto ana RCH kadi namba moja/kitabu cha ukuaji wa mtoto?", + "hint": "Je, mtoto ana kadi ya RCH 1/kijitabu cha ukuaji wa mtoto?", "values": [ - "Ndiyo", + "Nidyo", "Hapana" ], "keys": [ @@ -480,19 +520,19 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" } }, { "key": "nutrition_status", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "163301AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "nutrition_status", "type": "spinner", - "hint": "Hali ya lishe ya mtoto", + "hint": "Hali ya lishe", "values": [ - "Kijani", + "KIjani", "Kijivu/Njano", "Nyekundu" ], @@ -502,13 +542,13 @@ "Red" ], "openmrs_choice_ids": { - "Green": "160909AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "Grey": "163639AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "Red": "127778AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Green": "Green", + "Grey": "Grey", + "Red": "Red" }, "v_required": { "value": "true", - "err": "Tafadhali toa hali ya lishe ya watoto" + "err": "Tafadhali bainisha hali ya lishe ya mtoto" }, "relevance": { "rules-engine": { diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_deworming.json b/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_deworming.json index cb75ecc92..4d3afbced 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_deworming.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_deworming.json @@ -47,7 +47,7 @@ "encounter_location": "" }, "step1": { - "title": "Dozi ya {0} ya dawa ya minyoo", + "title": "Deworming {0} dose", "fields": [ { "key": "deworming{0}_date", @@ -56,12 +56,12 @@ "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "date_picker", "image": "ic_form_deworming", - "hint": "Dawa ya minyoo ya {0} lilifanyika lini?", + "hint": "Je, dawa ya minyoo {0} ilitolewa lini?", "min_date": "today-120y", "max_date": "today", "v_required": { "value": "true", - "err": "Tafadhali ingiza tarehe ya dozi ya dawa ya minyoo" + "err": "Tafadhali ingiza tarehe ya kupewa dawa ya minyoo" } } ] diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_malaria_prevention.json b/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_malaria_prevention.json new file mode 100644 index 000000000..ec9871d6c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_malaria_prevention.json @@ -0,0 +1,141 @@ +{ + "count": "1", + "encounter_type": "Malaria Prevention", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "today": { + "openmrs_entity_parent": "", + "openmrs_entity": "encounter", + "openmrs_entity_id": "encounter_date" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Malaria Prevention", + "fields": [ + { + "key": "fam_llin_1m5yr", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "openmrs_data_type": "select one", + "type": "spinner", + "hint": "Je, mtoto ana chandarua chenye dawa inayodumu kwa muda mrefu (LLIN)?", + "values": [ + "Ndiyo ", + "Hapana" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua chaguo moja" + } + }, + { + "key": "llin_2days_1m5yr", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "openmrs_data_type": "select one", + "type": "spinner", + "hint": "Je, mtoto alilala chini ya chandarua (LLIN) jana usiku?", + "values": [ + "Ndiyo", + "Hapana" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua chaguo moja" + }, + "relevance": { + "step1:fam_llin_1m5yr": { + "type": "string", + "ex": "equalTo(., \"Yes\")" + } + } + }, + { + "key": "llin_condition_1m5yr", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "openmrs_data_type": "select one", + "type": "spinner", + "hint": "Hali ya chandarua (LLIN)", + "values": [ + "Nduzi", + "Mbaya" + ], + "keys": [ + "Okay", + "Bad" + ], + "openmrs_choice_ids": { + "Okay": "159405AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "Bad": "159407AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "step1:fam_llin_1m5yr": { + "type": "string", + "ex": "equalTo(., \"Yes\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_nutrition_status.json b/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_nutrition_status.json new file mode 100644 index 000000000..41e31bffd --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_nutrition_status.json @@ -0,0 +1,82 @@ +{ + "count": "1", + "encounter_type": "Home Visit - Nutrition Status", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "today": { + "openmrs_entity_parent": "", + "openmrs_entity": "encounter", + "openmrs_entity_id": "encounter_date" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Nutrition status", + "fields": [ + { + "key": "nutrition_status_1m5yr", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "163301AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_data_type": "select one", + "type": "spinner", + "hint": "Hali ya lishe", + "values": [ + "Kawaida", + "Wastani", + "Mbaya" + ], + "keys": [ + "Normal", + "Moderate", + "Severe" + ], + "openmrs_choice_ids": { + "Normal": "1115AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "Moderate": "1499AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "Severe": "1500AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua chaguo moja" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_vaccine_card_received.json b/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_vaccine_card_received.json new file mode 100644 index 000000000..d77ad963e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_vaccine_card_received.json @@ -0,0 +1,72 @@ +{ + "count": "1", + "encounter_type": "Child vaccine card received", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "today": { + "openmrs_entity_parent": "", + "openmrs_entity": "encounter", + "openmrs_entity_id": "encounter_date" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Child vaccine card received", + "fields": [ + { + "key": "child_vaccine_card", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "164147AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_data_type": "select one", + "type": "spinner", + "image": "form_received_card", + "hint": "Je, mtoto alipokea kadi yake ya chanjo?", + "values": [ + "Ndiyo", + "Hapana" + ], + "openmrs_choice_ids": { + "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_vitamin_a.json b/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_vitamin_a.json index 486e785d2..3908129cd 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_vitamin_a.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/child_hv_vitamin_a.json @@ -47,7 +47,7 @@ "encounter_location": "" }, "step1": { - "title": "Dozi ya Vitamini A ya {0}", + "title": "Vitamin A {0} dose", "fields": [ { "key": "vitamin_a{0}_date", @@ -56,12 +56,12 @@ "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "date_picker", "image": "ic_form_vitamin", - "hint": "Dozi ya Vitamini A ya {0} ilifanyika lini?", + "hint": "Dozi ya Vitamini A {0} ilifanywa lini?", "min_date": "today-120y", "max_date": "today", "v_required": { "value": "true", - "err": "Tafadhali ingiza tarehe ya dozi ya Vitamini A" + "err": "Tafadhali ingiza tarehe ya kupewa dozi ya Vitamini A" } } ] diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/child_referral_form.json b/opensrp-chw-hf/src/main/assets/json.form-sw/child_referral_form.json new file mode 100644 index 000000000..9913f61db --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/child_referral_form.json @@ -0,0 +1,354 @@ +{ + "count": "1", + "encounter_type": "Sick Child Referral", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Sick child form", + "fields": [ + { + "key": "chw_referral_hf_child", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "1759AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "type": "hidden", + "is_problem": false, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "child_referral_calculation.yml" + } + } + } + }, + { + "key": "referral_problem_child", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "163182AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "type": "check_box", + "label": "Tatizo la kiafya / hali", + "label_text_style": "bold", + "options": [ + { + "key": "Fast_breathing_and_difficulty_with_breathing", + "text": "Kupumua kwa haraka na kwa shida", + "openmrs_entity": "concept", + "openmrs_entity_id": "142373AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Umbilical_cord_navel_bleeding", + "text": "Kutokwa damu kwenye kitovu", + "openmrs_entity": "concept", + "openmrs_entity_id": "123844AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Excessive_crying", + "text": "Kulia kupita kiasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "140944AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Convulsions", + "text": "Degedege", + "openmrs_entity": "concept", + "openmrs_entity_id": "113054AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Unable_to_breastfeed_or_swallow", + "text": "Kushindwa kukunyonya au kumeza", + "openmrs_entity": "concept", + "openmrs_entity_id": "159861AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Neck_stiffness", + "text": "Kukaza kwa shingo", + "openmrs_entity": "concept", + "openmrs_entity_id": "112721AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Fever", + "text": "Homa", + "openmrs_entity": "concept", + "openmrs_entity_id": "140238AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Bloating", + "text": "Tumbo kujaa ", + "openmrs_entity": "concept", + "openmrs_entity_id": "147132AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Redness_around_the_umbilical_cord_foul_smelling_discharge_from_the_umbilical_cord", + "text": "Kuwa na wekundu eneo la kitovu, kutokwa kwa majimaji yenye harufu mbaaya kutoka kwenye kitovu", + "openmrs_entity": "concept", + "openmrs_entity_id": "132407AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Bacterial_conjunctivitis", + "text": "Kuvimba kwa jicho inayosababishwa na bakteria", + "openmrs_entity": "concept", + "openmrs_entity_id": "148026AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Severe_anaemia", + "text": "Kupungukiwa kwa damu", + "openmrs_entity": "concept", + "openmrs_entity_id": "162044AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Severe_abdominal_pain", + "text": "Maumivu makali ya tumbo", + "openmrs_entity": "concept", + "openmrs_entity_id": "165271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Pale_or_jaundiced", + "text": "Kupauka au kuwa na rangi ya njano usoni", + "openmrs_entity": "concept", + "openmrs_entity_id": "136443AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Cyanosis_blueness_of_lips", + "text": "Mdomo kuwa na rangi ya bluu", + "openmrs_entity": "concept", + "openmrs_entity_id": "143050AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Skin_rash_pustules", + "text": "Vipele kwenye ngozi /pustules", + "openmrs_entity": "concept", + "openmrs_entity_id": "512AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Diarrhea", + "text": "Ulemavu", + "openmrs_entity": "concept", + "openmrs_entity_id": "142412AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Vomiting", + "text": "Kutapika", + "openmrs_entity": "concept", + "openmrs_entity_id": "122983AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Disabilities", + "text": "Ulemavu", + "openmrs_entity": "concept", + "openmrs_entity_id": "162558AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Premature_baby", + "text": "Mtoto", + "openmrs_entity": "concept", + "openmrs_entity_id": "159908AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Care_of_HIV_exposed_infant", + "text": "Utunzaji wa mtoto aliyeambukizwa VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "164818AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Immunisation", + "text": "Kupata chanjo ya kinga", + "openmrs_entity": "concept", + "openmrs_entity_id": "1914AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Other_symptom", + "text": "Dalili nyingine", + "ignore": true, + "openmrs_entity": "concept", + "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + } + ], + "v_required": { + "value": true, + "err": "Tafadhali bainisha tatizo la kiafya" + } + }, + { + "key": "referral_problem_child_other", + "type": "edit_text", + "openmrs_entity": "concept", + "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "163182AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "edit_type": "name", + "hint": "Dalili nyingine", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "child_referral_relevance.yml" + } + } + } + }, + { + "key": "service_before_child", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "type": "check_box", + "label": "Usimamizi uliyotolewa kabla ya kutoa rufaa ", + "label_text_style": "bold", + "is_problem": false, + "exclusive": [ + "None" + ], + "options": [ + { + "key": "ORS", + "text": "ORS", + "openmrs_entity": "concept", + "openmrs_entity_id": "351AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Panadol", + "text": "Panadol", + "openmrs_entity": "concept", + "openmrs_entity_id": "70116AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Other_treatment", + "text": "Matibabu mengine", + "ignore": true, + "openmrs_entity": "concept", + "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "None", + "text": "Hakuna", + "openmrs_entity": "concept", + "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + } + ], + "v_required": { + "value": "true", + "err": "Sehemu ya usimamizi wa kabla ya rufaa kutolewa inahitajika" + } + }, + { + "key": "service_before_child_other", + "type": "edit_text", + "openmrs_entity": "concept", + "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "edit_type": "name", + "hint": "Other treatment", + "is_problem": false, + "v_required": { + "value": "true", + "err": "Please specify other treatment" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "child_referral_relevance.yml" + } + } + } + }, + { + "key": "referral_date_child", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "163181AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "type": "hidden", + "is_problem": false, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "child_referral_calculation.yml" + } + } + } + }, + { + "key": "referral_time_child", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "referral_time_child", + "type": "hidden", + "is_problem": false, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "child_referral_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/child_sick_form.json b/opensrp-chw-hf/src/main/assets/json.form-sw/child_sick_form.json index 41920fcc9..15fbda492 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/child_sick_form.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/child_sick_form.json @@ -54,7 +54,7 @@ } }, "step1": { - "title": "Ufualitliaji wa mtoto mgonjwa", + "title": "Sick Child Follow-up", "fields": [ { "key": "date_sickchild", @@ -80,7 +80,7 @@ "hint": "Uzito (kg)", "v_required": { "value": "true", - "err": "Tafadahili ingiza uzito" + "err": "Tafadhali ingiza uzito wa mtoto" } }, { @@ -90,10 +90,10 @@ "openmrs_entity_id": "5090AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", "edit_type": "number", - "hint": "Urefu/Kimo (sm)", + "hint": "Urefu (cm)", "v_required": { "value": "true", - "err": "Tafadhali ingiza urefu" + "err": "Tafadhali ingiza urefu wa mtoto" } }, { @@ -102,7 +102,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "142412AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Mtoto anaharisha?", + "label": "Je, mtoto anaharisha?", "options": [ { "key": "Yes", @@ -121,7 +121,7 @@ ], "v_required": { "value": "true", - "err": "Tafadhali onesha ikiwa mtoto ana kuhara" + "err": "Tafadhali onyesha ikiwa mtoto anaharisha" } }, { @@ -130,7 +130,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "5984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Ameharisha kwa muda gani?", + "label": "Muda wa kuhara", "options": [ { "key": "Less_than_24_hours", @@ -144,7 +144,7 @@ "openmrs_entity": "", "openmrs_entity_id": "1072AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Siku" + "text": "Siku kadhaa" } ], "relevance": { @@ -165,33 +165,33 @@ "openmrs_entity": "concept", "openmrs_entity_id": "1497AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Upungufu wa maji na chumvichumvi mwilini", + "label": "Hali ya kukosa maji mwilini", "options": [ { "key": "No_dehydration", "openmrs_entity": "", "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Hakuna upungufu" + "text": "Hakosi maji mwilini" }, { "key": "Some_dehydration", "openmrs_entity": "", "openmrs_entity_id": "1499AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Kuna kiasi cha upungufu" + "text": "Anakosa kiasi cha maji mwilini" }, { "key": "Severe_dehydration", "openmrs_entity": "", "openmrs_entity_id": "1500AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Kuna upungufu mkubwan" + "text": "Anakosa maji mengi sana mwilini" } ], "v_required": { "value": "true", - "err": "Tafadhali chagua hali ya upungufu wa maji mwilini ya mtoto" + "err": "Tafadhali chagua hali ya mtoto kukosa maji mwilini" } }, { @@ -200,13 +200,13 @@ "openmrs_entity": "concept", "openmrs_entity_id": "1729AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Dalili za ziada zinazohusiana na kuharisha", + "label": "Dalili zingine zinazohusiana na kuhara", "combine_checkbox_option_values": "true", "options": [ { "key": "Bloody_diarrhoea", "openmrs_choice_id": "138868AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Damu kwenye kinyesi", + "text": "Kuharisha damu", "value": false }, { @@ -224,7 +224,7 @@ { "key": "Other", "openmrs_choice_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Dalili zingine", + "text": "Nyingine", "value": false }, { @@ -255,28 +255,28 @@ "openmrs_entity": "concept", "openmrs_entity_id": "1271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Vipimo vilivyoagizwa", + "label": "Uchunguzi ulioamriwa", "options": [ { "key": "Blood_test", "openmrs_entity": "", "openmrs_entity_id": "1019AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Vipimo vya damu" + "text": "Kipimo cha damu" }, { "key": "Stool_test", "openmrs_entity": "", "openmrs_entity_id": "161451AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Vipimo vya kinyesi" + "text": "Kipimo cha kinyesi" }, { "key": "Other_investigation", "openmrs_entity": "", "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Vipimo vingine" + "text": "Uchunguzi mwingine" }, { "key": "None", @@ -288,7 +288,7 @@ ], "v_required": { "value": "true", - "err": "Tafadhali chagua uchunguzi umeamuru" + "err": "Tafadhali chagua uchunguzi ulioamriwa" } }, { @@ -298,7 +298,7 @@ "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", "edit_type": "name", - "hint": "Vipimo vingine vilivyoangizwa", + "hint": "Uchunguzi mwingine uliyoamriwa", "relevance": { "rules-engine": { "ex-rules": { @@ -308,7 +308,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali ingiza uchunguzi mwingine umeamuru" + "err": "Tafadhali ingiza uchunguzi mwingine uliyoamriwa" } }, { @@ -318,7 +318,7 @@ "openmrs_entity_id": "161577AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", "edit_type": "name", - "hint": "Matokeo ya vipimo", + "hint": "Matokeo ya uchunguzi", "relevance": { "rules-engine": { "ex-rules": { @@ -328,7 +328,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali ingiza matokeo ya vipimo" + "err": "Tafadhali ingiza matokeo ya uchunguzi " } }, { @@ -338,10 +338,10 @@ "openmrs_entity_id": "161602AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", "edit_type": "name", - "hint": "Diagnosis (Utambuzi)", + "hint": "Diagnosis", "v_required": { "value": "true", - "err": "Tafadhali ingiza diagnosis" + "err": "Tafadhali ingiza utambuzi" } }, { @@ -350,19 +350,19 @@ "openmrs_entity": "concept", "openmrs_entity_id": "1767AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Matibabu ya kuharisha", + "label": "Matibabu kwa ajili ya kuhara", "combine_checkbox_option_values": "true", "options": [ { "key": "ORS_solution", "openmrs_choice_id": "351AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "ORS", + "text": "Mchanganyiko wa ORS", "value": false }, { "key": "IV_infusion_drip", "openmrs_choice_id": "162651AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Maji kwa njia ya mshipa", + "text": "Dripu ya maji", "value": false }, { @@ -374,7 +374,7 @@ { "key": "Other_treatments", "openmrs_choice_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Matibabu mengineyo", + "text": "Matibabu mengine", "value": false }, { @@ -396,7 +396,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali onyesha matibabu uliyopewa" + "err": "Tafadhali ionyesha matibabu yaliyotolewa" } }, { @@ -406,7 +406,7 @@ "openmrs_entity_id": "diarrhea_treat_ors", "openmrs_entity_parent": "", "edit_type": "number", - "hint": "Kiasi cha mchanganyiko wa ORS (ml)", + "hint": "Kiasi cha mchanganyiko wa ORS (ml)", "relevance": { "rules-engine": { "ex-rules": { @@ -416,7 +416,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali ingiza kiasi cha mchanganyiko wa ORS" + "err": "Tafahdali ingiza kiasi cha mchanganyiko wa ORS iliyotolewa" } }, { @@ -426,7 +426,7 @@ "openmrs_entity_id": "diarrhea_treat_rehydration", "openmrs_entity_parent": "", "edit_type": "number", - "hint": "Maji kwa njia ya mshipa (mls)", + "hint": "Dripu ya maji (mls)", "relevance": { "rules-engine": { "ex-rules": { @@ -436,7 +436,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali ingiza maji kwa njia ya mshipa" + "err": "Tafadhali ingiza kiasi cha dripu za maji" } }, { @@ -446,7 +446,7 @@ "openmrs_entity_id": "diarrhea_treat_zinc", "openmrs_entity_parent": "", "edit_type": "number", - "hint": "Zinki (mg)", + "hint": "Zinc (mg)", "relevance": { "rules-engine": { "ex-rules": { @@ -456,7 +456,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali ingiza kiasi cha Zinki" + "err": "Tafadhali ingiza kiasi cha Zinc iliyotolewa" } }, { @@ -465,25 +465,25 @@ "openmrs_entity": "concept", "openmrs_entity_id": "160742AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Dawa anazo ondoka nazo", + "label": "Dawa zilizotolewa kwwenda nazo nyumbani", "combine_checkbox_option_values": "true", "options": [ { "key": "ORS_Packs", "openmrs_choice_id": "351AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "ORS (Pks)", + "text": "Pakiti za ORS", "value": false }, { "key": "Zinc_pills", "openmrs_choice_id": "86672AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Zinki (vidonge)", + "text": "Zinc (vidonge)", "value": false }, { "key": "Other_drugs", "openmrs_choice_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Dawa nyingineyo", + "text": "Dawa zingine", "value": false } ], @@ -496,7 +496,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali chagua dawa zilizopelekwa nyumbani" + "err": "Tafadhali ingiza dawa zilizotolewa kwenda nazo nyumbani" } }, { @@ -506,10 +506,10 @@ "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", "edit_type": "name", - "hint": "Matibabu kutokana na utambuzi ambayo siyo kuharisha", + "hint": "Matibabu kutokana na utambuzi usiyo wa kuhara", "v_required": { "value": "true", - "err": "Tafadhali ongeza matibabu kutokana na utambuzi ambayo siyo kuharisha" + "err": "Tafadhali ingiza matibabu kutokana na utambuzi usiyo wa kuhara" } }, { @@ -519,7 +519,7 @@ "openmrs_entity_id": "1785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", "edit_type": "number", - "hint": "Muda wa kukaa DTC (dakika)", + "hint": "Muda uliyotumika kwenye DTC (mins)", "relevance": { "rules-engine": { "ex-rules": { @@ -529,7 +529,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali ingiza muda wa kukaa DTC (dakika)" + "err": "Tafadhali onyesha kiasi cha muda uliyotumika kwa kipimo cha dakika" } }, { @@ -545,7 +545,7 @@ "openmrs_entity": "", "openmrs_entity_id": "160433AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Ameruhusiwa" + "text": "Ametolewa" }, { "key": "Referred", @@ -566,14 +566,14 @@ "openmrs_entity": "", "openmrs_entity_id": "1654AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Amekufa" + "text": "Amefariki" } ], "v_required": { "value": "true", - "err": "Tafadhali chagua matokeo kwenye uwezeshajiy" + "err": "Tafadhali chagua matokeo kwenye kituo" } } ] } -} +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_register.json b/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_register.json index f220cf052..ecf008a53 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_register.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_register.json @@ -16,11 +16,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -52,38 +47,21 @@ } }, "step1": { - "title": "Taarifa ya familia", + "title": "Family Details", "fields": [ - { - "key": "fam_name", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "first_name", - "type": "edit_text", - "hint": "Jina la familia (ukoo)", - "edit_type": "name", - "v_required": { - "value": "true", - "err": "Tafadhali ingiza jina la familia (ukoo)" - }, - "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Tafadhali ingiza jina halali" - } - }, { "key": "unique_id", "openmrs_entity_parent": "", "openmrs_entity": "person_identifier", "openmrs_entity_id": "opensrp_id", "hidden": "true", - "type": "barcode", + "type": "edit_text", "barcode_type": "qrcode", - "hint": "ID *", + "hint": "Kitambulisho", "scanButtonText": "Scan QR Code", "v_numeric": { "value": "true", - "err": "Tafadhali ingiza namba halali" + "err": "Ingiza namba ya kitambulisho kwa usahihi" } }, { @@ -92,10 +70,10 @@ "openmrs_entity": "person_address", "openmrs_entity_id": "cityVillage", "type": "edit_text", - "hint": "Kijiji / mtaa", + "hint": "Jina la Eneo", "v_required": { "value": "true", - "err": "Tafadhali ingiza kijiji au jiji" + "err": "Tafadhali ingiza jina eneo au mji" } }, { @@ -104,28 +82,20 @@ "openmrs_entity": "person_address", "openmrs_entity_id": "landmark", "type": "edit_text", - "hint": "Alama ya eneo la makazi" - }, - { - "key": "gps", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_data_type": "text", - "type": "gps" + "hint": "Eneo maarufu" }, { "key": "nearest_facility", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "162724AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "nearest_facility", "openmrs_data_type": "text", "type": "tree", - "hint": "Kituo cha karibu cha kutolea huduma za afya", + "hint": "Kituo cha afya kilichopo karibu", "tree": [], "v_required": { "value": true, - "err": "Tafadhali ingiza kituo cha afya kilicho karibu" + "err": "Tafadhali ingiza kituo cha afya kilichopo karibu" } } ] diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_remove_child.json b/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_remove_child.json index 47d0728d2..7151e72c5 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_remove_child.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_remove_child.json @@ -52,12 +52,12 @@ } }, "step1": { - "title": "Ondoa mtoto chini ya miaki 5", + "title": "Remove Child Under 5", "fields": [ { "key": "spacer", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "spacer", "spacer_height": "10sp" @@ -65,7 +65,7 @@ { "key": "details", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "label", "text": "", @@ -75,13 +75,13 @@ "key": "divider1", "type": "h_line", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "spacer", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "spacer", "spacer_height": "15dp" @@ -93,11 +93,11 @@ "openmrs_entity_id": "160417AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Sababu ya kuiondoa", + "hint": "Sababu", "values": [ - "Kifo", + "Amefariki", "Amehama", - "Sababu nyingine" + "Nyinginezo" ], "keys": [ "Died", @@ -114,10 +114,29 @@ "Other": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } }, + { + "key": "other_reason_for_removing_the_client", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_removing_the_client", + "type": "edit_text", + "hint": "Sababu Nyinginezo", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu nyinginezo" + }, + "relevance": { + "step1:remove_reason": { + "type": "string", + "ex": "equalTo(., \"Other\")" + } + } + }, { "key": "dob", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "spacer", "expanded": false, @@ -131,20 +150,20 @@ "openmrs_entity_id": "164133AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "text", "type": "date_picker", - "label": "Tarehe aliyohama", - "hint": "Tarehe aliyohama", + "label": "Date moved away", + "hint": "Tarehe ya kuhamishwa", "expanded": false, "min_date": "", "max_date": "today", "v_required": { "value": "true", - "err": "Ingiza tarehe ambayo mwanachama alihama" + "err": "Weka tarehe ambayo mwanachama alihama" }, "constraints": [ { "type": "date", "ex": "greaterThanEqualTo(., step1:dob)", - "err": "Tarehe ya kuhamishwa haiwezi kuwa kabla ya tarehe ya kuzaliwa" + "err": "Moved away date cannot be before date of birth" } ], "relevance": { @@ -161,20 +180,20 @@ "openmrs_entity_id": "1543AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "text", "type": "date_picker", - "label": "Tarehe ya kifo", + "label": "Date of death", "hint": "Tarehe ya kifo", "expanded": false, "min_date": "", "max_date": "today", "v_required": { "value": "true", - "err": "Ingiza tarehe ya kifo" + "err": "Weka tarehe ya kifo" }, "constraints": [ { "type": "date", "ex": "greaterThanEqualTo(., step1:dob)", - "err": "Tarehe ya kifo haiwezi kutokea kabla ya tarehe ya kuzaliwa" + "err": "Date of death can't occur before date of birth" } ], "relevance": { @@ -187,10 +206,10 @@ { "key": "age_at_death", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", - "label": "Umri wakati anafariki", - "hint": "Umri wakati anafariki", + "label": "Age at death", + "hint": "Umri wakati wa kifo", "type": "edit_text", "read_only": "true", "relevance": { diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_remove_family.json b/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_remove_family.json index 84b8a4047..a07872252 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_remove_family.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_remove_family.json @@ -52,12 +52,12 @@ } }, "step1": { - "title": "Ondoa familia", + "title": "Remove Family", "fields": [ { "key": "spacer", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "spacer", "spacer_height": "30sp" @@ -65,7 +65,7 @@ { "key": "fam_name", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "label", "text": "", @@ -74,7 +74,7 @@ { "key": "details", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "label", "text": "", @@ -84,13 +84,13 @@ "key": "divider1", "type": "h_line", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "spacer", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "spacer", "spacer_height": "20sp" @@ -104,7 +104,7 @@ "type": "spinner", "hint": "Sababu ya kufungwa", "values": [ - "Kaya imehama", + "Uhamisho", "Nyingine" ], "keys": [ @@ -130,7 +130,7 @@ "hint": "Sababu nyingine", "v_required": { "value": "true", - "err": "Ingiza sababu ya kufungwa" + "err": "Weka sababu ya kufungwa" }, "relevance": { "step1:closure_reason_fam": { @@ -146,7 +146,7 @@ "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Kaya imehama", + "hint": "Uhamisho wa kaya", "values": [ "Ndani ya wilaya", "Nje ya wilaya" @@ -157,7 +157,7 @@ ], "v_required": { "value": "true", - "err": "Ingiza sababu ya kufungwa" + "err": "Weka sababu ya kufungwa" }, "relevance": { "step1:closure_reason_fam": { diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_remove_member.json b/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_remove_member.json index a95ae4224..6d8bca038 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_remove_member.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/family_details_remove_member.json @@ -52,12 +52,12 @@ } }, "step1": { - "title": "Ondoa mwanafamilia", + "title": "Remove Family Member", "fields": [ { "key": "spacer", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "spacer", "spacer_height": "10sp" @@ -65,7 +65,7 @@ { "key": "details", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "label", "text": "", @@ -75,13 +75,13 @@ "key": "divider1", "type": "h_line", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "spacer", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "spacer", "spacer_height": "15dp" @@ -93,15 +93,15 @@ "openmrs_entity_id": "160417AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Sababu ya kuiondoa", + "hint": "Sababu ya kumuondoa", "v_required": { "value": "true", - "err": "Chagua sababu ya kuondoa rekodi ya familia" + "err": "Chagua sababu ya kuondoa taarifa za wana familia" }, "values": [ "Kifo", "Amehama", - "Sababu nyingine" + "Nyingine" ], "keys": [ "Death", @@ -114,10 +114,29 @@ "Other": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } }, + { + "key": "other_reason_for_removing_the_client", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_removing_the_client", + "type": "edit_text", + "hint": "Sababu Nyinginezo", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu nyinginezo" + }, + "relevance": { + "step1:remove_reason": { + "type": "string", + "ex": "equalTo(., \"Other\")" + } + } + }, { "key": "dob", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "spacer", "expanded": false, @@ -131,20 +150,20 @@ "openmrs_entity_id": "164133AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "text", "type": "date_picker", - "label": "Tarehe aliyohama", - "hint": "Tarehe aliyohama", + "label": "Date moved away", + "hint": "Tarehe ya kuahama", "expanded": false, "min_date": "", "max_date": "today", "v_required": { "value": "true", - "err": "Ingiza tarehe ambayo mwanachama alihama" + "err": "Ingiza tarehe ambayo mwanafamilia alihama" }, "constraints": [ { "type": "date", "ex": "greaterThanEqualTo(., step1:dob)", - "err": "Tarehe iliyohamishwa imetokea kabla ya tarehe ya kuzaliwa" + "err": "Date moved away occur before date of birth" } ], "relevance": { @@ -161,20 +180,20 @@ "openmrs_entity_id": "1543AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "text", "type": "date_picker", - "label": "Tarehe ya kifo", - "hint": "Tarehe ya kifo", + "label": "Date of death", + "hint": "Tarehe ya Kifo", "expanded": false, "min_date": "today-80y", "max_date": "today", "v_required": { "value": "true", - "err": "Ingiza tarehe ya kifo" + "err": "Ingiza tarehe ya Kifo ya mwanafamilia" }, "constraints": [ { "type": "date", "ex": "greaterThanEqualTo(., step1:dob)", - "err": "Tarehe ya kifo haiwezi kutokea kabla ya tarehe ya kuzaliwa" + "err": "Date of death can't occur before date of birth" } ], "relevance": { @@ -188,10 +207,10 @@ { "key": "age_at_death", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", - "label": "Umri wakati anafariki", - "hint": "Umri wakati anafariki", + "label": "Age at death", + "hint": "Umri wa mwanafamilia wakati anafariki", "type": "edit_text", "read_only": "true", "relevance": { diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/family_member_register.json b/opensrp-chw-hf/src/main/assets/json.form-sw/family_member_register.json index 6b3b6b447..fb45e188a 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/family_member_register.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/family_member_register.json @@ -16,11 +16,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -52,61 +47,40 @@ } }, "step1": { - "title": "Ongeza Mwanachama wa Familia", + "title": "Sajili mwanafamilia", "fields": [ - { - "key": "sync_location_id", - "openmrs_entity_parent": "", - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "sync_location_id", - "type": "spinner", - "hint": "Chagua eneo la CHW", - "v_required": { - "value": "true", - "err": "Tafadhali chagua eneo la CHW" - } - }, - { - "key": "photo", - "openmrs_entity_parent": "", - "openmrs_entity": "", - "openmrs_entity_id": "", - "type": "choose_image", - "uploadButtonText": "Chukua picha ya muhusika" - }, { "key": "unique_id", "openmrs_entity_parent": "", "openmrs_entity": "person_identifier", "openmrs_entity_id": "opensrp_id", - "type": "barcode", - "barcode_type": "qrcode", - "hint": "Boresha Afya ID", - "scanButtonText": "Chukua QR code", + "type": "edit_text", + "read_only": true, + "hint": "Namba ya kitambulisho ya kituo", "v_numeric": { "value": "true", - "err": "Tafadhali ingiza namba halali" + "err": "Tafadhali weka kitambulisho halali" }, "v_required": { "value": "true", - "err": "Tafadhali ingiza namba ya kipekee" + "err": "Tafadhali weka kitambulisho cha KIPEKEE" } }, { "key": "surname", "openmrs_entity_parent": "", - "openmrs_entity": "", - "openmrs_entity_id": "", + "openmrs_entity": "person", + "openmrs_entity_id": "last_name", "type": "edit_text", - "hint": "Jina la mwisho (ukoo)", + "hint": "Jina la Ukoo", "edit_type": "name", "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Tafadhali ingiza jina halali" + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" }, "v_required": { "value": "true", - "err": "Tafadhali ingiza jina la ukoo" + "err": "Tafadhali weka Jina la Ukoo" }, "relevance": { "rules-engine": { @@ -119,7 +93,7 @@ { "key": "same_as_fam_name", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "openmrs_data_type": "text", "type": "check_box", @@ -130,7 +104,7 @@ "options": [ { "key": "same_as_fam_name", - "text": "Jina la ukoo ni sawa na jina la familia", + "text": "Jina la Ukoo sawa na jina la familia", "text_size": "18px", "value": "false" } @@ -139,7 +113,7 @@ { "key": "fam_name", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "label", "hidden": "true" @@ -150,7 +124,7 @@ "openmrs_entity": "person", "openmrs_entity_id": "last_name", "type": "hidden", - "hint": "Jina la ukoo ni sawa na jina la familia", + "hint": "Surname as Family name", "calculation": { "rules-engine": { "ex-rules": { @@ -165,15 +139,15 @@ "openmrs_entity": "person", "openmrs_entity_id": "first_name", "type": "edit_text", - "hint": "Jina la kwanza", + "hint": "Jina la Kwanza", "edit_type": "name", "v_required": { "value": "true", - "err": "Tafadhali ingiza jina la kwanza" + "err": "Tafadhali ingiza Jina la Kwanza" }, "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Tafadhali ingiza jina halali" + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza Jina la Kwanza" } }, { @@ -182,15 +156,15 @@ "openmrs_entity": "person", "openmrs_entity_id": "middle_name", "type": "edit_text", - "hint": "Jina la kati", + "hint": "Jina la Kati", "edit_type": "name", "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Tafadhali ingiza jina halali" + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" }, "v_required": { "value": "true", - "err": "Tafadhali ingiza jina la kati" + "err": "Tafadhali weka Jina la Kati" } }, { @@ -199,16 +173,16 @@ "openmrs_entity": "person", "openmrs_entity_id": "birthdate", "type": "date_picker", - "hint": "Tarehe ya kuzaliwa", + "hint": "Tarehe ya kuzaliwa (DOB)", "expanded": false, "duration": { - "label": "Age" + "label": "Umri" }, "min_date": "today-120y", "max_date": "today-5y", "v_required": { "value": "true", - "err": "Tafadhali ingiza tarehe ya kuzaliwa" + "err": "Tafadhali weka tarehe ya kuzaliwa" }, "relevance": { "rules-engine": { @@ -221,7 +195,7 @@ { "key": "age_calculated", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "hidden", "calculation": { @@ -242,11 +216,18 @@ "options": [ { "key": "dob_unknown", - "text": "Tarehe ya kuzaliwa haijulikani?", + "text": "Tarehe ya kuzaliwa Haijulikani", "text_size": "18px", "value": "false" } - ] + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_member_relevance.yml" + } + } + } }, { "key": "age", @@ -255,13 +236,18 @@ "openmrs_entity_id": "age", "type": "edit_text", "hint": "Umri", + "v_max_length": { + "value": "3", + "is_fixed_size": "true", + "err": "Weka umri halali" + }, "v_numeric": { "value": "true", - "err": "Tafadhali ingiza umri" + "err": "Nambari lazima ianze na 0 na lazima iwe jumla ya tarakimu 10 kwa urefu" }, "v_min": { "value": "5", - "err": "Umri lazima uwe sawa au mkubwa kuliko 5" + "err": "Umri lazima uwe sawa au zaidi ya 5" }, "v_max": { "value": "120", @@ -276,7 +262,99 @@ }, "v_required": { "value": true, - "err": "Tafadhali ingiza umri" + "err": "Tafadhali weka umri" + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Jinsi", + "values": [ + "Me", + "Ke" + ], + "keys": [ + "Male", + "Female" + ], + "v_required": { + "value": "true", + "err": "Tafadhali ingiza jinsi" + } + }, + { + "key": "marital_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "marital_status", + "type": "spinner", + "hint": "Hali ya Ndoa ya Mteja?", + "values": [ + "Hajaoa/Hajaolewa", + "Ameoa/Ameolewa", + "Ameachwa", + "Mjane/Mgane", + "Kuishi pamoja bila ndoa" + ], + "keys": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "openmrs_choice_ids": { + "Single": "Single", + "Married": "Married", + "Divorced": "Divorced", + "Widowed": "Widowed", + "Cohabitation": "Cohabitation" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_member_relevance.yml" + } + } + } + }, + { + "key": "phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "phone_number", + "type": "edit_text", + "hint": "Namba ya simu", + "v_numeric": { + "value": "true", + "err": "Namba lazima iwe jumla ya tarakimu 10 kwa urefu" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Namba lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." + } + }, + { + "key": "other_phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_phone_number", + "type": "edit_text", + "hint": "Namba nyingine ya simu", + "v_numeric": { + "value": "true", + "err": "Namba lazima iwe jumla ya tarakimu 10 kwa urefu" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Namba lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." } }, { @@ -285,7 +363,8 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "id_avail", "type": "check_box", - "label": "Je, ana kitambulisho chochote kati ya hivi??", + "combine_checkbox_option_values": "true", + "label": "Je, una kitambulisho chochote kati ya vifuatavyo?", "label_text_style": "normal", "text_color": "#C0C0C0", "exclusive": [ @@ -295,35 +374,24 @@ { "key": "chk_national_id", "text": "Kitambulisho cha taifa", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_national_id" }, { "key": "chk_voters_id", "text": "Kitambulisho cha mpiga kura", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_voters_id" }, { "key": "chk_drivers_license", - "text": "Leseni ya dereva", - "value": false, + "text": "Leseni ya udereva", "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_drivers_license" }, - { - "key": "chk_passport", - "text": "Hati ya kusafiria", - "value": false, - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "chk_passport" - }, { "key": "chk_none", "text": "Hakuna", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_none" } @@ -342,8 +410,24 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "National_ID", "type": "edit_text", - "hint": "Namba ya kitambulisho cha taifa", - "edit_type": "name", + "mask": "########-#####-#####-##", + "mask_hint": "12345678912345678912", + "allowed_chars": "0123456789", + "hint": "Namba ya kitambulisho cha taifa k.m 12345678-91234-56789-12", + "edit_type": "number", + "v_max_length": { + "value": "23", + "is_fixed_size": "true", + "err": "Tafadhali jaza namba halali" + }, + "v_regex": { + "value": "^\\d{8}-\\d{5}-\\d{5}-\\d{2}$", + "err": "Namba ya kitambulisho cha kitaifa inapaswa kuwa ya umbizo (XXXXXXXX-XXXXX-XXXXX-XX)" + }, + "v_required": { + "value": true, + "err": "Tafadhali jaza namba halali" + }, "relevance": { "step1:id_avail": { "ex-checkbox": [ @@ -362,8 +446,24 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "Voter_Registration_Number", "type": "edit_text", - "hint": "Namba ya kitambulisho cha mpiga kura", - "edit_type": "name", + "mask": "T-####-####-###-#", + "mask_hint": "123456789123", + "allowed_chars": "0123456789", + "hint": "Namba ya kitambulisho cha mpiga kura k.m T-1234-5678-912-3", + "edit_type": "number", + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Tafadhali jaza namba halali" + }, + "v_regex": { + "value": "^T-\\d{4}-\\d{4}-\\d{3}-\\d{1}$", + "err": "Namba ya usajili wa mpiga kura inapaswa kuwa ya umbizo (T-XXXX-XXXX-XXX-X)" + }, + "v_required": { + "value": true, + "err": "Tafadhali jaza namba halali" + }, "relevance": { "step1:id_avail": { "ex-checkbox": [ @@ -382,8 +482,24 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "Driver_License_Number", "type": "edit_text", - "hint": "Namba ya leseni ya udereva", - "edit_type": "name", + "mask": "##########", + "mask_hint": "1234567891", + "allowed_chars": "0123456789", + "hint": "Namba ya leseni ya udereva k.m 1234567891", + "edit_type": "number", + "v_max_length": { + "value": "10", + "is_fixed_size": "true", + "err": "Tafadhali jaza namba halali" + }, + "v_regex": { + "value": "^([0-9]{10})", + "err": "Namba ya leseni ya udereva inapaswa kuwa ya umbizo (XXXXXXXXX)" + }, + "v_required": { + "value": true, + "err": "Tafadhali jaza namba halali" + }, "relevance": { "step1:id_avail": { "ex-checkbox": [ @@ -396,67 +512,47 @@ } } }, - { - "key": "passport", - "openmrs_entity_parent": "", - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "Passport_Number", - "type": "edit_text", - "hint": "Namba ya hati ya kusafiria", - "edit_type": "name", - "relevance": { - "step1:id_avail": { - "ex-checkbox": [ - { - "or": [ - "chk_passport" - ] - } - ] - } - } - }, { "key": "insurance_provider", "openmrs_entity_parent": "", "openmrs_entity": "person_attribute", "openmrs_entity_id": "Health_Insurance_Type", "type": "spinner", - "hint": "Bima ya afya unaotumia", + "hint": "Mtoa huduma ya bima ya afya", "values": [ - "Bima ya afya ya jamii (CHF)", - "Bima ya afya ya jamii ulioboreshwa (iCHF)", - "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "Mfuko wa Afya ya Jamii", + "Mfuko wa Taifa wa Hifadhi ya Jamii - Manufaa ya Bima ya Afya ya Jamii (SHIB)", + "Mfuko wa Taifa wa Bima ya Afya (NHIF)", "Tiba Kwa Kadi (TIKA)", - "AAR Healthcare", - "Strategies Insurance", + "AAR Huduma ya Afya", + "Bima ya afya Strategies", "Milvik Tanzania Ltd (BIMA Mkononi)", - "Britam Insurance Tanzania", - "Jubilee Insurance", - "Resolutions Insurance", - "Reliance Insurance", - "Bima ya afya nyingezo", + "Bima ya afya ya Britam Tanzania", + "Bima ya afya Jubilee", + "Bima ya afya ya Resolutions ", + "Bima ya afya ya Reliance", + "Nyinginezo", "Hakuna" ], "keys": [ "Community Health Fund (CHF)", - "iCHF", "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", "Tiba Kwa Kadi (TIKA)", "AAR Healthcare", "Strategies Insurance", "Milvik Tanzania Ltd (BIMA Mkononi)", - "Britam Insurance Tanzania", - "Jubilee Insurance", - "Resolutions Insurance", - "Reliance Insurance", + "Bima ya afya ya Britam", + "Bima ya afya ya Jubilee", + "Bima ya afya ya Resolutions", + "Bima ya afya ya Reliance", "Other", "None" ], "openmrs_choice_ids": { "Community Health Fund (CHF)": "Community_Health_Fund", - "iCHF": "iCHF", "National Social Security Fund - Social Health Insurance Benefit (SHIB)": "National_Social_Security_Fund", + "National Health Insurance Fund (NHIF)": "National_Health_Insurance_Fund", "Tiba Kwa Kadi (TIKA)": "Tiba_kwa_Kadi", "AAR Healthcare": "AAR_Healthcare", "AAR Strategies Insurance": "Strategies_Insurance", @@ -470,7 +566,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali ingiza bima" + "err": "Tafadhali ingiza mtoa huduma wa bima" } }, { @@ -479,10 +575,10 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "Other_Health_Insurance_Type", "type": "edit_text", - "hint": "Bima ya afya mwingine unaotumia", + "hint": "Mtoa huduma mwingine wa bima ya afya", "v_required": { "value": "true", - "err": "Tafadhali ingiza bima" + "err": "Tafadhali bainisha mtoa huduma wa bima" }, "relevance": { "rules-engine": { @@ -498,10 +594,10 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "Health_Insurance_Number", "type": "edit_text", - "hint": "Namba ya bima ya afya umaotumia", + "hint": "Namba ya bima ya afya ya mteja", "v_required": { "value": "true", - "err": "Tafadhali ingiza namba ya mfuko wa bima ya afya umaotumia" + "err": "Tafadhali jaza namba ya bima ya afya ya mteja" }, "relevance": { "rules-engine": { @@ -511,30 +607,10 @@ } } }, - { - "key": "sex", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "gender", - "type": "spinner", - "hint": "Jinsi", - "values": [ - "Me", - "Ke" - ], - "keys": [ - "Male", - "Female" - ], - "v_required": { - "value": "true", - "err": "Tafadhali ingiza jinsi" - } - }, { "key": "wra", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "hidden", "calculation": { @@ -548,7 +624,7 @@ { "key": "mra", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "hidden", "calculation": { @@ -563,11 +639,11 @@ "key": "preg_1yr", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "160692AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "preg_1yr", "type": "spinner", - "hint": "Je, amejifungua ndani ya mwaka 1?", + "hint": "Je, mwanamke amejifungua katika mwaka 1 uliopita?", "values": [ - "Ndiyo", + "Ndio", "Hapana" ], "keys": [ @@ -575,8 +651,8 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" }, "v_required": { "value": "true", @@ -594,11 +670,11 @@ "key": "disabilities", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "162558AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "disabilities", "type": "spinner", - "hint": "Hali ya ulemavu", + "hint": "Ulemavu wa kimwili", "values": [ - "Ndiyo", + "Ndio", "Hapana" ], "keys": [ @@ -606,8 +682,8 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" }, "v_required": { "value": "true", @@ -616,15 +692,64 @@ }, { "key": "type_of_disability", - "openmrs_entity_parent": "162558AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "hint": "Aina ya ulemavu", - "v_required": { - "value": "true", - "err": "Tafadhali ingiza aina ya ulemavu" - }, + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Aina ya ulemavu", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Ulemavu wa mwili", + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Ulemavu wa Uti wa Mgongo", + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Majeraha ya Kichwa - Ulemavu wa Ubongo", + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Ulemavu wa Maono", + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Ulemavu wa Kusikia", + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Ulemavu wa Utambuzi au Kujifunza", + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Matatizo ya Kisaikolojia", + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Ulemavu Usioonekana", + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], "relevance": { "rules-engine": { "ex-rules": { @@ -636,12 +761,12 @@ { "key": "is_primary_caregiver", "openmrs_entity_parent": "", - "openmrs_entity": "", - "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_primary_caregiver", "type": "spinner", - "hint": "Ni mlezi mkuu wa familia?", + "hint": "Je, ana mlezi mkuu?", "values": [ - "Ndiyo", + "Ndio", "Hapana" ], "keys": [ @@ -653,150 +778,51 @@ "err": "Tafadhali chagua moja" } }, - { - "key": "phone_number", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "hint": "Namba ya simu", - "v_numeric": { - "value": "true", - "err": "Nambari lazima iwe jumla ya nambari 10 kwa urefu" - }, - "v_regex": { - "value": "(0[0-9]{9})|\\s*", - "err": "Nambari lazima iwe na nambari 10 na lazima ianze na 0." - }, - "v_required": { - "value": false, - "err": "Tafadhali taja numbe ya simu" - } - }, - { - "key": "other_phone_number", - "openmrs_entity_parent": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept", - "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "hint": "Namba za simu nyingine", - "v_numeric": { - "value": "true", - "err": "Nambari lazima iwe jumla ya nambari 10 kwa urefu" - }, - "v_regex": { - "value": "(0[0-9]{9})|\\s*", - "err": "Nambari lazima iwe na nambari 10 na lazima ianze na 0." - } - }, { "key": "service_provider", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1542AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "check_box", - "label": "Aina ya kazi anayojishughulisha", + "openmrs_entity_id": "service_provider", + "type": "native_radio", + "label": "Kazi ya mwanafamilia", "label_text_style": "normal", "text_color": "#C0C0C0", - "exclusive": [ - "chk_none" - ], "options": [ { - "key": "chk_farmer", - "text": "Mkulima", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "1538AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_cs", - "text": "Mtumishi wa serikali", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "162944AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_nurse", - "text": "Muuguzi", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "1577AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_teacher", - "text": "Mwalimu", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "162946AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_th", - "text": "Waganga wa tiba asilia (THs)", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "1821AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_chw", - "text": "Wahudumu wa afya ngazi ya jamii–WAJA", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "1555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_tba", - "text": "Wakunga wa jadi (TBAs)", - "value": false, + "key": "chk_self_employed", + "text": "Amejiajiri", "openmrs_entity": "concept", - "openmrs_entity_id": "1575AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_self_employed" }, { - "key": "chk_chmis", - "text": "Wakusanyaji takwimu za afya katika jamii (cHIMS)", - "value": false, + "key": "chk_employed", + "text": "Ameajiriwa", "openmrs_entity": "concept", - "openmrs_entity_id": "163334AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_employed" }, { - "key": "chk_cbd", - "text": "Wasambazaji wa dawa na vifaa vya uzazi wa mpango katika jamii (CBD)", - "value": false, + "key": "chk_unemployed", + "text": "Hajaajiriwa", "openmrs_entity": "concept", - "openmrs_entity_id": "1744AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_unemployed" }, { - "key": "chk_hbc", - "text": "Watoa huduma kwa wagonjwa majumbani (HBC)", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "161359AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_cimmci", - "text": "Watoa huduma za udhibiti wa magonjwa ya watoto kwa uwiano katika jamii (cIMCI)", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "163096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_other", - "text": "Nyingine", - "value": false, + "key": "chk_farmer", + "text": "Mkulima", "openmrs_entity": "concept", - "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_farmer" }, { - "key": "chk_none", - "text": "Hakuna", + "key": "chk_traditional_healer", + "text": "Mtoa huduma ya Tiba Asili", "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_traditional_healer" } ], "v_required": { "value": "true", - "err": "Tafadhali chagua angalau moja" + "err": "Tafadhali chagua moja" } }, { @@ -805,7 +831,8 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "Community_Leader", "type": "check_box", - "label": "Una jukumu lolote la uongozi kwenye ngazi ya jamii?", + "combine_checkbox_option_values": "true", + "label": "Una nafasi yoyote ya uongozi katika jamii?", "label_text_style": "normal", "text_color": "#C0C0C0", "exclusive": [ @@ -815,42 +842,36 @@ { "key": "chk_religious", "text": "Kiongozi wa dini", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Religious_Leader" }, { "key": "chk_traditional", - "text": "Kiongozi wa kimila", - "value": false, + "text": "Kiongozi wa jadi", "openmrs_entity": "person_attribute", "openmrs_entity_id": "Traditional_leader" }, { "key": "chk_political", "text": "Kiongozi wa kisiasa", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Political_leader" }, { "key": "chk_influential", - "text": "Mtu mwenye ushawishi kwenye jamii", - "value": false, + "text": "Kiongozi mwenye ushawishi", "openmrs_entity": "person_attribute", "openmrs_entity_id": "Influential_Leader" }, { "key": "chk_other", "text": "Nyinginezo", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Other_Community_Leader_Type" }, { "key": "chk_none", "text": "Hakuna", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Not_a_Community_Leader" } @@ -866,11 +887,11 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "Other_Community_Leader_Type_Name", "type": "edit_text", - "hint": "Taja hayo majukumu mengine", + "hint": "Taja nafasi nyingine katika jamii", "edit_type": "name", "v_required": { "value": "true", - "err": "Tafadhali taja jukumu" + "err": "Tafadhali bainisha jukumu" }, "relevance": { "step1:leader": { diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/family_planning_change_method.json b/opensrp-chw-hf/src/main/assets/json.form-sw/family_planning_change_method.json index 83f5f9bdf..b4d7632bb 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/family_planning_change_method.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/family_planning_change_method.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -54,7 +49,7 @@ } }, "step1": { - "title": "Badilisha au acha fomu ya uzazi wa mpango", + "title": "Change or Stop FP form", "next": "step2", "fields": [ { @@ -84,7 +79,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "164901AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Sababu za kuacha kutumia njia za uzazi wa mpango ya sasa", + "label": "Sababu ya mwanamke kusitisha njia yake ya sasa ya kupanga uzazi", "options": [ { "key": "side_effects", @@ -98,36 +93,35 @@ "openmrs_entity": "concept", "openmrs_entity_id": "160571AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Anataka mimba" + "text": "Anataka kushika mimba" }, { "key": "doesnt_want_to_use_anymore", "openmrs_entity": "concept", "openmrs_entity_id": "164260AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Hataki kutumia sasa" + "text": "Hataki kutumia tena" }, { "key": "menopause", "openmrs_entity": "concept", "openmrs_entity_id": "134346AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Kukoma kwa uzazi" + "text": "Kukoma hedhi" }, { "key": "decided_to_change_method", "openmrs_entity": "concept", "openmrs_entity_id": "163494AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "value": false, - "text": "Aliamua kubadilisha mpango wa uzazi" + "text": "Iliamua kubadilisha mbinu" }, { "key": "others", "openmrs_entity": "concept", "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Nyingine" + "text": "Wengine" } ], "v_required": { @@ -145,7 +139,7 @@ "hint": "Sababu nyingine", "v_required": { "value": "true", - "err": "Ingiza sababu nyingine" + "err": "Inatakiwa" }, "relevance": { "rules-engine": { @@ -165,7 +159,7 @@ "hint": "Madhara", "v_required": { "value": "true", - "err": "Ingiza madhara" + "err": "Inatakiwa" }, "relevance": { "rules-engine": { @@ -178,7 +172,7 @@ ] }, "step2": { - "title": "Njia ya uzazi wa mpango", + "title": "Family planning method", "fields": [ { "key": "fp_method_accepted", @@ -186,32 +180,19 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_method_accepted", "type": "spinner", - "hint": "Njia za uzazi wa mpango selectedd", + "hint": "Mbinu ya kupanga uzazi imechaguliwa", "values": [ "Kondomu ya kiume", "Kondomu ya kike", - "Vidonge vya kumeza vyenye vichocheo viwili (COC)", - "Vidonge vya kumeza vyenye vichocheo kimoja (POP)", - "Shanga", - "Sindano", - "Kitanzi", - "Kipandikizi cha miaka 3", - "Vipandikizi vya miaka 5", - "Kufunga kizazi mwanamke", - "Kufunga kizazi mwanamme" - ], - "keys": [ - "Male condom", - "Female condom", "COC", "POP", - "Standard day method", - "Injectable", + "Njia ya kawaida ya siku", + "Sindano", "IUCD", "Implanon - NXT", - "Jadelle", - "Female sterilization", - "Male sterilization" + "Kijiti", + "Kufunga kizazi kwa mwanamke", + "Kufunga kizazi kwa mwanaume" ], "openmrs_choice_ids": { "Male condom": "164813AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", @@ -238,7 +219,6 @@ } } }, - { "key": "no_condoms", "openmrs_entity_parent": "190AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", @@ -246,18 +226,18 @@ "openmrs_entity_id": "no_condoms", "type": "edit_text", "edit_type": "number", - "hint": "Amepata vipande vya kondpmu vingapi?", + "hint": "Je, alipewa kondomu ngapi?", "v_required": { "value": "true", - "err": "Sawa au kubwa kuliko 0" + "err": "Sawa au zaidi ya 0" }, "v_numeric_integer": { "value": "true", - "err": "Lazima iwe nambari iliyo na mviringo" + "err": "Must be a rounded number" }, "v_min": { "value": "0", - "err": "Nambari lazima iwe sawa au kubwa kuliko 0" + "err": "Nambari lazima iwe sawa au zaidi ya 0" }, "relevance": { "rules-engine": { @@ -289,18 +269,18 @@ "openmrs_entity_id": "163171AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "edit_text", "edit_type": "number", - "hint": "Amepata saiko ngapi?", + "hint": "Je, alipewa mizunguko mingapi ya vidonge?", "v_required": { "value": "true", - "err": "Sawa au kubwa kuliko 0" + "err": "Sawa au zaidi ya 0" }, "v_numeric_integer": { "value": "true", - "err": "Lazima iwe nambari iliyo na mviringo" + "err": "Weka umri halali" }, "v_min": { "value": "0", - "err": "Nambari lazima iwe sawa au kubwa kuliko 0" + "err": "Nambari lazima iwe sawa au zaidi ya 0" }, "relevance": { "rules-engine": { @@ -316,7 +296,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_cocpop", "type": "date_picker", - "hint": "Je, alianza au anapanga kuanza vidonge vya kumeza vyenye vichocheo viwili au kimoja lini?", + "hint": "Je, ni lini alianza au alipanga kuanza kutumia COC/POP?", "max_date": "today", "relevance": { "rules-engine": { @@ -327,7 +307,7 @@ }, "v_required": { "value": "true", - "err": "Ingiza tarehe ambao anapanga kuanza vidonge vya kumeza vyenye vichocheo viwili au kimoja" + "err": "Inatakiwa" } }, { @@ -336,15 +316,11 @@ "openmrs_entity": "concept", "openmrs_entity_id": "counselling_use", "type": "spinner", - "hint": "Je, mteja ameshauri jinsi ya kutumia njia za uzazi wa mpango aliyochagua?", + "hint": "Je, alishauriwa jinsi ya kutumia njia ya kupanga uzazi?", "values": [ - "Ndiyo", + "Ndio", "Hapana" ], - "keys": [ - "Yes", - "No" - ], "openmrs_choice_ids": { "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" @@ -367,7 +343,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "162881AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "date_picker", - "hint": "Tarehe ya sindano iliyopita", + "hint": "Tarehe ya sindano ya mwisho", "max_date": "today", "relevance": { "rules-engine": { @@ -378,7 +354,7 @@ }, "v_required": { "value": "true", - "err": "Tarehe ya sindano iliyopita" + "err": "Inatakiwa" } }, { @@ -387,7 +363,7 @@ "openmrs_entity": "5096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_id": "next_injection_due_date", "type": "edit_text", - "hint": "Tarehe ya sindano ijayo:", + "hint": "Sindano inayofuata inastahili:", "read_only": "true", "value": "0", "relevance": { @@ -411,7 +387,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_iucd", "type": "date_picker", - "hint": "Tarehe ya kuweka kitanzi", + "hint": "Tarehe ya kuwekwa kwa IUCD", "max_date": "today", "relevance": { "rules-engine": { @@ -422,7 +398,7 @@ }, "v_required": { "value": "true", - "err": "Ingiza tarehe ya kuweka kitanzi" + "err": "Inatakiwa" } }, { @@ -445,7 +421,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_implant_nxt", "type": "date_picker", - "hint": "Tarehe ya kuweka kipandikizi cha miaka 3", + "hint": "Tarehe ya kuingizwa kwa Implanon - NXT", "max_date": "today", "relevance": { "rules-engine": { @@ -456,7 +432,7 @@ }, "v_required": { "value": "true", - "err": "Ingiza tarehe ya kuweka kipandikizi cha miaka 3" + "err": "Inahitajika " } }, { @@ -479,7 +455,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_implant_jad", "type": "date_picker", - "hint": "Tarehe ya kuweka vipandikizi vya miaka 5", + "hint": "Tarehe ya kuingizwa kwa Kijiti", "max_date": "today", "relevance": { "rules-engine": { @@ -490,7 +466,7 @@ }, "v_required": { "value": "true", - "err": "Ingiza tarehe ya kuweka vipandikizi vya miaka 5" + "err": "Inahitajika" } }, { @@ -513,7 +489,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_female_ster", "type": "date_picker", - "hint": "Tarehe y kufunga kizazi mwanmke", + "hint": "Tarehe ya Kufunga kizazi kwa mwanamke", "max_date": "today", "relevance": { "rules-engine": { @@ -524,7 +500,7 @@ }, "v_required": { "value": "true", - "err": "Ingiza tarehe y kufunga kizazi mwanmke" + "err": "Inahitajika" } }, { @@ -533,7 +509,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_male_ster", "type": "date_picker", - "hint": "Tarehe ya kufunga kizazi mwanamume ya mume wake", + "hint": "Tarehe ya Kufunga kizazi kwa mwanaume", "max_date": "today", "relevance": { "rules-engine": { @@ -544,7 +520,7 @@ }, "v_required": { "value": "true", - "err": "Ingiza tarehe ya kufunga kizazi mwanamume ya mume wake" + "err": "Inahitajika" } }, { @@ -568,8 +544,8 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Tarehe ya sindano ijayo: {next_injection_due_date}", - "toaster_info_text": "Tarehe ya sindano ijayo: {next_injection_due_date}", + "text": "Muda wa kudunga sindano inayofuata: {next_injection_due_date}", + "toaster_info_text": "Muda wa kudunga sindano inayofuata: {next_injection_due_date}", "toaster_type": "info", "relevance": { "rules-engine": { @@ -592,8 +568,8 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Mwambie mwanamke achunguze dalili zifuatazo:\n- Kutokwa (usaha, damu) kwenye tovuti ya sindano\n- SPumba au mkono wa zabuni kwenye tovuti ya sindano", - "toaster_info_text": "Mwambie mwanamke achunguze dalili zifuatazo:\n- Kutokwa (usaha, damu) kwenye tovuti ya sindano\n- SPumba au mkono wa zabuni kwenye tovuti ya sindano", + "text": "Mwambie mwanamke aangalie dalili zifuatazo: - Kutoa usaha (usaha, damu) kwenye tovuti ya sindano - Kuvimba au mkono mwororo kwenye tovuti ya sindano.", + "toaster_info_text": "Mwambie mwanamke aangalie dalili zifuatazo: - Kutoa usaha (usaha, damu) kwenye tovuti ya sindano - Kuvimba au mkono mwororo kwenye tovuti ya sindano.", "toaster_type": "info", "relevance": { "rules-engine": { @@ -609,8 +585,8 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Tarehe kutoa: {iucd_removal}", - "toaster_info_text": "Tarehe kutoa: {iucd_removal}", + "text": "Tarehe ya kuondolewa: {iucd_removal}", + "toaster_info_text": "Tarehe ya kuondolewa: {iucd_removal}", "toaster_type": "info", "relevance": { "rules-engine": { @@ -633,8 +609,8 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Mwambie mwanamke achunguze yafuatayo na anaweza kurudi ikiwa kuna yoyote: \n- Ikiwa na kinga ya nje au IUCD ndani ya uke\n- Muongozi wa kuangalia IUCD kwenye pedi yake mara atakibadilisha\n- Ima ni mimes ina ukaguzi unakadiriwa ili kuona ikiwa IUCD inafukuzwa", - "toaster_info_text": "Mwambie mwanamke achunguze yafuatayo na anaweza kurudi ikiwa kuna yoyote: \n- Ikiwa na kinga ya nje au IUCD ndani ya uke\n- Muongozi wa kuangalia IUCD kwenye pedi yake mara atakibadilisha\n- Ima ni mimes ina ukaguzi unakadiriwa ili kuona ikiwa IUCD inafukuzwa", + "text": "Mwambie mwanamke aangalie mambo yafuatayo: - Kutokea kwa kamba nje au IUCD kwenye uke - Wakati wa hedhi, angalia IUCD kwenye pedi yake - Wakati wa hedhi, ikiwa imeganda, kagua kama IUCD imetolewa.", + "toaster_info_text": "Mwambie mwanamke aangalie mambo yafuatayo: - Kutokea kwa kamba nje au IUCD kwenye uke - Wakati wa hedhi, angalia IUCD kwenye pedi yake - Wakati wa hedhi, ikiwa imeganda, kagua kama IUCD imetolewa.", "toaster_type": "info", "relevance": { "rules-engine": { @@ -650,8 +626,8 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Tarehe kutoa: {implanon_nxt_removal}", - "toaster_info_text": "Tarehe kutoa: {implanon_nxt_removal}", + "text": "Tarehe ya kuondolewa: {implanon_nxt_removal}", + "toaster_info_text": "Tarehe ya kuondolewa: {implanon_nxt_removal}", "toaster_type": "info", "relevance": { "rules-engine": { @@ -674,8 +650,8 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Tarehe kutoa: {jadelle_removal}", - "toaster_info_text": "Tarehe kutoa: {jadelle_removal}", + "text": "Tarehe ya kuondolewa: {jadelle_removal}", + "toaster_info_text": "Tarehe ya kuondolewa: {jadelle_removal}", "toaster_type": "info", "relevance": { "rules-engine": { @@ -698,8 +674,8 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Mwambie mwanamke achungushe yafuatayo na arudi ikiwa kuna yoyote. \n- Kama kunakuwa na fimbo nje. \n- Mkono wa kuvimba na / au kutokwa kwa tovuti", - "toaster_info_text": "Mwambie mwanamke achungushe yafuatayo na arudi ikiwa kuna yoyote. \n- Kama kunakuwa na fimbo nje. \n- Mkono wa kuvimba na / au kutokwa kwa tovuti", + "text": "Mwambie mwanamke aangalie yafuatayo na arudi kama yapo. - Ikiwa fimbo imechomoza - mkono umevimba au umevimba na/au kutokwa kwenye tovuti ya kuingizwa.", + "toaster_info_text": "Mwambie mwanamke aangalie yafuatayo na arudi kama yapo. - Ikiwa fimbo imechomoza - mkono umevimba au umevimba na/au kutokwa kwenye tovuti ya kuingizwa.", "toaster_type": "info", "relevance": { "rules-engine": { @@ -715,8 +691,8 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Mwambie mwanamke arudi ikiwa:\n- Kuvimba, zabuni na kutokwa na maji machafu", - "toaster_info_text": "Mwambie mwanamke arudi ikiwa:\n- Kuvimba, zabuni na kutokwa na maji machafu", + "text": "Mwambie mwanamke huyo arudi ikiwa: - Amevimba, na ametokwa na usaha kwenye tovuti ya chale", + "toaster_info_text": "Mwambie mwanamke huyo arudi ikiwa: - Amevimba, na ametokwa na usaha kwenye tovuti ya chale", "toaster_type": "info", "relevance": { "rules-engine": { @@ -732,8 +708,8 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Tumia kondomu kwa miezi mitatu kuzuia ujazito", - "toaster_info_text": "Tumia kondomu kwa miezi mitatu kuzuia ujazito", + "text": "Mshauri mwanamke kutumia kondomu kwa muda wa miezi 3 ya kwanza ili kuzuia mimba", + "toaster_info_text": "Mshauri mwanamke kutumia kondomu kwa muda wa miezi 3 ya kwanza ili kuzuia mimba", "toaster_type": "info", "relevance": { "rules-engine": { @@ -745,4 +721,4 @@ } ] } -} +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/family_register.json b/opensrp-chw-hf/src/main/assets/json.form-sw/family_register.json index 8cf3cff79..57ffae93e 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/family_register.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/family_register.json @@ -1,6 +1,4 @@ { - "validate_on_submit": true, - "show_errors_on_submit": false, "count": "2", "encounter_type": "Family Registration", "entity_id": "", @@ -18,11 +16,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -54,7 +47,7 @@ } }, "step1": { - "title": "Taarifa ya familia", + "title": "Taarifa za familia", "next": "step2", "fields": [ { @@ -63,15 +56,49 @@ "openmrs_entity": "person", "openmrs_entity_id": "first_name", "type": "edit_text", - "hint": "Taarifa ya familia", + "hint": "Jina la Ukoo", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza Jina la Ukoo" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza jina sahihi" + } + }, + { + "key": "client_first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "Jina la Kwanza la Mkuu wa Kaya", "edit_type": "name", "v_required": { "value": "true", - "err": "Tafadhali ingiza jina la ukoo" + "err": "Tafadhali ingiza Jina la Kwanza" }, "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Tafadhali ingiza jina la ukoo" + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza jina kwa usahihi" + } + }, + { + "key": "client_middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Jina la Kati la mkuu wa kaya", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Ingiza jina kwa usahihi" + }, + "v_required": { + "value": "true", + "err": "Tafadhali ingiza Jina la Kati la mkuu wa kaya" } }, { @@ -80,13 +107,13 @@ "openmrs_entity": "person_identifier", "openmrs_entity_id": "opensrp_id", "hidden": "true", - "type": "barcode", + "type": "edit_text", "barcode_type": "qrcode", - "hint": "ID", - "scanButtonText": "Chukua QR code", + "hint": "Kitambulisho", + "scanButtonText": "Scan QR Code", "v_numeric": { "value": "true", - "err": "Tafadhali ingiza namba halali" + "err": "Tafadhali Ingiza namba ya kitambulisho" } }, { @@ -96,14 +123,10 @@ "openmrs_entity_id": "cityVillage", "type": "edit_text", "edit_type": "name", - "hint": "Kijiji / mtaa", + "hint": "Jina la Eneo", "v_required": { "value": "true", - "err": "Tafadhali ingiza kijiji au jiji" - }, - "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Tafadhali ingiza jina halali la kijiji" + "err": "Tafadhali ingiza jina la eneo" } }, { @@ -112,25 +135,16 @@ "openmrs_entity": "person_address", "openmrs_entity_id": "landmark", "type": "edit_text", - "edit_type": "name", - "hint": "Alama ya eneo la makazi", + "hint": "Maelezo ya eneo la makazi", "v_required": { "value": true, - "err": "Tafadhali ingiza maelezo ya alama au eneo la makazi" + "err": "Tafadhali ingiza jina eneo la makazi" } }, - { - "key": "gps", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_data_type": "text", - "type": "gps" - }, { "key": "spacer", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "spacer", "spacer_height": "15dp" @@ -141,10 +155,10 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "sync_location_id", "type": "spinner", - "hint": "Chagua eneo la CHW", + "hint": "Chagua eneo la WAJA", "v_required": { "value": "true", - "err": "Tafadhali chagua eneo la CHW" + "err": "Tafadhali chagua eneo la WAJA" } } ] @@ -152,30 +166,22 @@ "step2": { "title": "Mkuu wa kaya", "fields": [ - { - "key": "photo", - "openmrs_entity_parent": "", - "openmrs_entity": "", - "openmrs_entity_id": "", - "type": "choose_image", - "uploadButtonText": "Chukua picha ya muhusika / kiongozi wa familia" - }, { "key": "unique_id", "openmrs_entity_parent": "", "openmrs_entity": "person_identifier", "openmrs_entity_id": "opensrp_id", "type": "edit_text", - "hint": "ID", + "hint": "Kitambulisho", "value": "0", "read_only": "true", "v_numeric": { "value": "true", - "err": "Tafadhali ingiza namba halali" + "err": "Ingiza namba ya kitambulisho iliyosahihi" }, "v_required": { "value": "true", - "err": "Tafadhali ingiza namba" + "err": "Tafadhali ingiza namba ya kitambulisho" } }, { @@ -184,15 +190,23 @@ "openmrs_entity": "person", "openmrs_entity_id": "first_name", "type": "edit_text", - "hint": "Jina la kwanza", + "hint": "Jina la Kwanza", "edit_type": "name", "v_required": { "value": "true", - "err": "Tafadhali ingiza jina la kwanza" + "err": "Tafadhali ingiza Jina la Kwanza" }, "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Tafadhali ingiza jina halali" + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Ingiza jina sahihi" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_calculation.yml" + } + } } }, { @@ -201,29 +215,37 @@ "openmrs_entity": "person", "openmrs_entity_id": "middle_name", "type": "edit_text", - "hint": "Jina la kati", + "hint": "Jina la Kati", "edit_type": "name", "v_required": { "value": "true", - "err": "Tafadhali ingiza jina la kati" + "err": "Tafadhali ingiza Jina la Kati" }, "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Tafadhali ingiza jina halali" + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza jina sahihi" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_calculation.yml" + } + } } }, { "key": "surname", "openmrs_entity_parent": "", - "openmrs_entity": "", - "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_name", "type": "edit_text", - "hint": "Jina la familia (ukoo)", + "hint": "Jina la Ukoo", "edit_type": "name", "read_only": "true", "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Tafadhali ingiza jina halali" + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza jina sahihi" }, "calculation": { "rules-engine": { @@ -239,7 +261,7 @@ "openmrs_entity": "person", "openmrs_entity_id": "birthdate", "type": "date_picker", - "hint": "Tarehe ya kuzaliwa", + "hint": "Tarehe ya Kuzaliwa", "expanded": false, "duration": { "label": "Age" @@ -261,7 +283,7 @@ { "key": "age_calculated", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "hidden", "calculation": { @@ -286,7 +308,14 @@ "text_size": "18px", "value": "false" } - ] + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_relevance.yml" + } + } + } }, { "key": "age", @@ -297,15 +326,15 @@ "hint": "Umri", "v_numeric": { "value": "true", - "err": "Nambari lazima ianze na 0 na lazima iwe jumla ya nambari 10 kwa urefu" + "err": "" }, "v_min": { "value": "15", - "err": "Umri lazima uwe sawa au mkubwa kuliko 15" + "err": "Umri unapaswa kuwa sawa au kubwa kuliko 15" }, "v_max": { "value": "120", - "err": "Umri lazima uwe sawa au chini ya 120" + "err": "Umri unapaswa kuwa sawa au chini 120" }, "relevance": { "rules-engine": { @@ -316,7 +345,83 @@ }, "v_required": { "value": true, - "err": "Tafadhali ingiza umri" + "err": "Tafadhali ingiza Umri" + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Jinsi", + "values": [ + "Me", + "Ke" + ], + "keys": [ + "Male", + "Female" + ], + "v_required": { + "value": "true", + "err": "Tafadhali ingiza jinsi ya mteja" + } + }, + { + "key": "marital_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "marital_status", + "type": "spinner", + "hint": "Hali ya Ndoa ya Mteja?", + "values": [ + "Hajaoa/Hajaolewa", + "Ameoa/Ameolewa", + "Ameachiwa", + "Mjane/Mgane", + "Kuishi pamoja bila ndoa" + ], + "keys": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "openmrs_choice_ids": { + "Single": "Single", + "Married": "Married", + "Divorced": "Divorced", + "Widowed": "Widowed", + "Cohabitation": "Cohabitation" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_relevance.yml" + } + } + } + }, + { + "key": "phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "phone_number", + "type": "edit_text", + "hint": "Namba ya simu", + "v_numeric": { + "value": "true", + "err": "Namba inatakiwa iwe na tarakimu 10" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Nambari lazima iwe na tarakimu 10 na lazima ianze na 06 u 07." } }, { @@ -325,7 +430,8 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "id_avail", "type": "check_box", - "label": "Je, ana kitambulisho chochote kati ya hivi?", + "label": "Je una kitambulisho kimojawapo kati ya hivi?", + "combine_checkbox_option_values": "true", "label_text_style": "normal", "text_color": "#C0C0C0", "exclusive": [ @@ -334,49 +440,61 @@ "options": [ { "key": "chk_national_id", - "text": "Kitambulisho cha taifa", - "value": false, + "text": "Kitambulisho cha Taifa", "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_national_id" }, { "key": "chk_voters_id", "text": "Kitambulisho cha mpiga kura", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_voters_id" }, { "key": "chk_drivers_license", - "text": "Leseni ya dereva", - "value": false, + "text": "Leseni ya udereva", "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_drivers_license" }, - { - "key": "chk_passport", - "text": "Hati ya kusafiria", - "value": false, - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "chk_passport" - }, { "key": "chk_none", "text": "Hakuna", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_none" } - ] + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_relevance.yml" + } + } + } }, { "key": "national_id", "openmrs_entity_parent": "", "openmrs_entity": "person_attribute", "openmrs_entity_id": "National_ID", - "type": "edit_text", - "hint": "Namba ya kitambulisho cha taifa", - "edit_type": "name", + "type": "mask_edit_text", + "mask": "########-#####-#####-##", + "mask_hint": "12345678912345678912", + "allowed_chars": "0123456789", + "hint": "Namba ya Kitambulisho cha Taifa mfn:12345678-91234-56789-12", + "edit_type": "number", + "v_regex": { + "value": "^\\d{8}-\\d{5}-\\d{5}-\\d{2}$", + "err": "Namba ya kitambulisho inatakiwa kuandikwa kama ifuatavyo:(XXXXXXXX-XXXXX-XXXXX-XX)" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi" + }, + "v_max_length": { + "value": "23", + "is_fixed_size": "true", + "err": "Please enter a valid national id" + }, "relevance": { "step2:id_avail": { "ex-checkbox": [ @@ -394,9 +512,25 @@ "openmrs_entity_parent": "", "openmrs_entity": "person_attribute", "openmrs_entity_id": "Voter_Registration_Number", - "type": "edit_text", - "hint": "Namba ya kitambulisho cha mpiga kura", - "edit_type": "name", + "type": "mask_edit_text", + "mask": "T-####-####-###-#", + "mask_hint": "123456789123", + "allowed_chars": "0123456789", + "hint": "N Namba ya mpiga kura mfano:T-1234-5678-912-3", + "edit_type": "number", + "v_regex": { + "value": "^T-\\d{4}-\\d{4}-\\d{3}-\\d{1}$", + "err": "Namba ya mpiga kura inatakiwa kuandikwa kwa utaratibu huu:(T-XXXX-XXXX-XXX-X)" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid voters registration" + }, "relevance": { "step2:id_avail": { "ex-checkbox": [ @@ -414,9 +548,25 @@ "openmrs_entity_parent": "", "openmrs_entity": "person_attribute", "openmrs_entity_id": "Driver_License_Number", - "type": "edit_text", - "hint": "Namba ya leseni ya udereva", - "edit_type": "name", + "type": "mask_edit_text", + "mask": "##########", + "mask_hint": "1234567891", + "allowed_chars": "0123456789", + "hint": "Namba ya leseni ya udereva mfano:1234567891", + "edit_type": "number", + "v_max_length": { + "value": "10", + "is_fixed_size": "true", + "err": "Please enter a valid drivers license number" + }, + "v_regex": { + "value": "^([0-9]{10})", + "err": "Namba ya leseni ya udereva inatakiwa kuandikwa katika mfumo huu: (XXXXXXXXXX)" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi" + }, "relevance": { "step2:id_avail": { "ex-checkbox": [ @@ -429,52 +579,32 @@ } } }, - { - "key": "passport", - "openmrs_entity_parent": "", - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "Passport_Number", - "type": "edit_text", - "hint": "Namba ya hati ya kusafiria", - "edit_type": "name", - "relevance": { - "step2:id_avail": { - "ex-checkbox": [ - { - "or": [ - "chk_passport" - ] - } - ] - } - } - }, { "key": "insurance_provider", "openmrs_entity_parent": "", "openmrs_entity": "person_attribute", "openmrs_entity_id": "Health_Insurance_Type", "type": "spinner", - "hint": "Bima ya afya unaotumia", + "hint": "Mtoa huduma bima ya Afya", "values": [ - "Bima ya afya ya jamii (CHF)", - "Bima ya afya ya jamii ulioboreshwa (iCHF)", + "Community Health Fund (CHF)/(iCHF)", "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", "Tiba Kwa Kadi (TIKA)", "AAR Healthcare", "Strategies Insurance", "Milvik Tanzania Ltd (BIMA Mkononi)", - "Britam Insurance Tanzania", - "Jubilee Insurance", - "Resolutions Insurance", - "Reliance Insurance", - "Bima ya afya nyingezo", + "Bima ya afya ya Britam", + "Bima ya afya ya Jubilee ", + "Bima ya afya ya Reliance", + "Bima ya afya ya Reliance", + "Nyingine", "Hakuna" ], "keys": [ "Community Health Fund (CHF)", - "iCHF", "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", "Tiba Kwa Kadi (TIKA)", "AAR Healthcare", "Strategies Insurance", @@ -488,8 +618,8 @@ ], "openmrs_choice_ids": { "Community Health Fund (CHF)": "Community_Health_Fund", - "iCHF": "iCHF", "National Social Security Fund - Social Health Insurance Benefit (SHIB)": "National_Social_Security_Fund", + "National Health Insurance Fund (NHIF)": "National_Health_Insurance_Fund", "Tiba Kwa Kadi (TIKA)": "Tiba_kwa_Kadi", "AAR Healthcare": "AAR_Healthcare", "AAR Strategies Insurance": "Strategies_Insurance", @@ -503,7 +633,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali ingiza mfuko wa bima" + "err": "Tafadhali ingiza mtoa huduma wa Bima ya Afya" } }, { @@ -512,10 +642,10 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "Other_Health_Insurance_Type", "type": "edit_text", - "hint": "Bima ya afya mwingine unaotumia", + "hint": "Bima ya Afya nyingine", "v_required": { "value": "true", - "err": "Tafadhali taja bima" + "err": "Tafadhali bainisha Bima ya Afya nyingine" }, "relevance": { "rules-engine": { @@ -531,10 +661,10 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "Health_Insurance_Number", "type": "edit_text", - "hint": "Namba ya bima ya afya unaotumia", + "hint": "Namba ya bima ya afya ya mteja", "v_required": { "value": "true", - "err": "Tafadhali ongeza nambari ya bima ya afya" + "err": "Tafadhali jaza namba ya bima ya afya ya mteja" }, "relevance": { "rules-engine": { @@ -544,30 +674,10 @@ } } }, - { - "key": "sex", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "gender", - "type": "spinner", - "hint": "Jinsi", - "values": [ - "Me", - "Ke" - ], - "keys": [ - "Male", - "Female" - ], - "v_required": { - "value": "true", - "err": "Please enter the sex" - } - }, { "key": "wra", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "hidden", "calculation": { @@ -581,7 +691,7 @@ { "key": "mra", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "hidden", "values": "" @@ -590,9 +700,9 @@ "key": "preg_1yr", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "160692AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "preg_1yr", "type": "spinner", - "hint": "Je, amejifungua ndani ya mwaka 1?", + "hint": "Je mama amejifungua ndani ya mwaka mmoja uliopoita?", "values": [ "Ndiyo", "Hapana" @@ -602,12 +712,12 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" }, "v_required": { "value": "true", - "err": "Tafadhali chagua ikiwa mwanamke amejifungua katika mwaka 1 uliopita" + "err": "Je mama amejifungua ndani ya mwaka mmoja uliopoita?" }, "relevance": { "rules-engine": { @@ -621,9 +731,9 @@ "key": "disabilities", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "162558AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "disabilities", "type": "spinner", - "hint": "Hali ya ulemavu", + "hint": "Ulemavu wa viungo", "values": [ "Ndiyo", "Hapana" @@ -633,8 +743,8 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" }, "v_required": { "value": "true", @@ -643,163 +753,133 @@ }, { "key": "type_of_disability", - "openmrs_entity_parent": "162558AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept", - "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "hint": "Aina ya ulemavu", - "v_required": { - "value": "true", - "err": "Tafadhali ingiza aina ya ulemavu" - }, - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "family_register_relevance.yml" - } - } - } - }, - { - "key": "phone_number", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "hint": "Namba ya simu", - "v_numeric": { - "value": "true", - "err": "Nambari lazima iwe jumla ya nambari 10 kwa urefu" - }, - "v_regex": { - "value": "(0[0-9]{9})|\\s*", - "err": "Nambari lazima iwe na nambari 10 na lazima ianze na 0." - } - }, - { - "key": "other_phone_number", - "openmrs_entity_parent": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept", - "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "hint": "Namba za simu nyingine", - "v_numeric": { - "value": "true", - "err": "Nambari lazima iwe jumla ya nambari 10 kwa urefu" - }, - "v_regex": { - "value": "(0[0-9]{9})|\\s*", - "err": "Nambari lazima iwe na nambari 10 na lazima ianze na 0." - } - }, - { - "key": "service_provider", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1542AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "type_of_disability", "type": "check_box", - "label": "Aina ya kazi anayojishughulisha", + "label": "Aina ya Ulemavu", + "combine_checkbox_option_values": "true", "label_text_style": "normal", "text_color": "#C0C0C0", - "exclusive": [ - "chk_none" - ], "options": [ { - "key": "chk_farmer", - "text": "Mkulima", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "1538AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_cs", - "text": "Mtumishi wa serikali", - "value": false, + "key": "physical_impairments", + "text": "Ulemavu wa viungo vya mwili", "openmrs_entity": "concept", - "openmrs_entity_id": "162944AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "physical_impairments" }, { - "key": "chk_nurse", - "text": "Muuguzi", - "value": false, + "key": "spinal_cord_disability", + "text": "Ulemavu wa Uti wa mgongo", "openmrs_entity": "concept", - "openmrs_entity_id": "1577AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "spinal_cord_disability" }, { - "key": "chk_teacher", - "text": "Mwalimu", - "value": false, + "key": "brain_disability", + "text": "Ulemavu wa akili", "openmrs_entity": "concept", - "openmrs_entity_id": "162946AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "brain_disability" }, { - "key": "chk_th", - "text": "Waganga wa tiba asilia (THs)", - "value": false, + "key": "vision_disability", + "text": "Ulemavu wa macho", "openmrs_entity": "concept", - "openmrs_entity_id": "1821AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "vision_disability" }, { - "key": "chk_chw", - "text": "Wahudumu wa afya ngazi ya jamii–WAJA", - "value": false, + "key": "hearing_disability", + "text": "Ulemavu wa kusikia", "openmrs_entity": "concept", - "openmrs_entity_id": "1555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "hearing_disability" }, { - "key": "chk_tba", - "text": "Wakunga wa jadi (TBAs)", - "value": false, + "key": "learning_disabilities", + "text": "Ulemavu katika kusitambua au kujifunza vitu", "openmrs_entity": "concept", - "openmrs_entity_id": "1575AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "learning_disabilities" }, { - "key": "chk_chmis", - "text": "Wakusanyaji takwimu za afya katika jamii (cHIMS)", - "value": false, + "key": "psychological_disorders", + "text": "Ulemavu wa Kisaikologia", "openmrs_entity": "concept", - "openmrs_entity_id": "163334AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "psychological_disorders" }, { - "key": "chk_cbd", - "text": "Wasambazaji wa dawa na vifaa vya uzazi wa mpango katika jamii (CBD)", - "value": false, + "key": "invisible_disabilities", + "text": "Ulemavu usioonekana", "openmrs_entity": "concept", - "openmrs_entity_id": "1744AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, + "openmrs_entity_id": "invisible_disabilities" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_relevance.yml" + } + } + } + }, + { + "key": "other_phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_phone_number", + "type": "edit_text", + "hint": "Namba ya simu nyingine", + "v_numeric": { + "value": "true", + "err": "Namba ya simu inatakiwa kuwa na tarakimu 10" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Namba lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." + } + }, + { + "key": "service_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "service_provider", + "type": "native_radio", + "label": "Kazi ya Mkuu wa Kaya", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ { - "key": "chk_hbc", - "text": "Watoa huduma kwa wagonjwa majumbani (HBC)", - "value": false, + "key": "chk_self_employed", + "text": "Amejiajiri", "openmrs_entity": "concept", - "openmrs_entity_id": "161359AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_self_employed" }, { - "key": "chk_cimmci", - "text": "Watoa huduma za udhibiti wa magonjwa ya watoto kwa uwiano katika jamii (cIMCI)", - "value": false, + "key": "chk_employed", + "text": "Ameajiriwa", "openmrs_entity": "concept", - "openmrs_entity_id": "163096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_employed" }, { - "key": "chk_other", - "text": "Nyingine", - "value": false, + "key": "chk_unemployed", + "text": "Hajaajiriwa", "openmrs_entity": "concept", - "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_unemployed" }, { - "key": "chk_none", - "text": "Hakuna", - "value": false, + "key": "chk_farmer", + "text": "Mkulima", "openmrs_entity": "concept", - "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_farmer" } ], "v_required": { "value": "true", "err": "Tafadhali chagua angalau moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_relevance.yml" + } + } } }, { @@ -808,7 +888,8 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "Community_Leader", "type": "check_box", - "label": "Una jukumu lolote la uongozi kwenye ngazi ya jamii?", + "label": "Je ana uongozi wowote katika Jamii?", + "combine_checkbox_option_values": "true", "label_text_style": "normal", "text_color": "#C0C0C0", "exclusive": [ @@ -817,43 +898,37 @@ "options": [ { "key": "chk_religious", - "text": "Kiongozi wa dini", - "value": false, + "text": "Kiongozi wa kidini", "openmrs_entity": "person_attribute", "openmrs_entity_id": "Religious_Leader" }, { "key": "chk_traditional", - "text": "Kiongozi wa kimila", - "value": false, + "text": "Kiongozi wa jadi", "openmrs_entity": "person_attribute", "openmrs_entity_id": "Traditional_leader" }, { "key": "chk_political", "text": "Kiongozi wa kisiasa", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Political_leader" }, { "key": "chk_influential", - "text": "Mtu mwenye ushawishi kwenye jamii", - "value": false, + "text": "Kiongozi mwenye ushawishi katika jamii", "openmrs_entity": "person_attribute", "openmrs_entity_id": "Influential_Leader" }, { "key": "chk_other", - "text": "Nyinginezo", - "value": false, + "text": "Nyingine", "openmrs_entity": "person_attribute", "openmrs_entity_id": "Other_Community_Leader_Type" }, { "key": "chk_none", "text": "Hakuna", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Not_a_Community_Leader" } @@ -861,6 +936,13 @@ "v_required": { "value": "true", "err": "Tafadhali chagua angalau moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_relevance.yml" + } + } } }, { @@ -869,11 +951,11 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "Other_Community_Leader_Type_Name", "type": "edit_text", - "hint": "Taja hayo majukumu mengine", + "hint": "Taja uongozi mwingine alionao katika jamii", "edit_type": "name", "v_required": { "value": "true", - "err": "Tafadhali taja jukumu" + "err": "Tafadhali bainisha uongozi alionao" }, "relevance": { "step2:leader": { diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/female_family_planning_change_method.json b/opensrp-chw-hf/src/main/assets/json.form-sw/female_family_planning_change_method.json index c9734ce29..e80b2881f 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/female_family_planning_change_method.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/female_family_planning_change_method.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -119,7 +114,6 @@ "openmrs_entity": "concept", "openmrs_entity_id": "163494AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "value": false, "text": "Aliamua kubadilisha mpango wa uzazi" }, { @@ -238,7 +232,6 @@ } } }, - { "key": "no_condoms", "openmrs_entity_parent": "190AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", @@ -411,7 +404,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_iucd", "type": "date_picker", - "hint": "Tarehe ya kuweka kitanzi", + "hint": "Tarehe ya kuweka kitanzi", "max_date": "today", "relevance": { "rules-engine": { @@ -592,7 +585,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Mwambie mwanamke achunguze dalili zifuatazo:\n- Kutokwa (usaha, damu) kwenye tovuti ya sindano\n- SPumba au mkono wa zabuni kwenye tovuti ya sindano", + "text": "Mwambie mwanamke achunguze dalili zifuatazo:\n- Kutokwa (usaha, damu) kwenye tovuti ya sindano\n- SPumba au mkono wa zabuni kwenye tovuti ya sindano", "toaster_info_text": "Mwambie mwanamke achunguze dalili zifuatazo:\n- Kutokwa (usaha, damu) kwenye tovuti ya sindano\n- SPumba au mkono wa zabuni kwenye tovuti ya sindano", "toaster_type": "info", "relevance": { @@ -674,7 +667,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Tarehe kutoa: {jadelle_removal}", + "text": "Tarehe kutoa: {jadelle_removal}", "toaster_info_text": "Tarehe kutoa: {jadelle_removal}", "toaster_type": "info", "relevance": { @@ -732,7 +725,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Tumia kondomu kwa miezi mitatu kuzuia ujazito", + "text": "Tumia kondomu kwa miezi mitatu kuzuia ujazito", "toaster_info_text": "Tumia kondomu kwa miezi mitatu kuzuia ujazito", "toaster_type": "info", "relevance": { diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/female_family_planning_registration.json b/opensrp-chw-hf/src/main/assets/json.form-sw/female_family_planning_registration.json index a894287b4..e84f5bc51 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/female_family_planning_registration.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/female_family_planning_registration.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -128,8 +123,7 @@ "options": [ { "key": "pregnant_option", - "text": "Hakikisha kwamba yeye siyo mjamzito", - "value": false + "text": "Hakikisha kwamba yeye siyo mjamzito" } ] }, @@ -265,8 +259,7 @@ "openmrs_entity_parent": "190AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_condom", - "type": "edit_text", - "hidden": true, + "type": "hidden", "calculation": { "rules-engine": { "ex-rules": { @@ -329,7 +322,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "counselling_use", "type": "spinner", - "hint": "Je, mteja ameshauri jinsi ya kutumia njia za uzazi wa mpango aliyochagua?", + "hint": "Je, mteja ameshauri jinsi ya kutumia njia za uzazi wa mpango aliyochagua?", "values": [ "Ndiyo", "Hapana" @@ -360,7 +353,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "162881AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "date_picker", - "hint": "Tarehe ya sindano iliyopita", + "hint": "Tarehe ya sindano iliyopita", "max_date": "today", "relevance": { "rules-engine": { @@ -428,7 +421,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_implant_nxt", "type": "date_picker", - "hint": "Tarehe ya kuweka kipandikizi cha miaka 3", + "hint": "Tarehe ya kuweka kipandikizi cha miaka 3", "max_date": "today", "relevance": { "rules-engine": { @@ -462,7 +455,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_implant_jad", "type": "date_picker", - "hint": "Tarehe ya kuweka vipandikizi vya miaka 5", + "hint": "Tarehe ya kuweka vipandikizi vya miaka 5", "max_date": "today", "relevance": { "rules-engine": { @@ -516,7 +509,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_male_ster", "type": "date_picker", - "hint": "Tarehe ya kufunga kizazi mwanamume", + "hint": "Tarehe ya kufunga kizazi mwanamume", "max_date": "today", "relevance": { "rules-engine": { diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hei_arv_prescription_high_or_low_risk_infant.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_arv_prescription_high_or_low_risk_infant.json new file mode 100644 index 000000000..eddc8626c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_arv_prescription_high_or_low_risk_infant.json @@ -0,0 +1,196 @@ +{ + "count": "1", + "encounter_type": "HEI ARV prophylaxis for low risk infants", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Maagizo ya dawa za ARV", + "fields": [ + { + "key": "prompt_for_nvp_syrup", + "type": "toaster_notes", + "text": "Tafadhali mpatie Mtoto NVP Syrup", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info" + }, + { + "key": "provided_nvp_syrup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_nvp_syrup", + "type": "native_radio", + "label": "Je, Mtoto amepatiwa NVP Syrup?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + } + }, + { + "key": "number_of_nvp_days_dispensed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_nvp_days_dispensed", + "type": "edit_text", + "edit_type": "number", + "hint": "Idadi ya Siku Iliyotolewa", + "v_required": { + "value": "true", + "err": "Tafadhali jaza idadi ya siku iliyotolewa" + }, + "v_numeric_integer": { + "value": "true", + "err": "Tafadhali ingiza namba halali" + }, + "v_min": { + "value": "0", + "err": "Idadi ya siku iliyotolewa inatakiwa iwe zaidi ya 0" + }, + "v_max": { + "value": "180", + "err": "Idadi ya siku iliyotolewa inatakiwa iwe sawa na au chini ya 180" + }, + "relevance": { + "step1:provided_nvp_syrup": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "reason_for_not_providing_nvp_syrup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_nvp_syrup", + "type": "native_radio", + "label": "Tafadhali bainisha sababu", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_stock", + "text": "Dawa zimekwisha", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_stock" + }, + { + "key": "medication_expired", + "text": "Dawa zimekwisha muda wa matumizi", + "openmrs_entity": "concept", + "openmrs_entity_id": "medication_expired" + }, + { + "key": "home_delivery", + "text": "Amejifungua akiwa nyumbani", + "openmrs_entity": "concept", + "openmrs_entity_id": "home_delivery" + }, + { + "key": "other", + "text": "Nyingine (Bainisha)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "step1:provided_nvp_syrup": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_for_not_providing_nvp_syrup", + "type": "edit_text", + "hint": "Tafadhali bainisha sababu zingine", + "openmrs_entity_id": "other_reason_for_not_providing_nvp_syrup", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Tafadhali bainisha sababu zingine" + }, + "relevance": { + "step1:reason_for_not_providing_nvp_syrup": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "visit_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "type": "hidden" + }, + { + "key": "prophylaxis_arv_for_high_and_low_risk_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prophylaxis_arv_for_high_and_low_risk_given", + "type": "hidden", + "value": "true" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hei_arv_prescription_high_risk_infant.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_arv_prescription_high_risk_infant.json new file mode 100644 index 000000000..3eb623567 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_arv_prescription_high_risk_infant.json @@ -0,0 +1,243 @@ +{ + "count": "1", + "encounter_type": "HEI ARV prophylaxis for high risk infants", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Maagizo ya dawa za ARV", + "fields": [ + { + "key": "prompt_for_azt_nvp_syrup", + "type": "toaster_notes", + "text": "Tafadhali mpatie Mtoto AZT+3TC+NVP Syrup", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info" + }, + { + "key": "provided_azt_nvp_syrup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_azt_nvp_syrup", + "type": "native_radio", + "label": "Je, Mtoto amepatiwa AZT+3TC+NVP Syrup", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + } + }, + { + "key": "provided_other_combinations", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_other_combinations", + "type": "native_radio", + "label": "Je Mtoto amepatisha mchanganyiko mwingine wa dawa?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "step1:provided_azt_nvp_syrup": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "specify_the_combinations", + "type": "edit_text", + "hint": "Tafadhali bainisha mchanganyiko mwingine wa dawa", + "openmrs_entity_id": "specify_the_combinations", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify the combinations" + }, + "relevance": { + "step1:provided_other_combinations": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "number_of_azt_nvp_days_dispensed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_azt_nvp_days_dispensed", + "type": "edit_text", + "edit_type": "number", + "hint": "Idadi ya Siku Iliyotolewa", + "v_required": { + "value": "true", + "err": "Tafadhali jaza idadi ya siku iliyotolewa" + }, + "v_numeric_integer": { + "value": "true", + "err": "Tafadhali ingiza namba halali" + }, + "v_min": { + "value": "0", + "err": "Idadi ya siku iliyotolewa inatakiwa iwe zaidi ya 0" + }, + "v_max": { + "value": "180", + "err": "Idadi ya siku iliyotolewa inatakiwa iwe sawa na au chini ya 180" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_arv_prescription_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_providing_other_combination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_other_combination", + "type": "native_radio", + "label": "Tafadhali bainisha sababu", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_stock", + "text": "Dawa zimekwisha", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_stock" + }, + { + "key": "medication_expired", + "text": "Muda wa matumizi wa dawa umeisha", + "openmrs_entity": "concept", + "openmrs_entity_id": "medication_expired" + }, + { + "key": "other", + "text": "Nyingine (Bainisha)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "step1:provided_other_combinations": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_for_not_providing_other_combination", + "type": "edit_text", + "hint": "Tafadhali bainisha sababu nyingine", + "openmrs_entity_id": "other_reason_for_not_providing_other_combination", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Tafadhali bainisha sababu nyingine" + }, + "relevance": { + "step1:reason_for_not_providing_other_combination": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "visit_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "type": "hidden" + }, + { + "key": "prophylaxis_arv_for_high_risk_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prophylaxis_arv_for_high_risk_given", + "type": "hidden", + "value": "true" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hei_baseline_investigation.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_baseline_investigation.json new file mode 100644 index 000000000..10477c1de --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_baseline_investigation.json @@ -0,0 +1,281 @@ +{ + "count": "1", + "encounter_type": "HEI Baseline Investigation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Uchunguzi wa Vipimo vya Awali", + "fields": [ + { + "key": "followup_status", + "openmrs_entity_id": "followup_status", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Aina ya Hudhurio", + "type": "spinner", + "values": [ + "Mtoto na Mama (IM)", + "Mtoto mchanga pamoja na mlezi mwingine (IC)", + "Transit (O)", + "Lost to Followup" + ], + "keys": [ + "infant_and_mother", + "infant_with_other_caregiver", + "transfer_out", + "lost_to_followup" + ], + "openmrs_choice_ids": { + "infant_and_mother": "infant_and_mother", + "infant_with_other_caregiver": "infant_with_other_caregiver", + "transfer_out": "transfer_out", + "lost_to_followup": "lost_to_followup" + }, + "v_required": { + "value": true, + "err": "Tafadhali chagua aina ya hudhurio" + } + }, + { + "key": "name_of_hf", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "name_of_hf", + "buttonText": "Select Health Facility", + "sort": true, + "maxSelectable": 1, + "dialogTitle": "Jina la Kliniki Aliyohamishwa", + "searchHint": "Andika jina la kliniki/hospitali", + "options": [ + ], + "type": "multi_select_list", + "v_required": { + "value": true, + "err": "Tafadhali chagua jina la kliniki" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "health_status", + "openmrs_entity_id": "health_status", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Hali ya Kiafya", + "type": "spinner", + "values": [ + "Tumbo la kuhara", + "DEAR Draining Ears", + "Homa", + "KS Kaposi Sarcoma", + "Utapiamlo", + "OC Oesophageal Candidiasis", + "Nimonia", + "Ugonjwa wa ngozi", + "Kandidiasis ya mdomo", + "Kifua kikuu", + "Nzuri", + "LN Lymphadenopathy" + ], + "keys": [ + "diarrhoea", + "draining_ears", + "fever", + "kaposi_sarcoma", + "malnutrition", + "oesophageal_candidiasis", + "pneumonia", + "skin_disease", + "thrush", + "tuberculosis", + "well", + "lymphadenopathy" + ], + "openmrs_choice_ids": { + "diarrhoea": "diarrhoea", + "draining_ears": "draining_ears", + "fever": "fever", + "kaposi_sarcoma": "kaposi_sarcoma", + "malnutrition": "malnutrition", + "oesophageal_candidiasis": "oesophageal_candidiasis", + "pneumonia": "pneumonia", + "skin_disease": "skin_disease", + "thrush": "thrush", + "tuberculosis": "tuberculosis", + "well": "well", + "lymphadenopathy": "lymphadenopathy" + }, + "v_required": { + "value": true, + "err": "Tafadhali chagua hali ya afya" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_health_status", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "infant_feeding_practice", + "openmrs_entity_id": "infant_feeding_practice", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Lishe ya Mtoto", + "type": "spinner", + "values": [ + "EBF: Maziwa ya Mama pekee", + "RF: Maziwa mbadala", + "MF: Maziwa ya Mama na maziwa mbadala", + "BF + additional food: Maziwa ya Mama na vyakula vingine vya ziada", + "RF + additional food: Maziwa mbadala na vyakula vingine vya ziada", + "SBF: Mtoto ameacha kabisa maziwa ya Mama" + ], + "keys": [ + "ebf", + "rf", + "mf", + "bf+", + "rf+", + "sbf" + ], + "openmrs_choice_ids": { + "ebf": "ebf", + "rf": "rf", + "mf": "mf", + "bf+": "bf+", + "rf+": "rf+", + "sbf": "sbf" + }, + "v_required": { + "value": true, + "err": "Tafadhali chagua lishe ya afya" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Uzito (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza uzito" + }, + "v_min": { + "value": "0", + "err": "Uzito lazima uwe sawasawa au zaidi ya 0 (KG)" + }, + "v_max": { + "value": "20", + "err": "Uzito lazima uwe sawasawa au chini ya 20 (KG)" + }, + "v_max_length": { + "value": "5", + "is_fixed_size": "true", + "err": "Tafadhali ingiza uzito" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza uzito" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "followup_visit_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "followup_visit_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_followup_visit_date_calculation.yml" + } + } + } + }, + { + "key": "visit_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "type": "hidden" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hei_community_followup_referral.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_community_followup_referral.json new file mode 100644 index 000000000..8ebddc01f --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_community_followup_referral.json @@ -0,0 +1,134 @@ +{ + "count": "1", + "encounter_type": "HEI Community Followup", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Rufaa ya HEI ya Ufuatiliaji wa Jamii", + "fields": [ + { + "key": "last_client_visit_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_client_visit_date", + "type": "date_picker", + "hint": "Tarehe ya Udhurio la Mwisho Kituoni", + "expanded": false, + "max_date": "today", + "editable": false, + "read_only": true, + "v_required": { + "value": "true", + "err": "Tafadhali bainisha tarehe ya udhurio la mwisho kituoni" + } + }, + { + "key": "reasons_for_issuing_community_referral", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_issuing_community_referral", + "type": "native_radio", + "label": "Sababu ya kutuma rufaa ya Ufuatiliaji Ngazi ya Jamii", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "missed_appointment", + "text": "Amekosa kwenye miadi yake", + "openmrs_entity": "concept", + "openmrs_entity_id": "missed_appointment" + }, + { + "key": "lost_to_followup", + "text": "Mteja amepotea katika Ufuatiliaji", + "openmrs_entity": "concept", + "openmrs_entity_id": "lost_to_followup" + } + ], + "v_required": { + "value": "true", + "err": "Please select reason for issuing the referral" + } + }, + { + "key": "mother_champion_location", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_champion_location", + "type": "spinner", + "hint": "Chagua Eneo la Mama Kinara", + "v_required": { + "value": true, + "err": "Tafadhali chagua eneo alipo mama kinara" + } + }, + { + "key": "comment_pmtct_community_followup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "comment_pmtct_community_followup", + "type": "edit_text", + "hint": "Maoni" + }, + { + "key": "pmtct_community_referral_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_community_referral_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_community_followup_referral_calculation.yml" + } + } + } + }, + { + "key": "child_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_name", + "type": "hidden" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hei_dna_pcr_sample_collection.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_dna_pcr_sample_collection.json new file mode 100644 index 000000000..80f69d852 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_dna_pcr_sample_collection.json @@ -0,0 +1,180 @@ +{ + "count": "1", + "encounter_type": "HEI DNA PCR Sample Collection", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Kuchukua Sampuli ya DNA-PCR", + "fields": [ + { + "key": "clinician_name", + "type": "edit_text", + "hint": "Jina la mtoa huduma wa Afya", + "openmrs_entity_id": "clinician_name", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza Jina la mtoa huduma wa Afya" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza Jina la mtoa huduma wa Afya" + } + }, + { + "key": "clinician_position", + "type": "spinner", + "hint": "Cheo cha Mtoa huduma wa Afya", + "openmrs_entity_id": "clinician_position", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "Afisa Matibabu", + "Msaidizi wa Afisa Matibabu", + "Afisa wa Kliniki", + "Afisa wa Kliniki msaidizi", + "Nesi" + ], + "keys": [ + "medical_officer", + "assistant_medical_officer", + "clinical_officer", + "assistant_clinical_officer", + "nurse" + ], + "openmrs_choice_ids": { + "medical_officer": "medical_officer", + "assistant_medical_officer": "assistant_medical_officer", + "clinical_officer": "clinical_officer", + "assistant_clinical_officer": "assistant_clinical_officer", + "nurse": "nurse" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza cheo cha mtoa huduma wa Afya" + } + }, + { + "key": "clinician_phone_number", + "type": "edit_text", + "hint": "Namba ya simu ya Mtoa huduma wa Afya", + "edit_type": "number", + "openmrs_entity_id": "clinician_phone_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Namba ya simu lazima iwe na tarakimu 10 na lazima ianze na 06 au 07" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Namba ya simu lazima iwe na tarakimu 10 na lazima ianze na 06 au 07" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza Namba ya simu ya Mtoa huduma wa Afya" + } + }, + { + "key": "sample_collection_date", + "type": "date_picker", + "hint": "Tarehe ya kuchukua sampuli ya kipimo cha DNA-PCR", + "openmrs_entity_id": "sample_collection_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "min_date": "today-5y", + "max_date": "today", + "v_required": { + "value": true, + "err": "Tafadhali ingiza tarehe ya kuchukua sampuli ya kipimo cha DNA-PCR" + } + }, + { + "key": "dna_pcr_collection_time", + "type": "time_picker", + "hint": "Muda wa kuchukua sampuli ya kipimo cha DNA-PCR", + "openmrs_entity_id": "dna_pcr_collection_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Tafadhali ingiza Muda wa kuchukua sampuli ya kipimo cha DNA-PCR" + } + }, + { + "key": "sample_id", + "type": "edit_text", + "hint": "ID ya Sampuli kwa ajili kipimo cha DNA-PCR", + "edit_type": "number", + "openmrs_entity_id": "sample_id", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Tafadhali ingiza ID ya Sampuli kwa ajili kipimo cha DNA-PCR" + } + }, + { + "key": "type_of_hiv_test", + "type": "hidden", + "openmrs_entity_id": "type_of_hiv_test", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "value": "DNA PCR" + }, + { + "key": "test_at_age", + "type": "hidden", + "openmrs_entity_id": "test_at_age", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "actual_age", + "type": "hidden", + "openmrs_entity_id": "actual_age", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hei_hiv_test_results.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_hiv_test_results.json new file mode 100644 index 000000000..e35f9f648 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_hiv_test_results.json @@ -0,0 +1,333 @@ +{ + "count": "1", + "encounter_type": "HEI HIV Test Results", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Majibu ya kipimo cha VVU", + "fields": [ + { + "key": "sample_id", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "sample_id", + "openmrs_entity_parent": "" + }, + { + "key": "hiv_test_result", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_status", + "type": "native_radio", + "label": "Chagua majibu ya kipimo", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + } + }, + { + "key": "confirmation_hiv_test_result", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "confirmation_hiv_test_result", + "type": "native_radio", + "label": "Je, haya ni majibu ya kuhakiki?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "step1:hiv_test_result": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "prompt_for_confirm_hiv_results", + "type": "toaster_notes", + "text": "Fanya kipimo kingine cha DNA PCR kwa mtoto ili kudhibitisha hali ya maambukizi ya VVU", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:confirmation_hiv_test_result": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "prompt_for_hiv_test_results", + "type": "toaster_notes", + "text": "Mtoto ana maambukizi ya VVU, Mpe rufaa aende kwenye Kliniki ya tiba na matunzo", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:confirmation_hiv_test_result": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "hiv_test_result_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_result_date", + "type": "date_picker", + "hint": "Tarehe ya kupokea majibu", + "expanded": false, + "min_date": "today-3y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali chagua Tarehe ya kupokea majibu" + } + }, + { + "key": "results_provided_to_parents", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "results_provided_to_parents", + "type": "native_radio", + "label": "Je, wazazi wamepewa majibu ya kipimo?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_hiv_test_results_relevance.yml" + } + } + } + }, + { + "key": "hiv_test_result_to_parent_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_result_to_parent_date", + "type": "date_picker", + "hint": "Tarehe ya majibu kupewa mzazi", + "expanded": false, + "min_date": "today-3y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali chagua Tarehe ya majibu kupewa mzazi" + }, + "relevance": { + "step1:results_provided_to_parents": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "prompt_provide_results_to_parents", + "type": "toaster_notes", + "text": "Wapatie wazazi majibu ya kipimo", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:confirmation_hiv_test_result": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "linkage_to_ctc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "linkage_to_ctc", + "type": "native_radio", + "label": "Je, Mtoto ameunganishwa na huduma za CTC?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "step1:confirmation_hiv_test_result": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "Namba ya CTC", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "CTC Namba inafuata utaratibu huu" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid CTC Number" + }, + "v_required": { + "value": true, + "err": "Tafadhri ingiza Namba sahihi ya CTC" + }, + "relevance": { + "step1:linkage_to_ctc": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "prompt_for_linkage_to_ctc", + "type": "toaster_notes", + "text": "Muunganishe mtoto kwenye huduma za CTC na toa namba ya CTC", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:linkage_to_ctc": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "type_of_hiv_test", + "type": "hidden", + "openmrs_entity_id": "type_of_hiv_test", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "value": "Antibody Test" + }, + { + "key": "test_at_age", + "type": "hidden", + "openmrs_entity_id": "test_at_age", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "actual_age", + "type": "hidden", + "openmrs_entity_id": "actual_age", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hei_number_registration.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_number_registration.json new file mode 100644 index 000000000..988fbc070 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_number_registration.json @@ -0,0 +1,74 @@ +{ + "count": "1", + "encounter_type": "HEI Number Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Rekodi Namba ya HEI", + "fields": [ + { + "key": "hei_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hei_number", + "type": "mask_edit_text", + "mask": "##-##-####-######-C##", + "mask_hint": "1234567891234567", + "allowed_chars": "0123456789", + "hint": "Namba ya HEI", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6}-C\\d{2})?", + "err": "Namba ya HEI Inatakiwa kuwa mfano (XX-XX-XXXX-XXXXXX-CXX)" + }, + "v_max_length": { + "value": "21", + "is_fixed_size": "true", + "err": "Tafadhali weka namba sahihi ya HEI" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi ya HEI" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hei_rv_ctx.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_rv_ctx.json new file mode 100644 index 000000000..d80bf199a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hei_rv_ctx.json @@ -0,0 +1,173 @@ +{ + "count": "1", + "encounter_type": "HEI CTX Prescription", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Kupatiwa Dawa ya CTX", + "fields": [ + { + "key": "prescribed_ctx", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prescribed_ctx", + "type": "native_radio", + "label": "Je, Mtoto huyu amepatiwa CTX?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + } + }, + { + "key": "number_of_ctx_days_dispensed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_ctx_days_dispensed", + "type": "edit_text", + "edit_type": "number", + "hint": "Idadi ya Siku Iliyotolewa", + "v_required": { + "value": "true", + "err": "Tafadhali jaza idadi ya siku iliyotolewa" + }, + "v_numeric_integer": { + "value": "true", + "err": "Tafadhali ingiza namba halali" + }, + "v_min": { + "value": "0", + "err": "Idadi ya siku iliyotolewa inatakiwa iwe zaidi ya 0" + }, + "v_max": { + "value": "180", + "err": "Idadi ya siku iliyotolewa inatakiwa iwe sawa na au chini ya 180" + }, + "relevance": { + "step1:prescribed_ctx": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "reason_for_not_prescribing_ctx", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_prescribing_ctx", + "type": "native_radio", + "label": "Sababu za kutompatia Mtoto dawa", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_stock", + "text": "CTX zimeisha", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_stock" + }, + { + "key": "medication_expired", + "text": "Muda wa matumizi ya CTX umeisha", + "openmrs_entity": "concept", + "openmrs_entity_id": "medication_expired" + }, + { + "key": "other", + "text": "Nyingine (Bainisha)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "step1:prescribed_ctx": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_for_not_prescribing_ctx", + "type": "edit_text", + "hint": "Tafadhali bainisha sababu nyingine", + "openmrs_entity_id": "other_reason_for_not_prescribing_ctx", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Tafadhali bainisha sababu nyingine" + }, + "relevance": { + "step1:reason_for_not_prescribing_ctx": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "visit_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "type": "hidden" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_client_update_ctc_number.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_client_update_ctc_number.json new file mode 100644 index 000000000..1928040b7 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_client_update_ctc_number.json @@ -0,0 +1,83 @@ +{ + "form": "Update CTC Number", + "count": "1", + "encounter_type": "Update CTC Number", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_index_contact_ctc_enrollment_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Jaza Namba ya CTC", + "fields": [ + { + "name": "ctc_number", + "type": "masked_edit_text", + "properties": { + "hint": "Namba ya CTC, mfano: 12-34-5678-912345", + "type": "Care and Treatment Clinic registration number (CTC Number)", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "input_type": "number", + "allowed_chars": "0123456789" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "openmrs_entity_parent": "" + }, + "validation": [ + { + "condition": "value.matches(\"(\\\\d{2}-\\\\d{2}-\\\\d{4}-\\\\d{6})?\")", + "message": "Namba ya CTC inatakiwa kuwa (XX-XX-XXXX-XXXXXX)." + } + ], + "required_status": "yes:Tafadhali jaza namba ya CTC ya mteja" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_community_followup_referral.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_community_followup_referral.json new file mode 100644 index 000000000..2fbff9698 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_community_followup_referral.json @@ -0,0 +1,151 @@ +{ + "form": "HIV Community Followup", + "count": "1", + "encounter_type": "HIV Community Followup", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_community_followup_referral_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Rufaa ya ufuatiliaji wa wateja wa VVU katika ngazi ya jamii", + "fields": [ + { + "name": "reasons_for_issuing_community_referral", + "type": "radio_group", + "properties": { + "text": "Sababu za kutoa rufaa ya ufuatiliaji wa wateja kwenye Jamii" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_issuing_community_referral", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "missed_appointment", + "text": "Amekosa kwenye miadi", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "missed_appointment", + "openmrs_entity_parent": "" + } + }, + { + "name": "lost_to_followup", + "text": "Amepotea kwenye ufuatiliaji", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "lost_to_followup", + "openmrs_entity_parent": "" + } + }, + { + "name": "Other", + "text": "Nyinginezo", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "Other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali chagua sababu za kutoa rufaa ya ufuatiliaji katika ngazi ya jamii", + "dependent_calculations": [ + "hiv_community_referral_date" + ] + }, + { + "name": "reason_for_issuing_community_referral_other", + "type": "text_input_edit_text", + "properties": { + "hint": "Sababu nyinginezo", + "type": "name" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_issuing_community_referral_other", + "openmrs_entity_parent": "reasons_for_issuing_community_referral" + }, + "required_status": "true:Tafadhali jaza sababu zinginezo", + "subjects": "reasons_for_issuing_community_referral:map" + }, + { + "name": "last_client_visit_date", + "type": "datetime_picker", + "properties": { + "hint": "Tarehe ya mwisho ya hudhurio la mteja CTC", + "type": "date_picker", + "display_format": "dd/MM/yyyy", + "max_date": "today" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "last_client_visit_date", + "openmrs_entity_parent": "" + }, + "required_status": "true:Tafadhali chagua tarehe ya mwisho ya ya mteja kuhudhuria kliniki", + "subjects": "reasons_for_issuing_community_referral:map" + }, + { + "name": "comment_hiv_community_followup", + "type": "text_input_edit_text", + "properties": { + "hint": "Toa maoni" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment_hiv_community_followup", + "openmrs_entity_parent": "" + }, + "required_status": "false" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_clients_contacts_registration_form.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_clients_contacts_registration_form.json new file mode 100644 index 000000000..570beb277 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_clients_contacts_registration_form.json @@ -0,0 +1,867 @@ +{ + "count": "2", + "encounter_type": "Family Registration", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "global": {}, + "step1": { + "title": "Taarifa za Mteja", + "next": "step2", + "fields": [ + { + "key": "fam_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "fam_name", + "type": "edit_text", + "hint": "Jina la Ukoo", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Ukoo" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka Jina la Ukoo" + } + }, + { + "key": "client_first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "Jina la Kwanza", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kwanza" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + } + }, + { + "key": "client_middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Jina la Kati", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kati" + } + }, + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "hidden": "true", + "type": "edit_text", + "barcode_type": "qrcode", + "hint": "Nambari ya utambulisho", + "scanButtonText": "Scan QR Code", + "v_numeric": { + "value": "true", + "err": "Tafadhali weka namba ya utambulisho" + } + }, + { + "key": "fam_village", + "openmrs_entity_parent": "", + "openmrs_entity": "person_address", + "openmrs_entity_id": "cityVillage", + "type": "edit_text", + "edit_type": "name", + "hint": "Jina la eneo", + "v_required": { + "value": "true", + "err": "Tafadhali jaza jina la eneo" + } + }, + { + "key": "landmark", + "openmrs_entity_parent": "", + "openmrs_entity": "person_address", + "openmrs_entity_id": "landmark", + "type": "edit_text", + "hint": "Alama/Maelezo ya eneo la nyumba", + "v_required": { + "value": true, + "err": "Tafadhali weka alama/maelezo ya eneo." + } + }, + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "15dp" + }, + { + "key": "sync_location_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "sync_location_id", + "type": "spinner", + "hint": "Chagua eneo la WAJA", + "v_required": { + "value": "true", + "err": "Tafadhali chagua eneo la WAJA" + } + } + ] + }, + "step2": { + "title": "Taarifa za Mteja", + "fields": [ + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "type": "edit_text", + "read_only": true, + "hint": "Kituoni ID", + "v_numeric": { + "value": "true", + "err": "Tafadhali weka kitambulisho cha KIPEKEE" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka kitambulisho cha KIPEKEE" + } + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "last_name", + "type": "edit_text", + "hint": "Jina la Ukoo", + "edit_type": "name", + "read_only": true, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Ukoo" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_client_contacts_calculation.yml" + } + } + } + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "Jina la Kwanza", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kwanza" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "err": "Tafadhali weka jina halali" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_client_contacts_calculation.yml" + } + } + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Jina la Kati", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "err": "Tafadhali weka jina halali" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kati" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_client_contacts_calculation.yml" + } + } + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "hidden", + "hint": "Tarehe ya kuzaliwa", + "expanded": false, + "duration": { + "label": "Umri" + }, + "min_date": "today-120y", + "max_date": "today-5y", + "v_required": { + "value": "true", + "err": "Tafadhali jaza tarehe ya kuzaliwa" + } + }, + { + "key": "age_calculated", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_client_contacts_calculation.yml" + } + } + } + }, + { + "key": "dob_unknown", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdateApprox", + "type": "hidden", + "label": "", + "value": "true", + "options": [ + { + "key": "dob_unknown", + "text": "DOB unknown?", + "text_size": "18px", + "value": "true" + } + ] + }, + { + "key": "age", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "age", + "type": "edit_text", + "hint": "Umri", + "v_numeric_integer": { + "value": "true", + "err": "Weka umri halali" + }, + "v_min": { + "value": "0", + "err": "Weka umri halali" + }, + "v_max": { + "value": "120", + "err": "Umri lazima uwe sawa au chini ya 120" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza umri" + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Jinsi", + "values": [ + "Me", + "Ke" + ], + "keys": [ + "Male", + "Female" + ], + "v_required": { + "value": "true", + "err": "Tafadhali ingiza jinsi" + } + }, + { + "key": "wra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_client_contacts_calculation.yml" + } + } + } + }, + { + "key": "mra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_client_contacts_calculation.yml" + } + } + } + }, + { + "key": "phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "phone_number", + "type": "edit_text", + "hint": "Nambari ya simu ya mteja", + "v_numeric": { + "value": "true", + "err": "Nambari lazima iwe jumla ya tarakimu 10 kwa urefu" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Nambari lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." + }, + "v_required": { + "value": false, + "err": "Tafadhali taja nambari ya simu" + } + }, + { + "key": "other_phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_phone_number", + "type": "edit_text", + "hint": "Nambari nyingine ya simu", + "v_numeric": { + "value": "true", + "err": "Nambari lazima iwe jumla ya tarakimu 10 kwa urefu" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Nambari lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." + }, + "v_required": { + "value": false, + "err": "Tafadhali bainisha nambari nyingine ya simu" + } + }, + { + "key": "relationship_under_15", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relationship", + "type": "native_radio", + "label": "Uhusiano", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "biological_child_under_15", + "text": "Mtoto wa chini ya miaka 15", + "openmrs_entity": "concept", + "openmrs_entity_id": "biological_child_under_15" + }, + { + "key": "siblings_under_15", + "text": "Ndugu wa kuzaliwa chini ya miaka 15", + "openmrs_entity": "concept", + "openmrs_entity_id": "siblings_under_15" + } + ], + "v_required": { + "value": "true", + "err": "Uhusiano unahitajika" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "relationship_above_15_male", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relationship", + "type": "native_radio", + "label": "Uhusiano", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "sexual_partner", + "text": "Mwenzi wa kingono", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner" + }, + { + "key": "needle_sharing_partner", + "text": "Mshirika wa kujidunga", + "openmrs_entity": "concept", + "openmrs_entity_id": "needle_sharing_partner" + } + ], + "v_required": { + "value": "true", + "err": "Uhusiano unahitajika" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "relationship_above_15_female", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relationship", + "type": "native_radio", + "label": "Relationship", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "sexual_partner", + "text": "Mshiriki wa kingono", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner" + }, + { + "key": "needle_sharing_partner", + "text": "Mshiriki wa kujidunga", + "openmrs_entity": "concept", + "openmrs_entity_id": "needle_sharing_partner" + } + ], + "v_required": { + "value": "true", + "err": "Uhusiano unahitajika" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "relationship_above_15_male_for_possible_parents", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relationship", + "type": "native_radio", + "label": "Uhusiano", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "sexual_partner", + "text": "Mwenzi wa kingono", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner" + }, + { + "key": "needle_sharing_partner", + "text": "Mshirika wa kujidunga", + "openmrs_entity": "concept", + "openmrs_entity_id": "needle_sharing_partner" + }, + { + "key": "biological_father", + "text": "Baba Mzazi (Kama mama amefariki)", + "openmrs_entity": "concept", + "openmrs_entity_id": "biological_father" + } + ], + "v_required": { + "value": "true", + "err": "Uhusiano unahitajika" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "relationship_above_15_female_for_possible_parents", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relationship", + "type": "native_radio", + "label": "Uhusiano", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "sexual_partner", + "text": "Mshiriki wa kingono", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner" + }, + { + "key": "needle_sharing_partner", + "text": "Mshiriki wa kujidunga", + "openmrs_entity": "concept", + "openmrs_entity_id": "needle_sharing_partner" + }, + { + "key": "biological_mother", + "text": "Mama Mzazi", + "openmrs_entity": "concept", + "openmrs_entity_id": "biological_mother" + } + ], + "v_required": { + "value": "true", + "err": "Uhusiano unahitajika" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "relationship", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relationship", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_client_contacts_calculation.yml" + } + } + } + }, + { + "key": "gbv_analysis", + "type": "toaster_notes", + "text": "Fanya Uchambuzi wa unyanyasaji wa kijinsia", + "text_color": "#1199F9", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "physical_abuse", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_abuse", + "type": "native_radio", + "label": "Je, mtajwa amewahi kukupiga au kukunyanyasa kimwili?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Jibu la swali hili linahitajika" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "threatened_to_be_hurt", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "threatened_to_be_hurt", + "type": "native_radio", + "label": "Je, Mtajwa amewahi kutishia kukupiga au kukuumiza?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Jibu la swali hili linahitajika" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "sexual_assault", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_assault", + "type": "native_radio", + "label": "Je, mtajwa amewahi kutumia nguvu au kukushawishi kufanya ngono bila kupenda kwako?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Jibu la swali hili linahitajika" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "fearful_of_contact_client", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fearful_of_contact_client", + "type": "native_radio", + "label": "Je, unatishika au unamuogopa mshiriki wako wa kingono?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Jibu la swali hili linahitajika" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "additional_details", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fearful_of_contact_client", + "type": "native_radio", + "label": "Je, una maelezo yoyote ya ziada kuhusu ukatili ambao umefanyiwa?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_ipv_service", + "type": "toaster_notes", + "text": "Refer the client for post-IPV Services\n\nDiscuss with the client on the appropriate referral to communicate with Index Contact", + "openmrs_entity_id": "prompt_for_ipv_service", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "how_to_notify_the_contact_client", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "how_to_notify_the_contact_client", + "type": "native_radio", + "label": "Jinsi ya kuwasiliana na mteja wa mshirika wako wa kingono", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "client_referral", + "text": "Rufaa ya Mteja", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_referral" + }, + { + "key": "provider_referral", + "text": "Rufaa ya Mtoa huduma", + "openmrs_entity": "concept", + "openmrs_entity_id": "provider_referral" + }, + { + "key": "contract_referral", + "text": "Rufaa ya Mkataba", + "openmrs_entity": "concept", + "openmrs_entity_id": "contract_referral" + }, + { + "key": "dual_referral", + "text": "Ufuatiliaji kwa njia mbili", + "openmrs_entity": "concept", + "openmrs_entity_id": "dual_referral" + } + ], + "v_required": { + "value": "true", + "err": "Jibu la swali hili linahitajika" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_community_followup_referral.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_community_followup_referral.json new file mode 100644 index 000000000..d640fe916 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_community_followup_referral.json @@ -0,0 +1,102 @@ +{ + "form": "HIV Index Contact Community Followup Referral", + "count": "1", + "encounter_type": "HIV Index Contact Community Followup Referral", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_index_contact_community_followup_referral_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Ufuatiliaji wa wenza wa Kingono au wa Kujidunga wa mshirika katika jamii", + "fields": [ + { + "name": "toast_refer_to_chw", + "type": "toast_notification", + "properties": { + "notification_type": "info", + "dismissible": "no", + "title": "Mteja atapewa rufaa kwenda kwa mtoa huduma ya afya ngazi ya jamii", + "text": "Mteja anapewa rufaa kwenda kwa mtoa huduma wa afya ngazi ya jamii katika kijiji cha mteja kwa ajili ya ufuatiliaji.\n\n Ongeza maoni ya ziada yatakayo kwenda kwa mtoa huduma wa afya ngazi ya jamii\n\nHifadhi fomu ya rufaa kwajili ya kutuma rufaa", + "background_color": "#082455", + "text_color": "#EBEE2F" + } + }, + { + "name": "chw_referral_hf", + "type": "spinner", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "chw_referral_hf", + "openmrs_entity_parent": "" + }, + "properties": { + "text": "Eneo la Waja" + }, + "options": [], + "required_status": "yes:Tafadhali chagua", + "dependent_calculations": [ + "hiv_index_contact_community_followup_referral_date", + "refer_to_chw" + ] + }, + { + "name": "comment", + "type": "text_input_edit_text", + "properties": { + "hint": "Maoni" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment", + "openmrs_entity_parent": "" + }, + "required_status": "false" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_ctc_enrollment.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_ctc_enrollment.json new file mode 100644 index 000000000..23ee7c598 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_ctc_enrollment.json @@ -0,0 +1,120 @@ +{ + "form": "HIV Index Contact CTC Enrollment", + "count": "1", + "encounter_type": "Update HIV Index Contact Testing Followup", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_index_contact_ctc_enrollment_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Majibu ya mshirika wa kingono/wakujidunga", + "fields": [ + { + "name": "ctc_number", + "type": "masked_edit_text", + "properties": { + "hint": "Namba ya CTC, mfano: 12-34-5678-912345", + "type": "Care and Treatment Clinic registration number (CTC Number)", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "input_type": "number", + "allowed_chars": "0123456789" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "openmrs_entity_parent": "" + }, + "validation": [ + { + "condition": "value.matches(\"(\\\\d{2}-\\\\d{2}-\\\\d{4}-\\\\d{6})?\")", + "message": "Namba ya CTC inatakiwa kuwa (XX-XX-XXXX-XXXXXX)." + } + ], + "required_status": "yes:Tafadhali jaza namba ya CTC ya mteja" + }, + { + "name": "comment", + "type": "text_input_edit_text", + "properties": { + "hint": "Toa maoni" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment", + "openmrs_entity_parent": "" + }, + "required_status": "false" + }, + { + "name": "place_where_test_was_conducted", + "type": "text_input_edit_text", + "properties": { + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "place_where_test_was_conducted", + "openmrs_entity_parent": "" + }, + "subjects": "place_where_test_was_conducted:map" + }, + { + "name": "test_results", + "type": "text_input_edit_text", + "properties": { + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "test_results", + "openmrs_entity_parent": "" + }, + "subjects": "test_results:map" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_followup.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_followup.json new file mode 100644 index 000000000..4faf0bf80 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_followup.json @@ -0,0 +1,483 @@ +{ + "form": "HIV Index Contact Testing Followup", + "count": "1", + "encounter_type": "HIV Index Contact Testing Followup", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_index_contact_followup_for_non_sex_partner_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Majibu ya mshirika wa kingono/wakujidunga", + "fields": [ + { + "name": "has_the_client_been_reached", + "type": "radio_group", + "properties": { + "text": "Je, mteja amepatikana?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "has_the_client_been_reached", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Ndio", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "Hapana", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali chagua jibu", + "dependent_calculations": [ + "relationship" + ] + }, + { + "name": "eligibility_for_testing", + "type": "radio_group", + "properties": { + "text": "Je, mteja ana kidhi vigezo vya upimaji wa VVU?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "eligibility_for_testing", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Ndio", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "Hapana", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali chagua jibu", + "subjects": "has_the_client_been_reached:map" + }, + { + "name": "has_the_contact_client_been_tested", + "type": "radio_group", + "properties": { + "text": "Je, amepimwa VVU?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "has_the_contact_client_been_tested", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Ndio", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "Hapana", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali chagua jibu", + "subjects": "has_the_client_been_reached:map, eligibility_for_testing:map" + }, + { + "name": "reasons_conducting_testing_for_index_contact", + "type": "spinner", + "properties": { + "text": "Sababu ya kutofanya kipimo cha VVU" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_conducting_testing_for_index_contact", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "test_kits_are_out_of_stock", + "text": "Vifaa vya kupima vimeisha", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "test_kits_are_out_of_stock", + "openmrs_entity_parent": "" + } + }, + { + "name": "the_client_refused_to_be_tested", + "text": "Mteja alikataa kupimwa", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "the_client_refused_to_be_tested", + "openmrs_entity_parent": "" + } + }, + { + "name": "we_are_still_counselling_the_client", + "text": "Tunaendelea kumshauri mteja", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "we_are_still_counselling_the_client", + "openmrs_entity_parent": "" + } + }, + { + "name": "other", + "text": "Nyingine", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali ingiza sababu", + "subjects": "eligibility_for_testing:map,has_the_contact_client_been_tested:map,has_the_client_been_reached:map" + }, + { + "name": "other_reason_for_not_testing", + "type": "text_input_edit_text", + "properties": { + "hint": "Sababu nyingine ya kutofanya kipimo cha VVU" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_testing", + "openmrs_entity_parent": "" + }, + "required_status": "yes:Please enter the reason", + "subjects": "reasons_conducting_testing_for_index_contact:map,eligibility_for_testing:map,has_the_contact_client_been_tested:map,has_the_client_been_reached:map" + }, + { + "name": "test_results", + "type": "radio_group", + "properties": { + "text": "Ni nini matokeo ya kipimo cha VVU?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "test_results", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "positive", + "text": "Ana VVU", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "positive", + "openmrs_entity_parent": "" + } + }, + { + "name": "negative", + "text": "Hana VVU", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "negative", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali chagua matokeo ya vipimo vya VVU", + "subjects": "has_the_contact_client_been_tested:map, eligibility_for_testing:map, has_the_client_been_reached:map" + }, + { + "name": "place_where_test_was_conducted", + "type": "radio_group", + "properties": { + "text": "Mahali alikopimia mteja" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "place_where_test_was_conducted", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "outpatient_department", + "text": "Idara ya wagonjwa wa nje", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "outpatient_department", + "openmrs_entity_parent": "" + } + }, + { + "name": "inpatient_department", + "text": "Idara ya wagonjwa waliolazwa", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "inpatient_department", + "openmrs_entity_parent": "" + } + }, + { + "name": "community_based_hiv_testing_service", + "text": "Huduma za upimaji nyumbani", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "community_based_hiv_testing_service", + "openmrs_entity_parent": "" + } + }, + { + "name": "ctc", + "text": "CTC", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc", + "openmrs_entity_parent": "" + } + }, + { + "name": "outreach_services", + "text": "Huduma ya mkoba (outreach services)", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "outreach_services", + "openmrs_entity_parent": "" + } + }, + { + "name": "other", + "text": "Kwingineko", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali chagua jibu sahihi", + "subjects": "test_results:map, eligibility_for_testing:map, has_the_contact_client_been_tested:map, has_the_client_been_reached:map" + }, + { + "name": "client_test_date", + "type": "datetime_picker", + "properties": { + "hint": "Tarehe ya kupima ya mteja", + "type": "date_picker", + "display_format": "dd/MM/yyyy", + "max_date": "today" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "client_test_date", + "openmrs_entity_parent": "" + }, + "required_status": "true:Tafadhali jaza tarehe ya upimaji wa VVU wa mteja", + "subjects": "test_results:map, eligibility_for_testing:map, has_the_contact_client_been_tested:map, has_the_client_been_reached:map" + }, + { + "name": "toast_enroll_the_client_to_prep", + "type": "toast_notification", + "properties": { + "notification_type": "info", + "dismissible": "no", + "title": "Mteja anatakiwa kusajiliwa kwenye KVP/PrEP", + "text": "Mteja ni mshirika wa kingono wa mteja wa VVU, anatakiwa kusajiliwa kwenye huduma ya KVP/PrEP", + "background_color": "#082455", + "text_color": "#EBEE2F" + }, + "subjects": "relationship:text, test_results:map, has_the_contact_client_been_tested:map, eligibility_for_testing:map, has_the_client_been_reached:map" + }, + { + "name": "enrolled_to_clinic", + "type": "radio_group", + "properties": { + "text": "Je, mteja amesajiliwa kwenye kliniki ya VVU?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "enrolled_to_clinic", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Ndio", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "Hapana", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali jaza jibu", + "subjects": "test_results:map, eligibility_for_testing:map, has_the_contact_client_been_tested:map, has_the_client_been_reached:map" + }, + { + "name": "reasons_for_ineligibility_for_testing", + "type": "spinner", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_ineligibility_for_testing", + "openmrs_entity_parent": "" + }, + "properties": { + "text": "Sababu zinazomfanya mteja asifanyiwe kipimo cha HIV" + }, + "options": [ + { + "name": "known_positive", + "text": "Mteja tayari amekwisha pima na ana VVU", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "known_positive", + "openmrs_entity_parent": "" + } + }, + { + "name": "other", + "text": "Nyingine", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes: Tafadhali Chagua", + "subjects": "has_the_client_been_reached:map,eligibility_for_testing:map" + }, + { + "name": "other_reason_for_ineligibility", + "type": "text_input_edit_text", + "properties": { + "hint": "Nyingine" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_ineligibility", + "openmrs_entity_parent": "" + }, + "required_status": "yes: Tafadhali jaza sababu nyingine", + "subjects": "reasons_for_ineligibility_for_testing:map, eligibility_for_testing:map, has_the_client_been_reached:map" + }, + { + "name": "ctc_number", + "type": "masked_edit_text", + "properties": { + "hint": "Namba ya CTC, mfano: 12-34-5678-912345", + "type": "Care and Treatment Clinic registration number (CTC Number)", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "input_type": "number", + "allowed_chars": "0123456789" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "openmrs_entity_parent": "" + }, + "validation": [ + { + "condition": "value.matches(\"(\\\\d{2}-\\\\d{2}-\\\\d{4}-\\\\d{6})?\")", + "message": "Namba ya CTC inatakiwa kuwa (XX-XX-XXXX-XXXXXX)." + } + ], + "required_status": "yes:Tafadhali jaza namba ya CTC ya mteja", + "subjects": "enrolled_to_clinic:map, reasons_for_ineligibility_for_testing:map, eligibility_for_testing:map, test_results:map, has_the_contact_client_been_tested:map, has_the_client_been_reached:map" + }, + { + "name": "comment", + "type": "text_input_edit_text", + "properties": { + "hint": "Toa maoni" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment", + "openmrs_entity_parent": "" + }, + "required_status": "false" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_followup_for_negative_clients.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_followup_for_negative_clients.json new file mode 100644 index 000000000..14b43ccd1 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_followup_for_negative_clients.json @@ -0,0 +1,341 @@ +{ + "form": "HIV Index Contact Testing Followup", + "count": "1", + "encounter_type": "HIV Index Contact Testing Followup", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_index_contact_followup_for_negative_non_sex_partners_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Ufuatiliaji wa mshirika ambaye hajaathirika", + "fields": [ + { + "name": "place_where_test_was_conducted", + "type": "radio_group", + "properties": { + "text": "Amepimiwa Wapi?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "place_where_test_was_conducted", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "tb_clinic_outpatient", + "text": "Kiliniki ya Kifua Kikuu (Wateja wa Nje)", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "tb_clinic_outpatient", + "openmrs_entity_parent": "" + } + }, + { + "name": "sexual_transmitted_diseases_clinic", + "text": "Kliniki ya magonjwa ya zinaa", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_transmitted_diseases_clinic", + "openmrs_entity_parent": "" + } + }, + { + "name": "outpatient_department", + "text": "Idara ya wagonjwa wa njee", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "outpatient_department", + "openmrs_entity_parent": "" + } + }, + { + "name": "inpatient_department", + "text": "Idara ya wagonjwa wa ndani", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "inpatient_department", + "openmrs_entity_parent": "" + } + }, + { + "name": "blood_transfusion_service", + "text": "Huduma za uchagiaji damu", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_transfusion_service", + "openmrs_entity_parent": "" + } + }, + { + "name": "community_based_hiv_testing_service", + "text": "Huduma ya kujipima mwenyewe", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "community_based_hiv_testing_service", + "openmrs_entity_parent": "" + } + }, + { + "name": "voluntary_patients", + "text": "Mteja wakujitolea", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "voluntary_patients", + "openmrs_entity_parent": "" + } + }, + { + "name": "family_planning_clinic", + "text": "Kiliniki ya uzazi wa mpango", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "family_planning_clinic", + "openmrs_entity_parent": "" + } + }, + { + "name": "ctc", + "text": "CTC", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc", + "openmrs_entity_parent": "" + } + }, + { + "name": "men_circumcision", + "text": "Tohara ya wanaume", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "men_circumcision", + "openmrs_entity_parent": "" + } + }, + { + "name": "outreach_services", + "text": "Huduma ya Mkoba", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "outreach_services", + "openmrs_entity_parent": "" + } + }, + { + "name": "reproductive_an_child_health", + "text": "Afya ya mama na mtoto", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reproductive_an_child_health", + "openmrs_entity_parent": "" + } + }, + { + "name": "other", + "text": "Mengineo", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other", + "openmrs_entity_parent": "" + } + } + ], + "dependent_calculations": [ + "eligibility_for_testing" + ], + "required_status": "yes:Please select the answer" + }, + { + "name": "when_the_test_was_conducted", + "type": "datetime_picker", + "properties": { + "hint": "Lini mshiriki wa mteja alipimwa virusi vya ukimwi?", + "type": "date_picker", + "display_format": "dd/MM/yyyy" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "when_the_test_was_conducted", + "openmrs_entity_parent": "" + }, + "dependent_calculations": [ + "relationship", + "months_after_last_test" + ], + "required_status": "true:Tafadhali chagua tarehe aliyopimwa virusi?" + }, + { + "name": "toast_enroll_the_client_to_prep", + "type": "toast_notification", + "properties": { + "notification_type": "info", + "dismissible": "no", + "title": "Mteja anatakiwa anzishiwe KVP/PREP", + "text": "Mteja ni mshiriki wa kingono wa muathirika wa ukimwi, Anatakiwa kuanzishiwa KVP/PREP", + "background_color": "#082455", + "text_color": "#EBEE2F" + }, + "subjects": "relationship:text, when_the_test_was_conducted:number , months_after_last_test:number" + }, + { + "name": "toast_client_eligible_for_testing", + "type": "toast_notification", + "properties": { + "notification_type": "info", + "dismissible": "no", + "title": "Mteja anatakiwa kupimwa tena Ukimwi", + "text": "Mteja amepimwa miezi mitatu iliyopita. Mteja anatakiwa kupima tena virusi vya ukimwi", + "background_color": "#082455", + "text_color": "#EBEE2F" + }, + "subjects": "when_the_test_was_conducted:number, months_after_last_test:number" + }, + { + "name": "test_results", + "type": "radio_group", + "properties": { + "text": "Majibu ya Vipimo vya Ukimwi?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "test_results", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "negative", + "text": "Hasi", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "negative", + "openmrs_entity_parent": "" + } + }, + { + "name": "positive", + "text": "Chanya", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "positive", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the test results", + "subjects": "when_the_test_was_conducted:number, months_after_last_test:number" + }, + { + "name": "enrolled_to_clinic", + "type": "radio_group", + "properties": { + "text": "Mteja amenazishwa kwenye kiliniki ya tiba na matunzo?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "enrolled_to_clinic", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Ndio", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "Hapana", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali jibu swali hili", + "subjects": "when_the_test_was_conducted:number, test_results:map, months_after_last_test:number" + }, + { + "name": "ctc_number", + "type": "text_input_edit_text", + "properties": { + "hint": "Jaza numbari ya CTC ya mteja", + "type": "Care and Treatment Clinic registration number (CTC Number)" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "openmrs_entity_parent": "" + }, + "validation": [ + { + "condition": "value.matches(\"(\\\\d{2}-\\\\d{2}-\\\\d{4}-\\\\d{6})?\")", + "message": "Namba ya CTC iliyojazwa si sahihi." + } + ], + "required_status": "yes:Tafadhali jaza namba ya CTC ya mteja", + "subjects": "when_the_test_was_conducted:number, months_after_last_test:number, enrolled_to_clinic:map, test_results:map " + }, + { + "name": "comment", + "type": "text_input_edit_text", + "properties": { + "hint": "Maoni" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment", + "openmrs_entity_parent": "" + }, + "required_status": "false" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_followup_for_positive_clients.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_followup_for_positive_clients.json new file mode 100644 index 000000000..dd9559e64 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_index_contact_followup_for_positive_clients.json @@ -0,0 +1,296 @@ +{ + "form": "HIV Index Contact Testing Followup", + "count": "1", + "encounter_type": "HIV Index Contact Testing Followup", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_index_contact_followup_for_positive_clients_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Index Client Contact HIV Outcome", + "fields": [ + { + "name": "place_where_test_was_conducted", + "type": "radio_group", + "properties": { + "text": "Alikopimia mteja" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "place_where_test_was_conducted", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "tb_clinic_outpatient", + "text": "kliniki ya kifua kikuu(wagonjwa wa njee)", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "tb_clinic_outpatient", + "openmrs_entity_parent": "" + } + }, + { + "name": "sexual_transmitted_diseases_clinic", + "text": "kiliniki ya magonjwa ya zinaa", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_transmitted_diseases_clinic", + "openmrs_entity_parent": "" + } + }, + { + "name": "outpatient_department", + "text": "Idara ya wagonjwa wa njee", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "outpatient_department", + "openmrs_entity_parent": "" + } + }, + { + "name": "inpatient_department", + "text": "Idara ya wagonjwa wa ndani", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "inpatient_department", + "openmrs_entity_parent": "" + } + }, + { + "name": "blood_transfusion_service", + "text": "Huduma ya uchangiaji wa damu", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_transfusion_service", + "openmrs_entity_parent": "" + } + }, + { + "name": "community_based_hiv_testing_service", + "text": "Huduma ya kujipima mwenyewe nyumbani", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "community_based_hiv_testing_service", + "openmrs_entity_parent": "" + } + }, + { + "name": "voluntary_patients", + "text": "Wateja wakujitolea", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "voluntary_patients", + "openmrs_entity_parent": "" + } + }, + { + "name": "family_planning_clinic", + "text": "Kiliniki ya uzazi salama", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "family_planning_clinic", + "openmrs_entity_parent": "" + } + }, + { + "name": "ctc", + "text": "CTC", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc", + "openmrs_entity_parent": "" + } + }, + { + "name": "men_circumcision", + "text": "Tohara kwa wanaume", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "men_circumcision", + "openmrs_entity_parent": "" + } + }, + { + "name": "outreach_services", + "text": "Huduma ya Mkoba", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "outreach_services", + "openmrs_entity_parent": "" + } + }, + { + "name": "reproductive_an_child_health", + "text": "Afya ya uzazi na mtoto", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reproductive_an_child_health", + "openmrs_entity_parent": "" + } + }, + { + "name": "other", + "text": "Mengineo", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the answer", + "dependent_calculations": [ + "eligibility_for_testing", + "test_results" + ] + }, + { + "name": "willing_to_start_medication", + "type": "radio_group", + "properties": { + "text": "je mshirika muathirika yuko teyari kuanza dawa?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "willing_to_start_medication", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Ndio", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "Hapana", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the answer" + }, + { + "name": "enrolled_to_clinic", + "type": "radio_group", + "properties": { + "text": "Je mteja ameandikishwa kwenye kilinic ya matunzo na tiba?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "enrolled_to_clinic", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Ndio", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "Hapana", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the answer", + "subjects": "willing_to_start_medication:map" + }, + { + "name": "ctc_number", + "type": "text_input_edit_text", + "properties": { + "hint": "Ingiza number ya mteja wa CTC", + "type": "Care and Treatment Clinic registration number (CTC Number)" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "openmrs_entity_parent": "" + }, + "validation": [ + { + "condition": "value.matches(\"(\\\\d{2}-\\\\d{2}-\\\\d{4}-\\\\d{6})?\")", + "message": "Namba ya CTC iliyojazwa si sahihi." + } + ], + "required_status": "yes:Please specify client's CTC number", + "subjects": "willing_to_start_medication:map, enrolled_to_clinic:map" + }, + { + "name": "comment", + "type": "text_input_edit_text", + "properties": { + "hint": "Maoni" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment", + "openmrs_entity_parent": "" + }, + "required_status": "false" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_outcome.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_outcome.json new file mode 100644 index 000000000..1f116a048 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_outcome.json @@ -0,0 +1,270 @@ +{ + "form": "HIV Outcome", + "count": "1", + "encounter_type": "HIV Outcome", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_outcome_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Matokeo ya Vipimo vya VVU", + "fields": [ + { + "name": "action_taken_hiv_problems", + "type": "radio_group", + "properties": { + "text": "Hatua zilizochukuliwa kwenye kituo" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "action_taken_hiv_problems", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "no_action_taken", + "text": "Hajapimwa", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no_action_taken", + "openmrs_entity_parent": "" + } + }, + { + "name": "tested", + "text": "Amepimwa", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "tested", + "openmrs_entity_parent": "" + } + }, + { + "name": "referred", + "text": "Amepewa rufaa", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "referred", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select action taken", + "dependent_calculations": [ + "hiv_facility_visit_date" + ] + }, + { + "name": "reason_no_action_was_taken", + "type": "radio_group", + "properties": { + "text": "Sababu ya kutopata matibabu" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_no_action_was_taken", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "known_positive", + "text": "Inajulikana chanya", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "known_positive", + "openmrs_entity_parent": "" + } + }, + { + "name": "client_declined", + "text": "Mteja amekataa", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "client_declined", + "openmrs_entity_parent": "" + } + }, + { + "name": "test_not_required_based_on_risk_assessment", + "text": "Kipimo hakijafanyika kutokana na tathmini ya hatari", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_required_based_on_risk_assessment", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select action taken", + "subjects": "action_taken_hiv_problems:map", + "dependent_calculations": [ + "test_results_calculation" + ] + }, + { + "name": "test_results", + "type": "radio_group", + "properties": { + "text": "Chagua matokeo ya vipimo vya VVU" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "test_results", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "positive", + "text": "Ana VVU", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "positive", + "openmrs_entity_parent": "" + } + }, + { + "name": "negative", + "text": "Hana VVU", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "negative", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali chagua matokeo ya vipimo vya VVU", + "subjects": "action_taken_hiv_problems:map" + }, + { + "name": "enrolled_to_clinic", + "type": "radio_group", + "properties": { + "text": "Je, mteja amesajiliwa kwenye kliniki ya VVU?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "enrolled_to_clinic", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Ndio", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "Hapana", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali jaza jibu sahihi", + "subjects": "test_results:map, action_taken_hiv_problems:map" + }, + { + "name": "ctc_number", + "type": "masked_edit_text", + "properties": { + "hint": "Namba ya CTC, mfano: 12-34-5678-912345", + "type": "name", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "input_type": "number", + "allowed_chars": "0123456789" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "openmrs_entity_parent": "" + }, + "validation": [ + { + "condition": "value.matches(\"(\\\\d{2}-\\\\d{2}-\\\\d{4}-\\\\d{6})?\")", + "message": "Namba ya CTC inatakiwa kuwa (XX-XX-XXXX-XXXXXX)." + } + ], + "required_status": "true:Tafadhali jaza namba ya CTC ya mteja", + "subjects": "reason_no_action_was_taken:map, enrolled_to_clinic:map,test_results:map, action_taken_hiv_problems:map" + }, + { + "name": "prompt_for_ctc_enrollment", + "type": "toast_notification", + "properties": { + "notification_type": "info", + "dismissible": "no", + "text": "Endelea na ushauri mpaka mteja atakapokuwa tayari kuanzishiwa dawa", + "background_color": "#082455", + "text_color": "#EBEE2F" + }, + "subjects": "enrolled_to_clinic:map, test_results:map, action_taken_hiv_problems:map" + }, + { + "name": "comment_hiv_problems", + "type": "text_input_edit_text", + "properties": { + "hint": "Toa maoni" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment_hiv_problems", + "openmrs_entity_parent": "" + }, + "required_status": "false" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_registration.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_registration.json new file mode 100644 index 000000000..1857f2bc3 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hiv_registration.json @@ -0,0 +1,267 @@ +{ + "form": "HIV Registration form", + "count": "1", + "encounter_type": "HIV Registration", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_registration_form_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Usajili wa wateja wa VVU", + "fields": [ + { + "name": "new_or_current_hiv_client", + "type": "radio_group", + "properties": { + "text": "Je, mteja aliyesajiliwa ni mpya au alikuwepo kwenye huduma ya VVU?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "new_or_current_hiv_client", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "new", + "text": "Mteja mpya wa VVU", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "new", + "openmrs_entity_parent": "" + } + }, + { + "name": "existing", + "text": "Mteja aliyepo kwenye huduma ya VVU", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "existing", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali chagua jibu" + }, + { + "name": "place_where_test_was_conducted", + "type": "radio_group", + "properties": { + "text": "Mahali mteja alipopimia VVU" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "place_where_test_was_conducted", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "tb_clinic_outpatient", + "text": "Kliniki ya kifua kikuu (wagonjwa wa nje)", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "tb_clinic_outpatient", + "openmrs_entity_parent": "" + } + }, + { + "name": "sexual_transmitted_diseases_clinic", + "text": "Kliniki ya magonjwa ya ngono", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_transmitted_diseases_clinic", + "openmrs_entity_parent": "" + } + }, + { + "name": "outpatient_department", + "text": "Idara ya wagonjwa wa nje", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "outpatient_department", + "openmrs_entity_parent": "" + } + }, + { + "name": "inpatient_department", + "text": "Idara ya wagonjwa waliolazwa", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "inpatient_department", + "openmrs_entity_parent": "" + } + }, + { + "name": "blood_transfusion_service", + "text": "Huduma ya damu salama", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_transfusion_service", + "openmrs_entity_parent": "" + } + }, + { + "name": "community_based_hiv_testing_service", + "text": "Huduma za upimaji nyumbani", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "community_based_hiv_testing_service", + "openmrs_entity_parent": "" + } + }, + { + "name": "voluntary_patients", + "text": "Wateja wanaokwenda kwa hiari yao", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "voluntary_patients", + "openmrs_entity_parent": "" + } + }, + { + "name": "family_planning_clinic", + "text": "Kliniki ya uzazi wa mpango", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "family_planning_clinic", + "openmrs_entity_parent": "" + } + }, + { + "name": "ctc", + "text": "Kituo cha huduma ya tiba na matunzo ya UKIMWI", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc", + "openmrs_entity_parent": "" + } + }, + { + "name": "men_circumcision", + "text": "Wakati wa tohara ya wanaume", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "men_circumcision", + "openmrs_entity_parent": "" + } + }, + { + "name": "outreach_services", + "text": "Huduma ya mkoba (outreach services)", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "outreach_services", + "openmrs_entity_parent": "" + } + }, + { + "name": "reproductive_an_child_health", + "text": "Kliniki ya Mama, Baba na Mtoto", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reproductive_an_child_health", + "openmrs_entity_parent": "" + } + }, + { + "name": "other", + "text": "Sehemu nyingine", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali chagua jibu sahihi" + }, + { + "name": "place_where_test_was_conducted_other", + "type": "text_input_edit_text", + "properties": { + "hint": "Nyingine", + "type": "name" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "place_where_test_was_conducted_other", + "openmrs_entity_parent": "" + }, + "required_status": "true:Tafadhali jaza sehemu nyingine", + "subjects": "place_where_test_was_conducted:map" + }, + { + "name": "ctc_number", + "type": "masked_edit_text", + "properties": { + "hint": "Namba ya CTC, mfano: 12-34-5678-912345", + "type": "Namba ya CTC", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "input_type": "number", + "allowed_chars": "0123456789" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "openmrs_entity_parent": "" + }, + "validation": [ + { + "condition": "value.matches(\"(\\\\d{2}-\\\\d{2}-\\\\d{4}-\\\\d{6})?\")", + "message": "Namba ya CTC inatakiwa kuwa (XX-XX-XXXX-XXXXXX)." + } + ], + "required_status": "yes:Tafadhali jaza namba ya CTC ya mteja", + "dependent_calculations": [ + "hiv_registration_date", + "client_hiv_status_during_registration", + "test_results" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hivst_issue_kits.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hivst_issue_kits.json new file mode 100644 index 000000000..8d968f8ce --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hivst_issue_kits.json @@ -0,0 +1,509 @@ +{ + "count": "1", + "encounter_type": "Self Testing Kits Issue", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Ugawaji wa Vitepe vya Jipime", + "fields": [ + { + "key": "pre_test_counselling_and_instructions", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pre_test_counselling_and_instructions", + "label": "Je mteja amepata elimu na ushauri kabla ya kupima", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu " + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_relevance.yml" + } + } + } + }, + { + "key": "self_test_kit_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "self_test_kit_given", + "label": "Je mteja alipewa kitendanishi cha jipime", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu " + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_relevance.yml" + } + } + } + }, + { + "key": "kit_code", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "kit_code", + "type": "edit_text", + "hint": "Msimbo wa kitepe", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_relevance.yml" + } + } + } + }, + { + "key": "client_testing_approach", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_testing_approach", + "label": "Njia za upimaji wa mteja ", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "assisted_testing_on_site", + "text": "Kwa Usaidizi ktk eneo la upimaji", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "assisted_testing_on_site" + }, + { + "key": "assisted_testing_off_site", + "text": "Kwa Usaidizi nje ya eneo la upimaji", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "assisted_testing_off_site" + }, + { + "key": "unassisted_testing_on_site", + "text": "Bila Usaidizi ndani ya eneo la upimaji", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "unassisted_testing_on_site" + }, + { + "key": "unassisted_testing_off_site", + "text": "Bila Usaidizi nje ya eneo la upimaji", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "unassisted_testing_off_site" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu " + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_relevance.yml" + } + } + } + }, + { + "key": "extra_kits_required", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "extra_kits_required", + "label": "Je mteja anahitaji vitepe kwa ajili ya rafiki rika au mshirika ngono", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu " + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_relevance.yml" + } + } + } + }, + { + "key": "extra_kits_issued_for", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "extra_kits_issued_for", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Vitepe vya ziada vilivyotolewa kwa ajili ya", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "peer_friend", + "text": "Rafiki rika", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "peer_friend" + }, + { + "key": "sexual_partner", + "text": "Mshirika wa kingono", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu " + }, + "relevance": { + "step1:extra_kits_required": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "peer_friend_kit_code", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "peer_friend_kit_code", + "type": "edit_text", + "hint": "msimbo wa kitepe cha rafiki rika", + "relevance": { + "step1:extra_kits_issued_for": { + "ex-checkbox": [ + { + "or": [ + "peer_friend" + ] + } + ] + } + } + }, + { + "key": "sexual_partner_kit_code", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner_kit_code", + "type": "edit_text", + "hint": "msimbo wa kitepe cha mshirika wa kingono", + "relevance": { + "step1:extra_kits_issued_for": { + "ex-checkbox": [ + { + "or": [ + "sexual_partner" + ] + } + ] + } + } + }, + { + "key": "kits_batch_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "kit_batch_number", + "type": "edit_text", + "hint": "Kits Batch Namba", + "v_required": { + "value": true, + "err": "Tafadhali jaza batch namba" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_relevance.yml" + } + } + } + }, + { + "key": "kits_expiry_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "kits_expiry_date", + "type": "date_picker", + "hint": "Expiry Date", + "expanded": false, + "min_date": "today", + "v_required": { + "value": true, + "err": "Please select the Expiry date" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_relevance.yml" + } + } + } + }, + { + "key": "condoms_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condoms_given", + "label": "Je mteja alipewa kondomu", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu " + } + }, + { + "key": "type_of_issued_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_issued_condoms", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Chagua aina ya kondomu zilizotolewa", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "male_condoms", + "text": "kondomu za kiume", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms" + }, + { + "key": "female_condoms", + "text": "kondomu za kike", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu " + }, + "relevance": { + "step1:condoms_given": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "number_of_male_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_male_condoms_issued", + "type": "edit_text", + "hint": "Idadi ya kondomu za kiume zilizotolewa", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza namba sahihi" + }, + "v_min": { + "value": "1", + "err": "idadi ni lazima iwe sawa sawa au kubwa kuliko 0" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza namba" + }, + "relevance": { + "step1:type_of_issued_condoms": { + "ex-checkbox": [ + { + "or": [ + "male_condoms" + ] + } + ] + } + } + }, + { + "key": "number_of_female_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_female_condoms_issued", + "type": "edit_text", + "hint": "Idadi aa kondomu za kike zilizotolewa", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza namba sahihi" + }, + "v_min": { + "value": "1", + "err": "idadi ni lazima iwe sawa sawa au kubwa kuliko 0" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza namba" + }, + "relevance": { + "step1:type_of_issued_condoms": { + "ex-checkbox": [ + { + "or": [ + "female_condoms" + ] + } + ] + } + } + }, + { + "key": "sms_notification_service", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sms_notification_service", + "label": "Je mteja amekubali kuingia kwenye huduma za SMS", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "collection_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "collection_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hivst_mobilization_session.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hivst_mobilization_session.json new file mode 100644 index 000000000..5b687d818 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hivst_mobilization_session.json @@ -0,0 +1,196 @@ +{ + "count": "1", + "encounter_type": "HIVST Mobilization Session", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Uhamasishaji wa Vipindi vya Jipime", + "fields": [ + { + "key": "mobilization_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mobilization_date", + "type": "date_picker", + "hint": "Tarehe ya uhamasishaji", + "expanded": false, + "min_date": "today-6m", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza tarehe ya uhamasishaji" + } + }, + { + "key": "female_clients_reached", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_clients_reached", + "type": "edit_text", + "hint": "Idadi ya wateja wa kike waliofikiwa", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza numbari sahihi" + }, + "v_min": { + "value": "0", + "err": "Tarakimu ulioingiza inatakiwa iwe sawa au kubuwa kuliko 0" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza nambar" + } + }, + { + "key": "male_clients_reached", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_clients_reached", + "type": "edit_text", + "hint": "Idadi ya wateja wa kiume waliofikiwa", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza numbari sahihi" + }, + "v_min": { + "value": "0", + "err": "Tarakimu ulioingiza inatakiwa iwe sawa au kubuwa kuliko 0" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza nambar" + } + }, + { + "key": "gps", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gps", + "openmrs_data_type": "text", + "type": "gps" + }, + { + "key": "female_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms_issued", + "type": "edit_text", + "hint": "Idadi ya kondomu za kike zilizotolewa", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza numbari sahihi" + }, + "v_min": { + "value": "0", + "err": "Tarakimu ulioingiza inatakiwa iwe sawa au kubuwa kuliko 0" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza nambar" + } + }, + { + "key": "male_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms_issued", + "type": "edit_text", + "hint": "Idadi ya kondomu za kiume zilizotolewa", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza numbari sahihi" + }, + "v_min": { + "value": "0", + "err": "Tarakimu ulioingiza inatakiwa iwe sawa au kubuwa kuliko 0" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza nambar" + } + }, + { + "key": "kit_used_in_demonstration", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "kit_used_in_demonstration", + "label": "Je kitepe kilitumika kwajili ya kufundishia", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali changuwa jibu " + } + }, + { + "key": "kit_code", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "kit_code", + "type": "edit_text", + "hint": "Msimbo wa kitepe", + "relevance": { + "step1:kit_used_in_demonstration": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hivst_registration.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hivst_registration.json new file mode 100644 index 000000000..15e1c34e7 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hivst_registration.json @@ -0,0 +1,272 @@ +{ + "count": "1", + "encounter_type": "Self Testing Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "HIVST Enrollment", + "fields": [ + { + "key": "client_testing_history", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_testing_history", + "label": "Historia ya Upimaji wa mteja", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "new_client", + "text": "Mteja mpya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "new_client" + }, + { + "key": "returning_client", + "text": "Mteja wa marudio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "returning_client" + }, + { + "key": "known_positive", + "text": "Tayari ana maambukizi ya VVU", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_positive" + } + ], + "v_required": { + "value": "true", + "err": "Chaguwa jibu" + } + }, + { + "key": "client_group", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_group", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_registration_calculation.yml" + } + } + } + }, + { + "key": "client_group_female_15_24", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_group_female_15_24", + "label": "Chagua Kundi la Mteja ", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "fsw", + "text": "Mwanamke anayefanya biashara ya ngono", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fsw" + }, + { + "key": "pwid", + "text": "Wajidunga dawa za kulevya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwid" + }, + { + "key": "prisoners", + "text": "Mfungwa/Mahabusu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoners" + }, + { + "key": "agyw", + "text": "Kijana rika balehe ", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "agyw" + }, + { + "key": "others", + "text": "Makundi mengine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_registration_relevance.yml" + } + } + } + }, + { + "key": "client_group_female", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_group_female", + "label": "Chagua Kundi la Mteja ", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "fsw", + "text": "Mwanamke anayefanya biashara ya ngono", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fsw" + }, + { + "key": "pwid", + "text": "Wakujidunga", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwid" + }, + { + "key": "prisoners", + "text": "Mfungwa", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoners" + }, + { + "key": "others", + "text": "Makundi mengine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_registration_relevance.yml" + } + } + } + }, + { + "key": "client_group_male", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_group_male", + "label": "chagua Kundi la Mteja ", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "msm", + "text": "Mwanaume anayefanya ngono na mwanaume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "msm" + }, + { + "key": "pwid", + "text": "Wajidunga dawa za kulevya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwid" + }, + { + "key": "prisoners", + "text": "Mfungwa/Mahabusu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoners" + }, + { + "key": "others", + "text": "Makundi mengine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + } + + ], + "v_required": { + "value": "true", + "err": "Chaguwa jibu sahihi" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_registration_relevance.yml" + } + } + } + }, + { + "key": "known_positive_during_reg", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_positive_during_reg", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_registration_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/hivst_results.json b/opensrp-chw-hf/src/main/assets/json.form-sw/hivst_results.json new file mode 100644 index 000000000..b9a1e1f3a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/hivst_results.json @@ -0,0 +1,346 @@ +{ + "count": "1", + "encounter_type": "Self Testing Results", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Rekodi Matokeo ya Jipime", + "fields": [ + { + "key": "has_the_client_been_found", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "has_the_client_been_found", + "label": "Je Mteja amepatikana?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + } + }, + { + "key": "disclose_result", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disclose_result", + "label": "Mteja ametoa majibu yake", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + } + }, + { + "key": "client_test_result", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_test_result", + "label": "Chagua majibu ya vipimo vya mteja", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "reactive", + "text": "Viashiria Vipo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reactive" + }, + { + "key": "non_reactive", + "text": "Hana viashiria", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "non_reactive" + }, + { + "key": "invalid", + "text": "Jibu batili", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "invalid" + }, + { + "key": "wastage", + "text": "Upotevu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "wastage" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "peer_test_result", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "peer_test_result", + "label": "chagua majibu ya rafiki rika", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "reactive", + "text": "Viashiria Vipo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reactive" + }, + { + "key": "non_reactive", + "text": "Hana viashiria", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "non_reactive" + }, + { + "key": "invalid", + "text": "Jibu Batili", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "invalid" + }, + { + "key": "wastage", + "text": "Upotevu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "wastage" + }, + { + "key": "not_returned", + "text": "Majibu hayajarudi", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_returned" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + } + }, + { + "key": "sexual_partner_test_result", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner_test_result", + "label": "chagua majibu ya mshirika wa kingono", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "reactive", + "text": "Viashiria Vipo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reactive" + }, + { + "key": "non_reactive", + "text": "Hana viashiria", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "non_reactive" + }, + { + "key": "invalid", + "text": "Majibu batili", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "invalid" + }, + { + "key": "wastage", + "text": "Upotevu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "wastage" + }, + { + "key": "not_returned", + "text": "Majibu hayajarudi", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_returned" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chaguaa jibu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + } + }, + { + "key": "hivst_result", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hivst_result", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_calculation.yml" + } + } + } + }, + { + "key": "prompt_for_referral_for_peer_or_sexual_partner", + "type": "toaster_notes", + "text": "Mshauri mteja amshawishi rafiki rika/mshirika wa ngono kutembelea kituo cha afya kwa ajili ya kipimo cha uhakiki", + "toaster_info_text": "Mshauri mteja amshawishi rafiki rika/mshirika wa ngono kutembelea kituo cha afya kwa ajili ya kipimo cha uhakiki", + "toaster_info_title": "Mshauri mteja", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + } + }, + { + "key": "register_to_hts", + "type": "hidden", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "register_to_hts", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_calculation.yml" + } + } + } + }, + { + "key": "result_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "result_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_cervical_cancer_screening.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_cervical_cancer_screening.json new file mode 100644 index 000000000..aeada328e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_cervical_cancer_screening.json @@ -0,0 +1,88 @@ +{ + "count": "1", + "encounter_type": "KVP Cervical Cancer Screening", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Uchunguzi wa Saratani ya Shingo ya Kizazi", + "fields": [ + { + "key": "cervical_cancer_screening", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cervical_cancer_screening", + "type": "native_radio", + "label": "Je, mteja alipimwa Saratani ya Shingo ya Kizazi?", + "options": [ + { + "key": "screened", + "text": " Amechunguzwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "screened" + }, + { + "key": "not_screened", + "text": " Hajachunguzwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_provided" + }, + { + "key": "referred", + "text": "Amepewa rufaa kwa ajili ya matibabu", + "openmrs_entity": "concept", + "openmrs_entity_id": "referred" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": " Tafadhali chagua jibu" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_client_status.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_client_status.json new file mode 100644 index 000000000..804fe7eb5 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_client_status.json @@ -0,0 +1,183 @@ +{ + "count": "1", + "encounter_type": "KVP Client Status", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Hali ya Mteja", + "fields": [ + { + "key": "client_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_status", + "label": " Aina ya tembeleo", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "new_client", + "text": "Mteja Mpya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "new_visit" + }, + { + "key": "transfer_in", + "text": "Mteja amehamia kutoka kituo kingine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "transfer_in" + }, + { + "key": "return", + "text": "Mteja amerudi kwa matibabu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "return" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + } + }, + { + "key": "other_kvp_category", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_kvp_category", + "type": "check_box", + "label": "Aina nyingine ya Makundi Maalum", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "pwud", + "text": "Watumiaji wa dawa za kulevya kwa njia nyingine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwud" + }, + { + "key": "pwid", + "text": "Mjidunga dawa za kulevya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwid" + }, + { + "key": "fsw", + "text": "Mwanamke anayefanya biashara ya ngono", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fsw" + }, + { + "key": "msm", + "text": "Mwanaume anayefanya ngono na mwanaume mwenzie", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "msm" + }, + { + "key": "agyw", + "text": "Msichana rika balehe na mwanamke kijana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "agyw" + }, + { + "key": "prisoner", + "text": "Mfungwa", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoner" + }, + { + "key": "rumandee", + "text": "Mahabusu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rumandee" + }, + { + "key": "mobile_population", + "text": "Makundi ya watu wanao hamahama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mobile_population" + }, + { + "key": "serodiscordant_couple", + "text": "Mwenza mwenye majibu kinzani", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "serodiscordant_couple" + }, + { + "key": "other_vulnerable_population", + "text": "Makundi mengine hatarishi", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_vulnerable_population" + }, + { + "key": "none", + "text": "Hakuna", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua angalau moja" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_condom_provision.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_condom_provision.json new file mode 100644 index 000000000..a2e0c497a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_condom_provision.json @@ -0,0 +1,178 @@ +{ + "count": "1", + "encounter_type": "KVP Condom Provision", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Ugawaji Kondomu", + "fields": [ + { + "key": "condoms_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condoms_given", + "label": "Je, mteja alipewa kondomu?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "type_of_issued_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_issued_condoms", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Chagua aina ya kondomu iliyotolewa", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "male_condoms", + "text": "Kondomu za Kiume", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms" + }, + { + "key": "female_condoms", + "text": "Kondomu za Kike", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "step1:condoms_given": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "number_of_male_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_male_condoms_issued", + "type": "edit_text", + "hint": "Idadi ya kondomu za Kiume zilizotolewa (pisi)", + "v_numeric": { + "value": "true", + "err": "Tafadhali weka nambari halali" + }, + "v_min": { + "value": "0", + "err": "Nambari lazima iwe sawa au zaidi ya 0" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka nambari" + }, + "relevance": { + "step1:type_of_issued_condoms": { + "ex-checkbox": [ + { + "or": [ + "male_condoms" + ] + } + ] + } + } + }, + { + "key": "number_of_female_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_female_condoms_issued", + "type": "edit_text", + "hint": "Idadi ya kondomu za Kike zilizotolewa (pisi)", + "v_numeric": { + "value": "true", + "err": "Tafadhali weka nambari halali" + }, + "v_min": { + "value": "0", + "err": " Nambari lazima iwe sawa au zaidi ya 0" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka nambari" + }, + "relevance": { + "step1:type_of_issued_condoms": { + "ex-checkbox": [ + { + "or": [ + "female_condoms" + ] + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_female_family_planning_services.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_female_family_planning_services.json new file mode 100644 index 000000000..c646d9913 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_female_family_planning_services.json @@ -0,0 +1,153 @@ +{ + "count": "1", + "encounter_type": "KVP Family Planning", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Uzazi wa Mpango", + "fields": [ + { + "key": "family_planning_service", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "family_planning_service", + "type": "native_radio", + "label": "Huduma ya uzazi wa mpango alizopewa", + "options": [ + { + "key": "pill", + "text": "Vidonge", + "openmrs_entity": "concept", + "openmrs_entity_id": "pill" + }, + { + "key": "injectable", + "text": "Sindano", + "openmrs_entity": "concept", + "openmrs_entity_id": "injectable" + }, + { + "key": "implanon", + "text": "kijiti cha miaka 3", + "openmrs_entity": "concept", + "openmrs_entity_id": "implanon" + }, + { + "key": "jadelle", + "text": "Kijiti cha miaka 5", + "openmrs_entity": "concept", + "openmrs_entity_id": "jadelle" + }, + { + "key": "iucd", + "text": "Kitanzi", + "openmrs_entity": "concept", + "openmrs_entity_id": "iucd" + }, + { + "key": "traditional", + "text": "Njia ya asili", + "openmrs_entity": "concept", + "openmrs_entity_id": "traditional" + }, + { + "key": "tube_ligation", + "text": "Kufunga uzazi ", + "openmrs_entity": "concept", + "openmrs_entity_id": "tube_ligation" + }, + { + "key": "referral", + "text": "Rufaa", + "openmrs_entity": "concept", + "openmrs_entity_id": "referral" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + }, + { + "key": "refused", + "text": "Amekata", + "openmrs_entity": "concept", + "openmrs_entity_id": "refused" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "condom_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_provided", + "label": "Je mteja alipewa condom kama njia ya uzazi wa mtango", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu " + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_gbv_analysis.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_gbv_analysis.json new file mode 100644 index 000000000..3bed8402e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_gbv_analysis.json @@ -0,0 +1,88 @@ +{ + "count": "1", + "encounter_type": "KVP GBV Analysis", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Uchunguzi wa Ukatili wa Kijinsia", + "fields": [ + { + "key": "gbv_screening", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gbv_screening", + "type": "native_radio", + "label": "Uchunguzi wa ukatili wa kijinsia (kimatendo, kisaikolojia, kihisia)", + "options": [ + { + "key": "case_reported", + "text": "Mteja hajaripoti ukatili", + "openmrs_entity": "concept", + "openmrs_entity_id": "case_reported" + }, + { + "key": "case_not_reported", + "text": "Mteja ameripoti ukatili", + "openmrs_entity": "concept", + "openmrs_entity_id": "case_not_reported" + }, + { + "key": "received_post_gbv_care", + "text": "Amepata huduma kuhusu ukatili wa kijinsia", + "openmrs_entity": "concept", + "openmrs_entity_id": "received_post_gbv_care" + }, + { + "key": "referred", + "text": "Amepewa rufaa", + "openmrs_entity": "concept", + "openmrs_entity_id": "referred" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_health_education.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_health_education.json new file mode 100644 index 000000000..1d9506276 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_health_education.json @@ -0,0 +1,154 @@ +{ + "count": "1", + "encounter_type": "KVP Health Education", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Elimu ya Afya", + "fields": [ + { + "key": "health_education_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "health_education_provided", + "type": "check_box", + "label": "Elimu ya afya iliotolewa kwa mteja", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "sti", + "text": "Magonjwa ya ngono", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sti" + }, + { + "key": "hbv_hcv", + "text": "Homa ya ini B&C", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hbv_hcv" + }, + { + "key": "tb", + "text": "Kifua kikuu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tb" + }, + { + "key": "gbv", + "text": "Ukatili wa kijinsia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gbv" + }, + { + "key": "pep", + "text": "PEP", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pep" + }, + { + "key": "prep", + "text": "PrEP", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep" + }, + { + "key": "vmmc", + "text": "Huduma za tohara", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "vmmc" + }, + { + "key": "cacx", + "text": "Saratani ya shingo ya kizazi", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cacx" + }, + { + "key": "drug_use_disorder", + "text": "Athari za dawa za kulevya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_use_disorder" + }, + { + "key": "hiv_aids", + "text": "VVU na UKIMWI", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_aids" + }, + { + "key": "others", + "text": "Nyinginezo (Taja)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + }, + { + "key": "none", + "text": "Hakuna", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ], + "v_required": { + "value": "true", + "err": " Tafadhali chagua angalau moja" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_hepatitis.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_hepatitis.json new file mode 100644 index 000000000..d8bebeeab --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_hepatitis.json @@ -0,0 +1,126 @@ +{ + "count": "1", + "encounter_type": "KVP Hepatitis", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Uchunguzi wa Homa ya Ini B&C", + "fields": [ + { + "key": "hep_b_testing", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hep_b_testing", + "type": "native_radio", + "label": "Mteja alipimwa homa ya ini B", + "options": [ + { + "key": "positive", + "text": "Amepima na ana maambukizi", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "positive_and_referred", + "text": "Amepima anamaambukizi na amepewa rufaa", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive_and_referred" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "not_tested", + "text": "Hajapimwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_tested" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jubu" + } + }, + { + "key": "hep_c_testing", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hep_c_testing", + "type": "native_radio", + "label": "Mteja amepimwa homa ya ini c", + "options": [ + { + "key": "positive", + "text": "Amepima na ana maambukizi", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "positive_and_referred", + "text": "Amepima anamaambukizi na amepewa rufaa", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive_and_referred" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "not_tested", + "text": "Hajapimwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_tested" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jubu" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_hts.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_hts.json new file mode 100644 index 000000000..d51241d97 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_hts.json @@ -0,0 +1,383 @@ +{ + "count": "1", + "encounter_type": "KVP HTS", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Ushauri Nasaha na Upimaji", + "fields": [ + { + "key": "previous_hiv_testing_method", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "previous_hiv_testing_method", + "label": "Mbinu ya awali ya kupima VVU", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "hivst", + "text": "Kajipima mwenyewe", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hivst" + }, + { + "key": "hiv_cv_test", + "text": "Ya kawaida", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_cv_test" + }, + { + "key": "hivst_and_hiv_cv_test", + "text": "Zote", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hivst_and_hiv_cv_test" + }, + { + "key": "other_method", + "text": " Mbinu nyingine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_method" + }, + { + "key": "not_tested", + "text": "Haijapimwa", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_tested" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + } + }, + { + "key": "other_previous_hiv_testing_method", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_previous_hiv_testing_method", + "type": "edit_text", + "hint": " Nyingine(Bainisha)", + "v_required": { + "value": "true", + "err": " Tafadhali fafanua" + }, + "relevance": { + "step1:previous_hiv_testing_method": { + "type": "string", + "ex": "equalTo(., \"other_method\")" + } + } + }, + { + "key": "testing_site", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "testing_site", + "label": "Mahali huduma ya upimaji ilipofanyika", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "community", + "text": "Jumuiya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "community" + }, + { + "key": "facility", + "text": "Kituoni", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "facility" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_hts_relevance.yml" + } + } + } + }, + { + "key": "tested_hiv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tested_hiv", + "label": "Je, mteja amepima VVU?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + } + }, + { + "key": "testing_approach", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "testing_approach", + "label": "Mbinu ya upimaji wa mteja", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "citc", + "text": "CITC", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "citc" + }, + { + "key": "pitc", + "text": "PITC", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pitc" + }, + { + "key": "index", + "text": "Washirika wa kingono", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "index" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_hts_relevance.yml" + } + } + } + }, + { + "key": "hiv_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_status", + "label": "Matokeo baada ya mteja kupimwa", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "inconclusive", + "text": "Haikukamilika", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "inconclusive" + }, + { + "key": "refused_results", + "text": "Mteja alikataa kupokea matokeo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "refused_results" + }, + { + "key": "known_positive", + "text": "Inajulikana kuwa chanya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_positive" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_hts_relevance.yml" + } + } + } + }, + { + "key": "ctc_services", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_services", + "label": "Kujiandikisha kwenye huduma za CTC", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "enrolled_but_not_on_arv", + "text": "Amejiandikisha lakini haijaanzishwa kutumia ARV", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "enrolled_but_not_on_arv" + }, + { + "key": "enrolled_and_on_arv", + "text": "Amejiandikisha na kuanza kutumia ARV", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "enrolled_and_on_arv" + } + ], + "v_required": { + "value": "true", + "err": " Tafadhali chagua moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_hts_relevance.yml" + } + } + } + }, + { + "key": "ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "Namba ya CTC", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "Nambari ya CTC inapaswa kuwa ya fomati (XX-XX-XXXX-XXXXXX)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid CTC Number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_hts_relevance.yml" + } + } + } + }, + { + "key": "kits_distributed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "kits_distributed", + "label": "Amepewa kitepe cha Jipime", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_iec_sbcc.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_iec_sbcc.json new file mode 100644 index 000000000..a4b1c98eb --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_iec_sbcc.json @@ -0,0 +1,66 @@ +{ + "count": "1", + "encounter_type": "KVP IEC/SBCC", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "IEC/SBCC", + "fields": [ + { + "key": "iec_sbcc_materials", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "iec_sbcc_materials", + "type": "edit_text", + "hint": "Idadi ya vitita vya IEC/SBCC zinazotolewa kwa mteja", + "v_numeric": { + "value": "true", + "err": " Tafadhali weka nambari" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka nambari" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_male_family_planning_services.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_male_family_planning_services.json new file mode 100644 index 000000000..47a8c7f3c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_male_family_planning_services.json @@ -0,0 +1,129 @@ +{ + "count": "1", + "encounter_type": "KVP Family Planning", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Uzazi wa Mpango", + "fields": [ + { + "key": "family_planning_service", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "family_planning_service", + "type": "native_radio", + "label": "Huduma ya uzazi wa mpango alizopewa", + "options": [ + { + "key": "vasectomy", + "text": "Kufunga uzazi ", + "openmrs_entity": "concept", + "openmrs_entity_id": "vasectomy" + }, + { + "key": "traditional", + "text": "Njia ya asili", + "openmrs_entity": "concept", + "openmrs_entity_id": "traditional" + }, + { + "key": "referral", + "text": "Amepewa rufaa", + "openmrs_entity": "concept", + "openmrs_entity_id": "referral" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + }, + { + "key": "refused", + "text": "Amekataa", + "openmrs_entity": "concept", + "openmrs_entity_id": "refused" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la swali" + } + }, + { + "key": "condom_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_provided", + "label": "Je Mteja alipewa condom kama njia za uzazi wa mpango", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la swali" + }, + "relevance": { + "step1:family_planning_service": { + "type": "string", + "ex": "notEqualTo(., \"vasectomy\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_mat.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_mat.json new file mode 100644 index 000000000..545dc6562 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_mat.json @@ -0,0 +1,82 @@ +{ + "count": "1", + "encounter_type": "KVP MAT", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "MAT", + "fields": [ + { + "key": "mat_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mat_provided", + "type": "native_radio", + "label": " Je, mteja alipewa huduma za MAT?", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no_but_referral_given", + "text": "Hapana, lakini mteja alipewa rufaa", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_but_referral_given" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": " Tafadhali chagua jibu" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_other_services_and_referrals.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_other_services_and_referrals.json new file mode 100644 index 000000000..722851f17 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_other_services_and_referrals.json @@ -0,0 +1,142 @@ +{ + "count": "1", + "encounter_type": "KVP Other Services", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Rufaa na Huduma Nyingine", + "fields": [ + { + "key": "other_services_referrals_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_services_referrals_provided", + "type": "check_box", + "label": "Huduma/rufaa zingine zinazotolewa kwa mteja", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "rch", + "text": "Huduma za mama na mtoto", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rch" + }, + { + "key": "mental_health", + "text": "Afya ya akili na msaada wa kisaikolojia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mental_health" + }, + { + "key": "covid_vaccine", + "text": "Chanjo ya UVIKO", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "covid_vaccine" + }, + { + "key": "legal_services", + "text": "Huduma za msaada wa kisheria", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "legal_services" + }, + { + "key": "iga", + "text": "Huduma za kuongeza kipato", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "iga" + }, + { + "key": "other", + "text": "Nyinginezo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + }, + { + "key": "none", + "text": "Hakuna", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua angalau moja" + } + }, + { + "key": "other_other_services_referrals_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_other_services_referrals_provided", + "type": "edit_text", + "hint": "Nyingine(Bainisha)", + "v_required": { + "value": "true", + "err": "Tafadhali fafanua" + }, + "relevance": { + "step1:other_services_referrals_provided": { + "ex-checkbox": [ + { + "or": [ + "other" + ] + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_prep_pep.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_prep_pep.json new file mode 100644 index 000000000..db1a24826 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_prep_pep.json @@ -0,0 +1,107 @@ +{ + "count": "1", + "encounter_type": "KVP PrEP and PEP", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "PEP assesment", + "fields": [ + { + "key": "enrolled_to_prep", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "enrolled_to_prep", + "text_color": "#000000", + "type": "hidden" + }, + { + "key": "pep_provision", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pep_provision", + "label": "Ameandikishwa kwenye huduma za dawa kinga ", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "provided", + "text": "Amepewa ", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "community" + }, + { + "key": "not_provided", + "text": "Hajapewa", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "facility" + }, + { + "key": "referred", + "text": "amepewa rufa", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "referred" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadali chagua moja " + }, + "relevance": { + "step1:enrolled_to_prep": { + "type": "string", + "ex": "notEqualTo(., \"true\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_screening_female.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_screening_female.json new file mode 100644 index 000000000..1c49a22d6 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_screening_female.json @@ -0,0 +1,1087 @@ +{ + "count": "9", + "skip_blank_steps": false, + "encounter_type": "KVP Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Watumiaji wa Dawa Za Kulevya kwa Njia Nyengine", + "next": "step2", + "fields": [ + { + "key": "drug_use", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_use", + "label": "Umewahi kutumia Dawa za kulevya ndani ya miezi 12 iliyopita?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + } + }, + { + "key": "is_pwud", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_pwud", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_calculation.yml" + } + } + } + } + ] + }, + "step2": { + "title": "Wakujidunga", + "next": "step3", + "fields": [ + { + "key": "drug_injection", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_injection", + "label": "Umewahi kujidunga sindano za dawa ya kulevya?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "is_pwid", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_pwid", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_calculation.yml" + } + } + } + } + ] + }, + "step3": { + "title": "Tabia ya Ngono", + "next": "step4", + "fields": [ + { + "key": "sexual_intercourse", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_intercourse", + "label": "Umewahi kushiriki tendo la ngono", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + } + } + ] + }, + "step4": { + "title": "Mwenza Mwenye Majibu Kinzani", + "next": "step5", + "fields": [ + { + "key": "hiv_status_on_screening", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_status_on_screening", + "label": "Hali yako ya maambukizi ya VVU yakoje?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi ", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "unknown", + "text": "haijulikani", + "openmrs_entity": "concept", + "openmrs_entity_id": "unknown" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "hiv_positive_partner", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_positive_partner", + "label": "Je upo kwenye mahusiano ya kingono na mwenza mwenye VVU", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "partner_hiv_care_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_hiv_care_status", + "label": " Chunguza vigezo vifuatavyo vya mwenza wake", + "text_color": "#000000", + "type": "check_box", + "options": [ + { + "key": "not_started_art", + "text": "Hajaanza dawa za ART", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_started_art" + }, + { + "key": "art_more_than_six_months_unused", + "text": "Hajatumia dawa za ART zaidi ya miezi 6", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "art_more_than_six_months_unused" + }, + { + "key": "art_adherence_doubt", + "text": "Ana mashaka juu ya ufuasi au matumizi ya dawa za ART", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "art_adherence_doubt" + }, + { + "key": "no_evidence_low_vl", + "text": "Mwenza hana ushahidi juu kufubaza VVU", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_evidence_low_vl" + } + ], + "relevance": { + "step4:hiv_positive_partner": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "prompt_counsel_for_testing", + "type": "toaster_notes", + "text": "Mshauri mteja juu ya upimaji wa VVU", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step4:hiv_status": { + "type": "string", + "ex": "equalTo(., \"unknown\")" + } + } + }, + { + "key": "is_sdc", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_sdc", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_calculation.yml" + } + } + } + } + ] + }, + "step5": { + "title": "Mwanamke Anayefanya Biashara ya Ngono", + "next": "step6", + "fields": [ + { + "key": "sex_for_money", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sex_for_money", + "label": "Ndani ya miezi 6 iliyopita, umewahi kufanya ngono ili upate vitu, fedha au upendeleo? ", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "main_income_source_is_sex", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "main_income_source_is_sex", + "label": "Je biashara ya ngono Ndiyo njia kuu ya kupata kipato?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio ", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + }, + "relevance": { + "step5:sex_for_money": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "is_fsw", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_fsw", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_calculation.yml" + } + } + } + } + ] + }, + "step6": { + "title": "Msichana Rika ya Balehe", + "next": "step7", + "fields": [ + { + "key": "client_in_school", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_in_school", + "label": " Je, kwa sasa upo shule?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "harsh_condition_impact", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "harsh_condition_impact", + "type": "check_box", + "label": "Athari na mazingira magumu", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "not_applicable" + ], + "options": [ + { + "key": "sex_for_material", + "text": "Ndani ya miezi 6 iliyopita, amewahi kufanya ngono ili upate vitu au fedha.", + "openmrs_entity": "concept", + "openmrs_entity_id": "sex_for_material" + }, + { + "key": "sexually_abused", + "text": "Ana mahusiano ya kingono na mjidunga", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexually_abused" + }, + { + "key": "sex_last_three_months", + "text": "Mhanga anayeendelea kutendewa ukatili wa kingono", + "openmrs_entity": "concept", + "openmrs_entity_id": "sex_last_three_months" + }, + { + "key": "infected_with_sexual_disease", + "text": "Amepata maambukizi ya magonjwa ya ngono ndani ya miezi 3", + "openmrs_entity": "concept", + "openmrs_entity_id": "infected_with_sexual_disease" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + }, + "relevance": { + "step6:client_in_school": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "is_agyw", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_agyw", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_calculation.yml" + } + } + } + } + ] + }, + "step7": { + "title": "Makundi Mengine Hatarishi", + "next": "step8", + "fields": [ + { + "key": "prisoner_or_rumandee", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoner_or_rumandee", + "label": "Je mteja ni mfungwa au mahabusu?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "prisoner", + "text": "Mfungwa", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoner" + }, + { + "key": "rumandee", + "text": "Mahabusu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rumandee" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + } + }, + { + "key": "mobile_population", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mobile_population", + "label": "Makundi ya wanaohamahama", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "long_distance_drivers", + "text": "Madereva wa masafa marefu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "long_distance_drivers" + }, + { + "key": "fishermen", + "text": "Wavuvi", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fishermen" + }, + { + "key": "mining_workers", + "text": "Wafanyakazi migodini", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mining_workers" + }, + { + "key": "large_farm_farmers", + "text": "Wakulima wa mashamba makubwa", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "large_farm_farmers" + }, + { + "key": "road_builders", + "text": "Wajenzi wa barabara", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "road_builders" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + } + }, + { + "key": "other_groups_at_risk", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_groups_at_risk", + "label": "Makundi mengine yaliyo katika hatari ya maambukizi ya VVU.", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "disabled", + "text": "Walemavu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabled" + }, + { + "key": "street_children_or_orphans", + "text": "Watoto wa mitaani au yatima", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "street_children_or_orphans" + }, + { + "key": "street_working_children", + "text": "Watoto wadogo wanaofanya kazi mitaani", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "street_working_children" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + } + }, + { + "key": "is_ovp_kvp", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_ovp_kvp", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_calculation.yml" + } + } + } + } + ] + }, + "step8": { + "title": "Tathmini ya Dawa Kinga", + "next": "step9", + "fields": [ + { + "key": "should_enroll", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "should_enroll", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_calculation.yml" + } + } + } + }, + { + "key": "prep_assessment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_assessment", + "label": "Mteja amekwisha fanyiwa tathmini ya matumizi ya dawa kinga?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "prep_qualified", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_qualified", + "label": "Je, mteja anastahili kuanzishiwa dawa kinga?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + }, + "relevance": { + "step8:prep_assessment": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + }, + "step9": { + "title": "Uandikishaji wa Makundi Maalum", + "fields": [ + { + "key": "prompt_for_sdc_kvp", + "type": "toaster_notes", + "text": "Mteja huyu ni Mwenzi mwenye majibu kinzani, mteja anatakiwa kuandikishwa kwenye huduma rafiki za makundi maalum", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_agyw_kvp", + "type": "toaster_notes", + "text": "Mteja huyu ni Msichana rika balehe na mwanamke kijana, mteja anatakiwa kuandikishwa kwenye huduma rafiki za makundi maalum", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_ovp_kvp", + "type": "toaster_notes", + "text": "Mteja huyu ni Makundi mengine, Mteja anatakiwa kuandikishwa kwenye huduma rafiki za makundi maalum", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_fsw_kvp", + "type": "toaster_notes", + "text": "Mteja huyu ni Mwanamke anayefanya biashara ya ngono, mteja anatakiwa kuandikishwa kwenye huduma rafiki za makundi mahalumu", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_pwud_kvp", + "type": "toaster_notes", + "text": "Mteja huyu ni Mtumiaji wa dawa za kulevya kwa njia nyingine, Mteja anatakiwa kuandikishwa kwenye huduma rafiki za makundi maalum", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_pwid_kvp", + "type": "toaster_notes", + "text": "Mteja huyu ni Mjidunga dawa za kulevya, Mteja anatakiwa kuandikishwa kwenye huduma rafiki za makundi maalum", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "prompt_no_group", + "type": "toaster_notes", + "text": "Mteja huyu anguki kwenye kundi lolote la wateja wa kundi malumu, Usimsajilimteja kwenye kuni maalum", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "birth_region", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "birth_region", + "openmrs_data_type": "select one", + "type": "spinner", + "label_info_title": "Mkoa aliozaliwa mteja", + "label_info_text": "", + "hint": "Chagua mkoa aliozaliwa mteja", + "values": [ + "Arusha", + "Dar es Salaam", + "Dodoma", + "Geita", + "Iringa", + "Kagera", + "Katavi", + "Kigoma", + "Kilimanjaro", + "Lindi", + "Manyara", + "Mara", + "Mbeya", + "Morogoro", + "Mtwara", + "Mwanza", + "Njombe", + "Pwani", + "Rukwa", + "Ruvuma", + "Shinyanga", + "Simiyu", + "Singida", + "Songwe", + "Tabora", + "Tanga" + ], + "keys": [ + "Arusha", + "Dar es Salaam", + "Dodoma", + "Geita", + "Iringa", + "Kagera", + "Katavi", + "Kigoma", + "Kilimanjaro", + "Lindi", + "Manyara", + "Mara", + "Mbeya", + "Morogoro", + "Mtwara", + "Mwanza", + "Njombe", + "Pwani", + "Rukwa", + "Ruvuma", + "Shinyanga", + "Simiyu", + "Singida", + "Songwe", + "Tabora", + "Tanga" + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mkoa" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "enrollment_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "enrollment_date", + "type": "date_picker", + "hint": "Tarehe ya usajili", + "expanded": false, + "min_date": "today-1m", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "client_group", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_group", + "label": "chagua kundi la mteja kutokana na uchunguzi wa mtoa huduma", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "fsw", + "text": "Mwanamke anayefanya biashara ya ngono ", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fsw" + }, + { + "key": "pwud", + "text": "Mtumiaji wa dawa za kulevya kwa njia nyingine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwud" + }, + { + "key": "pwid", + "text": "Mjidunga dawa za kulevya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwid" + }, + { + "key": "prisoner", + "text": "Mfungwa", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoner" + }, + { + "key": "rumandee", + "text": "Mahabusu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rumandee" + }, + { + "key": "agyw", + "text": "Msichana rika balehe na mwanamke kijana ", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "agyw" + }, + { + "key": "serodiscordant_couple", + "text": "Mwenzi mwenye majibu kinzani", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "serodiscordant_couple" + }, + { + "key": "mobile_population", + "text": "Makundi ya watu wanaohamahama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mobile_population" + }, + { + "key": "other_vulnerable_population", + "text": "Makundi mengine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_vulnerable_population" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_screening_male.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_screening_male.json new file mode 100644 index 000000000..068e02cc9 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_screening_male.json @@ -0,0 +1,924 @@ +{ + "count": "8", + "skip_blank_steps": false, + "encounter_type": "KVP Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "PWUD", + "next": "step2", + "fields": [ + { + "key": "drug_use", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_use", + "label": "Umewahi kutumia Dawa za kulevya ndani ya miezi 12 iliyopita?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la swali" + } + }, + { + "key": "is_pwud", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_pwud", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_calculation.yml" + } + } + } + } + ] + }, + "step2": { + "title": "PWID", + "next": "step3", + "fields": [ + { + "key": "drug_injection", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_injection", + "label": "Umewahi kujidunga sindano za dawa ya kulevya?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la swali" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "is_pwid", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_pwid", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_calculation.yml" + } + } + } + } + ] + }, + "step3": { + "title": "Sexual Behavior", + "next": "step4", + "fields": [ + { + "key": "sexual_intercourse", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_intercourse", + "label": "Umewahi kushiriki tendo la ngono", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la swali" + } + } + ] + }, + "step4": { + "title": "Mwanaume Anayefanya Ngono na Mwanaume Mwenzie", + "next": "step5", + "fields": [ + { + "key": "sexual_intercourse_with", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_intercourse_with", + "label": "Je, unashiriki ngono na Mwanaume, Mwanamke au Wote?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "man", + "text": "Mwanaume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "man" + }, + { + "key": "woman", + "text": "Mwanamke", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "woman" + }, + { + "key": "both", + "text": "wote", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "both" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la swali" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "is_msm", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_msm", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_calculation.yml" + } + } + } + } + ] + }, + "step5": { + "title": "Serodiscordant Couple", + "next": "step6", + "fields": [ + { + "key": "hiv_status_on_screening", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_status_on_screening", + "label": "Hali yako ya maambukizi ya VVU yakoje?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "unknown", + "text": "haijulikani", + "openmrs_entity": "concept", + "openmrs_entity_id": "unknown" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la swali" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "hiv_positive_partner", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_positive_partner", + "label": "Je upo kwenye mahusiano ya kingono na mwenza mwenye VVU", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la swali" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "partner_hiv_care_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_hiv_care_status", + "label": " chunguza vigezo vifuatavyo vya mwenza wake", + "text_color": "#000000", + "type": "check_box", + "options": [ + { + "key": "not_started_art", + "text": "Hajaanza dawa za ART ", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_started_art" + }, + { + "key": "art_more_than_six_months_unused", + "text": "Hajatumia dawa za ART zaidi ya miezi 6 ", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "art_more_than_six_months_unused" + }, + { + "key": "art_adherence_doubt", + "text": "Ana mashaka juu ya ufuasi au matumizi ya dawa za ART", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "art_adherence_doubt" + }, + { + "key": "no_evidence_low_vl", + "text": "Mwenza hana ushahidi juu kufubaza VVU", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_evidence_low_vl" + } + ], + "relevance": { + "step5:hiv_positive_partner": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "prompt_counsel_for_testing", + "type": "toaster_notes", + "text": "Mshauri mteja kuhusu upimaji wa VVU", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step5:hiv_status": { + "type": "string", + "ex": "equalTo(., \"unknown\")" + } + } + }, + { + "key": "is_sdc", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_sdc", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_calculation.yml" + } + } + } + } + ] + }, + "step6": { + "title": "Makundi Mengine Hatarishi", + "next": "step7", + "fields": [ + { + "key": "prisoner_or_rumandee", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoner_or_rumandee", + "label": "Je mteja ni mfungwa au mahabusu?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "prisoner", + "text": "Mfungwa", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoner" + }, + { + "key": "rumandee", + "text": "Mahabusu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rumandee" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la swali" + } + }, + { + "key": "mobile_population", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mobile_population", + "label": "Makundi ya wanaohamahama ", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "long_distance_drivers", + "text": "Madereva wa masafa marefu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "long_distance_drivers" + }, + { + "key": "fishermen", + "text": "Wavuvi", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fishermen" + }, + { + "key": "mining_workers", + "text": "Wafanyakazi migodini ", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mining_workers" + }, + { + "key": "large_farm_farmers", + "text": "Wakulima wa mashamba makubwa ", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "large_farm_farmers" + }, + { + "key": "road_builders", + "text": "Wajenzi wa barabara ", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "road_builders" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la swali" + } + }, + { + "key": "other_groups_at_risk", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_groups_at_risk", + "label": "Makundi mengine yaliyo katika hatari ya maambukizi ya VVU", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "disabled", + "text": "Walemavu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabled" + }, + { + "key": "street_children_or_orphans", + "text": "Watoto wa mitaani au yatima", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "street_children_or_orphans" + }, + { + "key": "street_working_children", + "text": "Watoto wadogo wanaofanya kazi mitaani", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "street_working_children" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la swali" + } + }, + { + "key": "is_ovp_kvp", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_ovp_kvp", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_calculation.yml" + } + } + } + } + ] + }, + "step7": { + "title": "Tathmini ya Dawa Kinga", + "next": "step8", + "fields": [ + { + "key": "should_enroll", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "should_enroll", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_calculation.yml" + } + } + } + }, + { + "key": "prep_assessment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_assessment", + "label": "Mteja amekwisha fanyiwa tathmini ya matumizi ya dawa kinga?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "prep_qualified", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_qualified", + "label": "Je, mteja anastahili kuanzishiwa dawa kinga?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la swali" + }, + "relevance": { + "step7:prep_assessment": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + }, + "step8": { + "title": "Uandikishaji wa Makundi Maalum", + "fields": [ + { + "key": "prompt_for_sdc_kvp", + "type": "toaster_notes", + "text": "Mteja huyu ni Mwenzi mwenye majibu kinzani, mteja anatakiwa kuandikishwa kwenye huduma rafiki za makundi maalum ", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_msm_kvp", + "type": "toaster_notes", + "text": "Mteja huyu ni Mwanaume anayefanya ngono na mwanaume mwenzie, Mteja anatakiwa kuandikishwa kwenye huduma rafiki za makundi maalum ", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_pwud_kvp", + "type": "toaster_notes", + "text": "Mteja huyu ni Mtumiaji wa dawa za kulevya kwa njia nyingine, Mteja anatakiwa kuandikishwa kwenye huduma rafiki za makundi maalum ", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_pwid_kvp", + "type": "toaster_notes", + "text": "Mteja huyu ni Mjidunga dawa za kulevya, Mteja anatakiwa kuandikishwa kwenye huduma rafiki za makundi maalum ", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "prompt_no_group", + "type": "toaster_notes", + "text": "Mteja huyu anguki kwenye kundi lolote la wateja wa kundi malumu, Usimsajilimteja kwenye kuni maalum", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_ovp_kvp", + "type": "toaster_notes", + "text": "Mteja huyu ni Makundi mengine, Mteja anatakiwa kuandikishwa kwenye huduma rafiki za makundi maalum ", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "birth_region", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "birth_region", + "openmrs_data_type": "select one", + "type": "spinner", + "label_info_title": "Mkoa aliozaliwa mteja", + "label_info_text": "", + "hint": "Chagua mkoa aliozaliwa mteja", + "values": [ + "Arusha", + "Dar es Salaam", + "Dodoma", + "Geita", + "Iringa", + "Kagera", + "Katavi", + "Kigoma", + "Kilimanjaro", + "Lindi", + "Manyara", + "Mara", + "Mbeya", + "Morogoro", + "Mtwara", + "Mwanza", + "Njombe", + "Pwani", + "Rukwa", + "Ruvuma", + "Shinyanga", + "Simiyu", + "Singida", + "Songwe", + "Tabora", + "Tanga" + ], + "keys": [ + "Arusha", + "Dar es Salaam", + "Dodoma", + "Geita", + "Iringa", + "Kagera", + "Katavi", + "Kigoma", + "Kilimanjaro", + "Lindi", + "Manyara", + "Mara", + "Mbeya", + "Morogoro", + "Mtwara", + "Mwanza", + "Njombe", + "Pwani", + "Rukwa", + "Ruvuma", + "Shinyanga", + "Simiyu", + "Singida", + "Songwe", + "Tabora", + "Tanga" + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mkoa" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "enrollment_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "enrollment_date", + "type": "date_picker", + "hint": "Tarehe ya kuandikishwa", + "expanded": false, + "min_date": "today-1m", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "client_group", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_group", + "label": "Select the client group as screened by the health care provider", + "text_color": "#000000", + "type": "radio_group", + "options": [ + { + "key": "msm", + "text": "High Risk Men", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "msm" + }, + { + "key": "pwud", + "text": "PWUD", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwud" + }, + { + "key": "pwid", + "text": "PWID", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwid" + }, + { + "key": "prisoner", + "text": "Prisoners", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoner" + }, + { + "key": "rumandee", + "text": "Rumandee", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rumandee" + }, + { + "key": "serodiscordant_couple", + "text": "Mwenza /mwenye majibu kinzani", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "serodiscordant_couple" + }, + { + "key": "mobile_population", + "text": "Mobile population", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mobile_population" + }, + { + "key": "other_vulnerable_population", + "text": "Other vulnerable population", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_vulnerable_population" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jaza jibu la maswali" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_sti_screening.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_sti_screening.json new file mode 100644 index 000000000..54c615478 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_sti_screening.json @@ -0,0 +1,135 @@ +{ + "count": "1", + "encounter_type": "KVP STI", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Uchunguzi wa Magonjwa ya Ngono", + "fields": [ + { + "key": "sti_screening", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sti_screening", + "type": "native_radio", + "label": "Kuchunguzwa magonjwa ya Ngono", + "options": [ + { + "key": "positive", + "text": "chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "screening_not_conducted", + "text": "Hajachunguzwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "screening_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "treatment_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "treatment_provided", + "type": "native_radio", + "label": "Ametibiwa magonjwa ya ngono (kama alipata)", + "options": [ + { + "key": "treated", + "text": "Ametibiwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "treated" + }, + { + "key": "referral", + "text": "Amepewa rufaa", + "openmrs_entity": "concept", + "openmrs_entity_id": "referral" + }, + { + "key": "not_treated", + "text": "Haihusiki", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_treated" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "step1:sti_screening": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "prompt_for_further_management", + "type": "toaster_notes", + "text": "Mpe refa kwa huduma zaidi", + "openmrs_entity_id": "prompt_for_further_management", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:treatment_provided": { + "type": "string", + "ex": "equalTo(., \"not_treated\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_tb_investigation.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_tb_investigation.json new file mode 100644 index 000000000..2e4a2c47e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_tb_investigation.json @@ -0,0 +1,97 @@ +{ + "count": "1", + "encounter_type": "KVP TB Investigation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Uchunguzi wa Kifua Kikuu", + "fields": [ + { + "key": "tb_screening", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tb_screening", + "type": "native_radio", + "label": "Mteja amefanyiwa uchunguzi wa kifua kikuu", + "options": [ + { + "key": "presumptive", + "text": "Ana dalili ", + "openmrs_entity": "concept", + "openmrs_entity_id": "presumptive" + }, + { + "key": "not_presumptive", + "text": "Hana dalili", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_presumptive" + }, + { + "key": "not_screened", + "text": "Hajachunguzwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_screened" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "prompt_for_tb_investigation", + "type": "toaster_notes", + "text": "Mpatie mteja rufa kwa ajili ya kipimo cha kifua kikuu", + "openmrs_entity_id": "prompt_for_Tachycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:tb_screening": { + "type": "string", + "ex": "equalTo(., \"presumptive\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_vmmc_services.json b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_vmmc_services.json new file mode 100644 index 000000000..22f505596 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/kvp_vmmc_services.json @@ -0,0 +1,88 @@ +{ + "count": "1", + "encounter_type": "KVP VMMC", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Huduma za Tohara", + "fields": [ + { + "key": "vmcc_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "vmcc_provided", + "type": "native_radio", + "label": "Je, mteja alipewa huduma za Tohara?", + "options": [ + { + "key": "provided", + "text": "Alipewa", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided" + }, + { + "key": "not_provided", + "text": "Hakupewa", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_provided" + }, + { + "key": "referred", + "text": "Amepewa rufaa", + "openmrs_entity": "concept", + "openmrs_entity_id": "referred" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/malaria_confirmation.json b/opensrp-chw-hf/src/main/assets/json.form-sw/malaria_confirmation.json index 7e9efb2c6..da0bae284 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/malaria_confirmation.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/malaria_confirmation.json @@ -1,6 +1,4 @@ { - "validate_on_submit": true, - "show_errors_on_submit": false, "count": "2", "encounter_type": "Malaria Confirmation", "entity_id": "", @@ -54,7 +52,7 @@ } }, "step1": { - "title": "Uhakiki wa Malaria", + "title": "Malaria Confirmation", "next": "step2", "fields": [ { @@ -77,14 +75,10 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fever_malaria_chw", "type": "spinner", - "hint": "Je, mteja ana homa au aligunduliwa kuwa na malaria ndani ya siku 14 katika kituo cha afya?", + "hint": "Je, mtu huyu ana homa au alipima malaria katika siku 14 zilizopita kwenye kituo cha afya?", "values": [ "Ana homa", - "Alikuwa na malaria ndani ya siku 14" - ], - "keys": [ - "Has a fever", - "Tested positive for malaria in the last 14 days at a health facility" + "Alipimwa na kuwa na malaria katika siku 14 zilizopita katika kituo cha afya" ], "v_required": { "value": "true", @@ -101,14 +95,10 @@ "openmrs_entity": "concept", "openmrs_entity_id": "1731AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "spinner", - "hint": "Umekuwa na homa kwa muda gani?", + "hint": "Muda wa homa?", "values": [ - "Ndani ya saa 24", - "Zaidi ya saa 24" - ], - "keys": [ - "Less than 24 hrs", - "More than 24 hrs" + "Chini ya masaa 24", + "Zaidi ya masaa 24" ], "openmrs_choice_ids": { "Less than 24 hrs": "164449AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", @@ -132,16 +122,11 @@ "openmrs_entity": "concept", "openmrs_entity_id": "1643AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "spinner", - "hint": "Majibu ya mRDT", + "hint": "Matokeo ya mRDT", "values": [ "Chanya", "Hasi", - "Kipimo hakijafanyika" - ], - "keys": [ - "Positive", - "Negative", - "Not done" + "Haijafanyika" ], "openmrs_choice_ids": { "Positive": "703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", @@ -166,12 +151,12 @@ "openmrs_entity": "concept", "openmrs_entity_id": "date_hf_malaria_test", "type": "date_picker", - "hint": "Tarehe ya kipimo cha malaria katika kituo cha afya", + "hint": "Tarehe ya kufanyika kwa kipimo cha malaria katika kituo cha afya", "expanded": false, "max_date": "today", "v_required": { "value": "true", - "err": "Tafadhali ingiza tarehe ya majaribio ya ugonjwa wa malaria katika kituo cha afya" + "err": "Tafahdali ingiza tarehe ya kufanyika kwa kipimo cha malaria katika kituo cha afya" }, "relevance": { "rules-engine": { @@ -215,23 +200,15 @@ "openmrs_entity": "concept", "openmrs_entity_id": "malaria_treat", "type": "spinner", - "hint": "Matibabu aliyopewa", + "hint": "Matibabu yaliyotolewa", "values": [ "ALU 6", "ALU 12", "ALU 18", "ALU 24", - "Hajapewa", + "Hayakutolewa", "Matibabu mengine" ], - "keys": [ - "ALU 6", - "ALU 12", - "ALU 18", - "ALU 24", - "Not given", - "Other treatment" - ], "openmrs_choice_ids": { "ALU 6": "1072AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "ALU 12": "1072AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", @@ -255,7 +232,7 @@ ] }, "step2": { - "title": "Kuzuia Malaria", + "title": "Malaria Prevention", "fields": [ { "key": "fam_llin", @@ -263,22 +240,18 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fam_llin", "type": "spinner", - "hint": "Ana chandarua chenye viuwatilifu?", + "hint": "Je, una chandarua chenye dawa inayodumu kwa muda mrefu (LLIN)?", "values": [ "Ndiyo", "Hapana" ], - "keys": [ - "Yes", - "No" - ], "openmrs_choice_ids": { "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, "v_required": { "value": "true", - "err": "Tafadhali chagua chaguo moja" + "err": "Tafadhali chagua chaguzi moja" } }, { @@ -287,22 +260,18 @@ "openmrs_entity": "concept", "openmrs_entity_id": "llin_2days", "type": "spinner", - "hint": "Je, amelala kwenye chandarua chenye viuwatilifu usiku uliopita?", + "hint": "Je, ulilala chini ya chandarua (LLIN) jana usiku?", "values": [ "Ndiyo", "Hapana" ], - "keys": [ - "Yes", - "No" - ], "openmrs_choice_ids": { "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, "v_required": { "value": "true", - "err": "Tafadhali chagua chaguo moja" + "err": "Tafadhali chagua chaguzi moja" }, "relevance": { "rules-engine": { @@ -318,14 +287,10 @@ "openmrs_entity": "concept", "openmrs_entity_id": "llin_condition", "type": "spinner", - "hint": "Hali ya chandarua chenye viuwatilifu kinachotumika", + "hint": "Hali ya chandarua (LLIN)", "values": [ - "Nzima", - "Mbovu" - ], - "keys": [ - "Okay", - "Bad" + "Nzuri", + "Mbaya" ], "openmrs_choice_ids": { "Okay": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", @@ -333,7 +298,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali chagua chaguo moja" + "err": "Tafadhali chagua chaguzi moja" }, "relevance": { "rules-engine": { @@ -349,22 +314,14 @@ "openmrs_entity": "concept", "openmrs_entity_id": "1379AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "spinner", - "hint": "Mada juu ya ugonjwa wa malaria zilizofundishwa", + "hint": "Mada za malaria zilizojadiliwa", "values": [ - "Muktasari kuhusu ugonjwa wa malaria", - "Kuzuia malaria", - "Malaria isiyokali", - "Malaria kali", - "Malaria kwa mama mjamzito", - "Hajafanya" - ], - "keys": [ - "Overview on malaria", - "Malaria prevention", - "Uncomplicated malaria", - "Severe malaria", - "Malaria in pregnancy", - "None" + "Muhtasari wa ugonjwa wa malaria", + "Kuzuia Malaria", + "Malaria isiyo ngumu", + "Ml\\alaria kali", + "Malaria wakati wa ujauzito", + "Hakuna" ], "openmrs_choice_ids": { "Overview on malaria": "116128AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", @@ -376,7 +333,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali chagua chaguo moja" + "err": "Tafadhali chagua chaguzi moja" } } ] diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/malaria_follow_up_hf.json b/opensrp-chw-hf/src/main/assets/json.form-sw/malaria_follow_up_hf.json index 524f7786b..304106537 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/malaria_follow_up_hf.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/malaria_follow_up_hf.json @@ -80,7 +80,7 @@ "hint": "Uzito (kg)", "v_required": { "value": "true", - "err": "Tafadhali ingiza uzito (kg)" + "err": "Tafhadhali ingiza uzito" } }, { @@ -93,7 +93,7 @@ "hint": "Urefu (cm)", "v_required": { "value": "true", - "err": "Tafadhali ingiza urefu (cm)" + "err": "Tafadhali ingiza urefu" } }, { @@ -113,19 +113,19 @@ { "key": "mRDT_not_done", "openmrs_choice_id": "", - "text": "Kipimo cha mRDT hakitakiwi kufanyika", + "text": "mRDT haijafanyika", "value": false }, { "key": "Other_tests", "openmrs_choice_id": "", - "text": "Vipimo vingine", + "text": "Vpipimo vingine", "value": false } ], "v_required": { "value": "true", - "err": "Tafadhali onesha vipimo vilivyoamuru" + "err": "Tafadhali onyesha vipimo vilivyoagizwa" } }, { @@ -134,19 +134,19 @@ "openmrs_entity": "", "openmrs_entity_id": "no_mrdt_malaria_hf", "openmrs_entity_parent": "", - "label": "Sababu ya kutofanyika kipimo cha mRDT", + "label": "Sababu ya kipimo cha mRDT kutofanyika", "combine_checkbox_option_values": "true", "options": [ { "key": "stock_out", "openmrs_choice_id": "", - "text": "Ukosefu wa vitendanishi", + "text": "Vifaa vimeisha", "value": false }, { "key": "mRDT_done_within_14_days", "openmrs_choice_id": "", - "text": "Kipimo cha mRDT kimefanyika ndani ya siku 14", + "text": "mRDT imefanyika ndani ya siku 14", "value": false } ], @@ -159,7 +159,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali chagua sababu ya mRDT haijafanywa" + "err": "Tafadhali chagua sababu ya kutofanya kipimo cha mRDT" } }, { @@ -169,7 +169,7 @@ "openmrs_entity_id": "other_test_malaria_hf", "openmrs_entity_parent": "", "edit_type": "name", - "hint": "Taja vipimo vingine vilivyoagizwa", + "hint": "Vipimo vingu=ine vilivyoombwa", "relevance": { "rules-engine": { "ex-rules": { @@ -179,7 +179,7 @@ }, "v_required": { "value": false, - "err": "Tafadhali ingiza majaribio mengine yaliyoombewa" + "err": "Tafadhali ingiza vipimo vingine vilivyoombwa" } }, { @@ -188,7 +188,7 @@ "openmrs_entity": "", "openmrs_entity_id": "test_results_malaria_hf", "openmrs_entity_parent": "", - "label": "Matokeo ya vipimo", + "label": "Matokeo ya kipimo", "options": [ { "key": "mRDT_positive", @@ -199,31 +199,31 @@ { "key": "mRDT_negative", "openmrs_choice_id": "", - "text": "mRDT hasi", + "text": "mRDT hasi ", "value": false }, { "key": "Malaria_parasite_seen", "openmrs_choice_id": "", - "text": "Kuna vimelea vya malaria", + "text": "Kijidudu cha Malaria kimeonekana", "value": false }, { "key": "No_malaria_parasite_seen", "openmrs_choice_id": "", - "text": "Hakuna vimelea vya malaria", + "text": "Kijidudu cha Malaria hakionekani", "value": false }, { "key": "Other_test_results", "openmrs_choice_id": "", - "text": "Matokeo ya vipimo vingines", + "text": "Matokeo mengine ya kipimo", "value": false } ], "v_required": { "value": "true", - "err": "Tafadhali chagua matokeo ya jaribio" + "err": "Tafadhali ingiza matokeo ya kipimo" } }, { @@ -233,7 +233,7 @@ "openmrs_entity_id": "other_test_results_malaria_hf", "openmrs_entity_parent": "", "edit_type": "name", - "hint": "Matokeo ya vipimo vingine", + "hint": "Matokeo mengine ya kipimo", "relevance": { "rules-engine": { "ex-rules": { @@ -243,7 +243,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali ingiza matokeo mengine" + "err": "Tafadhali ingiza matokeo megine ya kipimo" } }, { @@ -252,13 +252,13 @@ "openmrs_entity": "", "openmrs_entity_id": "diagnosis_malaria_hf", "openmrs_entity_parent": "", - "label": "Diagnosis", + "label": "Utambuzi", "combine_checkbox_option_values": "true", "options": [ { "key": "Uncomplicated_malaria", "openmrs_choice_id": "", - "text": "Malaria isiyo kali", + "text": "Malaria isiyo ngumu", "value": false }, { @@ -270,13 +270,13 @@ { "key": "Other_diagnosis", "openmrs_choice_id": "", - "text": "Diagnosis nyingine", + "text": "Utambuzi mwingine", "value": false } ], "v_required": { "value": "true", - "err": "Tafadhali chagua utambuzi" + "err": "Tafadhali ingiza utambuzi" } }, { @@ -286,7 +286,7 @@ "openmrs_entity_id": "other_diagnosis_malaria_hf", "openmrs_entity_parent": "", "edit_type": "name", - "hint": "Diagnosis nyingine", + "hint": "Utambuzi mwingine", "relevance": { "rules-engine": { "ex-rules": { @@ -296,7 +296,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali ingiza diagnosis nyingine" + "err": "Tafadhali ingiza utambuzi mwingine" } }, { @@ -306,30 +306,30 @@ "openmrs_entity_id": "treat_malaria_hf", "openmrs_entity_parent": "", "combine_checkbox_option_values": "true", - "label": "Matibabu aliyoandikiwa", + "label": "Matibabu yaliyotolewa", "options": [ { "key": "ALU_1_x_6_strips", "openmrs_choice_id": "", - "text": "ALU ya 1 x 6", + "text": "Vipande vya ALU 1 x ", "value": false }, { "key": "ALU_2_x_6_strips", "openmrs_choice_id": "", - "text": "ALU ya 2 x 6", + "text": "Vipande vya ALU 2 x 6", "value": false }, { "key": "ALU_3_x_6_strips", "openmrs_choice_id": "", - "text": "ALU ya 3 x 6", + "text": "Vipandde vya ALU 3 x 6", "value": false }, { "key": "ALU_4_x_6_strips", "openmrs_choice_id": "", - "text": "ALU ya 4 x 6", + "text": "Vipande vya ALU 4 x 6", "value": false }, { @@ -341,13 +341,13 @@ { "key": "Paracetamol", "openmrs_choice_id": "", - "text": "Panadol (Dawa ya kupunguza maumivu)", + "text": "Paracetamol", "value": false }, { "key": "Other_drugs", "openmrs_choice_id": "NA", - "text": "Dawa nyingine", + "text": "Dawa zingine", "value": false } ], @@ -360,7 +360,7 @@ }, "v_required": { "value": "true", - "err": "Tafadhali ingiza matibabu iliyowekwa" + "err": "Tafadhali ingiza matibabu yaliyotolewa" } }, { @@ -370,7 +370,7 @@ "openmrs_entity_id": "treat_other_malaria_hf", "openmrs_entity_parent": "", "edit_type": "name", - "hint": "Taja dawa nyingine zilizotolewa", + "hint": "Taja dawa zingine zilizotolewa", "relevance": { "rules-engine": { "ex-rules": { @@ -380,7 +380,7 @@ }, "v_required": { "value": "true", - "err": "Taja dawa nyingine zilizotolewa" + "err": "Tafadhali ingiza dawa zingine" } }, { @@ -396,7 +396,7 @@ "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "", - "text": "Rufaa" + "text": "Amepewa rufaa" }, { "key": "Admitted", @@ -410,14 +410,14 @@ "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "", - "text": "Kifo" + "text": "Amefariki" }, { "key": "Discharge", "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "", - "text": "Ameruhusiwa" + "text": "Ametolewa" } ], "v_required": { @@ -435,7 +435,7 @@ "hint": "Maoni", "v_required": { "value": "false", - "err": null + "err": "Hamna" } }, { @@ -444,70 +444,70 @@ "openmrs_entity": "", "openmrs_entity_id": "hcp_attending", "openmrs_entity_parent": "", - "label": "Kada ya mtoa huduma kwa mteja", + "label": "Wadhifa wa mtoa huduma wa afya anamhudumia mteja", "options": [ { "key": "Medical_Doctor_MD", "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "", - "text": "Medical Doctor (MD)" + "text": "Daktari wa Tiba (MD)" }, { "key": "Assistant_Medical_Doctor_AMO", "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "", - "text": "Assistant Medical Doctor (AMO)" + "text": "Daktari Msaidizi wa Tiba (AMO)" }, { "key": "Clinical_Officer_CO", "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "", - "text": "Clinical Officer (CO)" + "text": "Afisa wa Kliniki (CO)" }, { "key": "Assistance_Clincal_Officer_ACO", "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "", - "text": "Assistance Clincal Officer (ACO)" + "text": "Afisa Msaidizi wa Kliniki (ACO)" }, { "key": "Nursing_Officer_NO", "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "", - "text": "Nursing Officer (NO)" + "text": "Afisa Muuguzi (NO)" }, { "key": "Assistant_Nursing_officer_ANO", "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "", - "text": "Assistant Nursing officer (ANO)" + "text": "Afisa Muuguzi Msaidizi" }, { "key": "Enrolled_Nurse_EN", "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "", - "text": "Enrolled Nurse (EN)" + "text": "Muuguzi aliyeanzikishwa (EN)" }, { "key": "Medical_Attendant_MAT", "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "", - "text": "Medical Attendant (MAT)" + "text": "Mhudumu wa matibabu (MAT)" } ], "v_required": { "value": "true", - "err": "Tafadhali chagua kichwa cha kuhudhuria" + "err": "Tafadhali chagua wadhifa wa mtoa huduma wa afya anayehudumia" } } ] } -} +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/malaria_follow_up_visit.json b/opensrp-chw-hf/src/main/assets/json.form-sw/malaria_follow_up_visit.json index e0f2b312b..42251ff69 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/malaria_follow_up_visit.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/malaria_follow_up_visit.json @@ -62,7 +62,7 @@ "openmrs_entity": "", "openmrs_entity_id": "1889AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Je, ulienda hospitali kwa ajili ya kipimo na matibabu ya malaria?", + "label": "Je, ulipokea rufaa au ulienda hospitali kwa matibabu ya malaria?", "options": [ { "key": "Yes", @@ -81,7 +81,7 @@ ], "v_required": { "value": "true", - "err": null + "err": "null" } }, { @@ -90,7 +90,7 @@ "openmrs_entity": "", "openmrs_entity_id": "162686AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Matibabu uliyopewa", + "label": "Matibabu yaliyotolewa", "options": [ { "key": "ALU_6", @@ -132,7 +132,7 @@ "openmrs_entity": "", "openmrs_entity_id": "1767AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Amepewa matibabu, lakini hakumbuki aina gani" + "text": "Amepewa matibabu, ila hakumbuki ni yapi hasa" }, { "key": "Not_given_treatment", @@ -144,7 +144,7 @@ ], "v_required": { "value": "true", - "err": null + "err": "null" }, "relevance": { "rules-engine": { @@ -160,7 +160,7 @@ "openmrs_entity": "", "openmrs_entity_id": "1743AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Sababu ya kutopata matibabu", + "label": "Sababu ya kutopewa matibabu", "options": [ { "key": "Referral_unsuccessful", @@ -174,7 +174,7 @@ "openmrs_entity": "", "openmrs_entity_id": "1754AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Dawa zimeisha" + "text": "Dawa ziliisha" }, { "key": "Other_reason", @@ -186,7 +186,7 @@ ], "v_required": { "value": "true", - "err": null + "err": "null" }, "relevance": { "rules-engine": { @@ -202,7 +202,7 @@ "openmrs_entity": "", "openmrs_entity_id": "140238AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Je, bado ana homa?", + "label": "Bado una homa?", "options": [ { "key": "Yes", @@ -221,7 +221,7 @@ ], "v_required": { "value": "true", - "err": null + "err": "null" } }, { @@ -230,26 +230,26 @@ "openmrs_entity": "", "openmrs_entity_id": "1731AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Umekuwa na homa kwa muda gani?", + "label": "Muda wa homa", "options": [ { "key": "Less_than_24hrs", "openmrs_entity": "", "openmrs_entity_id": "164449AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Ndani ya saa 24" + "text": "Chini ya masaa 24" }, { "key": "More_than_24hrs", "openmrs_entity": "", "openmrs_entity_id": "NA", "openmrs_entity_parent": "", - "text": "Zaidi ya saa 24" + "text": "Zaidi ya masaa 24" } ], "v_required": { "value": "true", - "err": null + "err": "null" }, "relevance": { "rules-engine": { diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/male_family_planning_change_method.json b/opensrp-chw-hf/src/main/assets/json.form-sw/male_family_planning_change_method.json index 23bde024b..f68baf9c5 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/male_family_planning_change_method.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/male_family_planning_change_method.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -54,7 +49,7 @@ } }, "step1": { - "title": "Badilisha au acha fomu ya uzazi wa mpango", + "title": "Change or Stop FP form", "next": "step2", "fields": [ { @@ -84,7 +79,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "164901AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Sababu za kuacha kutumia njia za uzazi wa mpango ya sasa", + "label": "Sababu ya mwanaume kusitisha njia yake ya sasa ya kupanga uzazi", "options": [ { "key": "side_effects", @@ -98,29 +93,28 @@ "openmrs_entity": "concept", "openmrs_entity_id": "160571AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Anataka mimba" + "text": "Anataka Kuzalisha" }, { "key": "doesnt_want_to_use_anymore", "openmrs_entity": "concept", "openmrs_entity_id": "164260AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Hataki kutumia sasa " + "text": "Hataki kutumia tena" }, { "key": "decided_to_change_method", "openmrs_entity": "concept", "openmrs_entity_id": "163494AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "value": false, - "text": "Aliamua kubadilisha mpango wa uzazi" + "text": "Iliamua kubadilisha mbinu" }, { "key": "others", "openmrs_entity": "concept", "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Nyingine" + "text": "Wengine" } ], "v_required": { @@ -138,7 +132,7 @@ "hint": "Sababu nyingine", "v_required": { "value": "true", - "err": "Ni lazima kuingiza sababu nyingine" + "err": "Inahitajika" }, "relevance": { "rules-engine": { @@ -158,7 +152,7 @@ "hint": "Madhara", "v_required": { "value": "true", - "err": "Ni lazima kuingiza madhara" + "err": "Inahitajika" }, "relevance": { "rules-engine": { @@ -171,7 +165,7 @@ ] }, "step2": { - "title": "Njia ya uzazi wa mpango", + "title": "Family planning method", "fields": [ { "key": "fp_method_accepted", @@ -179,11 +173,11 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_method_accepted", "type": "spinner", - "hint": "Njia za uzazi wa mpango selected", + "hint": "Mbinu ya kupanga uzazi imechaguliwa", "values": [ "Kondomu ya kiume", "Kondomu ya kike", - "Kufunga kizazi mwanamme" + "Kufunga kizazi kwa wanaume" ], "keys": [ "Male condom", @@ -214,18 +208,18 @@ "openmrs_entity_id": "no_condoms", "type": "edit_text", "edit_type": "number", - "hint": "Amepata vipande vya kondpmu vingapi?", + "hint": "Je, alipewa kondomu ngapi?", "v_required": { "value": "true", - "err": "Sawa au kubwa kuliko 0" + "err": "Sawa au zaidi ya 0" }, "v_numeric_integer": { "value": "true", - "err": "Lazima iwe nambari iliyo na mviringo" + "err": "Weka umri halali" }, "v_min": { "value": "0", - "err": "Nambari lazima iwe sawa au kubwa kuliko 0" + "err": "Nambari lazima iwe sawa au zaidi ya 0" }, "relevance": { "rules-engine": { @@ -256,9 +250,9 @@ "openmrs_entity": "concept", "openmrs_entity_id": "counselling_use", "type": "spinner", - "hint": "Je, ameshauri jinsi ya kutumia njia za uzazi wa mpango aliyochagua?", + "hint": "Je, alishauriwa jinsi ya kutumia njia ya kupanga uzazi?", "values": [ - "Ndiyo", + "Ndio", "Hapana" ], "keys": [ @@ -287,7 +281,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_male_ster", "type": "date_picker", - "hint": "Tarehe ya kufunga kizazi cha mwanamume", + "hint": "Tarehe ya Kufunga kizazi ya kiume", "max_date": "today", "relevance": { "rules-engine": { @@ -298,7 +292,7 @@ }, "v_required": { "value": "true", - "err": "Ni lazima kuingiza tarehe ya kufunga kizazi cha mwanamume" + "err": "Inahitajika" } }, { @@ -322,8 +316,8 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Tumia kondomu kwa miezi mitatu kuzuia ujazito", - "toaster_info_text": "Tumia kondomu kwa miezi mitatu kuzuia ujazito", + "text": "Mshauri mwanaume atumie kondomu kwa muda wa miezi 3 ya kwanza ili kuzuia mimba", + "toaster_info_text": "Advise the man to use condoms for the first 3 months to prevent pregnancy", "toaster_type": "info", "relevance": { "rules-engine": { @@ -335,4 +329,4 @@ } ] } -} +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/male_family_planning_registration.json b/opensrp-chw-hf/src/main/assets/json.form-sw/male_family_planning_registration.json index dbcbe7dfd..205cec95b 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/male_family_planning_registration.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/male_family_planning_registration.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -54,21 +49,9 @@ } }, "step1": { - "title": "Maelezo ya usajili wa uzazi wa mpango", + "title": "Family planning registration Info", "next": "step2", "fields": [ - { - "key": "sync_location_id", - "openmrs_entity_parent": "", - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "sync_location_id", - "type": "spinner", - "hint": "Tafadhali chagua eneo la CHW", - "v_required": { - "value": "true", - "err": "Tafadhali chagua eno la CHW" - } - }, { "key": "fp_reg_date", "openmrs_entity_parent": "", @@ -96,14 +79,14 @@ "openmrs_entity": "concept", "openmrs_entity_id": "1382AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "label": "Je, alishauriwa kwa njia tofauti za uzazi wa mpango?", + "label": "Je, alishauriwa kuhusu mbinu tofauti za kupanga uzazi?", "options": [ { "key": "yes", "openmrs_entity": "concept", "openmrs_entity_id": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Ndiyo" + "text": "Ndio" }, { "key": "no", @@ -115,7 +98,7 @@ ], "v_required": { "value": "true", - "err": "Tafadhali chagua chaguo moja" + "err": "Tafadhali chagua moja" } }, { @@ -131,7 +114,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "text": "Ndiyo" + "text": "Ndio" }, { "key": "no", @@ -149,7 +132,7 @@ ] }, "step2": { - "title": "Njia ya uzazi wa mpango", + "title": "Family planning method", "fields": [ { "key": "fp_method_accepted", @@ -157,16 +140,11 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_method_accepted", "type": "spinner", - "hint": "Njia za uzazi wa mpango selected", + "hint": "Mbinu ya kupanga uzazi imechaguliwa", "values": [ "Kondomu ya kiume", "Kondomu ya kike", - "Kufunga kizazi mwanamme" - ], - "keys": [ - "Male condom", - "Female condom", - "Male sterilization" + "Kufunga kizazi kwa wanaume" ], "openmrs_choice_ids": { "Male condom": "164813AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", @@ -199,18 +177,18 @@ "openmrs_entity_id": "no_condoms", "type": "edit_text", "edit_type": "number", - "hint": "Amepata vipande vya kondpmu vingapi?", + "hint": "Je, alipewa kondomu ngapi?", "v_required": { "value": "true", - "err": "Sawa au kubwa kuliko 0" + "err": "Sawa au zaidi ya 0" }, "v_numeric_integer": { "value": "true", - "err": "Lazima iwe nambari iliyo na mviringo" + "err": "Weka umri halali" }, "v_min": { "value": "0", - "err": "Nambari lazima iwe sawa au kubwa kuliko 0" + "err": "Nambari lazima iwe sawa au zaidi ya 0" }, "relevance": { "rules-engine": { @@ -225,8 +203,7 @@ "openmrs_entity_parent": "190AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_condom", - "type": "edit_text", - "hidden": true, + "type": "hidden", "calculation": { "rules-engine": { "ex-rules": { @@ -241,15 +218,11 @@ "openmrs_entity": "concept", "openmrs_entity_id": "counselling_use", "type": "spinner", - "hint": "Je, ameshauri jinsi ya kutumia njia za uzazi wa mpango aliyochagua?", + "hint": "Je, alishauriwa jinsi ya kutumia njia ya kupanga uzazi?", "values": [ - "Ndiyo", + "Ndio", "Hapana" ], - "keys": [ - "Yes", - "No" - ], "openmrs_choice_ids": { "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" @@ -272,7 +245,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_male_ster", "type": "date_picker", - "hint": "Tarehe ya kufunga kizazi cha mwanamume", + "hint": "Tarehe ya kufunga kizazi ya kiume", "max_date": "today", "relevance": { "rules-engine": { @@ -283,7 +256,7 @@ }, "v_required": { "value": "true", - "err": "Ni lazime kuingiza tarehe ya kufunga kizazi cha mwanamume" + "err": "Inahitajika" } }, { @@ -292,8 +265,8 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Tumia kondomu kwa miezi mitatu kuzuia ujazito", - "toaster_info_text": "Tumia kondomu kwa miezi mitatu kuzuia ujazito", + "text": "Mshauri mwanaume atumie kondomu kwa muda wa miezi 3 ya kwanza ili kuzuia mimba", + "toaster_info_text": "Mshauri mwanaume atumie kondomu kwa muda wa miezi 3 ya kwanza ili kuzuia mimba", "toaster_type": "info", "relevance": { "rules-engine": { @@ -320,4 +293,4 @@ } ] } -} +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/male_fp_referral_form.json b/opensrp-chw-hf/src/main/assets/json.form-sw/male_fp_referral_form.json new file mode 100644 index 000000000..062bb4a72 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/male_fp_referral_form.json @@ -0,0 +1,247 @@ +{ + "count": "1", + "encounter_type": "Family Planning Referral", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "today": { + "openmrs_entity_parent": "", + "openmrs_entity": "encounter", + "openmrs_entity_id": "encounter_date" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Family Planning Referral", + "fields": [ + { + "key": "fp_method_accepted_referral", + "type": "native_radio", + "openmrs_entity": "concept", + "openmrs_entity_id": "374AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "", + "label": "Mbinu ya FP iliyochaguliwa inayohitaji rufaa", + "label_text_style": "bold", + "options": [ + { + "key": "Male_condom", + "openmrs_entity": "", + "openmrs_entity_id": "164813AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "", + "text": "Kondomu ya kiume" + }, + { + "key": "Female_condom", + "openmrs_entity": "", + "openmrs_entity_id": "164814AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "", + "text": "Kondomu ya kike" + }, + { + "key": "Male_sterilization", + "openmrs_entity": "", + "openmrs_entity_id": "1489AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "", + "text": "Kufunga kizazi kwa wanaume" + }, + { + "key": "None", + "openmrs_entity": "", + "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "", + "text": "Hakuna" + }, + { + "key": "Not_applicable", + "openmrs_entity": "", + "openmrs_entity_id": "1175AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "", + "text": "Haitumiki" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mbinu ya kupanga uzazi" + } + }, + { + "key": "side_effects_sterialization", + "type": "check_box", + "openmrs_entity": "", + "openmrs_entity_id": "", + "openmrs_entity_parent": "", + "label": "Madhara ya uzazi wa mpango", + "label_text_style": "bold", + "exclusive": [ + "None", + "Not_applicable" + ], + "options": [ + { + "key": "Incisional_bleeding", + "text": "Kutokwa na damu kwa mkato", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "147241AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Pus_Discharge_from_incision", + "text": "Usaha/Kutokwa na chale", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "164495AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Swollen_around_the_incision", + "text": "Kuvimba karibu na chale", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "159012AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Others", + "text": "Wengine", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "None", + "text": "Hakuna", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Not_applicable", + "text": "Haitumiki", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "1175AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua " + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_fp_referral_relevance.yml" + } + } + } + }, + { + "key": "fp_side_effects", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "165273AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "type": "hidden", + "is_problem": false, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "fp_referral_calculation.yml" + } + } + } + }, + { + "key": "fp_side_effects_other", + "type": "edit_text", + "openmrs_entity": "concept", + "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "", + "hint": "Madhara mengine", + "v_required": { + "value": "true", + "err": "Tafadhali bainisha madhara mengine" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_fp_referral_relevance.yml" + } + } + } + }, + { + "key": "referral_date_fp", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "163181AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "type": "hidden", + "is_problem": false, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "fp_referral_calculation.yml" + } + } + } + }, + { + "key": "referral_time_fp", + "openmrs_entity_parent": "", + "openmrs_entity": "", + "openmrs_entity_id": "", + "type": "hidden", + "is_problem": false, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "fp_referral_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/male_partner_registration_form.json b/opensrp-chw-hf/src/main/assets/json.form-sw/male_partner_registration_form.json new file mode 100644 index 000000000..182cce261 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/male_partner_registration_form.json @@ -0,0 +1,943 @@ +{ + "count": "2", + "encounter_type": "Family Registration", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Taarifa za mteja", + "next": "step2", + "fields": [ + { + "key": "fam_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "fam_name", + "type": "edit_text", + "hint": "Jina la Ukoo", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Ukoo" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka Jina la Ukoo" + } + }, + { + "key": "client_first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "Jina la Kwanza", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kwanza" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + } + }, + { + "key": "client_middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Jina la Kati", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kati" + } + }, + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "hidden": "true", + "type": "edit_text", + "barcode_type": "qrcode", + "hint": "Nambari ya utambulisho", + "scanButtonText": "Scan QR Code", + "v_numeric": { + "value": "true", + "err": "Tafadhali weka kitambulisho halali" + } + }, + { + "key": "fam_village", + "openmrs_entity_parent": "", + "openmrs_entity": "person_address", + "openmrs_entity_id": "cityVillage", + "type": "edit_text", + "edit_type": "name", + "hint": "Jina la eneo", + "v_required": { + "value": "true", + "err": "Tafadhali weka jina la eneo au mji" + } + }, + { + "key": "landmark", + "openmrs_entity_parent": "", + "openmrs_entity": "person_address", + "openmrs_entity_id": "landmark", + "type": "edit_text", + "hint": "Alama/Maelezo ya eneo la nyumba", + "v_required": { + "value": true, + "err": "Tafadhali weka alama/maelezo ya eneo." + } + }, + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "15dp" + }, + { + "key": "sync_location_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "sync_location_id", + "type": "spinner", + "hint": "Chagua eneo la WAJA", + "v_required": { + "value": "true", + "err": "Chagua eneo la WAJA" + } + } + ] + }, + "step2": { + "title": "Taarifa za mteja", + "fields": [ + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "type": "edit_text", + "read_only": true, + "hint": "Kituoni ID", + "v_numeric": { + "value": "true", + "err": "Tafadhali weka kitambulisho halali" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka kitambulisho cha KIPEKEE" + } + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "last_name", + "type": "edit_text", + "hint": "Jina la Ukoo", + "edit_type": "name", + "read_only": true, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Ukoo" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "Jina la Kwanza", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kwanza" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Jina la Kati", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kati" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "date_picker", + "hint": "Tarehe ya kuzaliwa (DOB)", + "expanded": false, + "duration": { + "label": "Umri" + }, + "min_date": "today-120y", + "max_date": "today-11y", + "v_required": { + "value": "true", + "err": "Tarehe ya kuzaliwa (DOB)" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + } + }, + { + "key": "age_calculated", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + }, + { + "key": "dob_unknown", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdateApprox", + "type": "check_box", + "label": "", + "options": [ + { + "key": "dob_unknown", + "text": "Tarehe ya kuzaliwa haijulikani", + "text_size": "18px", + "value": "false" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + } + }, + { + "key": "age", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "age", + "type": "edit_text", + "hint": "Umri", + "v_numeric_integer": { + "value": "true", + "err": "Must be a rounded number" + }, + "v_max_length": { + "value": "3", + "is_fixed_size": "true", + "err": "Please enter a valid age" + }, + "v_numeric": { + "value": "true", + "err": "Lazima iwe namba kamili" + }, + "v_min": { + "value": "11", + "err": "Umri lazima uwe sawa au zaidi ya 11" + }, + "v_max": { + "value": "120", + "err": "Umri lazima uwe sawa au chini ya 120" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Tafadhali weka umri" + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + }, + { + "key": "marital_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "marital_status", + "type": "spinner", + "hint": "Hali ya Ndoa ya Mteja?", + "values": [ + "Hajaoa/Hajaolewa", + "Ameoa/Ameolewa", + "Ameachwa", + "Mjane/Mgane", + "Kuishi pamoja bila ndoa" + ], + "keys": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "openmrs_choice_ids": { + "Single": "Single", + "Married": "Married", + "Divorced": "Divorced", + "Widowed": "Widowed", + "Cohabitation": "Cohabitation" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + } + }, + { + "key": "phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "phone_number", + "type": "edit_text", + "hint": "Namba ya simu ya mteja", + "v_numeric": { + "value": "true", + "err": "Namba lazima iwe jumla ya tarakimu 10 kwa urefu" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Namba lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." + } + }, + { + "key": "id_avail", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "id_avail", + "type": "check_box", + "label": "Je, una kitambulisho chochote kati ya vifuatavyo?", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_national_id", + "text": "Kitambulisho cha Taifa", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_national_id" + }, + { + "key": "chk_voters_id", + "text": "Kitambulisho cha usajili wa mpiga kura", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_voters_id" + }, + { + "key": "chk_drivers_license", + "text": "Leseni ya udereva", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_drivers_license" + }, + { + "key": "chk_none", + "text": "Hakuna", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_none" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + } + }, + { + "key": "national_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "National_ID", + "type": "mask_edit_text", + "mask": "########-#####-#####-##", + "mask_hint": "12345678912345678912", + "allowed_chars": "0123456789", + "hint": "Namba ya kitambulisho cha taifa k.m 12345678-91234-56789-12", + "edit_type": "number", + "v_max_length": { + "value": "23", + "is_fixed_size": "true", + "err": "Tafadhali weka namba sahihi" + }, + "v_regex": { + "value": "^\\d{8}-\\d{5}-\\d{5}-\\d{2}$", + "err": "Namba ya kitambulisho cha kitaifa inapaswa kuwa ya umbizo (XXXXXXXX-XXXXX-XXXXX-XX)" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi" + }, + "relevance": { + "step2:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_national_id" + ] + } + ] + } + } + }, + { + "key": "voter_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Voter_Registration_Number", + "type": "mask_edit_text", + "mask": "T-####-####-###-#", + "mask_hint": "123456789123", + "allowed_chars": "0123456789", + "hint": "Namba ya kitambulisho cha mpiga kura k.m T-1234-5678-912-3", + "edit_type": "number", + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Tafadhali weka namba sahihi" + }, + "v_regex": { + "value": "^T-\\d{4}-\\d{4}-\\d{3}-\\d{1}$", + "err": "Namba ya kitambulosho cha mpiga kura inapaswa kuwa ya umbizo (T-XXXX-XXXX-XXX-X)" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi" + }, + "relevance": { + "step2:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_voters_id" + ] + } + ] + } + } + }, + { + "key": "driver_license", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Driver_License_Number", + "type": "mask_edit_text", + "mask": "##########", + "mask_hint": "1234567891", + "allowed_chars": "0123456789", + "hint": "Namba ya leseni ya udereva k.m 1234567891", + "edit_type": "number", + "v_max_length": { + "value": "10", + "is_fixed_size": "true", + "err": "Tafadhali weka namba sahihi" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka namba sahihi" + }, + "v_regex": { + "value": "^([0-9]{10})", + "err": "Namba ya leseni ya udereva inapaswa kuwa ya umbizo (XXXXXXXXX)" + }, + "relevance": { + "step2:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_drivers_license" + ] + } + ] + } + } + }, + { + "key": "insurance_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Health_Insurance_Type", + "type": "spinner", + "hint": "Mtoa huduma ya bima ya afya", + "values": [ + "Mfuko wa Afya ya Jamii (CHF)/(iCHF)", + "Mfuko wa Taifa wa Hifadhi ya Jamii - Manufaa ya Bima ya Afya ya Jamii (SHIB)", + "Mfuko wa Taifa wa Bima ya Afya (NHIF)", + "Tiba Kwa Kadi (TIKA)", + "AAR Huduma ya Afya", + "Bima ya afya Strategies", + "Milvik Tanzania Ltd (BIMA Mkononi)", + "Bima ya afya ya Britam Tanzania", + "Bima ya afya Jubilee", + "Bima ya afya ya Resolutions", + "Bima ya afya ya Reliance", + "Nyinginezo", + "Hakuna" + ], + "keys": [ + "Community Health Fund (CHF)", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", + "Tiba Kwa Kadi (TIKA)", + "AAR Healthcare", + "Strategies Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)", + "Britam Insurance Tanzania", + "Jubilee Insurance", + "Resolutions Insurance", + "Reliance Insurance", + "Other", + "None" + ], + "openmrs_choice_ids": { + "Community Health Fund (CHF)": "Community_Health_Fund", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)": "National_Social_Security_Fund", + "National Health Insurance Fund (NHIF)": "National_Health_Insurance_Fund", + "Tiba Kwa Kadi (TIKA)": "Tiba_kwa_Kadi", + "AAR Healthcare": "AAR_Healthcare", + "AAR Strategies Insurance": "Strategies_Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)": "BIMA_Mkononi", + "Britam Insurance Tanzania": "Britam_Insurance_Tanzania", + "Jubilee Insurance": "Jubilee_Insurance", + "Resolutions Insurance": "Resolutions_Insurance", + "Reliance Insurance": "Reliance_Insurance", + "Other": "Other_Health_Insurance_Type", + "None": "No_Health_Insurance" + }, + "v_required": { + "value": "true", + "err": "Tafadhali ingiza mtoa huduma wa bima" + } + }, + { + "key": "insurance_provider_other", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Health_Insurance_Type", + "type": "edit_text", + "hint": "Mtoa huduma mwingine wa bima ya afya", + "v_required": { + "value": "true", + "err": "Tafadhali bainisha mtoa huduma wa bima" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + } + }, + { + "key": "insurance_provider_number", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Health_Insurance_Number", + "type": "edit_text", + "hint": "Namba ya mtoa huduma ya bima ya afya", + "v_required": { + "value": "true", + "err": "Tafadhali ongeza Namba ya kitambulisho ya mtoa huduma wa bima ya afya" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + } + }, + { + "key": "wra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + }, + { + "key": "mra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + }, + { + "key": "disabilities", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabilities", + "type": "spinner", + "hint": "Ulemavu wa kimwili", + "values": [ + "Ndio ", + "Hapana" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + } + }, + { + "key": "type_of_disability", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Aina ya ulemavu", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Ulemavu wa kimwili", + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Ulemavu wa Uti wa Mgongo", + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Majeraha ya Kichwa - Ulemavu wa Ubongo", + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Ulemavu wa Maono", + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Ulemavu wa Kusikia", + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Ulemavu wa Utambuzi au Kujifunza", + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Matatizo ya Kisaikolojia", + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Ulemavu Usioonekana", + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Tafadhali chagua aina ya ulemavu wa kimwili" + } + }, + { + "key": "service_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "service_provider", + "type": "native_radio", + "label": "Kazi ya Mteja", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "chk_self_employed", + "text": "Amejiajiri", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_self_employed" + }, + { + "key": "chk_employed", + "text": "Ameajiriwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_employed" + }, + { + "key": "chk_unemployed", + "text": "Hajaajiriwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_unemployed" + }, + { + "key": "chk_farmer", + "text": "Mkulima", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_farmer" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua angalau moja" + } + }, + { + "key": "leader", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Community_Leader", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Una nafasi yoyote ya uongozi katika jamii?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_religious", + "text": "Kiongozi wa dini", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Religious_Leader" + }, + { + "key": "chk_traditional", + "text": "Kiongozi wa jadi", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Traditional_leader" + }, + { + "key": "chk_political", + "text": "Kiongozi wa kisiasa", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Political_leader" + }, + { + "key": "chk_influential", + "text": "Kiongozi mwenye ushawishi", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Influential_Leader" + }, + { + "key": "chk_other", + "text": "Nyingine", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Community_Leader_Type" + }, + { + "key": "chk_none", + "text": "Hakuna", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Not_a_Community_Leader" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua angalau moja" + } + }, + { + "key": "leader_other", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Community_Leader_Type_Name", + "type": "edit_text", + "hint": "Taja nafasi nyingine katika jamii", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali bainisha jukumu" + }, + "relevance": { + "step2:leader": { + "ex-checkbox": [ + { + "or": [ + "chk_other" + ] + } + ] + } + } + }, + { + "key": "reasons_for_registration", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Registration_Reason", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/monthly_report.json b/opensrp-chw-hf/src/main/assets/json.form-sw/monthly_report.json index a40e31c0d..bdf10384e 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/monthly_report.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/monthly_report.json @@ -16,11 +16,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/next_facility_visit_date_form.json b/opensrp-chw-hf/src/main/assets/json.form-sw/next_facility_visit_date_form.json new file mode 100644 index 000000000..9935b0a80 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/next_facility_visit_date_form.json @@ -0,0 +1,78 @@ +{ + "count": "1", + "encounter_type": "Next Facility Visit Date", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Tarehe ya Uthurio Lijalo", + "fields": [ + { + "key": "next_facility_visit_date", + "type": "date_picker", + "hint": "Tarehe ya Uthurio Lijalo Kituoni", + "openmrs_entity_id": "next_facility_visit_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "min_date": "today+1d", + "max_date": "today+6m", + "v_required": { + "value": true, + "err": "Tafadhali jaza tarehe" + } + }, + { + "key": "visit_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "type": "hidden" + }, + { + "key": "followup_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "followup_status", + "type": "hidden" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/observation_illness.json b/opensrp-chw-hf/src/main/assets/json.form-sw/observation_illness.json index e2409d44b..eedaa4b4b 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/observation_illness.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/observation_illness.json @@ -47,7 +47,7 @@ "encounter_location": "" }, "step1": { - "title": "Uangulifu na muda ya ugonjwa", + "title": "Observations & Illness", "fields": [ { "key": "date_of_illness", @@ -61,7 +61,7 @@ "min_date": "", "v_required": { "value": "true", - "err": "Tafadhali ingiza tarehe ya ugonjwa" + "err": "Tafadhali weka tarehe ya ugonjwa" } }, { @@ -74,7 +74,7 @@ "hint": "Maelezo", "v_required": { "value": "true", - "err": "Tafadhali ingiza maelezo" + "err": "Tafadhali weka maelezo" } }, { @@ -84,10 +84,10 @@ "openmrs_entity_id": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Hatua zilizochukuliwa", + "hint": "Hatua iliyochukuliwa", "v_required": { "value": "true", - "err": "Please select action" + "err": "Tafadhali chagua kitendo" }, "values": [ "ORS 5", @@ -105,7 +105,7 @@ { "key": "other_treat_1m5yr", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "edit_text", "hint": "Matibabu mengine", diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_cd4_sample_collection.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_cd4_sample_collection.json new file mode 100644 index 000000000..3496d0be1 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_cd4_sample_collection.json @@ -0,0 +1,158 @@ +{ + "count": "1", + "encounter_type": "PMTCT CD4 Sample Collection", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Kuchukua Sampuli ya CD4", + "fields": [ + { + "key": "clinician_name", + "type": "edit_text", + "hint": "Jina la Mtoa huduma wa Afya", + "openmrs_entity_id": "clinician_name", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza jina la Mtoa huduma" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza jina la Mtoa huduma" + } + }, + { + "key": "clinician_position", + "type": "spinner", + "hint": "Cheo cha Mtoa huduma wa Afya", + "openmrs_entity_id": "clinician_position", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "Afisa Matibabu", + "Afisa Matibabu msaidizi", + "Afisa wa Kliniki", + "Afisa wa Kliniki msaidizi", + "Nesi" + ], + "keys": [ + "medical_officer", + "assistant_medical_officer", + "clinical_officer", + "assistant_clinical_officer", + "nurse" + ], + "openmrs_choice_ids": { + "medical_officer": "medical_officer", + "assistant_medical_officer": "assistant_medical_officer", + "clinical_officer": "clinical_officer", + "assistant_clinical_officer": "assistant_clinical_officer", + "nurse": "nurse" + }, + "v_required": { + "value": true, + "err": "Tafadhali Ingiza cheo cha Mtoa huduma wa Afya" + } + }, + { + "key": "clinician_phone_number", + "type": "edit_text", + "hint": "Namba ya Simu ya Mtoa Huduma wa Afya", + "edit_type": "number", + "openmrs_entity_id": "clinician_phone_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Namba ya simu lazima iwe na tarakimu 10 na lazima ianze na 06 au 07" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Namba ya simu lazima iwe na tarakimu 10 na lazima ianze na 06 au 07" + }, + "v_required": { + "value": true, + "err": "Namba lazima iwe na tarakimu 10 na lazima ianze na 06 au 07" + } + }, + { + "key": "cd4_collection_date", + "type": "date_picker", + "hint": "Tarehe ya kuchukua sampuli ya CD4", + "openmrs_entity_id": "cd4_collection_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "min_date": "today-5y", + "max_date": "today", + "v_required": { + "value": true, + "err": "Tafadhali ingiza tarehe ya kuchukua sampuli ya CD4" + } + }, + { + "key": "cd4_collection_time", + "type": "time_picker", + "hint": "Muda ya kuchukua sampuli ya CD4", + "openmrs_entity_id": "cd4_collection_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Tafadhali ingiza muda ya kuchukua sampuli ya CD4" + } + }, + { + "key": "cd4_sample_id", + "type": "edit_text", + "hint": "Namba ya utambulisho ya sampuli ya CD4", + "openmrs_entity_id": "cd4_sample_id", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Tafadhali ingiza namba ya utambulisho ya sampuli ya CD4" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_cd4_test_results.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_cd4_test_results.json new file mode 100644 index 000000000..6f937c3d0 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_cd4_test_results.json @@ -0,0 +1,181 @@ +{ + "count": "1", + "encounter_type": "PMTCT CD4 Test Results", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Majibu ya CD4", + "fields": [ + { + "key": "cd4_sample_id", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "cd4_sample_id", + "openmrs_entity_parent": "" + }, + { + "key": "cd4_result", + "type": "edit_text", + "hint": "Jaza kiasi cha CD4", + "openmrs_entity": "concept", + "openmrs_entity_id": "cd4_result", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza Jaza kiasi cha CD4" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza Jaza kiasi cha CD4" + } + }, + { + "key": "prompt_to_start_ctx", + "type": "toaster_notes", + "text": "Mteja huyu mwanzishie CTX", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:cd4_result": { + "type": "numeric", + "ex": "lessThan(.,\"350\")" + } + } + }, + { + "key": "started_ctx", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "started_ctx", + "type": "native_radio", + "label": "Je Mteja ameshaanza CTX?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "step1:cd4_result": { + "type": "numeric", + "ex": "lessThan(.,\"350\")" + } + } + }, + { + "key": "reason_for_not_starting_ctx", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_starting_ctx", + "type": "native_radio", + "label": "Sababu za Mteja kutoanzishiwa CTX", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_medicine", + "text": "CTX zimekwisha", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_medicine" + }, + { + "key": "client_refused_medication", + "text": "Mteja amekataa dawa za CTX", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_refused_medication" + }, + { + "key": "client_allergic_to_ctx", + "text": "Mteja ana mzio na dawa hizi za CTXja ana ", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_allergic_to_ctx" + }, + { + "key": "drug_interaction", + "text": "Drug interaction", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_interaction" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "step1:started_ctx": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "cd4_result_date", + "type": "hidden", + "openmrs_entity_id": "cd4_result_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_cd4_test_results_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_clinical_staging_of_disease.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_clinical_staging_of_disease.json new file mode 100644 index 000000000..b9c6ef013 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_clinical_staging_of_disease.json @@ -0,0 +1,382 @@ +{ + "count": "1", + "encounter_type": "PMTCT clinical staging of disease", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Hatua ya Ugonjwa", + "fields": [ + { + "key": "clinical_staging_disease", + "type": "spinner", + "hint": "Hatua ya Ugonjwa (Clinical staging of disease)", + "openmrs_entity_id": "clinical_staging_disease", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "Hatua ya 1", + "Hatua ya 2", + "Hatua ya 3", + "Hatua ya 4" + ], + "keys": [ + "stage_1", + "stage_2", + "stage_3", + "stage_4" + ], + "openmrs_choice_ids": { + "stage_1": "stage_1", + "stage_2": "stage_2", + "stage_3": "stage_3", + "stage_4": "stage_4" + }, + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "stage_1_symptoms", + "type": "check_box", + "label": "Chagua dalili zinazoendana na Mteja", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "stage_1_symptoms", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "chk_asymptomatic" + ], + "options": [ + { + "key": "chk_asymptomatic", + "text": "Hakuna dalili yeyote ya tatizo", + "openmrs_entity_id": "chk_asymptomatic", + "openmrs_entity": "concept" + }, + { + "key": "chk_pgl", + "text": "Persistent generalized lymphadenopathy (PGL) Unexplained, asymptomatic hepatosplenomegaly", + "openmrs_entity_id": "chk_pgl", + "openmrs_entity": "concept" + } + ], + "relevance": { + "step1:clinical_staging_disease": { + "type": "string", + "ex": "equalTo(.,\"stage_1\")" + } + }, + "v_required": { + "value": true, + "err": "Tafadhali chagua dalili" + } + }, + { + "key": "stage_2_symptoms", + "type": "check_box", + "label": "Tafadhali chagua dalili zinaendana na Mteja", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "stage_2_symptoms", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "chk_ppe", + "text": "Papular pruritic eruptions (PPE)", + "openmrs_entity_id": "chk_ppe", + "openmrs_entity": "concept" + }, + { + "key": "chk_seb_derm", + "text": "Seborrheic dermatitis", + "openmrs_entity_id": "chk_seb_derm", + "openmrs_entity": "concept" + }, + { + "key": "chk_fung_infection", + "text": "Rangi ya kucha kubadilika kuwa nyeusi au kahawa inayo sababishwa na maradhi sugu ya fangasi", + "openmrs_entity_id": "chk_fung_infection", + "openmrs_entity": "concept" + }, + { + "key": "chk_seb_dermatitis", + "text": "Seborrheic dermatitis", + "openmrs_entity_id": "chk_seb_dermatitis", + "openmrs_entity": "concept" + }, + { + "key": "chk_ang_cheilities", + "text": "Angular cheilitis", + "openmrs_entity_id": "chk_ang_cheilities", + "openmrs_entity": "concept" + }, + { + "key": "chk_lin_erythema", + "text": "Linear gingival erythema", + "openmrs_entity_id": "chk_lin_erythema", + "openmrs_entity": "concept" + }, + { + "key": "chk_hpv_infection", + "text": "Extensive HPV or molluscum infection (>5% of body area/face)", + "openmrs_entity_id": "chk_hpv_infection", + "openmrs_entity": "concept" + }, + { + "key": "chk_oral_ulcer", + "text": "Recurrent oral ulcerations (>2 episodes/ in 6 months)", + "openmrs_entity_id": "chk_oral_ulcer", + "openmrs_entity": "concept" + }, + { + "key": "chk_par_enlargement", + "text": "Parotid enlargement", + "openmrs_entity_id": "chk_par_enlargement", + "openmrs_entity": "concept" + }, + { + "key": "chk_herp_zoster", + "text": "Herpes zoster (>1 episode/12 months)", + "openmrs_entity_id": "chk_herp_zoster", + "openmrs_entity": "concept" + }, + { + "key": "chk_rec_uri", + "text": "Recurrent or chronic upper respiratory infection (URI): otitis media, otorrhoea, sinusitis (>2 episodes/6 months)", + "openmrs_entity_id": "chk_rec_uri", + "openmrs_entity": "concept" + } + ], + "relevance": { + "step1:clinical_staging_disease": { + "type": "string", + "ex": "equalTo(.,\"stage_2\")" + } + }, + "v_required": { + "value": true, + "err": "Tafadhali chagua dalili" + } + }, + { + "key": "stage_3_symptoms", + "type": "check_box", + "label": "Chagua dalili zinazoendana na Mteja", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "stage_3_symptoms", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "chk_mod_malnutrition", + "text": "Unexplained moderate malnutrition (-2SD or Z score) not responding to standard therapy", + "openmrs_entity_id": "chk_mod_malnutrition", + "openmrs_entity": "concept" + }, + { + "key": "chk_per_diarrhoea", + "text": "Unexplained persistent diarrhoea (>14 days)", + "openmrs_entity_id": "chk_per_diarrhoea", + "openmrs_entity": "concept" + }, + { + "key": "chk_per_fever", + "text": "Unexplained persistent fever (intermittent or constant, > 1 mo.)", + "openmrs_entity_id": "chk_per_fever", + "openmrs_entity": "concept" + }, + { + "key": "chk_oral_candidiasis", + "text": "Oral candidiasis (outside neonatal period)", + "openmrs_entity_id": "chk_oral_candidiasis", + "openmrs_entity": "concept" + }, + { + "key": "chk_oral_leucoplakia", + "text": "Oral hairy Leucoplakia", + "openmrs_entity_id": "chk_oral_leucoplakia", + "openmrs_entity": "concept" + }, + { + "key": "chk_pul_tuberculosis", + "text": "Pulmonary tuberculosis", + "openmrs_entity_id": "chk_pul_tuberculosis", + "openmrs_entity": "concept" + }, + { + "key": "chk_rec_pneumonia", + "text": "Severe recurrent presumed bacterial pneumonia (>2 episodes/12 months)", + "openmrs_entity_id": "chk_rec_pneumonia", + "openmrs_entity": "concept" + }, + { + "key": "chk_acute_gingivitis", + "text": "Acute necrotizing ulcerative gingivitis/periodontitis", + "openmrs_entity_id": "chk_acute_gingivitis", + "openmrs_entity": "concept" + }, + { + "key": "chk_lym_pneumonitis", + "text": "Lymphoid interstitial pneumonitis (LIP)", + "openmrs_entity_id": "chk_lym_pneumonitis", + "openmrs_entity": "concept" + }, + { + "key": "chk_unexp_anaemia", + "text": "Unexplained anaemia (<8g/dL), neutropenia (<1000/mm3), or thrombocytopenia (<30,000/mm3) for >1 mo.", + "openmrs_entity_id": "chk_unexp_anaemia", + "openmrs_entity": "concept" + } + ], + "relevance": { + "step1:clinical_staging_disease": { + "type": "string", + "ex": "equalTo(.,\"stage_3\")" + } + }, + "v_required": { + "value": true, + "err": "Tafadhali chagua dalili" + } + }, + { + "key": "stage_4_symptoms", + "type": "check_box", + "label": "Tafadhali chagua dalili zinazoendana na Mteja", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "stage_4_symptoms", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "chk_sev_wasting", + "text": "Unexplained severe wasting or severe malnutrition (-3 SD or Z score) not responding to standard therapy", + "openmrs_entity_id": "chk_sev_wasting", + "openmrs_entity": "concept" + }, + { + "key": "chk_pneu_penumonia", + "text": "Pneumocystis pneumonia", + "openmrs_entity_id": "chk_pneu_penumonia", + "openmrs_entity": "concept" + }, + { + "key": "chk_recurrent_bacinf", + "text": "Recurrent severe bacterial infections (>2 episodes/12 months, excluding pneumonia)", + "openmrs_entity_id": "chk_recurrent_bacinf", + "openmrs_entity": "concept" + }, + { + "key": "chk_orol_hsv", + "text": "Chronic orolabial or cutaneous HSV (lasting > 1 mo)", + "openmrs_entity_id": "chk_orol_hsv", + "openmrs_entity": "concept" + }, + { + "key": "chk_extra_tuber", + "text": "Extra-pulmonary tuberculosis", + "openmrs_entity_id": "chk_extra_tuber", + "openmrs_entity": "concept" + }, + { + "key": "chk_kap_sarcoma", + "text": "Kaposi’s sarcoma", + "openmrs_entity_id": "chk_kap_sarcoma", + "openmrs_entity": "concept" + }, + { + "key": "chk_oes_candidiasis", + "text": "Oesophageal candidiasis", + "openmrs_entity_id": "chk_oes_candidiasis", + "openmrs_entity": "concept" + }, + { + "key": "chk_cns_toxoplasmosis", + "text": "CNS toxoplasmosis", + "openmrs_entity_id": "chk_cns_toxoplasmosis", + "openmrs_entity": "concept" + }, + { + "key": "chk_crypt_meningitis", + "text": "Cryptococcal meningitis", + "openmrs_entity_id": "chk_crypt_meningitis", + "openmrs_entity": "concept" + }, + { + "key": "chk_ende_mycosis", + "text": "Any disseminated endemic mycosis", + "openmrs_entity_id": "chk_ende_mycosis", + "openmrs_entity": "concept" + }, + { + "key": "chk_cryp_isos", + "text": "Cryptosporidiosis or Isosporiasis (with diarrhoea > 1 month)", + "openmrs_entity_id": "chk_cryp_isos", + "openmrs_entity": "concept" + }, + { + "key": "chk_cmv_organ", + "text": "CMV infection of organ other than liver, spleen, lymph nodes (and onset age >1 month)", + "openmrs_entity_id": "chk_cmv_organ", + "openmrs_entity": "concept" + }, + { + "key": "chk_dis_mycobacterial", + "text": "Disseminated mycobacterial disease other", + "openmrs_entity_id": "chk_dis_mycobacterial", + "openmrs_entity": "concept" + } + ], + "relevance": { + "step1:clinical_staging_disease": { + "type": "string", + "ex": "equalTo(.,\"stage_4\")" + } + }, + "v_required": { + "value": true, + "err": "Tafadhali chagua dalili" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_community_followup_referral.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_community_followup_referral.json new file mode 100644 index 000000000..a3bfbbe4c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_community_followup_referral.json @@ -0,0 +1,125 @@ +{ + "count": "1", + "encounter_type": "PMTCT Community Followup", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Rufaa Kwa Mama Kinara", + "fields": [ + { + "key": "last_client_visit_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_client_visit_date", + "type": "date_picker", + "hint": "Tarehe ya mwisho mteja kuhudhulia Kituoni", + "expanded": false, + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali bainisha Tarehe ya mwisho mteja kuhudhulia Kituoni" + } + }, + { + "key": "reasons_for_issuing_community_referral", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_issuing_community_referral", + "type": "native_radio", + "label": "Sababu za kumpa Mteja rufaa kwa ajili ya ufuatiliaji ngazi ya jamii", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "missed_appointment", + "text": "Amekosa kwenye miadi yake", + "openmrs_entity": "concept", + "openmrs_entity_id": "missed_appointment" + }, + { + "key": "mother_champion_services", + "text": "Huduma za Mama Kinara katika Ngazi ya Jamii", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_champion_services" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu za kumpa rufaa Mteja" + } + }, + { + "key": "mother_champion_location", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_champion_location", + "type": "spinner", + "hint": "Chagua Eneo la Mama Kinara", + "v_required": { + "value": true, + "err": "Tafadhali chagua eneo alipo mama kinara" + } + }, + { + "key": "comment_pmtct_community_followup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "comment_pmtct_community_followup", + "type": "edit_text", + "hint": "Maoni yako" + }, + { + "key": "pmtct_community_referral_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_community_referral_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_community_followup_referral_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_eac_visits.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_eac_visits.json new file mode 100644 index 000000000..d14594aec --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_eac_visits.json @@ -0,0 +1,634 @@ +{ + "count": "1", + "encounter_type": "PMTCT EAC Visit", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Ziara ya EAC", + "fields": [ + { + "key": "eac_visit_notification", + "type": "toaster_notes", + "text": "Nakiri tarehe ya hudhurio la EAC", + "openmrs_entity_id": "notify_retest", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info" + }, + { + "key": "eac_visit_date", + "type": "date_picker", + "hint": "Tarehe ya hudhurio la EAC", + "openmrs_entity_id": "eac_visit_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "min_date": "today-3m", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza Tarehe ya hudhurio la EAC" + } + }, + { + "key": "summary", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "summary", + "type": "edit_text", + "hint": "Muhtasari", + "v_required": { + "value": "true", + "err": "Tafadhali jaza muhtasari" + } + }, + { + "key": "arv_intake_demonstration_done", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "arv_intake_demonstration_done", + "type": "native_radio", + "label": "Maonyesho ya unywaji wa ARV na mgonjwa/mlezi yamefanyika?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "pill_count_done", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pill_count_done", + "type": "native_radio", + "label": "Hesabu ya vidonge imefanyika?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "pill_intake", + "type": "edit_text", + "hint": "Unywaji wa vidonge %", + "openmrs_entity_id": "pill_intake", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza % ya unywaji wa vidonge" + }, + "v_min": { + "value": "0", + "err": "Unywaji wa vidonge lazima iwe sawa au zaidi ya 0%" + }, + "v_max": { + "value": "100", + "err": "Unywaji wa vidonge lazima iwe sawa au chini ya 100%" + } + }, + { + "key": "additional_session", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "additional_session", + "type": "native_radio", + "label": "Does the client require an additional session?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_eac_visits_relevance.yml" + } + } + } + }, + { + "key": "patient_adherence_before_eac", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "patient_adherence_before_eac", + "type": "native_radio", + "label": "Your impression about patient’s adherence before EAC", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "likely_to_be_good", + "text": "Likely to be good", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "likely_to_be_good" + }, + { + "key": "likely_to_be_not_good", + "text": "Likely to be NOT good (relevant barriers identified)", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "likely_to_be_not_good" + }, + { + "key": "clearly_poor", + "text": "Clearly poor (defaulter)", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "clearly_poor" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_eac_visits_relevance.yml" + } + } + } + }, + { + "key": "patient_adherence_during_and_after_eac", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "patient_adherence_during_and_after_eac", + "type": "native_radio", + "label": "Your impression about patient’s adherence during and after EAC", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "likely_to_be_good", + "text": "Likely to be good", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "likely_to_be_good" + }, + { + "key": "likely_to_be_not_good", + "text": "Likely to be NOT good (relevant barriers identified and not cleared)", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "likely_to_be_not_good" + }, + { + "key": "clearly_poor", + "text": "Clearly poor (defaulter)", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "clearly_poor" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "eac_barriers_identified_prompt", + "type": "toaster_notes", + "text": "Major remaining barriers identified after EAC sessions", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:additional_session": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "behavioral_barriers", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "behavioral_barriers", + "type": "native_radio", + "label": "Behavioral", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:additional_session": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "behavioral_barriers_details", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "behavioral_barriers_details", + "type": "edit_text", + "hint": "Behavioral barriers", + "v_required": { + "value": "true", + "err": "Please enter the behavioral barriers" + }, + "relevance": { + "step1:behavioral_barriers": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "cognitive_barriers", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cognitive_barriers", + "type": "native_radio", + "label": "Cognitive", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:additional_session": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "cognitive_barriers_details", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cognitive_barriers_details", + "type": "edit_text", + "hint": "Cognitive barriers", + "v_required": { + "value": "true", + "err": "Please enter the cognitive barriers" + }, + "relevance": { + "step1:cognitive_barriers": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "emotional_barriers", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "emotional_barriers", + "type": "native_radio", + "label": "Emotional", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:additional_session": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "emotional_barriers_details", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "emotional_barriers_details", + "type": "edit_text", + "hint": "Emotional barriers", + "v_required": { + "value": "true", + "err": "Please enter the emotional barriers" + }, + "relevance": { + "step1:emotional_barriers": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "socio_economic_barriers", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "socio_economic_barriers", + "type": "native_radio", + "label": "Socio-economic", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:additional_session": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "socio_economic_barriers_details", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "socio_economic_barriers_details", + "type": "edit_text", + "hint": "Socio-economic barriers", + "v_required": { + "value": "true", + "err": "Please enter the socio-economic barriers" + }, + "relevance": { + "step1:socio_economic_barriers": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "other_barriers", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_barriers", + "type": "native_radio", + "label": "Others (Disclosure, Religion...)", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:additional_session": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_barriers_details", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_barriers_details", + "type": "edit_text", + "hint": "Other barriers", + "v_required": { + "value": "true", + "err": "Please enter other barriers" + }, + "relevance": { + "step1:other_barriers": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "counsellor_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "counsellor_name", + "type": "edit_text", + "hint": "Counsellor's name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the counsellor's name" + } + }, + { + "key": "eac_visit_type", + "type": "hidden", + "openmrs_entity_id": "eac_visit_type", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "eac_visit_session", + "type": "hidden", + "openmrs_entity_id": "eac_visit_session", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "eac_completion_status", + "type": "hidden", + "openmrs_entity_id": "eac_completion_status", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_eac_visits_calculation.yml" + } + } + } + }, + { + "key": "eac", + "type": "hidden", + "openmrs_entity_id": "eac", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "form_submission_timestamp", + "type": "hidden", + "openmrs_entity_id": "form_submission_timestamp", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_eac_visits_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_followup_status.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_followup_status.json new file mode 100644 index 000000000..39ef13016 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_followup_status.json @@ -0,0 +1,103 @@ +{ + "count": "1", + "encounter_type": "PMTCT Followup Status", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Hali ya Ufuatiliji", + "fields": [ + { + "key": "followup_status", + "type": "native_radio", + "label": "Hali ya Ufuatiliaji", + "openmrs_entity": "concept", + "openmrs_entity_id": "followup_status", + "openmrs_entity_parent": "", + "options": [ + { + "key": "continuing_with_services", + "text": "Anaendelea na Huduma (CTN)", + "openmrs_entity": "concept", + "openmrs_entity_id": "continuing_with_services" + }, + { + "key": "transfer_out", + "text": "Amehama", + "openmrs_entity": "concept", + "openmrs_entity_id": "transfer_out" + }, + { + "key": "lost_to_followup", + "text": "Mteja aliyepotes", + "openmrs_entity": "concept", + "openmrs_entity_id": "lost_to_followup" + } + ], + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "followup_visit_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "followup_visit_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_followup_calculation.yml" + } + } + } + }, + { + "key": "visit_number", + "type": "hidden", + "openmrs_entity_id": "visit_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_fv_baseline_investigation.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_fv_baseline_investigation.json new file mode 100644 index 000000000..04fac7f41 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_fv_baseline_investigation.json @@ -0,0 +1,430 @@ +{ + "count": "1", + "encounter_type": "PMTCT baseline investigation", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Uchunguzi wa Vipimo vya Awali", + "fields": [ + { + "key": "liver_function_test_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "liver_function_test_conducted", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_fv_baseline_investigation_calculation.yml" + } + } + } + }, + { + "key": "liver_function_test_conducted_question", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "liver_function_test_conducted_question", + "type": "native_radio", + "label": "Je, Mteja amefanyiwa kipimo cha Ini?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "test_conducted", + "text": "Ndio, Amefanyiwa kipimo", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted" + }, + { + "key": "test_not_conducted", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_liver_function_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_liver_function_test", + "type": "spinner", + "hint": "Sababu za kutomfanyia Mteja kipimo cha Ini", + "values": [ + "Vitendanishi vimekwisha", + "Mteja alikuwa kwenye hali yenye kuhitaji udharura", + "mteja amekaa kufanyiwa kipimo hiki", + "Bado tunaendelea kushauri Mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Chagua sababu" + }, + "relevance": { + "step1:liver_function_test_conducted": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_liver_function_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_liver_function_test", + "type": "edit_text", + "hint": "Bainisha sababu za kutomfanyia mteja kipimo cha Ini", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_liver_function_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "receive_liver_function_test_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receive_liver_function_test_results", + "type": "native_radio", + "label": "Je, umepokea majibu ya Mteja ya kipimo cha Ini?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "liver_function_test_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "liver_function_test_results", + "type": "native_radio", + "label": "Chagua majibu ya kipimo cha Ini ya Mteja", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "elevated_liver_enzymes", + "text": "Elevated Liver enzymes", + "openmrs_entity": "concept", + "openmrs_entity_id": "elevated_liver_enzymes" + }, + { + "key": "normal", + "text": "Ini lipo katika hali ya kawaida", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "step1:receive_liver_function_test_results": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "prompt_for_liver_function_test", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:liver_function_test_results": { + "type": "string", + "ex": "equalTo(., \"elevated_liver_enzymes\")" + } + } + }, + { + "key": "renal_function_test_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "renal_function_test_conducted", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_fv_baseline_investigation_calculation.yml" + } + } + } + }, + { + "key": "renal_function_test_conducted_question", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "renal_function_test_conducted_question", + "type": "native_radio", + "label": "Je, Mteja amefanyiwa kipimo cha Figo?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "test_conducted", + "text": "Kipimo cha Figo Kimefanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted" + }, + { + "key": "test_not_conducted", + "text": "Kipimo hakujafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_renal_function_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_renal_function_test", + "type": "spinner", + "hint": "Sababu ya kutomfanyia Mteja kipimo cha Figo", + "values": [ + "Vitendanishi vimeisha", + "Mteja alikuwa katika haili ya udharura", + "Mteja amekaa kipimo hiki", + "Bado tunaendelea kumshauri", + "Nyingine (Bainisha)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu ya kutomfanyia mteja kipimo cha Figo" + }, + "relevance": { + "step1:renal_function_test_conducted": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_renal_function_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_renal_function_test", + "type": "edit_text", + "hint": "Bainisha sababu nyingine", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_renal_function_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "receive_renal_function_test_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receive_renal_function_test_results", + "type": "native_radio", + "label": "Je, umepokea majibu ya Mteja ya kipimo cha Figo?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "renal_function_test_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "renal_function_test_results", + "type": "native_radio", + "label": "Chagua majibu ya kipimo cha Figo", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "elevated_serum_creatinine", + "text": "Elevated Serum Creatinine", + "openmrs_entity": "concept", + "openmrs_entity_id": "elevated_serum_creatinine" + }, + { + "key": "normal", + "text": "Figo lipo katika hali ya kawaida", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "step1:receive_renal_function_test_results": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "prompt_for_renal_function_test_results", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:renal_function_test_results": { + "type": "string", + "ex": "equalTo(., \"elevated_serum_creatinine\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_fv_counselling.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_fv_counselling.json new file mode 100644 index 000000000..a9b6d6f74 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_fv_counselling.json @@ -0,0 +1,198 @@ +{ + "count": "1", + "encounter_type": "PMTCT counselling", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Elimu ya Afya Endelevu", + "fields": [ + { + "key": "is_client_counselled", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_client_counselled", + "type": "native_radio", + "label": "Je, Mteja amepatiwa elimu ya afya endelevu?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + } + }, + { + "key": "counselling_topics_provided", + "type": "check_box", + "label": "Tafadhali chagua mada ambayo mtoa huduma amemshauri Mteja", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "counselling_topics_provided", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_hiv_info", + "text": "Maambukizi ya VVU, Matibabu, Maendeleo ya Ugonjwa na jinsi ya kujikinga", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_hiv_info" + }, + { + "key": "chk_disclosure", + "text": "Uwazi wa hali ya maambukizi ya VVU na kubainisha msaidizi wa kimatibabu", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_disclosure" + }, + { + "key": "chk_promote_testing", + "text": "Kuhamasisha upimaji wa wenza na wenza walio katika mnyororo wa kingono", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_promote_testing" + }, + { + "key": "chk_ayf_services", + "text": "Huduma rafiki za afya kwa vijana (Ufuasi mzuri wa dawa na kubaki kwenye matunzo)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_ayf_services" + }, + { + "key": "chk_prevention_diseases", + "text": "Jinsi ya Kujikinga na Magonjwa, kutumia chandarua na usafi wa mazingira na Binafsi", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_prevention_diseases" + }, + { + "key": "chk_imp_cpt", + "text": "Umuhimu wa CPT, CrPET na TPT", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_imp_cpt" + }, + { + "key": "chk_imp_adherence", + "text": "Umuhimu wa ufuasi mzuri wa dawa, Jinsi ya kukumbuka kumeza dawa, kuandaa mpango na Jinsi ya kufanya wakati wa kusafiri au wakati unaumwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_imp_adherence" + }, + { + "key": "chk_imp_support_group", + "text": "Umuhimu wa CBS na Vikundi vya msaada vya watu wanaishi na VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_imp_support_group" + }, + { + "key": "chk_imp_appointment", + "text": "Umuhimu wa miadi, tarehe, muda na mpango wa kusafiri", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_imp_appointment" + }, + { + "key": "chk_sti_rti", + "text": "Magonjwa ya STIs/RTIs", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_sti_rti" + }, + { + "key": "chk_imp_insurance", + "text": "Umuhimu wa kughalimikiwa matibabu kwa kutumia Bima ya Afya", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_imp_insurance" + }, + { + "key": "chk_non_communicable_diseases_prevention", + "text": "Jinsi ya kujikinga na Magonjwa yasiyoambukiza (muhimu kuzingatia lishe, kufanya mazoezi, mtindo wa Maisha)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_non_communicable_diseases_prevention" + }, + { + "key": "chk_eac_sessions", + "text": "Ushauri mahususi wa Ufuasi mzuri wa dawa/ matibabu, kama HVL > 1000 copies/ml", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_eac_sessions" + }, + { + "key": "chk_infant_feeding_options", + "text": "Chaguzi za kulisha watoto wachanga katika muktadha wa VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_infant_feeding_options" + }, + { + "key": "chk_living_with_hiv", + "text": "Jinsi ya kuishi na maambukizi ya VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_living_with_hiv" + }, + { + "key": "chk_none", + "text": "Ushauri haukutolewa", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_none" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mada" + }, + "relevance": { + "step1:is_client_counselled": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_hvl_sample_collection.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_hvl_sample_collection.json new file mode 100644 index 000000000..adb5f65a0 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_hvl_sample_collection.json @@ -0,0 +1,156 @@ +{ + "count": "1", + "encounter_type": "PMTCT Follow-up Visit", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Kuchukua Sampuli ya HVL", + "fields": [ + { + "key": "clinician_name", + "type": "edit_text", + "hint": "Jina la Mtoa huduma", + "openmrs_entity_id": "clinician_name", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza jina la Mtoa huduma" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza jina la mtoa huduma" + } + }, + { + "key": "clinician_position", + "type": "spinner", + "hint": "Cheo cha Mtoa huduma", + "openmrs_entity_id": "clinician_position", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "Afisa Matibabu", + "Afisa Matibabu msaidizi", + "Afisa wa Kliniki ", + "Afisa wa Kliniki msaidizi" + ], + "keys": [ + "medical_officer", + "assistant_medical_officer", + "clinical_officer", + "assistant_clinical_officer" + ], + "openmrs_choice_ids": { + "medical_officer": "medical_officer", + "assistant_medical_officer": "assistant_medical_officer", + "clinical_officer": "clinical_officer", + "assistant_clinical_officer": "assistant_clinical_officer" + }, + "v_required": { + "value": true, + "err": "Tafadhali" + } + }, + { + "key": "clinician_phone_number", + "type": "edit_text", + "hint": "Namba ya simu ya Mtoa huduma", + "edit_type": "number", + "openmrs_entity_id": "clinician_phone_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Namba ya simu lazima iwe na tarakimu 10 na lazima ianze na 06 au 07" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Namba ya simu lazima iwe na tarakimu 10 na lazima ianze na 06 au 07" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza namba ya simu ya Mtoa huduma" + } + }, + { + "key": "hvl_collection_date", + "type": "date_picker", + "hint": "Tarehe ya kuchukua sampuli ya damu kwa ajili ya kupima wingi wa virusi mwilini", + "openmrs_entity_id": "hvl_collection_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "min_date": "today-5y", + "max_date": "today", + "v_required": { + "value": true, + "err": "Tafadhali ingiza Tarehe ya kuchukua sampuli ya damu kwa ajili ya kupima wingi wa virusi mwilini" + } + }, + { + "key": "hvl_collection_time", + "type": "time_picker", + "hint": "Muda wakati wa kuchukua sampuli ya damu kwa ajili ya kupima wingi wa virusi mwilini", + "openmrs_entity_id": "hvl_collection_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Tafadhali ingiza Muda wakati wa kuchukua sampuli ya damu kwa ajili ya kupima wingi wa virusi mwilini" + } + }, + { + "key": "hvl_sample_id", + "type": "edit_text", + "hint": "Namba ya Utambulisho ya Sampuli ya HVL", + "edit_type": "number", + "openmrs_entity_id": "hvl_sample_id", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Tafadhali ingiza Namba ya Utambulisho ya Sampuli ya HVL" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_hvl_suppression_after_eac_1.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_hvl_suppression_after_eac_1.json new file mode 100644 index 000000000..5bfacd9c1 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_hvl_suppression_after_eac_1.json @@ -0,0 +1,102 @@ +{ + "count": "1", + "encounter_type": "PMTCT Follow-up Visit", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "today": { + "openmrs_entity_parent": "", + "openmrs_entity": "encounter", + "openmrs_entity_id": "encounter_date" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "HVL Suppression", + "fields": [ + { + "key": "hvl_suppression_after_eac_1", + "type": "edit_text", + "hint": "Ukandamizaji wa HVL", + "openmrs_entity_id": "hvl_suppression_after_eac_1", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali weka thamani halali" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka thamani ya ukandamizaji wa HVL" + } + }, + { + "key": "notify_continue_regimen", + "type": "toaster_notes", + "text": "Endelea na regimen ya sasa", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_info_text": "Rudia HVL baada ya miezi 6, 12 na 18", + "toaster_type": "info", + "relevance": { + "step1:hvl_suppression_after_eac_1": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"1000\")" + } + } + }, + { + "key": "notify_continue_eac_second", + "type": "toaster_notes", + "text": "Mteja ataandikishwa kwenye EAC ya pili", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hvl_suppression_after_eac_1": { + "type": "numeric", + "ex": "greaterThan(.,\"1000\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_hvl_suppression_after_eac_2.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_hvl_suppression_after_eac_2.json new file mode 100644 index 000000000..b3895b951 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_hvl_suppression_after_eac_2.json @@ -0,0 +1,378 @@ +{ + "count": "1", + "encounter_type": "PMTCT Follow-up Visit", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "today": { + "openmrs_entity_parent": "", + "openmrs_entity": "encounter", + "openmrs_entity_id": "encounter_date" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "HVL Suppression", + "fields": [ + { + "key": "hvl_suppression_after_eac_2", + "type": "edit_text", + "hint": "Ukandamizaji wa HVL", + "openmrs_entity_id": "hvl_suppression_after_eac_2", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali weka thamani halali" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka thamani ya ukandamizaji wa HVL" + } + }, + { + "key": "notify_continue_regimen", + "type": "toaster_notes", + "text": "Endelea na regimen ya sasa", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_info_text": "Rudia HVL baada ya miezi 6, 12 na 18", + "toaster_type": "info", + "relevance": { + "step1:hvl_suppression_after_eac_2": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"1000\")" + } + } + }, + { + "key": "choose_presc_line", + "type": "spinner", + "hint": "Agiza regimen mpya", + "openmrs_entity_id": "choose_presc_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "Mstari wa Kwanza", + "Mstari wa Pili", + "Mstari wa Tatu" + ], + "keys": [ + "first_line", + "second_line", + "third_line" + ], + "openmrs_choice_ids": { + "first_line": "first_line", + "second_line": "second_line", + "third_line": "third_line" + }, + "relevance": { + "step1:hvl_suppression_after_eac_2": { + "type": "numeric", + "ex": "greaterThan(.,\"1000\")" + } + }, + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "first_line", + "type": "spinner", + "hint": "Maagizo ya ARVs Mstari wa Kwanza", + "openmrs_entity_id": "first_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "1gA", + "1pA", + "1rA", + "1uA", + "1hA", + "1xA" + ], + "keys": [ + "1_gA", + "1_pA", + "1_rA", + "1_uA", + "1_hA", + "1_xA" + ], + "openmrs_choice_ids": { + "1_gA": "1_gA", + "1_pA": "1_pA", + "1_rA": "1_rA", + "1_uA": "1_uA", + "1_hA": "1_hA", + "1_xA": "1_xA" + }, + "relevance": { + "step1:choose_presc_line": { + "type": "string", + "ex": "equalTo(.,\"first_line\")" + } + }, + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "second_line", + "type": "spinner", + "hint": "Dawa ya Mstari wa Pili wa ARVs", + "openmrs_entity_id": "second_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "2fA", + "2hA", + "2sA", + "2GA", + "2kA", + "2nA", + "2uA", + "2xA" + ], + "keys": [ + "2_fA", + "2_hA", + "2_sA", + "2_GA", + "2_kA", + "2_nA", + "2_uA", + "2_xA" + ], + "openmrs_choice_ids": { + "2_fA": "2_fA", + "2_hA": "2_hA", + "2_sA": "2_sA", + "2_GA": "2_GA", + "2_kA": "2_kA", + "2_nA": "2_nA", + "2_uA": "2_uA", + "2_xA": "2_xA" + }, + "relevance": { + "step1:choose_presc_line": { + "type": "string", + "ex": "equalTo(.,\"second_line\")" + } + }, + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "third_line", + "type": "spinner", + "hint": "Maagizo ya ARVs Mstari wa Tatu", + "openmrs_entity_id": "third_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "3yA", + "3wA", + "3kA", + "3tA", + "3hA", + "3gA", + "3zA", + "3xA" + ], + "keys": [ + "3_wA", + "3_kA", + "3_tA", + "3_hA", + "3_gA", + "3_zA", + "3_xA", + "3_yA" + ], + "openmrs_choice_ids": { + "3_wA": "3_wA", + "3_kA": "3_kA", + "3_tA": "3_tA", + "3_hA": "3_hA", + "3_gA": "3_gA", + "3_zA": "3_zA", + "3_xA": "3_xA", + "3_yA": "3_yA" + }, + "relevance": { + "step1:choose_presc_line": { + "type": "string", + "ex": "equalTo(.,\"third_line\")" + } + }, + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "type": "hidden", + "key": "eac_day_1", + "openmrs_entity_id": "eac_day_1", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + }, + { + "type": "hidden", + "key": "eac_day_2", + "openmrs_entity_id": "eac_day_2", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + }, + { + "type": "hidden", + "key": "eac_day_3", + "openmrs_entity_id": "eac_day_3", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "step1:hvl_suppression_after_eac_2": { + "type": "numeric", + "ex": "greaterThan(.,\"1000\")" + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + }, + { + "type": "hidden", + "key": "eac_month_1", + "openmrs_entity_id": "eac_month_1", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + }, + { + "type": "hidden", + "key": "eac_month_2", + "openmrs_entity_id": "eac_month_2", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + }, + { + "type": "hidden", + "key": "eac_month_3", + "openmrs_entity_id": "eac_month_3", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + }, + { + "type": "hidden", + "key": "hvl_suppression", + "hint": "HVL Suppression", + "openmrs_entity_id": "hvl_suppression", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + }, + { + "type": "hidden", + "key": "hvl_suppression_after_eac_1", + "hint": "HVL Suppression", + "openmrs_entity_id": "hvl_suppression_after_eac_1", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_hvl_test_results.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_hvl_test_results.json new file mode 100644 index 000000000..c0754c9c2 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_hvl_test_results.json @@ -0,0 +1,586 @@ +{ + "count": "1", + "encounter_type": "PMTCT HVL Results", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": { + "is_after_eac": false + }, + "step1": { + "title": "HVL Suppression", + "fields": [ + { + "key": "hvl_sample_id", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "hvl_sample_id", + "openmrs_entity_parent": "" + }, + { + "key": "notify_tnd_results", + "type": "toaster_notes", + "text": "For HVL results that is TND, fill the results as 11", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning" + }, + { + "key": "hvl_result", + "type": "edit_text", + "hint": "Majibu ya HVL", + "openmrs_entity_id": "hvl_result", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza kiasi kwa usahihi" + }, + "v_required": { + "value": true, + "err": "Tafadhali Ingiza kiasi cha kufubaa kwa Virusi" + } + }, + { + "key": "hvl_results_comment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hvl_results_comment", + "type": "edit_text", + "hint": "Remarks/Comments", + "v_required": { + "value": "false", + "err": "Please enter the your remarks/comments" + }, + "relevance": { + "step1:hvl_result": { + "type": "string", + "ex": "equalTo(., \"11\")" + } + } + }, + { + "key": "notify_continue_regimen", + "type": "toaster_notes", + "text": "Continue current regimen", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_info_text": "Rudia kupima wingi wa virusi baada ya mwezi wa 6, 12 na 18", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "notify_continue_eac", + "type": "toaster_notes", + "text": "Mteja ataunganishwa katika EAC", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "discuss_plan_prompt", + "type": "toaster_notes", + "text": "Jadili Mpango wa matibabu ya Mteja Huyu", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "significant_drop_in_viral_load", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "significant_drop_in_viral_load", + "type": "native_radio", + "label": "Was it a significant drop in the Viral Load (fulfilling criteria of good response to EAC)?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "patient_presenting_oi_or_immunosuppression", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "patient_presenting_oi_or_immunosuppression", + "type": "native_radio", + "label": "Is this patient presenting any other OI or signs of immunosuppression?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "describe_patient_presenting_oi_or_immunosuppression", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "describe_patient_presenting_oi_or_immunosuppression", + "type": "edit_text", + "hint": "Describe the presenting OI or signs of immunosuppression", + "v_required": { + "value": "true", + "err": "Please answer the question" + }, + "relevance": { + "step1:patient_presenting_oi_or_immunosuppression": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "history_of_chronic_diarrhea_or_vomiting", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "history_of_chronic_diarrhea_or_vomiting", + "type": "native_radio", + "label": "History of chronic diarrhea or vomiting?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "use_of_traditional_medications", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "use_of_traditional_medications", + "type": "native_radio", + "label": "Use of traditional medications?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "history_of_arv_side_effects", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "history_of_arv_side_effects", + "type": "native_radio", + "label": "History of side-effects with ARV?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "describe_history_of_arv_side_effects", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "describe_history_of_arv_side_effects", + "type": "edit_text", + "hint": "Describe symptom and possible drug", + "v_required": { + "value": "true", + "err": "Please answer the question" + }, + "relevance": { + "step1:history_of_arv_side_effects": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "arv_regimen_plan", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "arv_regimen_plan", + "type": "native_radio", + "label": "Regarding the ARV regimen, what is the plan?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "continue_current_regimen", + "text": "Continue current regimen", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "continue_current_regimen" + }, + { + "key": "refer_to_doctor", + "text": "Refer to doctor for further management", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "refer_to_doctor" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "assessor_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "assessor_name", + "type": "edit_text", + "hint": "Assessor's Name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the assessor's name" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "plan_for_patient", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "plan_for_patient", + "type": "native_radio", + "label": "What is the plan for this patient?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "suitable_for_second_line_regimen", + "text": "Patient is suitable for Second-line Regimen", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "suitable_for_second_line_regimen" + }, + { + "key": "extend_eac_sessions", + "text": "Extend adherence sessions before new Viral Load (in 2-3 months’ time)", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "extend_eac_sessions" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "second_line", + "type": "spinner", + "hint": "New Regimen\nSecond Line", + "openmrs_entity_id": "second_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "2f-A (TDF+FTC+LPV/r)", + "2h-A (TDF+FTC+ATV/r)", + "2s-A (AZT+3TC+ATV/r)", + "2g-A (ABC+3TC+LPV/r)", + "2k-A (ABC+3TC+ATV/r)", + "2n-A (AZT+3TC+LPV/r)", + "2x-A (Other 2nd line)" + ], + "keys": [ + "2_fA", + "2_hA", + "2_sA", + "2_gA", + "2_kA", + "2_nA", + "2_xA" + ], + "openmrs_choice_ids": { + "2_fA": "2_fA", + "2_hA": "2_hA", + "2_sA": "2_sA", + "2_gA": "2_gA", + "2_kA": "2_kA", + "2_nA": "2_nA", + "2_xA": "2_xA" + }, + "v_required": { + "value": true, + "err": "Please answer this question" + }, + "relevance": { + "step1:plan_for_patient": { + "type": "string", + "ex": "equalTo(., \"suitable_for_second_line_regimen\")" + } + } + }, + { + "key": "plan_for_patient_comment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "plan_for_patient_comment", + "type": "edit_text", + "hint": "Comment", + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "review_team_lead_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "review_team_lead_name", + "type": "edit_text", + "hint": "Review Team Lead Name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the review team lead's name" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "hvl_result_date", + "type": "hidden", + "openmrs_entity_id": "hvl_result_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_calculation.yml" + } + } + } + }, + { + "key": "enroll_to_eac", + "type": "hidden", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "enroll_to_eac", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_prescription_line_selection.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_prescription_line_selection.json new file mode 100644 index 000000000..eb55b4c0c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_prescription_line_selection.json @@ -0,0 +1,344 @@ +{ + "count": "1", + "encounter_type": "PMTCT prescription line selection", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Kupatiwa Dawa za ARV", + "fields": [ + { + "key": "prescribed_regimes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prescribed_regimes", + "type": "native_radio", + "label": "Je, Mteja ameandikiwa na kupewa ARVs?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo:" + } + }, + { + "key": "arv_line", + "type": "spinner", + "hint": "Chagua laini ya ARV", + "openmrs_entity_id": "arv_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "Mstari wa Kwanza", + "Mstari wa Pili", + "Mstari wa tatu" + ], + "keys": [ + "first_line", + "second_line", + "third_line" + ], + "openmrs_choice_ids": { + "first_line": "first_line", + "second_line": "second_line", + "third_line": "third_line" + }, + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "step1:prescribed_regimes": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "first_line", + "type": "spinner", + "hint": "Dawa za ARVs katika mstari wa kwanza", + "openmrs_entity_id": "first_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "1g-A (TDF+3TC+EFV)", + "1b-A (AZT+3TC+NVP)", + "1c-A (AZT+3TC+EFV)", + "1k-A (ABC+3TC+EFV)", + "1p-A (ABC+3TC+DTG)", + "1r-A (TDF+3TC+DTG)", + "1u-A (AZT+3TC+DTG)", + "1q-A (TDF+FTC+DTG)", + "1x-A (Other 1st line)" + ], + "keys": [ + "1_gA", + "1_bA", + "1_cA", + "1_kA", + "1_pA", + "1_rA", + "1_uA", + "1_qA", + "1_xA" + ], + "openmrs_choice_ids": { + "1_gA": "1_gA", + "1_bA": "1_bA", + "1_cA": "1_cA", + "1_kA": "1_kA", + "1_pA": "1_pA", + "1_rA": "1_rA", + "1_uA": "1_uA", + "1_qA": "1_qA", + "1_xA": "1_xA" + }, + "relevance": { + "step1:arv_line": { + "type": "string", + "ex": "equalTo(.,\"first_line\")" + } + }, + "v_required": { + "value": true, + "err": "Tafadhali swali hili" + } + }, + { + "key": "second_line", + "type": "spinner", + "hint": "Dawa za ARVs katika Mstari wa pili", + "openmrs_entity_id": "second_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "2f-A (TDF+FTC+LPV/r)", + "2h-A (TDF+FTC+ATV/r)", + "2s-A (AZT+3TC+ATV/r)", + "2g-A (ABC+3TC+LPV/r)", + "2k-A (ABC+3TC+ATV/r)", + "2n-A (AZT+3TC+LPV/r)", + "2x-A (Other 2nd line)" + ], + "keys": [ + "2_fA", + "2_hA", + "2_sA", + "2_gA", + "2_kA", + "2_nA", + "2_xA" + ], + "openmrs_choice_ids": { + "2_fA": "2_fA", + "2_hA": "2_hA", + "2_sA": "2_sA", + "2_gA": "2_gA", + "2_kA": "2_kA", + "2_nA": "2_nA", + "2_xA": "2_xA" + }, + "relevance": { + "step1:arv_line": { + "type": "string", + "ex": "equalTo(.,\"second_line\")" + } + }, + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "third_line", + "type": "spinner", + "hint": "Dawa za ARVs katika mstari wa tatu", + "openmrs_entity_id": "third_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "3y-A (DTG+DRV/r+AZT+3TC)", + "3w-A (RAL+DRV/r+AZT+3TC)", + "3k-A (DTG+LPV/r+AZT+3TC)", + "3t-A (DTG+LPV/r+TDF+FTC)", + "3h-A (RAL+LPV/r+AZT+3TC)", + "3g-A (RAL+LPV/r+TDF+FTC)", + "3z-A (DTG+ATV/r+AZT+3TC)", + "3x-A (Other 3rd line)" + ], + "keys": [ + "3_yA", + "3_wA", + "3_kA", + "3_tA", + "3_hA", + "3_gA", + "3_zA", + "3_xA" + ], + "openmrs_choice_ids": { + "3_wA": "3_wA", + "3_kA": "3_kA", + "3_tA": "3_tA", + "3_hA": "3_hA", + "3_gA": "3_gA", + "3_zA": "3_zA", + "3_xA": "3_xA", + "3_yA": "3_yA" + }, + "relevance": { + "step1:arv_line": { + "type": "string", + "ex": "equalTo(.,\"third_line\")" + } + }, + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "reason_for_not_prescribing_arv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_prescribing_arv", + "type": "native_radio", + "label": "Sababu za kutokumpa dawa za ARVs ", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_medicine", + "text": "Dawa zimeisha", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_medicine" + }, + { + "key": "client_refused_medication", + "text": "Mteja amekataa kuchukua dawa", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_refused_medication" + }, + { + "key": "other", + "text": "Nyingine", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo:" + }, + "relevance": { + "step1:prescribed_regimes": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_for_not_prescribing_arv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_prescribing_arv", + "type": "edit_text", + "hint": "Sababu nyingine", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali bainisha sababu nyingine za kutokumpa mteja ARVs" + }, + "relevance": { + "step1:reason_for_not_prescribing_arv": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "number_of_arv_regimes_days_dispensed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_arv_regimes_days_dispensed", + "type": "edit_text", + "edit_type": "number", + "hint": "Idadi ya Siku Iliyotolewa", + "v_required": { + "value": "true", + "err": "Tafadhali jaza idadi ya siku iliyotolewa" + }, + "v_numeric_integer": { + "value": "true", + "err": "Tafadhali ingiza namba halali" + }, + "v_min": { + "value": "0", + "err": "Idadi ya siku iliyotolewa inatakiwa iwe zaidi ya 0" + }, + "v_max": { + "value": "180", + "err": "Idadi ya siku iliyotolewa inatakiwa iwe sawa na au chini ya 180" + }, + "relevance": { + "step1:prescribed_regimes": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_registration.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_registration.json new file mode 100644 index 000000000..3fead91a7 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_registration.json @@ -0,0 +1,370 @@ +{ + "count": "2", + "encounter_type": "PMTCT Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "ART", + "next": "step2", + "fields": [ + { + "key": "pmtct_register_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "pmtct_register_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_form_calculation.yml" + } + } + } + }, + { + "key": "hiv_registration_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "hiv_registration_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_form_calculation.yml" + } + } + } + }, + { + "key": "known_on_art", + "type": "native_radio", + "label": "Je, Mteja huyu yupo kwenye ART?", + "openmrs_entity_id": "known_on_art", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "is_transfer_in_client", + "type": "native_radio", + "label": "Je, Mteja amehamia kutoka Kituo kingine?", + "openmrs_entity_id": "is_transfer_in_client", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "step1:known_on_art": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "pmtct_register_date_from_originating_facility", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_register_date_from_originating_facility", + "type": "date_picker", + "hint": "Tarehe ya usajili katika huduma za PMTCT katika Kituo cha Afya alichotokea", + "expanded": false, + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza tarehe ya usajili katika huduma za PMTCT katika Kituo cha Afya alichotokea" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + } + }, + { + "key": "pmtct_register_date_at_this_facility", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_register_date_at_this_facility", + "type": "date_picker", + "hint": "Tarehe ya usajili katika huduma za PMTCT", + "expanded": false, + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza tarehe ya usajili katika huduma za PMTCT" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + } + } + ] + }, + "step2": { + "title": "Mwisho", + "fields": [ + { + "key": "notify_retest", + "type": "toaster_notes", + "text": "Tafadhali fanya kipimo cha HIV cha uhakiki kwa Mteja", + "openmrs_entity_id": "notify_retest", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:known_on_art": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "test_results", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "test_results", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_form_calculation.yml" + } + } + } + }, + { + "key": "hiv_status", + "type": "native_radio", + "label": "Hali ya VVU", + "openmrs_entity_id": "hiv_status", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity_id": "positive", + "openmrs_entity": "concept" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity_id": "negative", + "openmrs_entity": "concept" + } + ], + "relevance": { + "step1:known_on_art": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + }, + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "has_the_client_been_provided_with_ctc_number", + "type": "native_radio", + "label": "Je mteja amepewa namba ya CTC?", + "openmrs_entity_id": "has_the_client_been_provided_with_ctc_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "Namba ya CTC", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "Namba ya CTC inatakiwa kuwa (XX-XX-XXXX-XXXXXX)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Tafadhali jaza namba ya CTC ya mteja" + }, + "v_required": { + "value": true, + "err": "Tafadhali jaza namba ya CTC ya mteja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + } + }, + { + "key": "notify_first_visit", + "type": "toaster_notes", + "text": "Fanya Hudhurio awali la PMTCT", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "step1:known_on_art": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "notify_continue_with_anc", + "type": "toaster_notes", + "text": "Mshauri Mteja aendelee na huduma za ANC", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "step2:hiv_status": { + "type": "string", + "ex": "equalTo(.,\"negative\")" + } + } + }, + { + "key": "next_facility_visit_date", + "type": "hidden", + "openmrs_entity_id": "next_facility_visit_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_form_calculation.yml" + } + } + } + }, + { + "key": "followup_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "followup_status", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_form_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_registration_for_clients_known_on_art.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_registration_for_clients_known_on_art.json new file mode 100644 index 000000000..227d4eafc --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_registration_for_clients_known_on_art.json @@ -0,0 +1,195 @@ +{ + "count": "1", + "encounter_type": "PMTCT Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": { + }, + "step1": { + "title": "Mteja yupo kwenye ART tayari", + "fields": [ + { + "key": "pmtct_register_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "pmtct_register_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_form_calculation.yml" + } + } + } + }, + { + "key": "hiv_registration_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "hiv_registration_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_form_calculation.yml" + } + } + } + }, + { + "key": "known_on_art", + "type": "hidden", + "openmrs_entity_id": "known_on_art", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "value": "yes" + }, + { + "key": "is_transfer_in_client", + "type": "native_radio", + "label": "Je, Mteja amehamia kutoka Kituo kingine?", + "openmrs_entity_id": "is_transfer_in_client", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "pmtct_register_date_from_originating_facility", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_register_date_from_originating_facility", + "type": "date_picker", + "hint": "Tarehe ya usajili katika huduma za PMTCT katika Kituo cha Afya alichotokea", + "expanded": false, + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza tarehe ya usajili katika huduma za PMTCT katika Kituo cha Afya alichotokea" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + } + }, + { + "key": "pmtct_register_date_at_this_facility", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_register_date_at_this_facility", + "type": "date_picker", + "hint": "Tarehe ya usajili katika huduma za PMTCT", + "expanded": false, + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza tarehe ya usajili katika huduma za PMTCT" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + } + }, + { + "key": "test_results", + "type": "hidden", + "openmrs_entity_id": "test_results", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "value": "positive" + }, + { + "key": "ctc_number", + "type": "hidden", + "openmrs_entity_id": "ctc_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_calculation.yml" + } + } + } + }, + { + "key": "known_on_art_client", + "type": "toaster_notes", + "text": "Mteja mwenye CTC Namba {ctc_number} yupo kwenye ART tayari.\n\nTuma fomu hii kwa kumsajili Mteja huyu PMTCT na nakiri hudhurio la awali.", + "openmrs_entity_id": "notify_retest", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_tb_screening.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_tb_screening.json new file mode 100644 index 000000000..45fb3c0b7 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pmtct_tb_screening.json @@ -0,0 +1,496 @@ +{ + "count": "1", + "encounter_type": "PMTCT tb screening", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Uchunguzi wa Awali wa Kifua Kikuu", + "fields": [ + { + "key": "on_tb_treatment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "on_tb_treatment", + "type": "native_radio", + "label": "Je, Mteja huyu yupo katika Matibabu ya Kifua kikuu?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + } + }, + { + "key": "tb_registration_number", + "type": "edit_text", + "openmrs_entity_id": "tb_registration_number", + "hint": "Namba ya Kliniki ya TB ya mteja", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "step1:on_tb_treatment": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba ya Kliniki ya TB" + } + }, + { + "key": "tb_symptoms_screening", + "type": "check_box", + "label": "Tafadhali chagua kama Mteja ana dalili zifuatazo za Kifua Kikuu?", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "tb_symptoms_screening", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_cough", + "text": "Mteja anakikohozi cha muda wowote", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_cough" + }, + { + "key": "chk_sputum", + "text": "Mteja anakohoa makohozi yaliyochanganyika na damu", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_sputum" + }, + { + "key": "chk_fevers", + "text": "Mteja amekuwa na Homa kwa zaidi ya wiki mbili", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_fevers" + }, + { + "key": "chk_weight_loss", + "text": "Mteja anapoteza Uzito", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_weight_loss" + }, + { + "key": "chk_weight_loss_subsequent_visit", + "text": "Mteja amepungua uzito katika mfululizo mahudhulio", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_weight_loss_subsequent_visit" + }, + { + "key": "chk_excessive_sweating", + "text": "Mteja amekuwa akitoka na jasho jingi sana usiku kwa wiki mbili au zaidi", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_excessive_sweating" + }, + { + "key": "chk_none", + "text": "Hakuna", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_none" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mada" + }, + "relevance": { + "step1:on_tb_treatment": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "investigate_for_tb", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "investigate_for_tb", + "type": "native_radio", + "label": "Fanya uchunguzi wa Kifua kikuu", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hazi", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha TB hakijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo:" + }, + "relevance": { + "step1:tb_symptoms_screening": { + "ex-checkbox": [ + { + "or": [ + "chk_cough", + "chk_sputum", + "chk_fevers", + "chk_weight_loss", + "chk_weight_loss_subsequent_visit", + "chk_excessive_sweating" + ] + } + ] + } + } + }, + { + "key": "reason_for_not_conducting_tb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_tb_test", + "type": "spinner", + "hint": "Reason as to why the TB test was not conducted", + "values": [ + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:investigate_for_tb": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_tb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_tb_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting TB test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_tb_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "prompt_for_tb_treatment", + "type": "toaster_notes", + "text": "Mpe rufaa mteja kwa ajili ya Matibabu ya Kifua kikuu", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:investigate_for_tb": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "has_been_provided_with_tpt_before", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "has_been_provided_with_tpt_before", + "type": "native_radio", + "label": "Je, Mteja amewahi kupewa TPT kabla?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio (Amemaliza TPT)", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "partial_complete", + "text": "Ndio (Lakini hajamaliza TPT)", + "openmrs_entity": "concept", + "openmrs_entity_id": "partial_complete" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_tb_screening_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_tpt_eligibility", + "type": "toaster_notes", + "text": "Mteja huyu anakidhi vigezo kwa ajili ya kupewa TPT", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_tb_screening_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_tpt_ineligibility", + "type": "toaster_notes", + "text": "Mteja huyu hakidhi vigezo vya kupewa TPT", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_tb_screening_relevance.yml" + } + } + } + }, + { + "key": "completed_tpt", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "completed_tpt", + "type": "native_radio", + "label": "Je mteja amemaliza dose ya TPT?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu sahihi" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_tb_screening_relevance.yml" + } + } + } + }, + { + "key": "is_client_provided_with_tpt", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_client_provided_with_tpt", + "type": "native_radio", + "label": "Je, Mteja huyu amepewa TPT leo?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_tb_screening_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_providing_tpt", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_tpt", + "type": "native_radio", + "label": "Sababu ya kutompatia Mteja TPT?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_medicine", + "text": "Dawa zimeisha", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_medicine" + }, + { + "key": "client_refused_medication", + "text": "Mteja amekataa kuchukua dawa", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_refused_medication" + }, + { + "key": "client_allergic_to_tpt", + "text": "Mteja huyu ana mzio na dawa za TPT", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_allergic_to_tpt" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "step1:is_client_provided_with_tpt": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "number_of_tpt_days_dispensed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_tpt_days_dispensed", + "type": "edit_text", + "edit_type": "number", + "hint": "Idadi ya Siku Iliyotolewa", + "v_required": { + "value": "true", + "err": "Tafadhali jaza idadi ya siku iliyotolewa" + }, + "v_numeric_integer": { + "value": "true", + "err": "Tafadhali ingiza namba halali" + }, + "v_min": { + "value": "1", + "err": "Idadi ya siku iliyotolewa inatakiwa iwe zaidi ya 0" + }, + "v_max": { + "value": "180", + "err": "Idadi ya siku iliyotolewa inatakiwa iwe sawa na au chini ya 180" + }, + "relevance": { + "step1:is_client_provided_with_tpt": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_child_general_examination.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_child_general_examination.json new file mode 100644 index 000000000..53996bc3e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_child_general_examination.json @@ -0,0 +1,821 @@ +{ + "count": "1", + "encounter_type": "PNC Child Followup", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Uchunguzi wa Afya ya Mtoto", + "fields": [ + { + "key": "child_activeness", + "type": "native_radio", + "label": "Uchangamfu wa Mtoto", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_activeness", + "openmrs_entity_parent": "", + "options": [ + { + "key": "active", + "text": "Mchangamfu", + "openmrs_entity": "concept", + "openmrs_entity_id": "active" + }, + { + "key": "not_active", + "text": "Sio Mchangamfu", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_active" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_child_activeness", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:child_activeness": { + "type": "string", + "ex": "equalTo(.,\"not_active\")" + } + } + }, + { + "key": "height", + "type": "edit_text", + "hint": "Urefu (cm)", + "openmrs_entity": "concept", + "openmrs_entity_id": "height", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza Urefu" + }, + "v_min": { + "value": "10", + "err": "Urefu lazima uwe sawa au mkubwa kuliko 10 (cm)" + }, + "v_max": { + "value": "80", + "err": "Urefu lazima uwe sawa au mkubwa kuliko 80 (cm)" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza Urefu" + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Uzito (Kg)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza Uzito" + }, + "v_min": { + "value": "0.5", + "err": "The weight must be equal or greater than 0.5 (KG)" + }, + "v_max": { + "value": "7", + "err": "The weight must be equal or less than 7 (KG)" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza Uzito" + } + }, + { + "key": "hb_level_test", + "type": "native_radio", + "label": "Kipimo cha Kiwango cha damu (HB)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "test_conducted", + "text": "Kipimo cha kiwango cha damu (HB) kimefanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted", + "openmrs_entity_parent": "" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha kiwango cha damu (HB) hakijafanyika", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "hb_level", + "type": "edit_text", + "hint": "Kiwango cha damu (HB) (g/dl)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza kiwango cha damu (HB)" + }, + "v_min": { + "value": "0", + "err": "Kiwango cha damu (HB) lazima kiwe sawasawa au zaidi ya 0 (g/dl)" + }, + "v_max": { + "value": "20", + "err": "Kiwango cha damu (HB) lazima kiwe sawasawa au chini ya20 (g/dl)" + }, + "v_required": { + "value": true, + "err": "Tafadhali weka thamani" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_conducted\")" + } + } + }, + { + "key": "prompt_for_severe_anaemia_treatment", + "type": "toaster_notes", + "text": "Dhibiti hali hii ya upungufu mkubwa wa damu kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_severe_anaemia_treatment", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hb_level": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"8.5\")" + } + } + }, + { + "key": "prompt_for_moderate_anaemia_management", + "type": "toaster_notes", + "text": "Dhibiti hali hii ya ukosefu wa damu kulingana na muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_moderate_anaemia_management", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hb_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha HB", + "values": [ + "Cuvette Cartridges Hazipo Kituoni", + "Mashine ya Kupimwa wingi wa damu (Haemoque) haifanyi kazi", + "Mteja alikuwa katika hali ya dharura", + "Mteja amekataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "stock_out_of_cuvettes_cartridges": "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order": "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_hb_test_not_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_hb_test_not_conducted", + "type": "edit_text", + "hint": "Sababu nyingine ya kutofanya kipimo cha kiwango cha damu (HB)", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_hb_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "temperature", + "type": "edit_text", + "hint": "Joto (\u2103)", + "openmrs_entity_id": "temperature", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza Joto (\u2103)" + }, + "v_min": { + "value": "10", + "err": "Joto lazima iwe sawa au kubwa kuliko 10 (\u2103)" + }, + "v_max": { + "value": "50", + "err": "Joto lazima iwe sawa au kubwa kuliko 50 (\u2103)" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza Joto (\u2103)" + } + }, + { + "key": "notify_client_has_high_temperature", + "type": "toaster_notes", + "text": "Fanya vipimo vya maabara vinavyofaa ili kupata sababu ya homa na udhibiti kulingana na mwongozo wa Wizara ya Afya", + "openmrs_entity_id": "notify_client_has_fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "greaterThan(.,\"38.5\")" + } + } + }, + { + "key": "notify_client_has_low_temperature", + "type": "toaster_notes", + "text": "Mpatie mtoto joto na huduma zingine muhimu za utunzaji wa watoto wachanga kulingana na mwongozo wa Wizara ya Afya", + "openmrs_entity_id": "notify_client_has_hypothermia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "lessThan(.,\"36.5\")" + } + } + }, + { + "key": "head_circumference", + "type": "edit_text", + "hint": "Mzunguko wa kichwa cha Mtoto (CM)", + "openmrs_entity": "concept", + "openmrs_entity_id": "head_circumference", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza mzunguko wa kichwa (CM)" + }, + "v_min": {}, + "v_required": { + "value": true, + "err": "Tafadhali ingiza mzunguko wa kichwa (CM)" + } + }, + { + "key": "prompt_for_large_head_circumference", + "type": "toaster_notes", + "text": "Tathmini vipengele vya vichwa vikubwa (hydrocephalus) na mpatie rufaa kwa ajili ya uwezekano wa kupatiwa upasuaji kichwa", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:head_circumference": { + "type": "numeric", + "ex": "greaterThan(.,\"50\")" + } + } + }, + { + "key": "prompt_for_small_head_circumference", + "type": "toaster_notes", + "text": "Angalia dalili za ugonjwa unaozuia mttoto asiweze kujifunza (down's syndrome) au kasoro zingine za neva zinazopelekea kuwa na kichwa kidogo (microcephaly). Mpatie rufaa mtoto kwa ajili ya matibabu ya hali ya juu", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:head_circumference": { + "type": "numeric", + "ex": "lessThan(.,\"30\")" + } + } + }, + { + "key": "upper_arm_circumference", + "type": "edit_text", + "hint": "Mzunguko wa juu wa mkono (CM)", + "openmrs_entity": "concept", + "openmrs_entity_id": "upper_arm_circumference", + "openmrs_entity_parent": "", + "v_min": { + "value": "7.5", + "err": "Mzunguko wa juu wa mkono hauwezi kuwa chini ya 7.5" + }, + "v_max": { + "value": "13", + "err": "Mzunguko wa juu wa mkono hauwezi kuzidi 13" + }, + "v_numeric": { + "value": "true", + "err": "Ingiza Mzunguko wa juu wa mkono (CM)" + }, + "v_required": { + "value": true, + "err": "Ingiza mzunguko wa juu wa mkono (CM)" + } + }, + { + "key": "feeding_options", + "type": "native_radio", + "label": "Chaguzi za kulisha", + "openmrs_entity": "concept", + "openmrs_entity_id": "feeding_options", + "openmrs_entity_parent": "", + "options": [ + { + "key": "ebf", + "text": "Kumnyonyesha maziwa ya mama pekee kwa kipindi cha Miezi 6 ya Mwanzo (EBF)", + "openmrs_entity": "concept", + "openmrs_entity_id": "ebf" + }, + { + "key": "rf", + "text": "Kumnyonyesha maziwa mbadala (RF)", + "openmrs_entity": "concept", + "openmrs_entity_id": "rf" + }, + { + "key": "mf", + "text": "Ananyonyeshwa maziwa ya mama na kupatiwa chakula kingine (MF)", + "openmrs_entity": "concept", + "openmrs_entity_id": "mf" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "septicaemia", + "type": "native_radio", + "label": "Mtoto ana uambukizo mkali (Septicaemia)", + "openmrs_entity": "concept", + "openmrs_entity_id": "septicaemia", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_septicaemia", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "prompt_for_septicaemia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:septicaemia": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "umbilical_cord", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "umbilical_cord", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Tathimini ya Kitovu", + "exclusive": [ + "chk_no_abnormalities" + ], + "options": [ + { + "key": "chk_smell_bad", + "text": "Kina harufu mbaya", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_smell_bad", + "value": "false" + }, + { + "key": "chk_infection", + "text": "Kina maambukizi", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_infection", + "value": "false" + }, + { + "key": "chk_descended", + "text": "Kimevimba/kimetanuka", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_descended", + "value": "false" + }, + { + "key": "chk_delayed_off", + "text": "Kimechelewa kukatika", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_delayed_off", + "value": "false" + }, + { + "key": "chk_no_abnormalities", + "text": "Hakina hali yoyote isiyo ya kawaida", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_no_abnormalities", + "value": "false" + }, + { + "key": "chk_other", + "text": "Nyingine (Bainisha)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_other", + "value": "false" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_umbilical_cord_smelling_bad", + "type": "toaster_notes", + "text": "Dhibiti kulingana na mwongozo wa Wizara ya Afya/Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:umbilical_cord": { + "ex-checkbox": [ + { + "or": [ + "chk_smell_bad", + "chk_infection" + ] + } + ] + } + } + }, + { + "key": "umbilical_cord_other_assessment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "umbilical_cord_other_assessment", + "type": "edit_text", + "hint": "Bainisha Tathimini ya Kitovu Nyingine", + "v_required": { + "value": "true", + "err": "Tafadhali bainisha tathimini ya kitovu nyingine" + }, + "relevance": { + "step1:umbilical_cord": { + "ex-checkbox": [ + { + "or": [ + "chk_other" + ] + } + ] + } + } + }, + { + "key": "jaundice", + "type": "native_radio", + "label": "Je, Mtoto ana homa ya manjano?", + "openmrs_entity": "concept", + "openmrs_entity_id": "jaundice", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_jaundice", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:jaundice": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "skin_infection", + "type": "native_radio", + "label": "Je, Mtoto ana maambukizi ya ngozi?", + "openmrs_entity": "concept", + "openmrs_entity_id": "skin_infection", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_skin_infection", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:skin_infection": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "kangaroo_enrollment", + "type": "native_radio", + "label": "Je, mtoto ameanzishiwa huduma ya kangaroo (KMC)?", + "openmrs_entity": "concept", + "openmrs_entity_id": "kangaroo_enrollment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_child_examination_relevance.yml" + } + } + } + }, + { + "key": "child_bcg_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_bcg_vaccination", + "type": "native_radio", + "label": "Je, mtoto amechanjwa BCG?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Chagua mojawapo" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_child_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_bcg_vaccination", + "type": "toaster_notes", + "text": "Mtoto apewe chanjo ya BCG", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:child_bcg_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "child_opv0_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_opv0_vaccination", + "type": "native_radio", + "label": "Je, mtoto amechanjwa OPV0?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu sahihi" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_child_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_opv0_vaccination", + "type": "toaster_notes", + "text": "Mtoto apewe chanjo ya OPV0 kabla ya umri wa siku 14", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:child_opv0_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "followup_visit_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "followup_visit_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_followup_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_counselling.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_counselling.json index 4cbc54c7b..c6ef53fc3 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_counselling.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_counselling.json @@ -47,7 +47,7 @@ "encounter_location": "" }, "step1": { - "title": "Ushauri", + "title": "Counselling", "fields": [ { "key": "couselling_pnc", @@ -55,7 +55,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "1379AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "check_box", - "label": "Ushauri uliotolewa", + "label": "Ushauri umetolewa", "label_text_style": "normal", "text_color": "#C0C0C0", "exclusive": [ @@ -64,133 +64,140 @@ "options": [ { "key": "chk_maternal_nutrition", - "text": "3. Lishe kwa mama wakati wa kunyonyesha", + "text": "Lishe ya mama wakati wa kunyonyesha", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1380AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_hiv_aids", - "text": "5. Umuhimu wa kupata ushauri nasaha na kupima VVU", + "text": "Taarifa za jumla za VVU/UKIMWI", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1914AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_pmtct", - "text": "6. Kuzuia mambukizi ya VVU kutoka kwa mama kwenda kwa mtoto", + "text": "PMTCT kwa mama", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "160538AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_malaria_prevention", - "text": "7. Kuzuia malaria kwa watoto wenye umri chini ya miaka mitano", + "text": "Kuzuia Malaria", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164884AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_pnc_care_for_mother", - "text": "9. Huduma kwa mama baada ya kujifungua", + "text": "PNC huduma kwa mama", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1623AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, + { + "key": "chk_hiv_exposed_infant", + "text": "Ufuatiliaji wa Mtoto aliye katika hatari ya VVU", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "164818AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, { "key": "chk_pnc_danger_signs", - "text": "10. Dalili za hatari mara baada ya kujifungua hadi siku arobaini na mbili ya uzazi", + "text": "Dalili za hatari za PNC", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "161541AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_care_of_infant_after_birth", - "text": "11. Huduma kwa mtoto mchanga mara baada ya kuzaliwa", + "text": "Matunzo ya mtoto baada ya kuzaliwa", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "159839AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_care_of_premature_baby", - "text": "12. Huduma kwa mtoto aliyezaliwa kabla ya muda wake / njiti au mtoto mwenye uzito pungufu", + "text": "Matunzo ya mtoto aliyezaliwa kabla ya wakati", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_care_of_new_born", - "text": "13. Kumhudumia mtoto mchanga", + "text": "Matunzo ya mtoto mchanga", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "160413AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_new_born_danger_signs", - "text": "14. Dalili za hatari kwa mtoto mchanga", + "text": "Ishara za hatari kwa watoto wachanga", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "161071AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_hiv_exposed_infant", - "text": "15. Ufuatiliaji wa mtoto aliyezaliwa na mama mwenye VVU", + "text": "Ufuatiliaji wa mtoto aliyeambukizwa VVU", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164818AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_breastfeeding", - "text": "16. Unyonyeshaji wa mazima wa mama", + "text": "Kunyonyesha", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1910AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_lam", - "text": "17. Njia ya uzazi wa mpango ya unyonyeshaji maziwa ya mama pekee kwa kipindi cha miezi sita baada ya kujifungua (LAM)", + "text": "LAM kama njia ya asili ya FP, ambayo inajumuisha unyonyeshaji wa kipekee miezi sita baada ya kujifungua", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "161096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_family_planning", - "text": "18. Uzazi wa mpango", + "text": "Uzazi wa mpango", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1382AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_birth_registration", - "text": "19. Usajili wa vizazi", + "text": "Usajili wa kuzaliwa", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "165406AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_immunisation", - "text": "22. Chanjo", + "text": "Kinga", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1914AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_infection_prevention", - "text": "24. Kuzuia maambukizi katika jamii", + "text": "Kuzuia na kudhibiti maambukizi", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1906AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_gender_issues", - "text": "26. Jinsia", + "text": "Masuala ya jinsia", "value": false, "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_none", - "text": "Hakushauriwa", + "text": "Uuzaji wa Spur", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" @@ -203,4 +210,4 @@ } ] } -} +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_danger_signs_baby.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_danger_signs_baby.json index f514213ea..12c8495f6 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_danger_signs_baby.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_danger_signs_baby.json @@ -47,7 +47,7 @@ "encounter_location": "" }, "step1": { - "title": "Dalili za hatari kwa mtoto", + "title": "Danger Signs Baby", "fields": [ { "key": "danger_signs_present_child", @@ -55,7 +55,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "159860AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "check_box", - "label": "Je, mtoto mchanga ana dalili zozote za hatari?", + "label": "Je, mtoto ana dalili zozote za hatari?", "label_text_style": "normal", "text_color": "#C0C0C0", "exclusive": [ @@ -71,35 +71,35 @@ }, { "key": "chk_excessive_crying", - "text": "Mtoto kulia sana", + "text": "Kulia kupita kiasi", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "110540AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_fast_breathing", - "text": "Kupumua kwa haraka", + "text": "Kupumua haraka", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "125061AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_difficult_breathing", - "text": "Kushindwa kupumua", + "text": "Ugumu wa kupumua", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "142373AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_unable_to_suck", - "text": "Kushindwa kunyonya au kumeza", + "text": "Haiwezi kunyonya", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "159861AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_umbilical_discharge", - "text": "Kutoka damu kwenye kitovu au usaha", + "text": "Kutokwa na damu ya kitovu / usaha", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "123843AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" @@ -113,28 +113,28 @@ }, { "key": "chk_convulsions", - "text": "Degedege / Mtukutiko wa mwili", + "text": "Degedege", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164483AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_skin_rashes", - "text": "Vipele mwilini", + "text": "Vipele vya ngozi", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "512AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_pale", - "text": "Mwili kuwa njano", + "text": "Kupaula au manjano", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "136443AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_eye_discharge", - "text": "Macho kutoa uchafu / usaha", + "text": "Kutokwa kwa macho", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "142246AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" @@ -148,14 +148,14 @@ }, { "key": "chk_lethargy", - "text": "Uchovu / Kulegea mwili", + "text": "Ulegevu", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "116334AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_none", - "text": "Hakuna", + "text": "Hakun", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" @@ -169,10 +169,10 @@ { "key": "danger_signs_present_toaster", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Dalili za hatari! \nToa rufaa haraka kwenda kituo cha kutolea huduma za afya.", + "text": "Alama ya hatari! Mpe rufaa mara moja kwenye kituo cha afya.", "text_color": "#CF0800", "toaster_type": "problem", "relevance": { @@ -201,4 +201,4 @@ } ] } -} +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_danger_signs_mother.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_danger_signs_mother.json index f980cd8d6..bc65f8add 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_danger_signs_mother.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_danger_signs_mother.json @@ -47,7 +47,7 @@ "encounter_location": "" }, "step1": { - "title": "Dalili za hatari kwa mama", + "title": "Danger Signs Mother", "fields": [ { "key": "danger_signs_present_mama", @@ -71,49 +71,49 @@ }, { "key": "chk_bleeding_vaginally", - "text": "Damu kutoka ukeni", + "text": "Kutokwa na damu ukeni", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "150802AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_server_headache", - "text": "Maumivu ya kichwa", + "text": "Maumivu makali ya kichwa", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "139081AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_convulsions", - "text": "Degedege / Mtukutiko wa mwili", + "text": "Degedege", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164483AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_difficulty_breathing", - "text": "Kupumua kwa shida", + "text": "Ugumu wa kupumua", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "142373AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_severe_leg_pain", - "text": "Maumivu makali kwenye misuli ya miguu", + "text": "Maumivu makali ya mguu", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "114395AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_unusual_behaviour", - "text": "Tabia isiyo ya kawaida (msongo wa mawazo, kuchanganyikiwa)", + "text": "Tabia isiyo ya kawaida (stress, kuchanganyikiwa)", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "152376AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_swelling of breast", - "text": "Kuvimba kwa matiti na chuchu zilizo chanika", + "text": "Kuvimba kwa matiti na chuchu", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "125212AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" @@ -127,14 +127,14 @@ }, { "key": "chk_vaginal_discharge", - "text": "Kutoka uchafu / majimaji ukeni yenye harufu mbaya", + "text": "Kutokwa na majimaji yenye rangi nyekundu au yenye majimaji ukeni yenye harufu mbaya", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "123395AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_blurred_vision", - "text": "Kutoona vizuri", + "text": "Maono yaliyofifia", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "147104AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" @@ -148,7 +148,7 @@ }, { "key": "chk_urination", - "text": "Kupata mkojo kidogo au kuvuja mkojo mfululizo", + "text": "Kojoa kidogo au kuvuja kwa mkojo", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "118982AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" @@ -172,7 +172,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "", "type": "toaster_notes", - "text": "Dalili za hatari! \nMpe rufaa haraka kwenda kituo cha afya.", + "text": "Alama ya hatari! Mpe rufaa mara moja kwenye kituo cha afya.", "text_color": "#CF0800", "toaster_type": "problem", "relevance": { @@ -201,4 +201,4 @@ } ] } -} +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_danger_signs_outcome.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_danger_signs_outcome.json index 60f544af5..393811162 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_danger_signs_outcome.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_danger_signs_outcome.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -82,104 +77,87 @@ { "key": "Fever", "openmrs_choice_id": "", - "text": "Homa", - "value": false + "text": "Homa" }, { "key": "Bleeding_vaginally", "openmrs_choice_id": "", - "text": "Damu kutoka ukeni", - "value": false + "text": "Damu kutoka ukeni" }, { "key": "Severe_headache", "openmrs_choice_id": "", - "text": "Maumivu ya kichwa", - "value": false + "text": "Maumivu ya kichwa" }, { "key": "Convulsions", "openmrs_choice_id": "", - "text": "Degedege", - "value": false + "text": "Degedege" }, { "key": "Difficulty_breathing", "openmrs_choice_id": "", - "text": "Kushindwa kupumua", - "value": false + "text": "Kushindwa kupumua" }, { "key": "Severe_abdominal_pain", "openmrs_choice_id": "", - "text": "Maumivu makali ya tumbo", - "value": false + "text": "Maumivu makali ya tumbo" }, { "key": "Vaginal_discharge_with_a_bad_smell", "openmrs_choice_id": "", - "text": "Kutoka uchafu / majimaji ukeni yenye harufu mbaya", - "value": false + "text": "Kutoka uchafu / majimaji ukeni yenye harufu mbaya" }, { "key": "Redness_around_the_umbilical_cord_foul_smelling_discharge_from_the_umbilical_cord", "openmrs_choice_id": "", - "text": "Uambukizo kwenye kitovu", - "value": false + "text": "Uambukizo kwenye kitovu" }, { "key": "Excessive_crying", "openmrs_choice_id": "", - "text": "Mtoto kulia sana", - "value": false + "text": "Mtoto kulia sana" }, { "key": "Fast_breathing", "openmrs_choice_id": "", - "text": "Kushindwa kupumua", - "value": false + "text": "Kushindwa kupumua" }, { "key": "Chest_indrawing", "openmrs_choice_id": "", - "text": "Kifua kikovu", - "value": false + "text": "Kifua kikovu" }, { "key": "Unable_to_suck", "openmrs_choice_id": "", - "text": "Kushindwa kunyonya", - "value": false + "text": "Kushindwa kunyonya" }, { "key": "No_movement", "openmrs_choice_id": "", - "text": "Hakuna harakati", - "value": false + "text": "Hakuna harakati" }, { "key": "Pale_or_jaundiced", "openmrs_choice_id": "", - "text": "Mwili kuwa njano", - "value": false + "text": "Mwili kuwa njano" }, { "key": "Lethargy", "openmrs_choice_id": "", - "text": "Uchovu", - "value": false + "text": "Uchovu" }, { "key": "Other", "openmrs_choice_id": "", - "text": "Nyingine", - "value": false + "text": "Nyingine" }, { "key": "None", "openmrs_choice_id": "", - "text": "Hakuna", - "value": false + "text": "Hakuna" } ], "exclusive": [ diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_exclusive_breastfeeding.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_exclusive_breastfeeding.json index 65785a603..9a6b86d12 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_exclusive_breastfeeding.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_exclusive_breastfeeding.json @@ -47,7 +47,7 @@ "encounter_location": "" }, "step1": { - "title": "Kunyonyeshwa maziwa ya mama pekee mwezi 0", + "title": "Exclusive breastfeeding", "fields": [ { "key": "exclusive_breast_feeding", @@ -57,9 +57,9 @@ "openmrs_data_type": "exclusive_breast_feeding", "type": "spinner", "image": "ic_form_bf", - "hint": "Je, mtoto amenyonyeshwa maziwa ya mama pekee?", + "hint": "Je, mtoto amekuwa akinyonyesha maziwa ya mama pekee?", "values": [ - "Ndiyo", + "Ndio", "Hapana" ], "keys": [ diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_family_planning.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_family_planning.json index 9cbd5543d..9546fe3e6 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_family_planning.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_family_planning.json @@ -47,7 +47,7 @@ "encounter_location": "" }, "step1": { - "title": "Uzazi wa mpango", + "title": "Family Planning", "fields": [ { "key": "fp_counseling", @@ -56,10 +56,10 @@ "openmrs_entity_id": "1382AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Je, mama amepata ushauri juu ya uzazi wa mpango katika kituo cha kutolea huduma za afya hivi karibuni?", + "hint": "Je, mama alishauriwa hivi majuzi kuhusu upangaji uzazi katika kituo cha afya?", "values": [ - "Ndiyo", - "Hapana" + "Ndio", + "Haoana" ], "keys": [ "Yes", @@ -80,27 +80,27 @@ "openmrs_entity": "concept", "openmrs_entity_id": "159860AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "check_box", - "label": "Je, alipewa ushauri katika kipindi gani?", + "label": "Alishauriwa katika kipindi gani?", "label_text_style": "normal", "text_color": "#C0C0C0", "options": [ { "key": "chk_during_anc", - "text": "Wakati wa kliniki ya wajawazito", + "text": "Wakati wa ANC", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "chk_during_anc" }, { "key": "chk_during_labour_and_delivery", - "text": "Wakati wa uchungu na kujifungua", + "text": "Wakati wa kujifungua", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "chk_during_labour_and_delivery" }, { "key": "chk_during_pnc", - "text": "Wakati wa huduma ya mama na mtoto wa baada ya kujifungua", + "text": "Wakati wa PNC", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "chk_during_pnc" @@ -124,17 +124,17 @@ "openmrs_entity_id": "374AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Njia ya uzazi wa mpango uliyochagua?", + "hint": "Mbinu ya Upangaji Uzazi imechaguliwa?", "values": [ - "Kitanzi", - "Vidonge vya kumeza (POP)", - "Kipandikizi", - "Kondomu", - "Njia ya uzazi wa mpango kwa unyonyeshaji (LAM)", - "Shanga", - "Kufunga kizazi mwanamke", - "Kufunga kizazi mwanamme", - "Hakuchagua njia yoyote" + "PPIUCD", + "Vidonge", + "Pandikiza", + "Kindomu", + "LAM", + "Njia ya kawaida ya siku", + "Kudumu (BTL)", + "Permanent (Vascemtomy)", + "Hakuna" ], "keys": [ "PPIUCD", @@ -172,15 +172,15 @@ { "key": "fp_start_date", "openmrs_entity_parent": "163757AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "date_picker", - "hint": "Tarehe ya kuanza njia ya uzazi wa mpango", + "hint": "Tarehe ya kuanza", "min_date": "today-120y", "max_date": "today", "v_required": { "value": "true", - "err": "Tafadhali ingiza tarehe" + "err": "Tafadhali weka tarehe ya kuanza kwa mbinu" }, "relevance": { "step1:fp_counseling": { diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_family_planning_services.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_family_planning_services.json new file mode 100644 index 000000000..266e14b63 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_family_planning_services.json @@ -0,0 +1,234 @@ +{ + "count": "1", + "encounter_type": "PNC Family Planning Services", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Huduma za Uzazi wa Mpango", + "fields": [ + { + "key": "education_counselling_given", + "type": "native_radio", + "label": "Je, Mteja alipewa Elimu/Ushauri?", + "openmrs_entity": "concept", + "openmrs_entity_id": "education_counselling_given", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_provide_education_counselling", + "type": "toaster_notes", + "text": "Tafadhali toa Elimu/Ushauri kwa mteja", + "openmrs_entity_id": "prompt_provide_education_counselling", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:education_counselling_given": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "iec_given", + "type": "native_radio", + "label": "Je, alipewa vijarida vya Habari, Elimu na Mawasiliano (IEC)?", + "openmrs_entity": "concept", + "openmrs_entity_id": "iec_given", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "using_family_planning_method", + "type": "native_radio", + "label": "Je, Mteja anatumia Njia ya Uzazi wa Mpango?", + "openmrs_entity": "concept", + "openmrs_entity_id": "using_family_planning_method", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "method_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "method_provided", + "type": "native_radio", + "label": "Njia ya uzazi wa mpango iliyotolewa", + "options": [ + { + "key": "chk_condom", + "text": "Kondomu", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_condom" + }, + { + "key": "chk_pills", + "text": "Vidonge (Progestogen-only pill)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_pills" + }, + { + "key": "chk_injectable", + "text": "Sindano (Baada ya siku 42)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_injectable" + }, + { + "key": "chk_jadelle", + "text": "Vipandikizi (Jadelle)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_jadelle" + }, + { + "key": "chk_implants", + "text": "Vipandikizi (Implanon/NXT)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_implants" + }, + { + "key": "chk_iucd", + "text": "Kitanzi (PPIUCD) (Ndani ya masaa 48 baada ya kujifungua au baada ya siku 42 za PNC)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_iucd" + }, + { + "key": "chk_tubal_ligation", + "text": "Kufungwa mirija ya uzazi (BTL)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_tubal_ligation" + }, + { + "key": "chk_referred_fp_services", + "text": "Amepewa Rufaa ya huduma nyingine za Uzazi wa Mpango", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_referred_fp_services" + }, + { + "key": "chk_none", + "text": "Hakuna", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_none" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "step1:using_family_planning_method": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "reason_for_not_providing_fp_method", + "type": "edit_text", + "hint": "Specify reason for not providing FP method", + "openmrs_entity_id": "reason_for_not_providing_fp_method", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "step1:method_provided": { + "type": "string", + "ex": "equalTo(.,\"chk_none\")" + } + }, + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_health_facility_visit.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_health_facility_visit.json index c3122c39d..88526bfbb 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_health_facility_visit.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_health_facility_visit.json @@ -47,7 +47,7 @@ "encounter_location": "" }, "step1": { - "title": "Hudhurio katika kituo cha kutolea huduma za afya ya mama na mtoto baada ya kujifungua", + "title": "Health Facility Visit", "fields": [ { "key": "pnc_visit_{0}", @@ -56,18 +56,14 @@ "openmrs_entity_id": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Je, mama alihudhuria hudhurio la {0} la huduma ya mama na mtoto baada ya kujifungua katika kituo cha kutolea huduma za afya? \n\nTarehe ya hudhurio lingine: {1}", + "hint": "Je, mwanamke huyo alihudhuria PNC yake alipotembelea {0} kituo cha afya? Tembelea tarehe ya kukamilisha: {1}", "v_required": { "value": "true", "err": "Tafadhali chagua chaguo" }, "values": [ - "Ndiyo", + "Ndio", "Hapana" - ], - "keys": [ - "Yes", - "No" ] }, { @@ -76,12 +72,12 @@ "openmrs_entity": "concept", "openmrs_entity_id": "164093AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "date_picker", - "hint": "Tarehe ya hudhurio la {0} la huduma ya mama na mtoto baada ya kujifungua", + "hint": "Tarehe ya kutembelea kituo cha afya cha PNC {0}", "expanded": false, "max_date": "today", "v_required": { "value": "true", - "err": "Tafadhali ingiza tarehe" + "err": "Tafadhali weka tarehe" }, "relevance": { "step1:pnc_visit_{0}": { @@ -97,19 +93,15 @@ "openmrs_entity_id": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Je, mama alipewa Vitamini A ndani ya masaa 24 baada ya kujifungua?", + "hint": "Je, mwanamke huyo alipokea Vitamini A ndani ya saa 24 baada ya kujifungua?", "v_required": { "value": "true", "err": "Tafadhali chagua chaguo" }, "values": [ - "Ndiyo", + "Ndio", "Hapana" ], - "keys": [ - "Yes", - "No" - ], "relevance": { "step1:pnc_visit_{0}": { "type": "string", @@ -124,19 +116,15 @@ "openmrs_entity_id": "104677AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Je, mama alipewa dawa za kuongeza damu (FEFO) ndani ya masaa 24 baada ya kujifungua?", + "hint": "Je, mwanamke alipokea vidonge vya iron na folic acid (IFA) ndani ya saa 24 baada ya kujifungua?", "v_required": { "value": "true", - "err": "Tafadhali chagua chaguo" + "err": "Tafadhali chagua " }, "values": [ - "Ndiyo", + "Ndio", "Hapana" ], - "keys": [ - "Yes", - "No" - ], "openmrs_choice_ids": { "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_health_facility_visit_two.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_health_facility_visit_two.json index 238f82418..3a1b9e4fd 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_health_facility_visit_two.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_health_facility_visit_two.json @@ -16,6 +16,7 @@ "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, "today": { + "openmrs_entity_parent": "", "openmrs_entity": "encounter", "openmrs_entity_id": "encounter_date" }, @@ -46,7 +47,7 @@ "encounter_location": "" }, "step1": { - "title": "Hudhurio katika kituo cha kutolea huduma za afya ya mama na mtoto baada ya kujifungua", + "title": "Health Facility Visit", "fields": [ { "key": "pnc_visit_{0}", @@ -55,18 +56,14 @@ "openmrs_entity_id": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Je, mama alihudhuria hudhurio la {0} la huduma ya mama na mtoto baada ya kujifungua katika kituo cha kutolea huduma za afya?\n\nTarehe ya hudhurio lingine: {1}", + "hint": "Je, mwanamke huyo alihudhuria PNC yake alipotembelea {0} kituo cha afya? Tembelea tarehe ya kukamilisha: {1}", "v_required": { "value": "true", "err": "Tafadhali chagua chaguo" }, "values": [ - "Ndiyo", + "Ndio", "Hapana" - ], - "keys": [ - "Yes", - "No" ] }, { @@ -75,12 +72,12 @@ "openmrs_entity": "concept", "openmrs_entity_id": "164093AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "date_picker", - "hint": "Tarehe ya hudhurio la {0} la huduma ya mama na mtoto baada ya kujifungua", + "hint": "Tarehe ya kutembelea kituo cha afya cha PNC {0}", "expanded": false, "max_date": "today", "v_required": { "value": "true", - "err": "Tafadhali ingiza tarehe" + "err": "Tafadhali weka tarehe" }, "relevance": { "step1:pnc_visit_{0}": { diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_hiv_test_results.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_hiv_test_results.json new file mode 100644 index 000000000..c51a0f477 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_hiv_test_results.json @@ -0,0 +1,200 @@ +{ + "count": "1", + "encounter_type": "PNC HIV Test Results", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "today": { + "openmrs_entity_parent": "", + "openmrs_entity": "encounter", + "openmrs_entity_id": "encounter_date" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "HIV Test Results", + "fields": [ + { + "key": "hiv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv", + "type": "native_radio", + "label": "Chagua majibu ya Kipimo cha VVU", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "positive", + "text": "Chanya", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Kipimo hakijafanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + } + }, + { + "key": "reason_for_not_conducting_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hiv_test", + "type": "spinner", + "hint": "Sababu za kutofanyika kwa kipimo cha VVU", + "values": [ + "Tumeishiwa na Vitendanishi", + "Mteja alikuwa katika hali ya Udharula", + "Mteja amekataa kupimwa", + "bado tunaendelea kumpa ushauri mteja", + "Nyingine bainisha" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:hiv": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_hiv_test", + "type": "edit_text", + "hint": "Bainisha sababu nyingine za kutokufanya kipimo cha VVU", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali weka sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_hiv_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "hiv_test_result_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_result_date", + "type": "date_picker", + "hint": "Tarehe ya kupokea majibu", + "expanded": false, + "min_date": "today-3y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali chagua Tarehe ya kupokea majibu" + }, + "relevance": { + "step1:hiv_test_result": { + "type": "string", + "ex": "notEqualTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "register_pmtct", + "type": "toaster_notes", + "text": "Sajili Mteja huyu kwa huduma za PMTCT na ufuatiliaji", + "openmrs_entity_id": "register_pmtct", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hiv_test_result": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "prescribe_arv", + "type": "toaster_notes", + "text": "Mpatie mteja huyu ARV kwa kufuata muongozo wa Wizara ya Afya", + "openmrs_entity_id": "prescribe_arv", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hiv_test_result": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_hv_danger_signs.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_hv_danger_signs.json new file mode 100644 index 000000000..f45d68160 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_hv_danger_signs.json @@ -0,0 +1,195 @@ +{ + "count": "1", + "encounter_type": "PNC HomeVisit", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "today": { + "openmrs_entity_parent": "", + "openmrs_entity": "encounter", + "openmrs_entity_id": "encounter_date" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "PNC Danger Signs", + "fields": [ + { + "key": "danger_signs_present", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "160939AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "type": "check_box", + "label": "Je, mama ana dalili zozote za hatari?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_fever", + "text": "Homa", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "140238AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "chk_bleeding_vaginally", + "text": "Kutokwa na damu ukeni", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "150802AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "chk_server_headache", + "text": "Maumivu makali ya kichwa", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "139081AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "chk_convulsions", + "text": "Degedege", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "164483AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "chk_difficulty_breathing", + "text": "Ugumu wa kupumua", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "142373AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "chk_severe_abdominal_pain", + "text": "Maumivu makali ya tumbo", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "165271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "chk_swelling", + "text": "Kuvimba kwa uso na/au mikono", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "460AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "chk_vaginal_discharge", + "text": "Kutokwa na majimaji yenye rangi nyekundu au yenye majimaji ukeni yenye harufu mbaya", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "123395AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "chk_unusual_movement", + "text": "Mtoto hachezi kwenye tumbo la mama", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "113377AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + { + "key": "chk_none", + "text": "Jakuna", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua angalau moja" + } + }, + { + "key": "danger_signs_present_toaster", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "toaster_notes", + "text": "Alama ya hatari! Mpe rufaa mara moja kwenye kituo cha afya.", + "text_color": "#CF0800", + "toaster_type": "problem", + "relevance": { + "step1:danger_signs_present": { + "ex-checkbox": [ + { + "or": [ + "chk_fever", + "chk_bleeding_vaginally", + "chk_server_headache", + "chk_convulsions", + "chk_difficulty_breathing", + "chk_severe_abdominal_pain", + "chk_swelling", + "chk_vaginal_discharge", + "chk_unusual_movement" + ] + } + ] + } + } + }, + { + "key": "danger_signs_counseling", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "165310AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_data_type": "select one", + "type": "spinner", + "label_info_title": "Did the mother receive counselling", + "label_info_text": "Did the mother receive counselling on danger signs at the health facility recently?", + "hint": "Je, mama alipokea ushauri nasaha kuhusu dalili za hatari katika kituo cha afya hivi karibuni?", + "values": [ + "Ndio", + "Hapana" + ], + "openmrs_choice_ids": { + "Yes": "1267AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "No": "1118AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua chaguo moja" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_hv_observations_infant.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_hv_observations_infant.json index 538dfe38a..33d47ef3d 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_hv_observations_infant.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_hv_observations_infant.json @@ -47,7 +47,7 @@ "encounter_location": "" }, "step1": { - "title": "Uchunguzi na ugonjwa kwa mtoto", + "title": "Observations & Illness - Child", "fields": [ { "key": "date_of_illness_child", @@ -61,7 +61,7 @@ "max_date": "today", "v_required": { "value": "true", - "err": "Tafadhali ingiza tarehe ya shida" + "err": "Tafadhali weka tarehe ya ugonjwa" } }, { @@ -73,7 +73,7 @@ "hint": "Maelezo", "v_required": { "value": "true", - "err": "Tafadhali ingiza maelezo" + "err": "Tafadhali weka maelezo" } }, { @@ -82,7 +82,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "type": "check_box", - "label": "Hatua zilizochukuliwa", + "label": "Hatua iliyochukuliwa", "label_text_style": "normal", "text_color": "#C0C0C0", "exclusive": [ @@ -98,7 +98,7 @@ }, { "key": "chk_zinc", - "text": "Zinc 10", + "text": "Zinki 10", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "86672AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" @@ -126,7 +126,7 @@ }, { "key": "chk_none", - "text": "Hajapata matibabu", + "text": "Hakuna matibabu iliyotolewa", "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" @@ -142,7 +142,7 @@ "hint": "Matibabu mengine", "v_required": { "value": "true", - "err": "Tafadhali ingiza maelezo ya ugonjwa" + "err": "Tafadhali weka maelezo ya ugonjwa" }, "relevance": { "rules-engine": { diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_hv_observations_mother.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_hv_observations_mother.json index fb1daa076..b17980831 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_hv_observations_mother.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_hv_observations_mother.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -92,42 +87,36 @@ { "key": "chk_ors", "text": "ORS 5", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "351AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_zinc", "text": "Zinc 10", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "86672AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_paracetamol", "text": "Panadol", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "70116AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_referred", "text": "Amepewa rufaa", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "163762AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_other_treatment", "text": "Matibabu mengine", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_none", "text": "Hajapata matibabu", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_immunization.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_immunization.json new file mode 100644 index 000000000..fb767ac71 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_immunization.json @@ -0,0 +1,146 @@ +{ + "count": "1", + "encounter_type": "PNC Immunization", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Chanjo", + "fields": [ + { + "key": "tetanus_vaccination", + "type": "native_radio", + "label": "Je chanjo ya Diphtheria/Pepopunda imetolewa?", + "openmrs_entity": "concept", + "openmrs_entity_id": "tetanus_vaccination", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_immunization_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_tetanus_vaccination", + "type": "toaster_notes", + "text": "Mpatie kulingana na ratiba", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:tetanus_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "hepatitis_b_vaccination", + "type": "native_radio", + "label": "Je mteja huyu amechanjwa chanjo ya homa ya ini?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hepatitis_b_vaccination", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_immunization_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_hepatitis_b_vaccination", + "type": "toaster_notes", + "text": "Mteja atapaswa kupewa chanjo ya homa ya ini", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hepatitis_b_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_malaria_prevention.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_malaria_prevention.json index 1d4980670..6a0bcb2e8 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_malaria_prevention.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_malaria_prevention.json @@ -47,18 +47,18 @@ "encounter_location": "" }, "step1": { - "title": "Kuzuia malaria", + "title": "Malaria Prevention", "fields": [ { "key": "fam_llin", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Je, ana chandarua chenye viuwatilifu vya muda mrefu?", + "hint": "Je, ana chandarua kinachodumu kwa muda mrefu (LLIN)?", "values": [ - "Ndiyo", + "Ndio", "Hapana" ], "keys": [ @@ -77,13 +77,13 @@ { "key": "llin_2days", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Je, amelala kwenye chandarua chenye viuwatilifu vya muda mrefu usiku uliopita?", + "hint": "Je, alilala chini ya neti jana usiku?", "values": [ - "Ndiyo", + "Ndio", "Hapana" ], "keys": [ @@ -108,14 +108,14 @@ { "key": "llin_condition", "openmrs_entity_parent": "", - "openmrs_entity": "", + "openmrs_entity": "concept", "openmrs_entity_id": "", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Hali ya chandarua chenye viuwatilifu vya muda mrefu kinachotumika", + "hint": "Hali ya neti", "values": [ - "Nzima", - "Mbovu" + "Nzuri", + "Mbaya" ], "keys": [ "Okay", diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_mother_general_examination.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_mother_general_examination.json new file mode 100644 index 000000000..f4eda2c0d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_mother_general_examination.json @@ -0,0 +1,880 @@ +{ + "count": "1", + "encounter_type": "PNC Mother General Examination", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Uchunguzi wa Afya ya Mama", + "fields": [ + { + "key": "followup_visit_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "followup_visit_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_followup_calculation.yml" + } + } + } + }, + { + "key": "systolic", + "type": "edit_text", + "hint": "Systolic (Blood Pressure)", + "openmrs_entity_id": "systolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza namba ya Systolic (Blood Pressure)" + }, + "v_min": { + "value": "0", + "err": "namba ya Tafadhali ingiza namba ya Systolic lazime iwe sawa au kubwa kuliko 0" + }, + "v_max": { + "value": "320", + "err": "Tafadhali ingiza namba ya Systolic lazima iwe sawa au chini ya 320" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza namba ya Systolic (Blood Pressure)" + } + }, + { + "key": "diastolic", + "type": "edit_text", + "hint": "Diastolic", + "openmrs_entity_id": "diastolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza Diastolic" + }, + "v_min": { + "value": "0", + "err": " Diastolic lazima iwe sawa au kubwa na 0" + }, + "v_max": { + "value": "200", + "err": " Diastolic lazima iwe sawa au ndogo ya 200" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza Diastolic" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:systolic)", + "err": "Thamani ya diastolic lazima iwe chini ya thamani ya systolic" + } + ] + }, + { + "key": "prompt_for_management_of_hypertension", + "type": "toaster_notes", + "text": "Mtibu Mteja Shinikizo la damu ya juu kulingana na mwongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_management_of_hypertension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_mother_general_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_management_of_hypotension", + "type": "toaster_notes", + "text": "Mpatie IV Fluids, pia bainisha chanzo cha Shinikizo la damu ya chini na dhibiti hali hii kulingana na mwongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_management_of_hypotension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_mother_general_examination_relevance.yml" + } + } + } + }, + { + "key": "hb_level_test", + "type": "native_radio", + "label": "Kipimo cha kiwango cha damu (HB)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "test_conducted", + "text": "Kipimo cha HB kimefanyika", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted", + "openmrs_entity_parent": "" + }, + { + "key": "test_not_conducted", + "text": "Kipimo cha HB hakujafanyika", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": true, + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "hb_level", + "type": "edit_text", + "hint": "Kiwango cha damu (HB) (g/dl)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Ingiza kiasi cha HB" + }, + "v_min": { + "value": "0", + "err": "Kiasi cha HB lazima kiwe sawa au zaidi ya 0" + }, + "v_max": { + "value": "20", + "err": "Kiasi cha HB lazima kiwe sawa au chini ya 20 (g/dl)" + }, + "v_required": { + "value": true, + "err": "Ingiza kiasi cha HB" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_conducted\")" + } + } + }, + { + "key": "prompt_for_severe_anaemia_treatment", + "type": "toaster_notes", + "text": "Dhibiti anaemia kali kulingana na miongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_severe_anaemia_treatment", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hb_level": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"8.5\")" + } + } + }, + { + "key": "prompt_for_moderate_anaemia_management", + "type": "toaster_notes", + "text": "Dhibiti anemia kidogo kulingana na mwongozo wa Wizara ya Afya", + "openmrs_entity_id": "prompt_for_moderate_anaemia_management", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_mother_general_examination_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hb_test", + "type": "spinner", + "hint": "Sababu ya kutofanya kipimo cha HB", + "values": [ + "Cuvette Cartridges Hazipo Kituoni", + "Mashine ya Kupimwa wingi wa damu (Haemoque) haifanyi kazi", + "Mteja alikuwa katika hali ya dharura", + "Mteja amekataa kupimwa", + "Tunaendelea kumshauri mteja", + "Nyingine (Bainisha)" + ], + "keys": [ + "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "stock_out_of_cuvettes_cartridges": "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order": "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_hb_test_not_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_hb_test_not_conducted", + "type": "edit_text", + "hint": "Sababu nyingine kwa kutofanyika kwa kipimo cha HB", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Jaza sababu" + }, + "relevance": { + "step1:reason_for_not_conducting_hb_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "temperature", + "type": "edit_text", + "hint": "Joto (\u2103)", + "openmrs_entity_id": "temperature", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Ingiza kiasi cha Joto (\u2103)" + }, + "v_min": { + "value": "10", + "err": "Kiasi cha joto lazima kiwe sawa au kubwa kuliko 10 C" + }, + "v_max": { + "value": "50", + "err": "Kiasi cha joto lazima kiwe sawa au chini kuliko 50 C" + }, + "v_required": { + "value": true, + "err": "Ingiza kiasi cha Joto (\u2103)" + } + }, + { + "key": "notify_client_has_fever", + "type": "toaster_notes", + "text": "Fanya vipimo vya maabara vinavyofaa ili kupata sababu ya homa na udhibiti kulingana na mwongozo wa Wizara ya Afya", + "openmrs_entity_id": "notify_client_has_fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "greaterThan(.,\"37.8\")" + } + } + }, + { + "key": "notify_client_has_hypothermia", + "type": "toaster_notes", + "text": "Dhibiti hypothermia kulingana na miongozo wa Wizara ya Afya", + "openmrs_entity_id": "notify_client_has_hypothermia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "lessThan(.,\"36.5\")" + } + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Uzito (Kg)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza Uzito wa Mteja" + }, + "v_min": { + "value": "20", + "err": "Uzito lazima uwe sawa au zaidi ya 20kg" + }, + "v_max": { + "value": "300", + "err": "Uzito lazima uwe sawa au chini ya 300kg" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza Uzito wa Mteja" + } + }, + { + "key": "prompt_for_breast_exam", + "type": "toaster_notes", + "text": "Uchunguzi wa Matiti", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info" + }, + { + "key": "breast_milk_flow", + "type": "native_radio", + "label": "Je Matiti ya mama yanatoa maziwa?", + "openmrs_entity": "concept", + "openmrs_entity_id": "breast_milk_flow", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_no_breast_milk_flow", + "type": "toaster_notes", + "text": "Mshauri na msaidie Mama kumweka Mtoto katika ziwa wakati wa kunyonyesha mtoto. Maziwa ya mama yataendelea kutoka kwa wingi jinsi mtoto ananyoendelea kunyonya", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:breast_milk_flow": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "bruised_nipples", + "type": "native_radio", + "label": "Je, Mama ana Chuchu Iliyochubuka?", + "openmrs_entity": "concept", + "openmrs_entity_id": "bruised_nipples", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_bruised_nipples", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:bruised_nipples": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "engorgement_mastitis", + "type": "native_radio", + "label": "Je, matiti ya Mama yamejaa au yamevimba?", + "openmrs_entity": "concept", + "openmrs_entity_id": "engorgement_mastitis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_engorgement_mastitis", + "type": "toaster_notes", + "text": "Mpatie mama antibiotiki (kiuavijsimu) na dawa za kutuliza maumivu", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:engorgement_mastitis": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "abscess", + "type": "native_radio", + "label": "Je, Mama ana Jipu?", + "openmrs_entity": "concept", + "openmrs_entity_id": "abscess", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_abscess", + "type": "toaster_notes", + "text": "Minya, toboa na kamua Jipu la Mama. Mpatie Mama antibiotics na dawa za kutuliza maumivu", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:abscess": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "perineum_infection", + "type": "native_radio", + "label": "Je, Mama ana msamba au kidonda cha upasuaji ulioambikwizwa/ulioachia?", + "openmrs_entity": "concept", + "openmrs_entity_id": "perineum_infection", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_perineum_infection", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:perineum_infection": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "uterus_assessment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "uterus_assessment", + "type": "native_radio", + "label": "Tathmini ya mfuko wa uzazi", + "options": [ + { + "key": "chk_normal_involution", + "text": "Upo kawaida", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_normal_involution" + }, + { + "key": "chk_pain", + "text": "Kuna maumivu", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_pain" + }, + { + "key": "chk_distended", + "text": "Haujanywea", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_distended" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_uterus_pain", + "type": "toaster_notes", + "text": "Fanya uchunguzi wa uke kuangalia kama kuna dalili zozote za puerperial sepsis au mabaki yoyote ya uchafu baada ya kujifungua. Dhibiti hali hii kulingana na muongozo na mpatie Antibiotiki (Kiuavijasumu) na Dawa za kutuliza maumivu kulingana na muongozo", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:uterus_assessment": { + "type": "string", + "ex": "equalTo(.,\"chk_pain\")" + } + } + }, + { + "key": "prompt_for_uterus_distended", + "type": "toaster_notes", + "text": "Tathmini usikivu wa tumbo na mabadiliko ya uterasi, dhibiti hali ya mteja kulingana na mwongozo wa Wizara ya Afya", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:uterus_assessment": { + "type": "string", + "ex": "equalTo(.,\"chk_distended\")" + } + } + }, + { + "key": "lochia_assessment", + "type": "native_radio", + "label": "Tathmini ya Lokia", + "openmrs_entity": "concept", + "openmrs_entity_id": "lochia_assessment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "lochia_rubra", + "text": "Ute mwekundu ukeni (lokia)", + "openmrs_entity": "concept", + "openmrs_entity_id": "lochia_rubra" + }, + { + "key": "lochia_serosa", + "text": "Ute wa pinki au kahawia ukeni (lokia)", + "openmrs_entity": "concept", + "openmrs_entity_id": "lochia_serosa" + }, + { + "key": "lochia_alba", + "text": "Ute mweupe ukeni", + "openmrs_entity": "concept", + "openmrs_entity_id": "lochia_alba" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "vaginal_assessment", + "type": "native_radio", + "label": "Tathmini ya uke", + "openmrs_entity": "concept", + "openmrs_entity_id": "vaginal_assessment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "tear", + "text": "Umechanika", + "openmrs_entity": "concept", + "openmrs_entity_id": "tear" + }, + { + "key": "episiotomy", + "text": "Kuongezewa njia wakati wa kujifungua", + "openmrs_entity": "concept", + "openmrs_entity_id": "episiotomy" + }, + { + "key": "intact", + "text": "Haujacahnika", + "openmrs_entity": "concept", + "openmrs_entity_id": "intact" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_tear_vaginal_assessment", + "type": "toaster_notes", + "text": "Ikiwa mteja anavuja damu sana, toa huduma ya dharura ya kuzuia uvujaji damu baada ya kujifungua, rekebisha jeraha na mpe Antibiotics na dawa za kutuliza maumivu", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:vaginal_assessment": { + "type": "string", + "ex": "equalTo(.,\"tear\")" + } + } + }, + { + "key": "prompt_for_episiotomy_vaginal_assessment", + "type": "toaster_notes", + "text": "Angalia jeraha kama linatokwa na damu na maambukizi yoyote, udhibiti hali hii kulingana na mwongozo wa Wizara ya Afya", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:vaginal_assessment": { + "type": "string", + "ex": "equalTo(.,\"episiotomy\")" + } + } + }, + { + "key": "fistula", + "type": "native_radio", + "label": "Je, Mama huyu ana Fistula?", + "openmrs_entity": "concept", + "openmrs_entity_id": "fistula", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "prompt_for_fistula", + "type": "toaster_notes", + "text": "Mpatie rufaa ya upasuaji kwa ajili kurekebisha fistula", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:fistula": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "prompt_for_mental_health_examination", + "type": "toaster_notes", + "text": "Uchunguzi wa Afya ya Akili", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info" + }, + { + "key": "puerperal_psychosis", + "type": "native_radio", + "label": "Je, Mama amepata Kichaa cha mimba?", + "openmrs_entity": "concept", + "openmrs_entity_id": "puerperal_psychosis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "mental_illness_symptom", + "type": "native_radio", + "label": "Dalili nyingine yoyote ya Ugonjwa wa Akili", + "openmrs_entity": "concept", + "openmrs_entity_id": "mental_illness_symptom", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "step1:puerperal_psychosis": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "prompt_for_mental_illness", + "type": "toaster_notes", + "text": "Mpatie rufaa kwenda kumuona Daktari wa Magonjwa ya Akili", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_mother_general_examination_relevance.yml" + } + } + } + }, + { + "key": "visit_number", + "type": "hidden", + "openmrs_entity_id": "visit_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_no_mother_registration.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_no_mother_registration.json new file mode 100644 index 000000000..2cce446fc --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_no_mother_registration.json @@ -0,0 +1,482 @@ +{ + "count": "2", + "encounter_type": "No Mother PNC Registration", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Usajili wa Mtoto", + "next": "step2", + "fields": [ + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "hidden": "true", + "type": "edit_text", + "barcode_type": "qrcode", + "hint": "ID", + "scanButtonText": "Scan QR Code", + "v_numeric": { + "value": "true", + "err": "Please enter a valid ID" + } + }, + { + "key": "fam_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "fam_name", + "type": "edit_text", + "hint": "Jina la Ukoo la Mtoto", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Ukoo" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka Jina la Ukoo" + } + }, + { + "key": "client_first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "Jina la Kwanza la Mtoto", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kwanza" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + } + }, + { + "key": "client_middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Jina la Kati la Mtoto", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali weka jina halali" + }, + "v_required": { + "value": "true", + "err": "Tafadhali weka Jina la Kati" + } + }, + { + "key": "fam_village", + "openmrs_entity_parent": "", + "openmrs_entity": "person_address", + "openmrs_entity_id": "cityVillage", + "type": "edit_text", + "edit_type": "name", + "hint": "Jina la eneo", + "v_required": { + "value": "true", + "err": "Tafadhali weka jina la eneo au mji" + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Uzito (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Tafadhali ingiza uzito" + }, + "v_min": { + "value": "0", + "err": "Uzito lazima uwe sawasawa au zaidi ya 0 (KG)" + }, + "v_max": { + "value": "6", + "err": "Uzito lazima uwe sawasawa au chini ya 6 (KG)" + }, + "v_required": { + "value": true, + "err": "Tafadhali ingiza uzito" + } + }, + { + "key": "prompt_for_underweight", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_no_mother_registration_relevance.yml" + } + } + } + }, + { + "key": "disabilities", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabilities", + "type": "spinner", + "hint": "Ulemavu wa kimwili", + "values": [ + "Ndio", + "Hapana" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua moja" + } + }, + { + "key": "prompt_for_disabilities", + "type": "toaster_notes", + "text": "Toa rufaa kwa huduma zaidi", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:disabilities": { + "type": "string", + "ex": "equalTo(.,\"Yes\")" + } + } + }, + { + "key": "type_of_disability", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "label": "Aina ya Ulemavu", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Ulemavu wa kimwili", + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Ulemavu wa Uti wa Mgongo", + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Majeraha ya Kichwa - Ulemavu wa Ubongo", + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Ulemavu wa Maono", + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Ulemavu wa Kusikia", + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Ulemavu wa Utambuzi au Kujifunza", + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Matatizo ya Kisaikolojia", + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Ulemavu Usioonekana", + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], + "relevance": { + "step1:disabilities": { + "type": "string", + "ex": "equalTo(.,\"Yes\")" + } + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "date_picker", + "hint": "Tarehe ya kuzaliwa (DOB)", + "expanded": false, + "duration": { + "label": "Umri" + }, + "min_date": "today-6w", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali ingiza tarehe ya kuzaliwa (DOB)" + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Jinsi", + "values": [ + "Me", + "Ke", + "Jinsia Tata" + ], + "keys": [ + "Male", + "Female", + "Ambiguous" + ], + "v_required": { + "value": "true", + "err": "Tafadhali ingiza jinsi" + } + }, + { + "key": "entry_point", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "entry_point", + "type": "hidden", + "value": "PNC" + } + ] + }, + "step2": { + "title": "Taarifa za Mlezi", + "fields": [ + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "type": "hidden" + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "last_name", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_no_mother_registration_calculation.yml" + } + } + } + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_no_mother_registration_calculation.yml" + } + } + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_no_mother_registration_calculation.yml" + } + } + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_no_mother_registration_calculation.yml" + } + } + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_no_mother_registration_calculation.yml" + } + } + } + }, + { + "key": "risk_category", + "type": "hidden", + "openmrs_entity_id": "risk_category", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "value": "high" + }, + { + "key": "delivery_date", + "type": "hidden", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_date", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_no_mother_registration_calculation.yml" + } + } + } + }, + { + "key": "caregiver_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "caregiver_name", + "type": "edit_text", + "edit_type": "name", + "hint": "Jina la mlezi", + "v_required": { + "value": "true", + "err": "Tafadhali taja jina la mlezi." + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali ingiza jina sahihi" + } + }, + { + "key": "caregiver_phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "caregiver_phone_number", + "type": "edit_text", + "hint": "Namba ya simu ya mlezi mkuu", + "v_numeric": { + "value": "true", + "err": "Namba lazima iwe jumla ya tarakimu 10 kwa urefu" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Namba lazima iwe na tarakimu 10 na lazima ianze na 06 au 07." + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza namba ya simu" + } + }, + { + "key": "caregiver_location", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "caregiver_location", + "type": "edit_text", + "edit_type": "name", + "hint": "Eneo la mlezi", + "v_required": { + "value": "true", + "err": "Tafadhali jaza eneo la mlezi" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_nutrition_status_infant.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_nutrition_status_infant.json index 703d9af91..750847c5b 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_nutrition_status_infant.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_nutrition_status_infant.json @@ -47,7 +47,7 @@ "encounter_location": "" }, "step1": { - "title": "Hali ya lishe ya mtoto", + "title": "Nutrition Status - Baby", "fields": [ { "key": "nutrition_status_1m", @@ -58,9 +58,9 @@ "type": "spinner", "hint": "Hali ya lishe ya mtoto mchanga", "values": [ - "Nzuri/Kijani", - "Kadri/Njano", - "Dhaifu/Nyekundu" + "Kawaida/Kijani", + "Wastani/Njano", + "Nyekundu / kali" ], "keys": [ "Normal", diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_nutrition_status_mother.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_nutrition_status_mother.json index cb8b44470..5141f3c7b 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_nutrition_status_mother.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_nutrition_status_mother.json @@ -47,7 +47,7 @@ "encounter_location": "" }, "step1": { - "title": "Hali ya lishe ya mama", + "title": "Nutrition Status - Mother", "fields": [ { "key": "nutrition_status_mama", @@ -56,11 +56,11 @@ "openmrs_entity_id": "163300AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_data_type": "select one", "type": "spinner", - "hint": "Hali ya lishe ya mama", + "hint": "Hali ya lishe ya mwanamke", "values": [ - "Nzuri/Kijani", - "Kadri/Njano", - "Dhaifu/Nyekundu" + "Kawaida/Kijani", + "Wastani/Njano", + "Nyekundu / kali" ], "keys": [ "Normal", diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_nutritional_supplement.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_nutritional_supplement.json new file mode 100644 index 000000000..fb7cb757d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_nutritional_supplement.json @@ -0,0 +1,221 @@ +{ + "count": "1", + "encounter_type": "PNC Nutritional Supplement", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Virutubisho vya Lishe", + "fields": [ + { + "key": "iron_and_folic_acid", + "type": "native_radio", + "label": "Je, Mama amepewa Madini Chuma (Iron) na Foliki Asidi?", + "openmrs_entity": "concept", + "openmrs_entity_id": "iron_and_folic_acid", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + } + }, + { + "key": "reason_for_not_giving_iron_and_folic_acid", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_iron_and_folic_acid", + "type": "spinner", + "hint": "Sababu kwanini Madini Chuma (Iron) na Foliki Asidi hazikutolewa", + "values": [ + "Zimeisha", + "Mteja amekataa kuchukua", + "Mteja ana mzio na Iron Folic acid", + "Nyingine" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua sababu" + }, + "relevance": { + "step1:iron_and_folic_acid": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "other_reason_for_not_giving_iron_and_folic_acid", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_giving_iron_and_folic_acid", + "type": "edit_text", + "hint": "Bainisha sababu nyingine ya kutotoa madini chuma (iron) na folic acid", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_for_not_giving_iron_and_folic_acid": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "vitamin_a", + "type": "native_radio", + "label": "Je, Mama amepatiwa Vitamin A?", + "openmrs_entity": "concept", + "openmrs_entity_id": "vitamin_a", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali jibu swali hili" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_nutritional_supplement_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_giving_vitamin_a", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_vitamin_a", + "type": "spinner", + "hint": "Sababu za kutokutoa Vitamin A", + "values": [ + "Vitamin A zimeisha", + "Mteja amekataa kuchukua", + "Mteja ana mzio na Vitamin A", + "Nyingine (Bainisha)" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua mojawapo" + }, + "relevance": { + "step1:vitamin_a": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "other_reason_for_not_giving_vitamin_a", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_giving_vitamin_a", + "type": "edit_text", + "hint": "Bainisha sababu nyingine ya kutokutoa Vitamin A", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Tafadhali jaza sababu" + }, + "relevance": { + "step1:reason_for_not_giving_vitamin_a": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_referral_form.json b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_referral_form.json new file mode 100644 index 000000000..0e1ec4748 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/pnc_referral_form.json @@ -0,0 +1,497 @@ +{ + "count": "1", + "encounter_type": "PNC Referral", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "today": { + "openmrs_entity_parent": "", + "openmrs_entity": "encounter", + "openmrs_entity_id": "encounter_date" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "PNC referral form", + "fields": [ + { + "key": "chw_referral_hf_pnc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "1759AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "type": "hidden", + "is_problem": false, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_referral_calculation.yml" + } + } + } + }, + { + "key": "problem_hf_pnc", + "openmrs_entity_parent": "", + "openmrs_entity": "", + "openmrs_entity_id": "", + "type": "check_box", + "label": "Hali ya mteja / tatizo", + "label_text_style": "bold", + "options": [ + { + "key": "Vaginal_bleeding", + "text": "Kutokwa na damu ukeni", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "147232AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Discoloured_or_watery_liquid_vaginal_discharge", + "text": "Kutokwa na majimaji yenye rangi nyekundu au yenye majimaji ukeni yenye harufu mbaya", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "123396AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Severe_abdominal_pain", + "text": "Maumivu makali ya tumbo", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "165271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Severe_anaemia", + "text": "Anemia kali", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "162044AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Convulsions", + "text": "Degedege", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "113054AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "A_severe_headache_dizziness", + "text": "Maumivu ya kichwa kali / kizunguzungu", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "139081AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Swelling_of_the_face_and_or_hands", + "text": "Kuvimba kwa uso na/au mikono", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "460AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Fever", + "text": "Homa", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "140238AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Shivering_trembling", + "text": "Kutetemeka/kutetemeka", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "158359AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Nausea", + "text": "Kichefuchefu", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "5978AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Vomiting", + "text": "Kutapika", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "122983AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Cord_prolapse", + "text": "Prolapse ya kamba", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "113617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Perineum_bleeding", + "text": "Kutokwa na damu kwa perineum", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "136938AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Fullness_or_pain_of_the_breasts", + "text": "Kuvimba kwa matiti", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "118620AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "HIV_care_and_support_services", + "text": "Huduma za matunzo na usaidizi wa VVU", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "159811AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Family_planning_services", + "text": "Huduma za uzazi wa mpango", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "5271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "PMTCT_for_mothers", + "text": "PMTCT kwa akina mama", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "160538AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Fistula", + "text": "Fistula", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "160854AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Fast_breathing_and_difficulty_with_breathing", + "text": "Kupumua haraka na ugumu wa kupumua", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "142373AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Umbilical_cord", + "text": "Kutokwa na damu kwa kitovu/kitovu", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "123844AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Excessive_crying", + "text": "Kulia kupita kiasi", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "140944AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Unable_to_breastfeed_or_swallow", + "text": "Haiwezi kunyonyesha au kumeza", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "159861AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Neck_stiffness", + "text": "Ugumu wa shingo", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "112721AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Bloating", + "text": "Kuvimba", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "147132AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Redness_around_the_umbilical_cord_foul", + "text": "Wekundu kuzunguka kitovu, kutokwa na harufu mbaya kutoka kwa kitovu", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "132407AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Bacterial_conjunctivitis", + "text": "Bakteria kwenye kiwambo cha sikio", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "148026AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Pale_or_jaundiced", + "text": "Kupauka au manjano", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "136443AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Cyanosis_blueness_of_lips", + "text": "Cyanosis (bluu ya midomo)", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "143050AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Skin_rash_pustules", + "text": "Upele wa ngozi ", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "512AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Diarrhea", + "text": "Kuhara", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "142412AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Disabilities", + "text": "Ulemavu wa Kuzaliwa", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "162558AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Premature_baby", + "text": "Mtoto wa mapema", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "159908AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Failure_to_pass_urine_or_stool", + "text": "Kushindwa kutoa mkojo au kinyesi ndani ya saa 24 baada ya kuzaliwa", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "", + "openmrs_entity_parent": "" + }, + { + "key": "Care_of_HIV_exposed_infant", + "text": "Utunzaji wa mtoto aliyeambukizwa VVU", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "164818AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Immunisation", + "text": "Kinga", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "1914AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Other_symptom", + "text": "Dalili nyingine", + "value": false, + "ignore": true, + "openmrs_entity": "", + "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + } + ], + "v_required": { + "value": true, + "err": "Tafadhali bainisha hali/tatizo la mteja" + } + }, + { + "key": "problem_hf_pnc_other", + "type": "edit_text", + "openmrs_entity": "", + "openmrs_entity_id": "", + "openmrs_entity_parent": "", + "edit_type": "name", + "hint": "Dalili nyingine", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_referral_relevance.yml" + } + } + } + }, + { + "key": "service_before_pnc", + "openmrs_entity_parent": "", + "openmrs_entity": "", + "openmrs_entity_id": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "type": "check_box", + "label": "Usimamizi wa rufaa kabla umetolewa", + "label_text_style": "bold", + "is_problem": false, + "exclusive": [ + "None" + ], + "options": [ + { + "key": "ORS", + "text": "ORS", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "351AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Panadol", + "text": "Panadol", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "70116AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "Other_treatment", + "text": "Other treatment", + "value": false, + "ignore": true, + "openmrs_entity": "", + "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + }, + { + "key": "None", + "text": "None", + "value": false, + "openmrs_entity": "", + "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "" + } + ], + "v_required": { + "value": "true", + "err": "Sehemu ya usimamizi wa rufaa ya mapema inahitajika" + } + }, + { + "key": "service_before_pnc_other", + "type": "edit_text", + "openmrs_entity": "", + "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "", + "edit_type": "name", + "hint": "Matibabu mengine", + "is_problem": false, + "v_required": { + "value": "true", + "err": "Tafadhali taja matibabu mengine" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_referral_relevance.yml" + } + } + } + }, + { + "key": "referral_date_pnc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "163181AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "type": "hidden", + "is_problem": false, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_referral_calculation.yml" + } + } + } + }, + { + "key": "referral_time_pnc", + "openmrs_entity_parent": "", + "openmrs_entity": "", + "openmrs_entity_id": "", + "type": "hidden", + "is_problem": false, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_referral_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/prep_initiation.json b/opensrp-chw-hf/src/main/assets/json.form-sw/prep_initiation.json new file mode 100644 index 000000000..8b839fcd4 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/prep_initiation.json @@ -0,0 +1,518 @@ +{ + "count": "1", + "encounter_type": "PrEP Initiation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Kuanza dawa kinga", + "fields": [ + { + "key": "prep_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_status", + "label": "Hali ya dawa kinga katika hudhurio", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "initiated", + "text": "Ameanza", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "initiated" + }, + { + "key": "continuing", + "text": "Anaendelea", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "continuing" + }, + { + "key": "re_start", + "text": "Ameanza upya tena", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "re_start" + }, + { + "key": "not_initiated", + "text": "Hajaanza", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_initiated" + }, + { + "key": "discontinued_quit", + "text": "Ameachishwa", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "discontinued_quit" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu " + } + }, + { + "key": "prep_drug_offered", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_drug_offered", + "label": "Aina ya dawa PrEP aliyopewa", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "tdf_ftc", + "text": "TDF/FTC", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tdf_ftc" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu " + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_relevance.yml" + } + } + } + }, + { + "key": "prep_pills_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_pills_number", + "type": "edit_text", + "hint": "Idadi ya vidonge vya PrEP alivyopewa", + "v_required": { + "value": "true", + "err": "Tafadhali Jaza Numba" + }, + "v_numeric": { + "value": "true", + "err": "Tafadhali Jaza Numba" + }, + "relevance": { + "step1:prep_drug_offered": { + "type": "string", + "ex": "equalTo(., \"tdf_ftc\")" + } + }, + "v_max": { + "value": "30", + "err": "Namba ya vidonge inatakiwa iwe sawa au chini ya 30" + } + }, + { + "key": "prep_adherence", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_adherence", + "label": "ufuasi wa PrEP", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "good", + "text": "Mzuri", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "good" + }, + { + "key": "poor", + "text": "Hafifu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "poor" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu " + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_relevance.yml" + } + } + } + }, + { + "key": "poor_prep_adherence_reason", + "type": "check_box", + "label": "Sababu za Ufuasi/Matumizi duni ya PrEP", + "combine_checkbox_option_values": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "poor_prep_adherence_reason", + "openmrs_entity_parent": "", + "exclusive": [ + "not_applicable" + ], + "options": [ + { + "key": "forgotten", + "text": "Amesahau", + "openmrs_entity": "concept", + "openmrs_entity_id": "forgotten" + }, + { + "key": "lost_out_of_drugs", + "text": "Amepoteza/Ameishiwa dawa", + "openmrs_entity": "concept", + "openmrs_entity_id": "lost_out_of_drugs" + }, + { + "key": "pill_burden", + "text": "Mzigo wa dawa", + "openmrs_entity": "concept", + "openmrs_entity_id": "pill_burden" + }, + { + "key": "side_effects", + "text": "Madhara", + "openmrs_entity": "concept", + "openmrs_entity_id": "side_effects" + }, + { + "key": "stigma", + "text": "Unyanyapaa", + "openmrs_entity": "concept", + "openmrs_entity_id": "stigma" + }, + { + "key": "not_at_risk", + "text": "Hayupo hatarini", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_at_risk" + }, + { + "key": "others", + "text": "Nyinginezo", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "step1:prep_adherence": { + "type": "string", + "ex": "equalTo(., \"poor\")" + } + } + }, + { + "key": "other_poor_prep_adherence_reason", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_poor_prep_adherence_reason", + "type": "edit_text", + "hint": "Nyinginezo(Taja)", + "v_required": { + "value": "true", + "err": "Tafadhali taja" + }, + "relevance": { + "step1:poor_prep_adherence_reason": { + "type": "string", + "ex": "equalTo(., \"others\")" + } + } + }, + { + "key": "prep_side_effects", + "type": "check_box", + "label": "Maudhi madogo madogo ya PrEP", + "combine_checkbox_option_values": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_side_effects", + "openmrs_entity_parent": "", + "exclusive": [ + "not_applicable", + "no_side_effects" + ], + "options": [ + { + "key": "nausea", + "text": "Kichefuchefu", + "openmrs_entity": "concept", + "openmrs_entity_id": "nausea" + }, + { + "key": "abdominal_pain", + "text": "Maumivu ya tumbo", + "openmrs_entity": "concept", + "openmrs_entity_id": "abdominal_pain" + }, + { + "key": "headache", + "text": "Maumivu ya kichwa", + "openmrs_entity": "concept", + "openmrs_entity_id": "headache" + }, + { + "key": "diarrhea", + "text": "Kuharisha", + "openmrs_entity": "concept", + "openmrs_entity_id": "diarrhea" + }, + { + "key": "loss_of_appetite", + "text": "Kukosa hamu ya kula", + "openmrs_entity": "concept", + "openmrs_entity_id": "loss_of_appetite" + }, + { + "key": "dizziness", + "text": "Kizunguzungu", + "openmrs_entity": "concept", + "openmrs_entity_id": "dizziness" + }, + { + "key": "others", + "text": "Nyingine", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + }, + { + "key": "no_side_effects", + "text": "Hamna", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_side_effects" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu moja" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_relevance.yml" + } + } + } + }, + { + "key": "other_prep_side_effects", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_prep_side_effects", + "type": "edit_text", + "hint": "Nyingine (Taja)", + "v_required": { + "value": "true", + "err": "Tafadhali taja" + }, + "relevance": { + "step1:prep_side_effects": { + "ex-checkbox": [ + { + "or": [ + "others" + ] + } + ] + } + } + }, + { + "key": "reasons_stopping_prep", + "type": "check_box", + "label": "Sababu za kuacha PrEP", + "combine_checkbox_option_values": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_stopping_prep", + "openmrs_entity_parent": "", + "exclusive": [ + "not_applicable" + ], + "options": [ + { + "key": "hiv_positive", + "text": "Ameambukizwa VVU", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_positive" + }, + { + "key": "side_effect_or_allergy", + "text": "Madhara ya dawa au allergy", + "openmrs_entity": "concept", + "openmrs_entity_id": "side_effect_or_allergy" + }, + { + "key": "poor_adherence", + "text": "Matumizi hafifu ", + "openmrs_entity": "concept", + "openmrs_entity_id": "poor_adherence" + }, + { + "key": "client_decision", + "text": "Mteja ameamua kuacha", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_decision" + }, + { + "key": "not_at_risk", + "text": "Mteja ameacha,hayupo katika hali hatarishi", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_at_risk" + }, + { + "key": "others", + "text": "Nyingine (Andika)", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu " + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_relevance.yml" + } + } + } + }, + { + "key": "other_reason_stopping_prep", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_stopping_prep", + "type": "edit_text", + "hint": "Sababu zingine", + "v_required": { + "value": "true", + "err": "Tafadhali chagua sabau" + }, + "relevance": { + "step1:reasons_stopping_prep": { + "ex-checkbox": [ + { + "or": [ + "others" + ] + } + ] + } + } + }, + { + "key": "prep_initiation_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "prep_initiation_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_calculation.yml" + } + } + } + }, + { + "key": "next_visit_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "next_visit_date", + "type": "date_picker", + "hint": "Tarehe ya hudhurio lijalo ", + "expanded": false, + "min_date": "today", + "max_date": "today+1y", + "v_required": { + "value": "true", + "err": "Tafadhali jaza tarehe ya hudhurio lijalo " + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_relevance.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/prep_other_services.json b/opensrp-chw-hf/src/main/assets/json.form-sw/prep_other_services.json new file mode 100644 index 000000000..9e1bba485 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/prep_other_services.json @@ -0,0 +1,380 @@ +{ + "count": "1", + "encounter_type": "PrEP Other Services", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Huduma nyingine na rufaa", + "fields": [ + { + "key": "health_edu_sti_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "health_edu_sti_provided", + "label": "Elimu kuhusu magonjwa ya ngono imetolewa?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "sti_rti_screening", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sti_rti_screening", + "label": "Kuchunguzwa magonjwa ya Ngono", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "sti_rti_treatment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sti_rti_treatment", + "label": "Ametibiwa magonjwa ya ngono (kama alipata)", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "treated", + "text": "Ametibiwa", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "treated" + }, + { + "key": "referred", + "text": "Amepewa rufaa ", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "referred" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "step1:sti_rti_screening": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "condoms_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condoms_given", + "label": "Mteja alipatiwa kondom?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "type_of_issued_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_issued_condoms", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Chaguwa aina ya kondom alizopewa", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "male_condoms", + "text": "Kondomu za Kiume", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms" + }, + { + "key": "female_condoms", + "text": "Kondomu za Kike", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "step1:condoms_given": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "number_of_male_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_male_condoms_issued", + "type": "edit_text", + "hint": "Idadi ya Kondomu za Kiume zilizotolewa", + "v_numeric": { + "value": "true", + "err": "Jaza tarakimu sahihi" + }, + "v_min": { + "value": "0", + "err": "Number lazima iwe sawa au zaidi ya 0" + }, + "v_required": { + "value": true, + "err": "Tafadhali jaza idadi" + }, + "relevance": { + "step1:type_of_issued_condoms": { + "ex-checkbox": [ + { + "or": [ + "male_condoms" + ] + } + ] + } + } + }, + { + "key": "number_of_female_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_female_condoms_issued", + "type": "edit_text", + "hint": "Idadi ya Kondomu za Kike zilizotolewa", + "v_numeric": { + "value": "true", + "err": "Jaza tarakimu sahihi" + }, + "v_min": { + "value": "0", + "err": "Number lazima iwe sawa au zaidi ya 0" + }, + "v_required": { + "value": true, + "err": "Tafadhali jaza idadi" + }, + "relevance": { + "step1:type_of_issued_condoms": { + "ex-checkbox": [ + { + "or": [ + "female_condoms" + ] + } + ] + } + } + }, + { + "key": "iec_sbcc_materials", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "iec_sbcc_materials", + "type": "edit_text", + "hint": "Idadi ya Vipeperushi vya Elimu ya Afya alivyopewa", + "v_numeric": { + "value": "true", + "err": "Tafadhali jaza idadi" + }, + "v_required": { + "value": "true", + "err": "Tafadhali jaza idadi" + } + }, + { + "key": "services_and_referral", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "services_and_referral", + "label": "Huduma nyingine na rufaa", + "text_color": "#000000", + "type": "check_box", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "rch", + "text": "Huduma za Mama na mtoto", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rch" + }, + { + "key": "mental_health", + "text": "Afya ya akili na msaada wa kisaikolojia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mental_health" + }, + { + "key": "covid_vaccine", + "text": "Chanjo ya UVIKO", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "covid_vaccine" + }, + { + "key": "legal_services", + "text": "Huduma za msaada wa kisheria", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "legal_services" + }, + { + "key": "iga", + "text": "Huduma za kuongeza kipato", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "iga" + }, + { + "key": "other", + "text": "Nyinginezo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + }, + { + "key": "none", + "text": "hakuna", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ] + }, + { + "key": "services_and_referral_other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "services_and_referral_other", + "type": "edit_text", + "hint": "Nyinginezo", + "v_required": { + "value": "true", + "err": "Tafadhali chagua" + }, + "relevance": { + "step1:services_and_referral": { + "ex-checkbox": [ + { + "or": [ + "other" + ] + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/prep_registration.json b/opensrp-chw-hf/src/main/assets/json.form-sw/prep_registration.json new file mode 100644 index 000000000..be5b757ab --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/prep_registration.json @@ -0,0 +1,121 @@ +{ + "count": "1", + "encounter_type": "PrEP Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Uandikishwaji wa dawa kinga", + "fields": [ + { + "key": "nickname", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "nickname", + "type": "edit_text", + "hint": "Jina maarufu", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Tafadhali jaza jina halisi" + } + }, + { + "key": "agreed_to_use_prep", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "agreed_to_use_prep", + "label": "Ridhaa ya kutumia Dawa Kinga", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "sms_notification_service", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sms_notification_service", + "label": "Ridhaa ya kutumiwa ujumbe kwa njia ya simu", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndio", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/prep_screening.json b/opensrp-chw-hf/src/main/assets/json.form-sw/prep_screening.json new file mode 100644 index 000000000..0438bf9c4 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/prep_screening.json @@ -0,0 +1,636 @@ +{ + "count": "1", + "encounter_type": "PrEP Screening", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Uchunguzi wa ustahili wa dawa kinga", + "fields": [ + { + "key": "diabetes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "diabetes", + "label": " Kisukari", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "treated", + "text": "Ametibiwa/anaendelea vizuri", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "treated" + }, + { + "key": "not_treated", + "text": "Hajatibiwa/Haendelei vizuri", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_treated" + }, + { + "key": "not_diabetic", + "text": "Hana Kisukari", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_diabetic" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "blood_pressure", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_pressure", + "label": "Shinikizo la damu", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "treated", + "text": "Ametibiwa/anaendelea vizuri", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "treated" + }, + { + "key": "not_treated", + "text": "Hajatibiwa/Haendelei vizuri", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_treated" + }, + { + "key": "normal", + "text": "Ana shinikizo la damu la kawaida", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "kidney_disease", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "kidney_disease", + "label": "Ugonjwa wa figo", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "treated", + "text": "Ametibiwa/anaendelea vizuri", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "treated" + }, + { + "key": "not_treated", + "text": "Hajatibiwa/Haendelei vizuri", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_treated" + }, + { + "key": "no_disease", + "text": "Hana ugonjwa wa figo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_disease" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "nephrotoxic_drugs", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "nephrotoxic_drugs", + "label": "Je, mteja anatumia dawa zinazoathiri figo (Nephrotoxic drugs)", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "tested_hbv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tested_hbv", + "label": "Alipimwa HBV", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "hbv_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hbv_results", + "label": "Majibu ya HBV", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "step1:tested_hbv": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "hbv_test_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "hbv_test_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_calculation.yml" + } + } + } + }, + { + "key": "tested_hcv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tested_hcv", + "label": "Alipimwa HCV", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "hcv_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hcv_results", + "label": "Majibu ya HCV", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "positive", + "text": "Chanya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Hasi", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "not_applicable", + "text": "Haihusiki", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "hcv_test_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "hcv_test_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_calculation.yml" + } + } + } + }, + { + "key": "tested_crcl", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tested_crcl", + "label": "Alipimwa Serum Creatinine (CrCL)", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "should_test_for_crcl", + "type": "toaster_notes", + "text": "Mteja anatakiwa kupimwa Serum Creatinine (CrCL)", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "crcl_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "crcl_results", + "label": "Majibu ya Creatinine Clearance (CrCL)", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "greater_than_60", + "text": "> 60 ml/min", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "greater_than_60" + }, + { + "key": "less_than_60", + "text": "< 60 ml/min", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "less_than_60" + }, + { + "key": "no_results", + "text": "Hakuna majibu", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_results" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "step1:tested_crcl": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "crcl_test_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "crcl_test_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_calculation.yml" + } + } + } + }, + { + "key": "weight_35_or_above", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight_35_or_above", + "label": " Je, mteja ana uzito wa KG 35 au zaidi", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "acute_hiv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "acute_hiv", + "label": "Dalili za maambukizi makali ya VVU", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Ndiyo", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "Hapana", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "should_initiate", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "should_initiate", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_calculation.yml" + } + } + } + }, + { + "key": "prompt_for_prep_eligibility", + "type": "toaster_notes", + "text": "Mteja huyu anastahili PrEP", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_prep_ineligibility", + "type": "toaster_notes", + "text": "Mteja huyu hastahili PrEP", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/prep_visit_type.json b/opensrp-chw-hf/src/main/assets/json.form-sw/prep_visit_type.json new file mode 100644 index 000000000..1ad02e111 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/prep_visit_type.json @@ -0,0 +1,122 @@ +{ + "count": "1", + "encounter_type": "PrEP Visit Type", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Aina ya hudhurio la dawa kinga", + "fields": [ + { + "key": "place", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "place", + "label": "Mahali", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "facility", + "text": "Kituo cha Afya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "facility" + }, + { + "key": "community_outreach", + "text": "Jamii/Ufikiaji", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "community_outreach" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + }, + { + "key": "visit_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_type", + "label": "Aina ya tembeleo", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "new_client", + "text": "Mteja mpya", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "new_client" + }, + { + "key": "returning_client", + "text": "Anaerudi", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "returning_client" + }, + { + "key": "transfer_in", + "text": "Mteja alie hamia kutoka kituo kingine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "transfer_in" + }, + { + "key": "visited_another_facility", + "text": "Alitembelea kituo kingine (refill/outreach/transit)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visited_another_facility" + } + ], + "v_required": { + "value": "true", + "err": "Tafadhali chagua jibu" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/referrals/ltfu_referral_form.json b/opensrp-chw-hf/src/main/assets/json.form-sw/referrals/ltfu_referral_form.json new file mode 100644 index 000000000..08762bd04 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/referrals/ltfu_referral_form.json @@ -0,0 +1,186 @@ +{ + "form": "Referral form", + "encounter_type": "Referral Registration", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/general_neat_referral_form_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Fomu ya ufuatiliaji wateja wasiofika kliniki", + "fields": [ + { + "name": "on_art", + "type": "radio_group", + "properties": { + "text": "Mteja anatumia ARVs?" + }, + "options": [ + { + "name": "yes", + "text": "Ndio", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "Hapana", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "meta_data": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "on_art" + }, + "required_status": "yes:Tafadhali chagua" + }, + { + "name": "problem", + "type": "radio_group", + "properties": { + "text": "Kitengo ananchotokea mteja" + }, + "meta_data": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "problem" + }, + "options": [ + { + "name": "CTC", + "text": "CTC", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "CTC", + "openmrs_entity_parent": "" + } + }, + { + "name": "Prep", + "text": "CTC(Dawa Kinga)", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "Prep", + "openmrs_entity_parent": "" + } + }, + { + "name": "PMTCT", + "text": "PMTCT", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "PMTCT", + "openmrs_entity_parent": "" + } + }, + { + "name": "TB", + "text": "TB", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "TB", + "openmrs_entity_parent": "" + } + }, + { + "name": "PWID", + "text": "KLINKI YA WAJIDUNGA", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "PWID", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali chagua", + "dependent_calculations": [ + "referral_date", + "referral_time", + "referral_type", + "referral_status" + ] + }, + { + "name": "chw_referral_hf", + "type": "spinner", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "chw_referral_hf", + "openmrs_entity_parent": "" + }, + "properties": { + "text": "Eneo la Waja" + }, + "options": [], + "required_status": "yes:Tafadhali chagua" + }, + { + "name": "last_appointment_date", + "type": "datetime_picker", + "properties": { + "hint": "Tarehe ya hudhurio la mwisho", + "type": "date_picker", + "display_format": "dd/MM/yyyy", + "max_date": "today" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "last_appointment_date", + "openmrs_entity_parent": "" + }, + "required_status": "true:Tafadhali jaza tarehe ya hudhurio la mwisho" + } + ] + } + ] +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/routine_home_visit.json b/opensrp-chw-hf/src/main/assets/json.form-sw/routine_home_visit.json index e803f9505..b4f73449d 100644 --- a/opensrp-chw-hf/src/main/assets/json.form-sw/routine_home_visit.json +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/routine_home_visit.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -71,106 +66,91 @@ "options": [ { "key": "chk_maternal_nutrition", - "text": "3. Lishe kwa mama wakati wa kunyonyesha", - "value": false, + "text": "Lishe kwa mama wakati wa kunyonyesha", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_hiv_aids", - "text": "5. Umuhimu wa kupata ushauri nasaha na kupima VVU", - "value": false, + "text": "Umuhimu wa kupata ushauri nasaha na kupima VVU", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_pmtc_for_mother", - "text": "6. Kuzuia mambukizi ya VVU kutoka kwa mama kwenda kwa mtoto", - "value": false, + "text": "Kuzuia mambukizi ya VVU kutoka kwa mama kwenda kwa mtoto", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_malaria_prevention", - "text": "7. Kuzuia malaria kwa watoto wenye umri chini ya miaka mitano", - "value": false, + "text": "Kuzuia malaria kwa watoto wenye umri chini ya miaka mitano", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_hiv_exposed_infant", - "text": "15. Ufuatiliaji wa mtoto aliyezaliwa na mama mwenye VVU", - "value": false, + "text": "Ufuatiliaji wa mtoto aliyezaliwa na mama mwenye VVU", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_breast_feeding", - "text": "16. Unyonyeshaji wa maziwa ya mama", - "value": false, + "text": "Unyonyeshaji wa maziwa ya mama", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_birth_registration", - "text": "19. Usajili wa vizazi", - "value": false, + "text": "Usajili wa vizazi", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_complementary_feeding", - "text": "20. Kumlisha mtoto vyakula vya nyongeza", - "value": false, + "text": "Kumlisha mtoto vyakula vya nyongeza", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_growth_and_dev", - "text": "21. Makuzi na maendeleo ya awali ya mtoto", - "value": false, + "text": "Makuzi na maendeleo ya awali ya mtoto", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_immunization", - "text": "22. Chanjo", - "value": false, + "text": "Chanjo", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_newborn_danger", - "text": "23. Dalili za hatari kwa mtoto mchanga", - "value": false, + "text": "Dalili za hatari kwa mtoto mchanga", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_infection", - "text": "24. Kuzuia maambukizi katika jamii", - "value": false, + "text": "Kuzuia maambukizi katika jamii", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_prevention_of_accidents", - "text": "25. Kuzuia ajali kwa watoto chini ya miaka Mitano", - "value": false, + "text": "Kuzuia ajali kwa watoto chini ya miaka Mitano", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_gender_issues", - "text": "26. Jinsia", - "value": false, + "text": "Jinsia", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_none", "text": "Hajafanya", - "value": false, "openmrs_entity": "", "openmrs_entity_id": "" } diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/tb_community_followup_referral.json b/opensrp-chw-hf/src/main/assets/json.form-sw/tb_community_followup_referral.json new file mode 100644 index 000000000..b2572db27 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/tb_community_followup_referral.json @@ -0,0 +1,151 @@ +{ + "form": "TB Community Followup", + "count": "1", + "encounter_type": "TB Community Followup", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/tb_community_followup_referral_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Rufaa ya ufuatiliaji wa wateja wa TB katika ngazi ya jamii", + "fields": [ + { + "name": "reasons_for_issuing_community_referral", + "type": "radio_group", + "properties": { + "text": "Sababu za kutoa rufaa ya ufuatiliaji kwenye Jamii" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_issuing_community_referral", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "missed_appointment", + "text": "Missed Appointment", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "missed_appointment", + "openmrs_entity_parent": "" + } + }, + { + "name": "lost_to_followup", + "text": "Lost to followup client", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "lost_to_followup", + "openmrs_entity_parent": "" + } + }, + { + "name": "Other", + "text": "Nyinginezo", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "Other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali chagua sababu za kutoa rufaa ya ufuatiliaji katika ngazi ya jamii", + "dependent_calculations": [ + "tb_community_referral_date" + ] + }, + { + "name": "reason_for_issuing_community_referral_other", + "type": "text_input_edit_text", + "properties": { + "hint": "Sababu nyinginezo", + "type": "name" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_issuing_community_referral_other", + "openmrs_entity_parent": "reasons_for_issuing_community_referral" + }, + "required_status": "true:Tafadhali jaza sababu zinginezo", + "subjects": "reasons_for_issuing_community_referral:map" + }, + { + "name": "last_client_visit_date", + "type": "datetime_picker", + "properties": { + "hint": "Tarehe ya mwisho ya ya mteja kuhudhuria kliniki", + "type": "date_picker", + "display_format": "dd/MM/yyyy", + "max_date": "today" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "last_client_visit_date", + "openmrs_entity_parent": "" + }, + "required_status": "true:Tafadhali chagua tarehe ya mwisho ya ya mteja kuhudhuria kliniki", + "subjects": "reasons_for_issuing_community_referral:map" + }, + { + "name": "comment_tb_community_followup", + "type": "text_input_edit_text", + "properties": { + "hint": "Toa maoni" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment_tb_community_followup", + "openmrs_entity_parent": "" + }, + "required_status": "false" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/tb_outcome.json b/opensrp-chw-hf/src/main/assets/json.form-sw/tb_outcome.json new file mode 100644 index 000000000..fd575ae61 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/tb_outcome.json @@ -0,0 +1,314 @@ +{ + "form": "TB Outcome", + "count": "1", + "encounter_type": "TB Outcome", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/tb_outcome_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Matokeo ya Vipimo vya TB", + "fields": [ + { + "name": "problem", + "type": "multi_choice_checkbox", + "properties": { + "text": "Chagua dalili za hatari za TB alizonazo mteja." + }, + "meta_data": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "problem" + }, + "options": [ + { + "name": "coughing_blood", + "text": "Kukohoa damu", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "coughing_blood", + "openmrs_entity_parent": "" + } + }, + { + "name": "pain_in_the_chest", + "text": "Maumivu ya kifua", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "cough_lasting_3_weeks_or_more", + "openmrs_entity_parent": "" + } + }, + { + "name": "cough_lasting_3_weeks_or_more", + "text": "Kikohozi kilicho endelea kwa zaidi ya wiki tatu ", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "cough_lasting_3_weeks_or_more", + "openmrs_entity_parent": "" + } + }, + { + "name": "fever", + "text": "Homa", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "fever", + "openmrs_entity_parent": "" + } + }, + { + "name": "weight_loss", + "text": "Kupungua uzito", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "weight_loss", + "openmrs_entity_parent": "" + } + }, + { + "name": "lack_of_appetite", + "text": "Kukosa hamu ya chakula", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "lack_of_appetite", + "openmrs_entity_parent": "" + } + }, + { + "name": "night_sweats", + "text": "Kutokwa jasho wakati wa usiku", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "night_sweats", + "openmrs_entity_parent": "" + } + }, + { + "name": "Other", + "text": "Dalili nyinginezo", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "Other", + "openmrs_entity_parent": "" + } + }, + { + "name": "None", + "text": "Hana dalili za hatari", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "None", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali chagua dalili za hatari", + "dependent_calculations": [ + "tb_facility_visit_date" + ] + }, + { + "name": "problem_other", + "type": "text_input_edit_text", + "properties": { + "hint": "Dalili nyingine", + "type": "name" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "problem_other", + "openmrs_entity_parent": "problem" + }, + "required_status": "true:Tafadhali jaza dalili nyingine za hatari", + "subjects": "problem:map" + }, + { + "name": "action_taken_tb_problems", + "type": "radio_group", + "properties": { + "text": "Hatua zilizochukuliwa." + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "action_taken_tb_problems", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "no_action_taken", + "text": "Hajapewa matibabu yoyote", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no_action_taken", + "openmrs_entity_parent": "" + } + }, + { + "name": "tested", + "text": "Amepimwa", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "tested", + "openmrs_entity_parent": "" + } + }, + { + "name": "referred", + "text": "Amepewa rufaa", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "referred", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali chagua hatua zilizochukuliwa" + }, + { + "name": "test_results", + "type": "radio_group", + "properties": { + "text": "Chagua matokeo ya vipimo vya TB.." + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "test_results", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "positive", + "text": "Ana TB", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "positive", + "openmrs_entity_parent": "" + } + }, + { + "name": "negative", + "text": "Hana TB", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "negative", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali chagua matokeo ya vipimo vya TB", + "subjects": "action_taken_tb_problems:map" + }, + { + "name": "enrolled_to_clinic", + "type": "radio_group", + "properties": { + "text": "Je mteja amesajiliwa kwenye kliniki ya TB?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "enrolled_to_clinic", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Ndio", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "Hapana", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali jaza jibu sahihi", + "subjects": "test_results:map" + }, + { + "name": "tb_clinic_number", + "type": "text_input_edit_text", + "properties": { + "hint": "Jaza namba ya Kliniki ya TB ya mteja", + "type": "name" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "tb_clinic_number", + "openmrs_entity_parent": "" + }, + "required_status": "true:Tafadhali jaza namba ya Kliniki ya TB ya mteja", + "subjects": "enrolled_to_clinic:map" + }, + { + "name": "comment_tb_problems", + "type": "text_input_edit_text", + "properties": { + "hint": "Toa maoni" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment_tb_problems", + "openmrs_entity_parent": "" + }, + "required_status": "false" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form-sw/tb_registration.json b/opensrp-chw-hf/src/main/assets/json.form-sw/tb_registration.json new file mode 100644 index 000000000..ae2115be3 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form-sw/tb_registration.json @@ -0,0 +1,294 @@ +{ + "form": "TB Registration form", + "count": "1", + "encounter_type": "TB Registration", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/tb_registration_form_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Usajili wa wateja wa TB", + "fields": [ + { + "name": "community_client_tb_registration_number", + "type": "text_input_edit_text", + "properties": { + "hint": "Namba ya Kliniki ya TB" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "community_client_tb_registration_number", + "openmrs_entity_parent": "" + }, + "required_status": "yes: Tafadhali jaza namba ya mteja ya cliniki ya TB", + "dependent_calculations": [ + "tb_registration_date", + "client_tb_status_during_registration", + "test_results" + ] + }, + { + "name": "place_of_domicile", + "type": "spinner", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "place_of_domicile", + "openmrs_entity_parent": "" + }, + "properties": { + "text": "Mahali alipotokea mteja/alipohojiwa" + }, + "options": [ + { + "name": "a_family_with_tb_patient", + "text": "Familia yenye mgonjwa wa TB (Andika namba ya wilaya ya mgonjwa wa TB)", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "a_family_with_tb_patient", + "openmrs_entity_parent": "" + } + }, + { + "name": "a_family_without_tb_patient", + "text": "Familia isiyo na mgonjwa wa TB/DR-TB", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "a_family_without_tb_patient", + "openmrs_entity_parent": "" + } + }, + { + "name": "community_gathering", + "text": "Mkusanyiko wa watu/sehemu nyingine", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "community_gathering", + "openmrs_entity_parent": "" + } + }, + { + "name": "pharmacy", + "text": "Duka la dawa", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "pharmacy", + "openmrs_entity_parent": "" + } + }, + { + "name": "traditional_doctors", + "text": "Mganga wa jadi", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "traditional_doctors", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali jaza mahali alipotokea mteja/alipohojiwa" + }, + { + "name": "district_council_number_of_current_tb_client", + "type": "text_input_edit_text", + "properties": { + "hint": "Jaza namba ya wilaya ya mgonjwa wa TB" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "district_council_number_of_current_tb_client", + "openmrs_entity_parent": "" + }, + "required_status": "yes:Tafadhali jaza jaza namba ya wilaya ya mgonjwa wa TB", + "subjects": "place_of_domicile:text" + }, + { + "name": "community_gathering", + "type": "spinner", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "community_gathering", + "openmrs_entity_parent": "" + }, + "properties": { + "text": "Mkusanyiko wa watu/sehemu nyingine" + }, + "options": [ + { + "name": "school", + "text": "Shule", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "school", + "openmrs_entity_parent": "" + } + }, + { + "name": "worship_houses", + "text": "Nyumba za Ibada", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "worship_houses", + "openmrs_entity_parent": "" + } + }, + { + "name": "mining", + "text": "Machimbo", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "mining", + "openmrs_entity_parent": "" + } + }, + { + "name": "public_meetings", + "text": "Mikutano ya hadhara", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "public_meetings", + "openmrs_entity_parent": "" + } + }, + { + "name": "prison", + "text": "Magereza", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "prison", + "openmrs_entity_parent": "" + } + }, + { + "name": "others", + "text": "Kwingineko", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "others", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali jaza mkusanyiko wa watu/sehemu nyingine", + "subjects": "place_of_domicile:text" + }, + { + "name": "other_community_gathering", + "type": "text_input_edit_text", + "properties": { + "hint": "Taja kwingineko" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other_community_gathering", + "openmrs_entity_parent": "" + }, + "required_status": "yes:Tafadhali jaza kwingineko", + "subjects": "community_gathering:text" + }, + { + "name": "client_tb_screening_results", + "type": "spinner", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "client_tb_screening_results", + "openmrs_entity_parent": "" + }, + "properties": { + "text": "Matokeo ya mahojiano (*Dalili alizonazo)" + }, + "options": [ + { + "name": "coughing", + "text": "Kikihozi", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "coughing", + "openmrs_entity_parent": "" + } + }, + { + "name": "hemoptysis", + "text": "Makohozi yaliyochanganyika na Damu", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "hemoptysis", + "openmrs_entity_parent": "" + } + }, + { + "name": "fever", + "text": "Homa", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "fever", + "openmrs_entity_parent": "" + } + }, + { + "name": "weight_lose", + "text": "Kupungua uzito", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "weight_lose", + "openmrs_entity_parent": "" + } + }, + { + "name": "night_sweats", + "text": "Kutokwa jasho jingi kuliko kawaida hasa nyakati za usiku", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "night_sweats", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Tafadhali jaza matokeo ya mahojiano (*Dalili alizonazo)" + } + ] + } + ] +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/all_clients_registration_form.json b/opensrp-chw-hf/src/main/assets/json.form/all_clients_registration_form.json new file mode 100644 index 000000000..583cc0cf4 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/all_clients_registration_form.json @@ -0,0 +1,1089 @@ +{ + "count": "2", + "encounter_type": "Family Registration", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Location details", + "next": "step2", + "fields": [ + { + "key": "fam_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "fam_name", + "type": "edit_text", + "hint": "Surname", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the surname" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter the surname" + } + }, + { + "key": "client_first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "First name", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the first name" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + } + }, + { + "key": "client_middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Middle name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the middle name" + } + }, + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "hidden": "true", + "type": "edit_text", + "barcode_type": "qrcode", + "hint": "ID", + "scanButtonText": "Scan QR Code", + "v_numeric": { + "value": "true", + "err": "Please enter a valid ID" + } + }, + { + "key": "fam_village", + "openmrs_entity_parent": "", + "openmrs_entity": "person_address", + "openmrs_entity_id": "cityVillage", + "type": "edit_text", + "edit_type": "name", + "hint": "Area name", + "v_required": { + "value": "true", + "err": "Please enter the name of area or town" + } + }, + { + "key": "landmark", + "openmrs_entity_parent": "", + "openmrs_entity": "person_address", + "openmrs_entity_id": "landmark", + "type": "edit_text", + "hint": "Landmark/Description of house location", + "v_required": { + "value": true, + "err": "Please enter the landmark/description of location." + } + }, + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "15dp" + }, + { + "key": "sync_location_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "sync_location_id", + "type": "spinner", + "hint": "Select CHW Location" + } + ] + }, + "step2": { + "title": "Client details", + "fields": [ + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "type": "edit_text", + "read_only": true, + "hint": "Kituoni ID", + "v_numeric": { + "value": "true", + "err": "Please enter a valid ID" + }, + "v_required": { + "value": "true", + "err": "Please enter the UNIQUE ID" + } + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "last_name", + "type": "edit_text", + "hint": "Surname", + "edit_type": "name", + "read_only": true, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the surname" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_calculation.yml" + } + } + } + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "First name", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the first name" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_calculation.yml" + } + } + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Middle name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the middle name" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_calculation.yml" + } + } + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "date_picker", + "hint": "Date of birth (DOB)", + "expanded": false, + "duration": { + "label": "Age" + }, + "min_date": "today-120y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the date of birth" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "age_calculated", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_calculation.yml" + } + } + } + }, + { + "key": "dob_unknown", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdateApprox", + "type": "check_box", + "label": "", + "options": [ + { + "key": "dob_unknown", + "text": "DOB unknown?", + "text_size": "18px", + "value": "false" + } + ] + }, + { + "key": "age", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "age", + "type": "edit_text", + "hint": "Age", + "v_numeric_integer": { + "value": "true", + "err": "Must be a rounded number" + }, + "v_max_length": { + "value": "3", + "is_fixed_size": "true", + "err": "Please enter a valid age" + }, + "v_numeric": { + "value": "true", + "err": "Please enter a valid age" + }, + "v_min": { + "value": "0", + "err": "Age must be equal or greater than 0" + }, + "v_max": { + "value": "120", + "err": "Age must be equal or less than 120" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please enter the age" + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Sex", + "values": [ + "Male", + "Female" + ], + "keys": [ + "Male", + "Female" + ], + "v_required": { + "value": "true", + "err": "Please enter the sex" + } + }, + { + "key": "marital_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "marital_status", + "type": "spinner", + "hint": "Client's Marital Status?", + "values": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "keys": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "openmrs_choice_ids": { + "Single": "Single", + "Married": "Married", + "Divorced": "Divorced", + "Widowed": "Widowed", + "Cohabitation": "Cohabitation" + }, + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "phone_number", + "type": "edit_text", + "hint": "Client phone number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + } + }, + { + "key": "id_avail", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "id_avail", + "type": "check_box", + "label": "Do you have any of the following IDs?", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_national_id", + "text": "National ID", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_national_id" + }, + { + "key": "chk_voters_id", + "text": "Voter's registration ID", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_voters_id" + }, + { + "key": "chk_drivers_license", + "text": "Driver's license", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_drivers_license" + }, + { + "key": "chk_passport_number", + "text": "Passport", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_passport_number" + }, + { + "key": "chk_none", + "text": "None", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_none" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "national_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "National_ID", + "type": "mask_edit_text", + "mask": "########-#####-#####-##", + "mask_hint": "12345678912345678912", + "allowed_chars": "0123456789", + "hint": "National ID number e.g 12345678-91234-56789-12", + "edit_type": "number", + "v_max_length": { + "value": "23", + "is_fixed_size": "true", + "err": "Please enter a valid national id" + }, + "v_regex": { + "value": "^\\d{8}-\\d{5}-\\d{5}-\\d{2}$", + "err": "National ID number should be of the format (XXXXXXXX-XXXXX-XXXXX-XX)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid national ID" + }, + "relevance": { + "step2:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_national_id" + ] + } + ] + } + } + }, + { + "key": "voter_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Voter_Registration_Number", + "type": "mask_edit_text", + "mask": "T-####-####-###-#", + "mask_hint": "123456789123", + "allowed_chars": "0123456789", + "hint": "Voter's registration number e.g T-1234-5678-912-3", + "edit_type": "number", + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid voters registration" + }, + "v_regex": { + "value": "^T-\\d{4}-\\d{4}-\\d{3}-\\d{1}$", + "err": "Voter's registration number should be of the format (T-XXXX-XXXX-XXX-X)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid voters registration number" + }, + "relevance": { + "step2:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_voters_id" + ] + } + ] + } + } + }, + { + "key": "driver_license", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Driver_License_Number", + "type": "mask_edit_text", + "mask": "##########", + "mask_hint": "1234567891", + "allowed_chars": "0123456789", + "hint": "Driver's license number e.g 1234567891", + "edit_type": "number", + "v_max_length": { + "value": "10", + "is_fixed_size": "true", + "err": "Please enter a valid drivers license number" + }, + "v_regex": { + "value": "^([0-9]{10})", + "err": "Driver's license number should be of the format (XXXXXXXXXX)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid driver's license number" + }, + "relevance": { + "step2:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_drivers_license" + ] + } + ] + } + } + }, + { + "key": "passport_number", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Passport", + "type": "mask_edit_text", + "mask": "TAE-###-###", + "mask_hint": "123456", + "allowed_chars": "0123456789", + "hint": "Passport number e.g TAE-123-456", + "edit_type": "number", + "v_max_length": { + "value": "11", + "is_fixed_size": "true", + "err": "Please enter a valid passport number" + }, + "v_regex": { + "value": "^TAE-\\d{3}-\\d{3}$", + "err": "Passport number should be of the format (TAE-XXX-XXX)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid passport number" + }, + "relevance": { + "step2:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_passport_number" + ] + } + ] + } + } + }, + { + "key": "insurance_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Health_Insurance_Type", + "type": "spinner", + "hint": "Health insurance provider", + "values": [ + "Community Health Fund (CHF)/(iCHF)", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", + "Tiba Kwa Kadi (TIKA)", + "AAR Healthcare", + "Strategies Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)", + "Britam Insurance Tanzania", + "Jubilee Insurance", + "Resolutions Insurance", + "Reliance Insurance", + "Other", + "None" + ], + "keys": [ + "Community Health Fund (CHF)", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", + "Tiba Kwa Kadi (TIKA)", + "AAR Healthcare", + "Strategies Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)", + "Britam Insurance Tanzania", + "Jubilee Insurance", + "Resolutions Insurance", + "Reliance Insurance", + "Other", + "None" + ], + "openmrs_choice_ids": { + "Community Health Fund (CHF)": "Community_Health_Fund", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)": "National_Social_Security_Fund", + "National Health Insurance Fund (NHIF)": "National_Health_Insurance_Fund", + "Tiba Kwa Kadi (TIKA)": "Tiba_kwa_Kadi", + "AAR Healthcare": "AAR_Healthcare", + "AAR Strategies Insurance": "Strategies_Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)": "BIMA_Mkononi", + "Britam Insurance Tanzania": "Britam_Insurance_Tanzania", + "Jubilee Insurance": "Jubilee_Insurance", + "Resolutions Insurance": "Resolutions_Insurance", + "Reliance Insurance": "Reliance_Insurance", + "Other": "Other_Health_Insurance_Type", + "None": "No_Health_Insurance" + }, + "v_required": { + "value": "true", + "err": "Please enter the insurance provider" + } + }, + { + "key": "insurance_provider_other", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Health_Insurance_Type", + "type": "edit_text", + "hint": "Other health insurance provider", + "v_required": { + "value": "true", + "err": "Please specify the insurance provider" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "insurance_provider_number", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Health_Insurance_Number", + "type": "edit_text", + "hint": "Health insurance provider number", + "v_required": { + "value": "true", + "err": "Please add the health insurance provider iD Number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "wra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_calculation.yml" + } + } + } + }, + { + "key": "mra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_calculation.yml" + } + } + } + }, + { + "key": "preg_1yr", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "preg_1yr", + "type": "spinner", + "hint": "Has the woman delivered in the last 1 year?", + "values": [ + "Yes", + "No" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Please select if the woman has delivered in the last 1 year" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "disabilities", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabilities", + "type": "spinner", + "hint": "Physical disabilities", + "values": [ + "Yes", + "No" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "type_of_disability", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "label": "Type of disability", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Mobility and Physical Impairments", + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Spinal Cord Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Head Injuries - Brain Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Vision Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Hearing Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Cognitive or Learning Disabilities", + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Psychological Disorders", + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Invisible Disabilities", + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please select the type of physical disabilities" + } + }, + { + "key": "has_primary_caregiver", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "Has_Primary_Caregiver", + "type": "spinner", + "hint": " Do you have a primary caregiver/Treatment supporter?", + "values": [ + "Yes", + "No" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "primary_caregiver_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "Primary_Caregiver_Name", + "type": "edit_text", + "edit_type": "name", + "hint": "Name of caregiver", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please specify the name of the caregiver." + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "other_phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_phone_number", + "type": "edit_text", + "hint": "Primary caregiver phone number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "service_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "service_provider", + "type": "native_radio", + "label": "Occupation of the Client", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "chk_self_employed", + "text": "Self-Employed", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_self_employed" + }, + { + "key": "chk_employed", + "text": "Employed", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_employed" + }, + { + "key": "chk_unemployed", + "text": "Unemployed", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_unemployed" + }, + { + "key": "chk_farmer", + "text": "Farmer", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_farmer" + }, + { + "key": "chk_traditional_healer", + "text": "Traditional healer", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_traditional_healer" + } + ], + "v_required": { + "value": "true", + "err": "Please pick at least one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "leader", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Community_Leader", + "type": "check_box", + "label": "Any leadership role in the community?", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_religious", + "text": "Religious leader", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Religious_Leader" + }, + { + "key": "chk_traditional", + "text": "Traditional leader", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Traditional_leader" + }, + { + "key": "chk_political", + "text": "Political leader", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Political_leader" + }, + { + "key": "chk_influential", + "text": "Influential leader", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Influential_Leader" + }, + { + "key": "chk_other", + "text": "Other", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Community_Leader_Type" + }, + { + "key": "chk_none", + "text": "None", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Not_a_Community_Leader" + } + ], + "v_required": { + "value": "true", + "err": "Please pick at least one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_relevance.yml" + } + } + } + }, + { + "key": "leader_other", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Community_Leader_Type_Name", + "type": "edit_text", + "hint": "Mention other role in the community", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please specify role" + }, + "relevance": { + "step2:leader": { + "ex-checkbox": [ + { + "or": [ + "chk_other" + ] + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/all_clients_update_registration_info_form.json b/opensrp-chw-hf/src/main/assets/json.form/all_clients_update_registration_info_form.json new file mode 100644 index 000000000..b242c5e37 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/all_clients_update_registration_info_form.json @@ -0,0 +1,956 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Family Registration", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Client details", + "fields": [ + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "type": "edit_text", + "read_only": true, + "hint": "Kituoni ID", + "v_numeric": { + "value": "true", + "err": "Please enter a valid ID" + }, + "v_required": { + "value": "true", + "err": "Please enter the UNIQUE ID" + } + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "last_name", + "type": "edit_text", + "hint": "Surname", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the surname" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_calculation.yml" + } + } + } + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "First name", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the first name" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Middle name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the middle name" + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "date_picker", + "hint": "Date of birth (DOB)", + "expanded": false, + "duration": { + "label": "Age" + }, + "min_date": "today-120y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the date of birth" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "age_calculated", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_calculation.yml" + } + } + } + }, + { + "key": "dob_unknown", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdateApprox", + "type": "check_box", + "label": "", + "options": [ + { + "key": "dob_unknown", + "text": "DOB unknown?", + "text_size": "18px", + "value": "false" + } + ] + }, + { + "key": "age", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "age", + "type": "edit_text", + "hint": "Age", + "v_max_length": { + "value": "3", + "is_fixed_size": "true", + "err": "Please enter a valid age" + }, + "v_numeric_integer": { + "value": "true", + "err": "Must be a rounded number" + }, + "v_numeric": { + "value": "true", + "err": "Number must begin with 0 and must be a total of 10 digits in length" + }, + "v_max": { + "value": "120", + "err": "Age must be equal or less than 120" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please enter the age" + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Sex", + "values": [ + "Male", + "Female" + ], + "keys": [ + "Male", + "Female" + ], + "v_required": { + "value": "true", + "err": "Please enter the sex" + } + }, + { + "key": "marital_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "marital_status", + "type": "spinner", + "hint": "Client's Marital Status?", + "values": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "keys": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "openmrs_choice_ids": { + "Single": "Single", + "Married": "Married", + "Divorced": "Divorced", + "Widowed": "Widowed", + "Cohabitation": "Cohabitation" + }, + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "phone_number", + "type": "edit_text", + "hint": "Client phone number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + } + }, + { + "key": "id_avail", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "id_avail", + "type": "check_box", + "label": "Do you have any of the following IDs?", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_national_id", + "text": "National ID", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_national_id" + }, + { + "key": "chk_voters_id", + "text": "Voter's registration ID", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_voters_id" + }, + { + "key": "chk_drivers_license", + "text": "Driver's license", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_drivers_license" + }, + { + "key": "chk_passport_number", + "text": "Passort", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_passport_number" + }, + { + "key": "chk_none", + "text": "None", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_none" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "national_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "National_ID", + "type": "mask_edit_text", + "mask": "########-#####-#####-##", + "mask_hint": "12345678912345678912", + "allowed_chars": "0123456789", + "hint": "National ID number e.g 12345678-91234-56789-12", + "edit_type": "number", + "v_max_length": { + "value": "23", + "is_fixed_size": "true", + "err": "Please enter a valid national id" + }, + "v_regex": { + "value": "^\\d{8}-\\d{5}-\\d{5}-\\d{2}$", + "err": "National ID number should be of the format (XXXXXXXX-XXXXX-XXXXX-XX)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid national ID" + }, + "relevance": { + "step1:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_national_id" + ] + } + ] + } + } + }, + { + "key": "voter_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Voter_Registration_Number", + "type": "mask_edit_text", + "mask": "T-####-####-###-#", + "mask_hint": "123456789123", + "allowed_chars": "0123456789", + "hint": "Voter's registration number e.g T-1234-5678-912-3", + "edit_type": "number", + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid voters registration" + }, + "v_regex": { + "value": "^T-\\d{4}-\\d{4}-\\d{3}-\\d{1}$", + "err": "Voter's registration number should be of the format (T-XXXX-XXXX-XXX-X)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid voters registration number" + }, + "relevance": { + "step1:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_voters_id" + ] + } + ] + } + } + }, + { + "key": "driver_license", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Driver_License_Number", + "type": "mask_edit_text", + "mask": "##########", + "mask_hint": "1234567891", + "allowed_chars": "0123456789", + "hint": "Driver's license number e.g 1234567891", + "edit_type": "number", + "v_max_length": { + "value": "10", + "is_fixed_size": "true", + "err": "Please enter a valid drivers license number" + }, + "v_regex": { + "value": "^([0-9]{10})", + "err": "Driver's license number should be of the format (XXXXXXXXXX)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid driver's license number" + }, + "relevance": { + "step1:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_drivers_license" + ] + } + ] + } + } + }, + { + "key": "passport_number", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Passport", + "type": "mask_edit_text", + "mask": "TAE-###-###", + "mask_hint": "123456", + "allowed_chars": "0123456789", + "hint": "Passport number e.g TAE-123-456", + "edit_type": "number", + "v_max_length": { + "value": "11", + "is_fixed_size": "true", + "err": "Please enter a valid passport number" + }, + "v_regex": { + "value": "^TAE-\\d{3}-\\d{3}$", + "err": "Passport number should be of the format (TAE-XXX-XXX)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid passport number" + }, + "relevance": { + "step1:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_passport_number" + ] + } + ] + } + } + }, + { + "key": "insurance_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Health_Insurance_Type", + "type": "spinner", + "hint": "Health insurance provider", + "values": [ + "Community Health Fund (CHF)/(iCHF)", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", + "Tiba Kwa Kadi (TIKA)", + "AAR Healthcare", + "Strategies Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)", + "Britam Insurance Tanzania", + "Jubilee Insurance", + "Resolutions Insurance", + "Reliance Insurance", + "Other", + "None" + ], + "keys": [ + "Community Health Fund (CHF)", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", + "Tiba Kwa Kadi (TIKA)", + "AAR Healthcare", + "Strategies Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)", + "Britam Insurance Tanzania", + "Jubilee Insurance", + "Resolutions Insurance", + "Reliance Insurance", + "Other", + "None" + ], + "openmrs_choice_ids": { + "Community Health Fund (CHF)": "Community_Health_Fund", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)": "National_Social_Security_Fund", + "National Health Insurance Fund (NHIF)": "National_Health_Insurance_Fund", + "Tiba Kwa Kadi (TIKA)": "Tiba_kwa_Kadi", + "AAR Healthcare": "AAR_Healthcare", + "AAR Strategies Insurance": "Strategies_Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)": "BIMA_Mkononi", + "Britam Insurance Tanzania": "Britam_Insurance_Tanzania", + "Jubilee Insurance": "Jubilee_Insurance", + "Resolutions Insurance": "Resolutions_Insurance", + "Reliance Insurance": "Reliance_Insurance", + "Other": "Other_Health_Insurance_Type", + "None": "No_Health_Insurance" + }, + "v_required": { + "value": "true", + "err": "Please enter the insurance provider" + } + }, + { + "key": "insurance_provider_other", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Health_Insurance_Type", + "type": "edit_text", + "hint": "Other health insurance provider", + "v_required": { + "value": "true", + "err": "Please specify the insurance provider" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "insurance_provider_number", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Health_Insurance_Number", + "type": "edit_text", + "hint": "Health insurance provider number", + "v_required": { + "value": "true", + "err": "Please add the health insurance provider iD Number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "wra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_calculation.yml" + } + } + } + }, + { + "key": "mra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_calculation.yml" + } + } + } + }, + { + "key": "preg_1yr", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "preg_1yr", + "type": "spinner", + "hint": "Has the woman delivered in the last 1 year?", + "values": [ + "Yes", + "No" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Please select if the woman has delivered in the last 1 year" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "disabilities", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabilities", + "type": "spinner", + "hint": "Physical disabilities", + "values": [ + "Yes", + "No" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "type_of_disability", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "label": "Type of physical disabilities", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Mobility and Physical Impairments", + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Spinal Cord Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Head Injuries - Brain Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Vision Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Hearing Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Cognitive or Learning Disabilities", + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Psychological Disorders", + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Invisible Disabilities", + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], + "v_required": { + "value": "true", + "err": "Please enter type of disability" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "has_primary_caregiver", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "Has_Primary_Caregiver", + "type": "spinner", + "hint": " Do you have a primary caregiver/Treatment supporter?", + "values": [ + "Yes", + "No" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "primary_caregiver_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "Primary_Caregiver_Name", + "type": "edit_text", + "hint": "Name of caregiver", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please specify the name of the caregiver." + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "other_phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_phone_number", + "type": "edit_text", + "hint": "Primary caregiver phone number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "service_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "service_provider", + "type": "native_radio", + "label": "Occupation of the Client", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "chk_self_employed", + "text": "Self-Employed", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_self_employed" + }, + { + "key": "chk_employed", + "text": "Employed", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_employed" + }, + { + "key": "chk_unemployed", + "text": "Unemployed", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_unemployed" + }, + { + "key": "chk_farmer", + "text": "Farmer", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_farmer" + }, + { + "key": "chk_traditional_healer", + "text": "Traditional healer", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_traditional_healer" + } + ], + "v_required": { + "value": "true", + "err": "Please pick at least one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "leader", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Community_Leader", + "type": "check_box", + "label": "Any leadership role in the community?", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_religious", + "text": "Religious leader", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Religious_Leader" + }, + { + "key": "chk_traditional", + "text": "Traditional leader", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Traditional_leader" + }, + { + "key": "chk_political", + "text": "Political leader", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Political_leader" + }, + { + "key": "chk_influential", + "text": "Influential leader", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Influential_Leader" + }, + { + "key": "chk_other", + "text": "Other", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Community_Leader_Type" + }, + { + "key": "chk_none", + "text": "None", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Not_a_Community_Leader" + } + ], + "v_required": { + "value": "true", + "err": "Please pick at least one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "all_clients_member_update_relevance.yml" + } + } + } + }, + { + "key": "leader_other", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Community_Leader_Type_Name", + "type": "edit_text", + "hint": "Mention other role in the community", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please specify role" + }, + "relevance": { + "step1:leader": { + "ex-checkbox": [ + { + "or": [ + "chk_other" + ] + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_counselling.json b/opensrp-chw-hf/src/main/assets/json.form/anc_counselling.json new file mode 100644 index 000000000..e6ca0039a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_counselling.json @@ -0,0 +1,151 @@ +{ + "count": "1", + "encounter_type": "ANC Counselling", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Counselling", + "fields": [ + { + "key": "given_counselling", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "given_counselling", + "type": "check_box", + "label": "Select the topics counseled on this visit", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_sexual_relationship", + "text": "Sexual relationship", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_sexual_relationship" + }, + { + "key": "chk_birth_emergency_plan", + "text": "Birth and emergency plan", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_birth_emergency_plan" + }, + { + "key": "chk_danger_signs", + "text": "Danger signs", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_danger_signs" + }, + { + "key": "chk_discussion_std_hiv", + "text": "Discussion on STI/RTI/HIV", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_discussion_std_hiv" + }, + { + "key": "chk_condom_use", + "text": "Condom use", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_condom_use" + }, + { + "key": "chk_advice_gravid", + "text": "Advice on common gravid discomfort", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_advice_gravid" + }, + { + "key": "chk_self_care", + "text": "Self care", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_self_care" + }, + { + "key": "chk_healthy_eating", + "text": "Healthy eating", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_healthy_eating" + }, + { + "key": "chk_physical_activity", + "text": "Physical activity", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_physical_activity" + }, + { + "key": "chk_use_folic_acid", + "text": "Daily use of Iron folic acid", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_use_folic_acid" + }, + { + "key": "chk_counsel_llin", + "text": "Provide and counsel on use of LLIN", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_counsel_llin" + }, + { + "key": "chk_child_feeding", + "text": "Child Feeding", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_child_feeding" + }, + { + "key": "chk_none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_none" + } + ] + }, + { + "key": "counselling_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "counselling_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_danger_signs_outcome.json b/opensrp-chw-hf/src/main/assets/json.form/anc_danger_signs_outcome.json index 9cbcc0103..0e898584d 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/anc_danger_signs_outcome.json +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_danger_signs_outcome.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -97,7 +92,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "anc_key_info", "type": "toaster_notes", - "text": "Key information for health facility:\nLast menstrual period: (LNMP)\nGestational age: {gest_age}\nEDD: {edd}", + "text": "Key information for health facility:\nLast normal menstrual period: (LNMP)\nGestational age: {gest_age}\nEDD: {edd}", "toaster_type": "info", "calculation": { "rules-engine": { @@ -111,76 +106,65 @@ "key": "danger_signs_present", "type": "check_box", "openmrs_entity": "concept", - "openmrs_entity_id": "160939AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "danger_signs_present", "openmrs_entity_parent": "", "label": "What dangers sign did the woman have?", "combine_checkbox_option_values": "true", "options": [ { "key": "Fever", - "openmrs_choice_id": "140238AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Fever", - "value": false + "openmrs_choice_id": "Fever", + "text": "Fever" }, { "key": "Bleeding_vaginally", - "openmrs_choice_id": "150802AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Bleeding vaginally", - "value": false + "openmrs_choice_id": "Bleeding_vaginally", + "text": "Bleeding vaginally" }, { "key": "Severe_headache", - "openmrs_choice_id": "139081AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Severe headache", - "value": false + "openmrs_choice_id": "Severe_headache", + "text": "Severe headache" }, { "key": "Convulsions", - "openmrs_choice_id": "164483AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Convulsions", - "value": false + "openmrs_choice_id": "Convulsions", + "text": "Convulsions" }, { "key": "Difficulty_breathing", - "openmrs_choice_id": "142373AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Difficulty breathing", - "value": false + "openmrs_choice_id": "Difficulty_breathing", + "text": "Difficulty breathing" }, { "key": "Severe_abdominal_pain", - "openmrs_choice_id": "165271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Severe abdominal pain", - "value": false + "openmrs_choice_id": "Severe_abdominal_pain", + "text": "Severe abdominal pain" }, { "key": "Swelling_of_the_face_and/or_hands", - "openmrs_choice_id": "460AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Swelling of the face and/or hands", - "value": false + "openmrs_choice_id": "Swelling_of_the_face_and", + "text": "Swelling of the face and/or hands" }, { "key": "Discoloured_or_watery_liquid_vaginal_discharge_with_a_bad_smell", - "openmrs_choice_id": "123395AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Discoloured or watery, liquid vaginal discharge with a bad smell", - "value": false + "openmrs_choice_id": "Discoloured_or_watery_liquid_vaginal_discharge_with_a_bad_smell", + "text": "Discoloured or watery, liquid vaginal discharge with a bad smell" }, { "key": "No_movement_unusual_movement_for_a_child_in_the_womb", - "openmrs_choice_id": "113377AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "No movement / unusual movement for a child in the womb", - "value": false + "openmrs_choice_id": "No_movement_unusual_movement_for_a_child_in_the_womb", + "text": "No movement / unusual movement for a child in the womb" }, { "key": "Other", - "openmrs_choice_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Other", - "value": false + "openmrs_choice_id": "Other", + "text": "Other" }, { "key": "None", - "openmrs_choice_id": "", - "text": "None", - "value": false + "openmrs_choice_id": "None", + "text": "None" } ], "exclusive": [ @@ -195,7 +179,7 @@ "key": "other_anc_danger_signs", "type": "edit_text", "openmrs_entity": "concept", - "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "other_anc_danger_signs", "openmrs_entity_parent": "", "edit_type": "name", "hint": "Other danger sign", @@ -215,28 +199,28 @@ "key": "action_taken_anc_danger_signs", "type": "native_radio", "openmrs_entity": "concept", - "openmrs_entity_id": "164378AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "action_taken_anc_danger_signs", "openmrs_entity_parent": "", "label": "Action taken by health facility", "options": [ { "key": "No_action_taken", "openmrs_entity": "", - "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "No_action_taken", "openmrs_entity_parent": "", "text": "No action taken" }, { "key": "Managed", "openmrs_entity": "", - "openmrs_entity_id": "1692AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "Managed", "openmrs_entity_parent": "", "text": "Managed" }, { "key": "Referred", "openmrs_entity": "", - "openmrs_entity_id": "1648AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "Referred", "openmrs_entity_parent": "", "text": "Referred" } @@ -257,14 +241,14 @@ { "key": "Discharged", "openmrs_entity": "", - "openmrs_entity_id": "1654AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "Discharged", "openmrs_entity_parent": "", "text": "Discharged" }, { "key": "Died", "openmrs_entity": "", - "openmrs_entity_id": "159AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "Died", "openmrs_entity_parent": "", "text": "Died" } diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_fv_baseline_investigation.json b/opensrp-chw-hf/src/main/assets/json.form/anc_fv_baseline_investigation.json new file mode 100644 index 000000000..373042d3a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_fv_baseline_investigation.json @@ -0,0 +1,1321 @@ +{ + "count": "1", + "encounter_type": "Baseline Investigation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Baseline Investigation", + "fields": [ + { + "key": "glucose_in_urine", + "type": "native_radio", + "label": "Glucose In Urine", + "openmrs_entity": "concept", + "openmrs_entity_id": "glucose_in_urine", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Glucose In Urine Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "prompt_for_glucose_in_urine", + "type": "toaster_notes", + "text": "Check Random Blood Glucose to rule-out gestational diabetes ", + "openmrs_entity_id": "prompt_for_glucose_in_urine", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:glucose_in_urine": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_glucose_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_glucose_in_urine_test", + "type": "spinner", + "hint": "Reason as to why the Glucose In Urine test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:glucose_in_urine": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_glucose_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_glucose_in_urine_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting Glucose In Urine test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_glucose_in_urine_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "protein_in_urine", + "type": "native_radio", + "label": "Protein In Urine", + "openmrs_entity": "concept", + "openmrs_entity_id": "protein_in_urine", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Protein In Urine Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "prompt_for_protein_in_urine", + "type": "toaster_notes", + "text": "Monitor Blood Pressure to rule out pre-eclampsia, elicit symptoms of Urinary Tract Infection and manage the cause of proteinuria according to standard guidelines", + "openmrs_entity_id": "prompt_for_protein_in_urine", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:protein_in_urine": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_protein_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_protein_in_urine_test", + "type": "spinner", + "hint": "Reason as to why the Protein In Urine test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:protein_in_urine": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_protein_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_protein_in_urine_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting Protein In Urine test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_protein_in_urine_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "blood_group", + "type": "spinner", + "hint": "Blood Group", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_group", + "openmrs_entity_parent": "", + "values": [ + "A", + "B", + "AB", + "O", + "Blood Type Test Not Conducted" + ], + "keys": [ + "A", + "B", + "AB", + "O", + "test_not_conducted" + ], + "openmrs_choice_ids": { + "A": "A", + "B": "B", + "AB": "AB", + "O": "O", + "test_not_conducted": "test_not_conducted" + } + }, + { + "key": "reason_for_not_conducting_blood_group_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_blood_group_test", + "type": "spinner", + "hint": "Reason as to why the Blood Type Test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:blood_group": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_blood_group_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_blood_group_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting the Blood Type Test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_blood_group_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "rh_factor", + "type": "native_radio", + "label": "Rh", + "openmrs_entity": "concept", + "openmrs_entity_id": "rh_factor", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_rh_factor", + "type": "toaster_notes", + "text": "Refer the client for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:rh_factor": { + "type": "string", + "ex": "equalTo(., \"negative\")" + } + } + }, + { + "key": "hb_level_test", + "type": "native_radio", + "label": "HB Level Test", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "test_conducted", + "text": "HB Level Test conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted", + "openmrs_entity_parent": "" + }, + { + "key": "test_not_conducted", + "text": "HB Level Test not conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "hb_level", + "type": "edit_text", + "hint": "HB Level (g/dl)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the HB level" + }, + "v_min": { + "value": "0", + "err": "HB level must be equal or greater than 0 (g/dl)" + }, + "v_max": { + "value": "20", + "err": "HB level must be equal or less than 20 (g/dl)" + }, + "v_required": { + "value": "true", + "err": "Please enter the HB level" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_conducted\")" + } + } + }, + { + "key": "prompt_for_severe_anaemia_treatment", + "type": "toaster_notes", + "text": "Manage the severe anaemia according to standard guidelines", + "openmrs_entity_id": "prompt_for_severe_anaemia_treatment", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hb_level": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"8.5\")" + } + } + }, + { + "key": "prompt_for_moderate_anaemia_management", + "type": "toaster_notes", + "text": "Manage the mild anaemia according to standard guidelines", + "openmrs_entity_id": "prompt_for_moderate_anaemia_management", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hb_test", + "type": "spinner", + "hint": "Reason as to why the HB Level test was not conducted", + "values": [ + "Cuvette Cartridges Out of Stock", + "Haemoque machine out of order", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other" + ], + "keys": [ + "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "stock_out_of_cuvettes_cartridges": "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order": "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_hb_test_not_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_hb_test_not_conducted", + "type": "edit_text", + "hint": "Specify other reasons for not conducting the HB Level Test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_hb_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "blood_for_glucose_test", + "type": "native_radio", + "label": "Blood For Glucose Test", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_for_glucose_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "test_conducted", + "text": "Blood for Glucose Test conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted", + "openmrs_entity_parent": "" + }, + { + "key": "test_not_conducted", + "text": "Blood for Glucose Test not conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "type_of_blood_for_glucose_test", + "type": "native_radio", + "label": "Type Of Blood For Glucose Test Conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_blood_for_glucose_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "rbg", + "text": " Random Blood Glucose Test (rbg)", + "openmrs_entity": "concept", + "openmrs_entity_id": "rbg", + "openmrs_entity_parent": "" + }, + { + "key": "gtt", + "text": "Glucose Tolerance test (GTT)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gtt" + }, + { + "key": "fbg", + "text": "Fasting Blood Glucose Test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fbg" + } + ], + "v_required": { + "value": true, + "err": "Please answer this question" + }, + "relevance": { + "step1:blood_for_glucose_test": { + "type": "string", + "ex": "equalTo(., \"test_conducted\")" + } + } + }, + { + "key": "blood_for_glucose", + "type": "edit_text", + "hint": "Blood For Glucose (mmol/L)", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_for_glucose", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the blood for glucose (mmol/L)" + }, + "v_min": { + "value": "0", + "err": "Blood for glucose must be equal or greater than 0 (mmol/L)" + }, + "v_max": { + "value": "45", + "err": "Blood for glucose must be equal or less than 45 (mmol/L)" + }, + "v_required": { + "value": "true", + "err": "Please enter the blood for glucose (mmol/L)" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_gestational_diabetes_mellitus", + "type": "toaster_notes", + "text": "Manage the gestational diabetes mellitus according to standard guidelines", + "openmrs_entity_id": "prompt_for_gestational_diabetes_mellitus", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_hypoglycaemia", + "type": "toaster_notes", + "text": "Manage the hypoglycaemia according to standard guidelines", + "openmrs_entity_id": "prompt_for_hypoglycaemia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_blood_glucose_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_blood_glucose_test", + "type": "spinner", + "hint": "Reason as to why the Blood for Glucose test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_are_out_of_stock": "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:blood_for_glucose_test": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_blood_glucose_test_not_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_blood_glucose_test_not_conducted", + "type": "edit_text", + "hint": "Specify other reasons for not conducting the Blood for Glucose test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_blood_glucose_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "hiv", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_calculation.yml" + } + } + } + }, + { + "key": "hiv_qn", + "type": "native_radio", + "label": "HIV Test Results", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_qn", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "HIV Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hiv_test", + "type": "spinner", + "hint": "Reason as to why the HIV test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:hiv_qn": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_hiv_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting HIV test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_hiv_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "register_pmtct", + "type": "toaster_notes", + "text": "Register the client for PMTCT care and follow up", + "openmrs_entity_id": "register_pmtct", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hiv_qn": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "prescribe_arv", + "type": "toaster_notes", + "text": "Prescribe ARVs to the client according to standard guidelines", + "openmrs_entity_id": "prescribe_arv", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hiv_qn": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "hiv_counselling_before_testing", + "type": "native_radio", + "label": "Was the client provided with counselling before HIV testing?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_counselling_before_testing", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "hiv_counselling_after_testing", + "type": "native_radio", + "label": "Was the client provided with counselling after HIV testing?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_counselling_after_testing", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "syphilis", + "type": "native_radio", + "label": "Syphilis Test Results", + "openmrs_entity": "concept", + "openmrs_entity_id": "syphilis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Syphilis Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "prescribe_anti_sy", + "type": "toaster_notes", + "text": "Prescribe client to Antibiotics", + "openmrs_entity_id": "prescribe_anti_sy", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:syphilis": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_syphilis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_syphilis_test", + "type": "spinner", + "hint": "Reason as to why the Syphilis test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:syphilis": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_syphilis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_syphilis_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting Syphilis test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_syphilis_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "syphilis_treatment", + "type": "native_radio", + "label": "Was syphilis treatment provided?", + "openmrs_entity": "concept", + "openmrs_entity_id": "syphilis_treatment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:syphilis": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "hepatitis", + "type": "native_radio", + "label": "Hepatitis B Test Results", + "openmrs_entity": "concept", + "openmrs_entity_id": "hepatitis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Hepatitis B Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "prescribe_arv_hepb_at_above_twenty_eight", + "type": "toaster_notes", + "text": "Prescribe ARVs to the client according to standard guidelines", + "openmrs_entity_id": "prescribe_arv_hepb_at_above_twenty_eight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "counsel_arv_hepb_below_twenty_eight", + "type": "toaster_notes", + "text": "Counsel on ARVs uptake at 28-weeks of gestation", + "openmrs_entity_id": "counsel_arv_hepb_below_twenty_eight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hepatitis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hepatitis_test", + "type": "spinner", + "hint": "Reason as to why the Hepatitis B test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:hepatitis": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_hepatitis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_hepatitis_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting Hepatitis B test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_hepatitis_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "other_stds", + "type": "native_radio", + "label": "Has the client tested positive for other STIs?", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_stds", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ] + }, + { + "key": "other_stds_treatment", + "type": "native_radio", + "label": "Was treatment provided for other STIs?", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_stds_treatment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:other_stds": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "reason_for_not_giving_medication_for_other_stds", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_medication_for_other_stds", + "type": "spinner", + "hint": "Reason as to why treatment was not given", + "values": [ + "Out of stock", + "The client did not agree to take the medication", + "The client is allergic to medication", + "Other (Specify)" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:other_stds_treatment": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "other_reason_for_not_giving_medication_for_other_stds", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_giving_medication_for_other_stds", + "type": "edit_text", + "hint": "Specify other reasons for not giving treatment", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_giving_medication_for_other_stds": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "date_anc_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "date_anc_hiv_test", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_calculation.yml" + } + } + } + }, + { + "key": "hiv_test_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_number", + "type": "hidden" + }, + { + "key": "hiv_test_at_32", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_at_32", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_baseline_investigation_calculation.yml" + } + } + } + }, + { + "key": "baseline_investigation_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "baseline_investigation_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_fv_malaria_investigation_form.json b/opensrp-chw-hf/src/main/assets/json.form/anc_fv_malaria_investigation_form.json new file mode 100644 index 000000000..f55731509 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_fv_malaria_investigation_form.json @@ -0,0 +1,371 @@ +{ + "count": "1", + "encounter_type": "Malaria Investigation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": { + "llin_provided": false + }, + "step1": { + "title": "Malaria Investigation", + "fields": [ + { + "key": "client_on_malaria_medication", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_on_malaria_medication", + "type": "native_radio", + "label": "Is the client on malaria medication?", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "mRDT_for_malaria", + "type": "native_radio", + "label": "mRDT for Malaria Results", + "openmrs_entity": "concept", + "openmrs_entity_id": "mRDT_for_malaria", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Malaria Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "step1:client_on_malaria_medication": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + }, + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_mRDT", + "type": "toaster_notes", + "text": "Provide anti-malaria medication and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_mRDT", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:mRDT_for_malaria": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_malaria_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_malaria_test", + "type": "spinner", + "hint": "Reason as to why the Malaria test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:mRDT_for_malaria": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_malaria_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_malaria_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting Malaria test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_malaria_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "malaria_preventive_therapy", + "type": "hidden", + "openmrs_entity_id": "malaria_preventive_therapy", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_malaria_investigation_calculation.yml" + } + } + } + }, + { + "key": "malaria_preventive_therapy_ipt1", + "type": "native_radio", + "openmrs_entity_id": "malaria_preventive_therapy_ipt1", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Malaria Preventive Therapy", + "options": [ + { + "key": "ipt1", + "text": "IPT1", + "openmrs_entity_id": "ipt1", + "openmrs_entity": "concept" + }, + { + "key": "medication_not_given", + "text": "Malaria preventive therapy not given", + "openmrs_entity_id": "medication_not_given", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Please select the medication for Malaria Preventive Therapy" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_giving_malaria_medication", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_malaria_medication", + "type": "spinner", + "hint": "Reason as to why the Malaria medication was not given", + "values": [ + "Out of stock", + "The client did not agree to take the medication", + "The client is allergic to medication", + "Other (Specify)" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "other_reason_malaria_medication_not_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_malaria_medication_not_given", + "type": "edit_text", + "hint": "Specify other reasons for not giving the Malaria medication", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_giving_malaria_medication": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "llin_provision", + "type": "native_radio", + "openmrs_entity_id": "llin_provision", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Was the client provided with LLINs (Long lasting insecticidal nets)?", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "reason_for_not_providing_llin", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_llin", + "type": "spinner", + "hint": "Reason as to why the client was not provided with LLINs", + "values": [ + "Out of stock", + "The client refused", + "Other (Specify)" + ], + "keys": [ + "out_of_stock", + "the_client_refused", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "the_client_refused": "the_client_refused", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:llin_provision": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_llin_not_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_llin_not_given", + "type": "edit_text", + "hint": "Specify other reasons for not providing the LLINs", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_providing_llin": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "malaria_investigation_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "malaria_investigation_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_fv_medical_and_surgical_history.json b/opensrp-chw-hf/src/main/assets/json.form/anc_fv_medical_and_surgical_history.json new file mode 100644 index 000000000..7b41a16f9 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_fv_medical_and_surgical_history.json @@ -0,0 +1,476 @@ +{ + "count": "1", + "encounter_type": "Medical and Surgical History", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Medical and Surgical History", + "fields": [ + { + "key": "medical_surgical_history", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "medical_surgical_history", + "type": "check_box", + "label": "Any Medical and surgical History of the Patient?", + "combine_checkbox_option_values": "true", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "diabetes_mellitus", + "text": "Diabetes Mellitus", + "openmrs_entity": "concept", + "openmrs_entity_id": "diabetes_mellitus" + }, + { + "key": "sickle_cell_disease", + "text": "Sickle Cell Disease", + "openmrs_entity": "concept", + "openmrs_entity_id": "sickle_cell_disease" + }, + { + "key": "heart_diseases", + "text": "Heart Diseases", + "openmrs_entity": "concept", + "openmrs_entity_id": "heart_diseases" + }, + { + "key": "thyroid_diseases", + "text": "Thyroid Diseases", + "openmrs_entity": "concept", + "openmrs_entity_id": "thyroid_diseases" + }, + { + "key": "blood_transfusion", + "text": "Blood transfusion", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_transfusion" + }, + { + "key": "known_on_art", + "text": "On ART", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_on_art" + }, + { + "key": "epilepsy", + "text": "Epilepsy", + "openmrs_entity": "concept", + "openmrs_entity_id": "epilepsy" + }, + { + "key": "previous_c_s", + "text": "Previous C/S", + "openmrs_entity": "concept", + "openmrs_entity_id": "previous_c_s" + }, + { + "key": "myomectomy", + "text": "Myomectomy", + "openmrs_entity": "concept", + "openmrs_entity_id": "myomectomy" + }, + { + "key": "third_degree_tear", + "text": "Third Degree Tear", + "openmrs_entity": "concept", + "openmrs_entity_id": "third_degree_tear" + }, + { + "key": "repaired_fistula", + "text": "Repaired Fistula", + "openmrs_entity": "concept", + "openmrs_entity_id": "repaired_fistula" + }, + { + "key": "female_genital_mutilation", + "text": "Female Genital Mutilation", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_genital_mutilation" + }, + { + "key": "closely_spaced_pregnancy", + "text": "Closely spaced pregnancy (within 2 years)", + "openmrs_entity": "concept", + "openmrs_entity_id": "closely_spaced_pregnancy" + }, + { + "key": "pregnant_more_than_four", + "text": "Pregnant four or more times", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnant_more_than_four" + }, + { + "key": "hx_hemorrhage", + "text": "History of Hemorrhage", + "openmrs_entity": "concept", + "openmrs_entity_id": "hx_hemorrhage" + }, + { + "key": "history_of_high_blood_pressure", + "text": "History of high blood pressure", + "openmrs_entity": "concept", + "openmrs_entity_id": "history_of_high_blood_pressure" + }, + { + "key": "anaemia", + "text": "Anaemia", + "openmrs_entity": "concept", + "openmrs_entity_id": "anaemia" + }, + { + "key": "difficult_delivery", + "text": "Difficult delivery (Vacuum, episiotomy)", + "openmrs_entity": "concept", + "openmrs_entity_id": "difficult_delivery" + }, + { + "key": "hx_abortions", + "text": "History of Abortions", + "openmrs_entity": "concept", + "openmrs_entity_id": "hx_abortions" + }, + { + "key": "other", + "text": "Others (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ] + }, + { + "key": "other_medical_surgical_history", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_medical_surgical_history", + "type": "edit_text", + "hint": "Specify other medical and surgical history", + "v_required": { + "value": "true", + "err": "Please specify the other medical surgical history" + }, + "relevance": { + "step1:medical_surgical_history": { + "ex-checkbox": [ + { + "or": [ + "other" + ] + } + ] + } + } + }, + { + "key": "ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "CTC Number", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "CTC number should be of the format (XX-XX-XXXX-XXXXXX)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid CTC Number" + }, + "v_required": { + "value": true, + "err": "Please enter a valid CTC Number" + }, + "relevance": { + "step1:medical_surgical_history": { + "ex-checkbox": [ + { + "or": [ + "known_on_art" + ] + } + ] + } + } + }, + { + "key": "gravida", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "gravida", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_calculation.yml" + } + } + } + }, + { + "key": "parity", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "parity", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_calculation.yml" + } + } + } + }, + { + "key": "no_surv_children", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_surv_children", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_calculation.yml" + } + } + } + }, + { + "key": "gravida_read_only", + "type": "edit_text", + "read_only": "true", + "hint": "Gravida", + "openmrs_entity": "concept", + "openmrs_entity_id": "gravida_read_only", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_relevance.yml" + } + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_calculation.yml" + } + } + } + }, + { + "key": "parity_read_only", + "type": "edit_text", + "read_only": "true", + "hint": "Parity", + "openmrs_entity": "concept", + "openmrs_entity_id": "parity_read_only", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_relevance.yml" + } + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_calculation.yml" + } + } + } + }, + { + "key": "no_surv_children_read_only", + "type": "edit_text", + "read_only": "true", + "hint": "Number of living children", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_surv_children_read_only", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_relevance.yml" + } + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_calculation.yml" + } + } + } + }, + { + "key": "gravida_text", + "type": "edit_text", + "hint": "Gravida", + "openmrs_entity": "concept", + "openmrs_entity_id": "gravida_text", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the gravida number" + }, + "v_max": { + "value": "35", + "err": "Gravida must be equal to or less than 35" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please answer" + } + }, + { + "key": "parity_text", + "type": "edit_text", + "hint": "Parity", + "openmrs_entity": "concept", + "openmrs_entity_id": "parity_text", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter parity number" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:gravida_text)", + "err": "Parity must be less than gravida" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please answer" + } + }, + { + "key": "prompt_for_grand_multiparity", + "type": "toaster_notes", + "text": "Counsel on the risk of uterine rupture and closely monitor the client", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_relevance.yml" + } + } + } + }, + { + "key": "no_surv_children_text", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_surv_children_text", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of living children", + "v_required": { + "value": true, + "err": "Please answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_relevance.yml" + } + } + } + }, + { + "key": "known_on_art", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_on_art", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_medical_and_surgical_history_calculation.yml" + } + } + } + }, + { + "key": "visit_number", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "openmrs_entity_parent": "", + "value": 1 + }, + { + "key": "medical_surgical_history_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "medical_surgical_history_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_fv_obstetric_examination.json b/opensrp-chw-hf/src/main/assets/json.form/anc_fv_obstetric_examination.json new file mode 100644 index 000000000..f5a1a4197 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_fv_obstetric_examination.json @@ -0,0 +1,730 @@ +{ + "count": "1", + "encounter_type": "Obstetric Examination", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Obstetric Examination", + "fields": [ + { + "key": "gest_age", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gest_age", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_calculation.yml" + } + } + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Weight (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the weight" + }, + "v_min": { + "value": "20", + "err": "The weight must be equal or greater than 20 (KG)" + }, + "v_max": { + "value": "300", + "err": "The weight must be equal or less than 300 (KG)" + } + }, + { + "key": "height", + "type": "edit_text", + "hint": "Height (CM)", + "openmrs_entity": "concept", + "openmrs_entity_id": "height", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the height" + }, + "v_min": { + "value": "60", + "err": "The height must be equal or greater than 60 (CM)" + }, + "v_max": { + "value": "200", + "err": "The height must be equal or less than 200 (CM)" + } + }, + { + "key": "prompt_for_short_stature", + "type": "toaster_notes", + "text": "Counsel the client on her risk of obstructed labour and advise her to deliver at a health care facility", + "openmrs_entity_id": "prompt_for_short_stature", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:height": { + "type": "numeric", + "ex": "lessThan(.,\"145\")" + } + } + }, + { + "key": "bmi", + "type": "edit_text", + "hint": "Body Mass Index (BMI)", + "read_only": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "bmi", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the height" + }, + "v_required": { + "value": true, + "err": "Please enter the height" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_underweight", + "type": "toaster_notes", + "text": "Manage the undernourished client using standard guidelines", + "openmrs_entity_id": "prompt_for_underweight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:bmi": { + "type": "numeric", + "ex": "lessThan(.,\"18.5\")" + } + } + }, + { + "key": "prompt_for_overweight", + "type": "toaster_notes", + "text": "Manage the overweight client using standard guidelines", + "openmrs_entity_id": "prompt_for_overweight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:bmi": { + "type": "numeric", + "ex": "greaterThanEqualTo(.,\"29\")" + } + } + }, + { + "key": "systolic", + "type": "edit_text", + "hint": "Systolic (Blood Pressure)", + "openmrs_entity_id": "systolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the systolic value" + }, + "v_min": { + "value": "0", + "err": "Systolic value must be equal or greater than 0" + }, + "v_max": { + "value": "320", + "err": "Systolic value must be equal or less than 320" + } + }, + { + "key": "diastolic", + "type": "edit_text", + "hint": "Diastolic (Blood Pressure)", + "openmrs_entity_id": "diastolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the diastolic value" + }, + "v_min": { + "value": "0", + "err": "Diastolic value must be equal or greater than 0" + }, + "v_max": { + "value": "200", + "err": "Diastolic value must be equal or less than 200" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:systolic)", + "err": "The diastolic value must be less than the systolic value" + } + ] + }, + { + "key": "prompt_for_management_of_hypertension", + "type": "toaster_notes", + "text": "Manage the hypertension according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypertension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_management_of_hypotension", + "type": "toaster_notes", + "text": "Elicit the cause of hypotension and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypotension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "pulse_rate", + "type": "edit_text", + "hint": "Pulse Rate (Beats per minute)", + "openmrs_entity_id": "pulse_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the pulse rate" + }, + "v_min": { + "value": "0", + "err": "The pulse rate must be equal or greater than 0 (bpm)" + }, + "v_max": { + "value": "200", + "err": "The pulse rate must be equal or less than 200 (bpm)" + } + }, + { + "key": "prompt_for_Bradycardia", + "type": "toaster_notes", + "text": "Elicit the cause of bradycardia and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_Bradycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "lessThan(.,\"60\")" + } + } + }, + { + "key": "prompt_for_Tachycardia", + "type": "toaster_notes", + "text": "Elicit the cause of tachycardia and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_Tachycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "greaterThan(.,\"100\")" + } + } + }, + { + "key": "temperature", + "type": "edit_text", + "hint": "Temperature (\u2103)", + "openmrs_entity_id": "temperature", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the temperature" + }, + "v_min": { + "value": "10", + "err": "Temperature must be equal or greater than 10" + }, + "v_max": { + "value": "50", + "err": "Temperature must be equal or less than 50" + } + }, + { + "key": "notify_client_has_fever", + "type": "toaster_notes", + "text": "Conduct relevant laboratory tests to elicit the cause of fever and manage according to standard guidelines ", + "openmrs_entity_id": "notify_client_has_fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "greaterThan(.,\"37.8\")" + } + } + }, + { + "key": "notify_client_has_hypothermia", + "type": "toaster_notes", + "text": "Manage the hypothermia according to standard guidelines", + "openmrs_entity_id": "notify_client_has_hypothermia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "lessThan(.,\"36.5\")" + } + } + }, + { + "key": "abdominal_scars", + "type": "native_radio", + "label": "Are there any lower abdominal caesarian scars?", + "openmrs_entity_id": "abdominal_scars", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "prompt_for_abdominal_scars", + "type": "toaster_notes", + "text": "Counsel the client on her risk of uterine rupture during labour and advise her to deliver at a health care facility", + "openmrs_entity_id": "prompt_for_abdominal_scars", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:abdominal_scars": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "abdominal_movement_with_respiration", + "type": "native_radio", + "label": "Does the Abdomen Move with respiration", + "openmrs_entity_id": "abdominal_movement_with_respiration", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "prompt_for_abdominal_movement_with_respiration", + "type": "toaster_notes", + "text": "Refer the client for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:abdominal_movement_with_respiration": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "abdominal_contour", + "type": "spinner", + "hint": "Abdominal Contour", + "label_info_title": "Abdominal Contour", + "label_info_text": "Observe the shape of the abdomen", + "openmrs_entity_id": "abdominal_contour", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "Distended", + "Normal Contour" + ], + "keys": [ + "distended", + "normal_contour" + ], + "openmrs_choice_ids": { + "distended": "distended", + "normal_contour": "normal_contour" + } + }, + { + "key": "fundal_height", + "type": "edit_text", + "openmrs_entity_id": "fundal_height", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Fundal Height (CM)", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + }, + "v_numeric": { + "value": "true", + "err": "Please enter the fundal height" + }, + "v_min": {}, + "v_max": { + "value": "50", + "err": "Fundal height must be equal or less than 50 CM" + } + }, + { + "key": "lie", + "type": "spinner", + "openmrs_entity_id": "lie", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Lie", + "values": [ + "Transverse", + "Oblique", + "Longitudinal" + ], + "keys": [ + "transverse", + "oblique", + "longitudinal" + ], + "openmrs_choice_ids": { + "transverse": "transverse", + "oblique": "oblique", + "longitudinal": "longitudinal" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_lie", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "presentation", + "type": "spinner", + "openmrs_entity_id": "presentation", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Presentation", + "values": [ + "Breech Presentation", + "Cephalic Presentation" + ], + "keys": [ + "breech", + "cephalic" + ], + "openmrs_choice_ids": { + "breech": "breech", + "cephalic": "cephalic" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_presentation", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "fetal_heart_rate", + "type": "edit_text", + "hint": "Count Fetal Heart Rate(bpm)", + "openmrs_entity_id": "fetal_heart_rate", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the fetal heart rate" + }, + "v_min": { + "value": "0", + "err": "Fetal heart rate must be equal or greater than 0" + }, + "v_max": { + "value": "300", + "err": "Fetal heart rate must be equal or less than 300" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_fetal_distress", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "prompt_for_fetal_distress", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_obstetric_examination_relevance.yml" + } + } + } + }, + { + "key": "abnormal_vaginal_discharge", + "type": "native_radio", + "label": "Abnormal Vaginal Discharge", + "openmrs_entity_id": "abnormal_vaginal_discharge", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "prompt_for_vaginal_discharge", + "type": "toaster_notes", + "text": "Identify the cause of vaginal discharge and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_vaginal_discharge", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:abnormal_vaginal_discharge": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "vaginal_sores", + "type": "native_radio", + "label": "Vaginal Sores", + "openmrs_entity_id": "vaginal_sores", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "prompt_for_vaginal_sores", + "type": "toaster_notes", + "text": "Identify the cause of vaginal sores and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_vaginal_sores", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:vaginal_sores": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "vaginal_swelling", + "type": "native_radio", + "label": "Vaginal Swelling", + "openmrs_entity_id": "vaginal_swelling", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "prompt_for_vaginal_swelling", + "type": "toaster_notes", + "text": "Identify the cause of vaginal swelling and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_vaginal_swelling", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:vaginal_swelling": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "obstetric_examination_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "obstetric_examination_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_fv_tb_screening.json b/opensrp-chw-hf/src/main/assets/json.form/anc_fv_tb_screening.json new file mode 100644 index 000000000..6dee8fd1b --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_fv_tb_screening.json @@ -0,0 +1,364 @@ +{ + "count": "1", + "encounter_type": "ANC TB Screening", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "TB Screening", + "fields": [ + { + "key": "on_tb_treatment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "on_tb_treatment", + "type": "native_radio", + "label": "Is the client on TB treatment?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ] + }, + { + "key": "tb_registration_number", + "type": "edit_text", + "openmrs_entity_id": "tb_registration_number", + "hint": "TB Clinic Number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "step1:on_tb_treatment": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + }, + "v_required": { + "value": "true", + "err": "Please enter the clients TB Clinic Number" + } + }, + { + "key": "was_client_screened_for_tb", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "was_client_screened_for_tb", + "type": "native_radio", + "label": "Was the client screened for TB?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select one of the answer" + }, + "relevance": { + "step1:on_tb_treatment": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "tb_symptoms_screening", + "type": "check_box", + "label": "Please select if the client has any of the following TB symptoms", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "tb_symptoms_screening", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_cough", + "text": "Cough for two or more weeks", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_cough" + }, + { + "key": "chk_sputum", + "text": "Coughing up blood-stained sputum (hemoptysis)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_sputum" + }, + { + "key": "chk_fevers", + "text": "Fevers for two or more weeks?", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_fevers" + }, + { + "key": "chk_weight_loss", + "text": "Noticeable weight loss for new patients or 3 kgs", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_weight_loss" + }, + { + "key": "chk_weight_loss_subsequent_visit", + "text": "Weight loss in a month (subsequent visit)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_weight_loss_subsequent_visit" + }, + { + "key": "chk_excessive_sweating", + "text": "Excessive sweating at night for two or more weeks", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_excessive_sweating" + }, + { + "key": "chk_none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_none" + } + ], + "v_required": { + "value": "true", + "err": "Please select the topic(s)" + }, + "relevance": { + "step1:was_client_screened_for_tb": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "investigate_for_tb", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "investigate_for_tb", + "type": "native_radio", + "label": "Investigate for TB", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:tb_symptoms_screening": { + "ex-checkbox": [ + { + "or": [ + "chk_cough", + "chk_sputum", + "chk_fevers", + "chk_weight_loss", + "chk_weight_loss_subsequent_visit", + "chk_excessive_sweating" + ] + } + ] + } + } + }, + { + "key": "reason_for_not_conducting_tb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_tb_test", + "type": "spinner", + "hint": "Reason as to why the TB test was not conducted", + "values": [ + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:investigate_for_tb": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_tb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_tb_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting TB test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_tb_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "prompt_for_other_treatment", + "type": "toaster_notes", + "text": "Refer the client for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:investigate_for_tb": { + "type": "string", + "ex": "equalTo(., \"negative\")" + } + } + }, + { + "key": "prompt_for_tb_treatment", + "type": "toaster_notes", + "text": "Refer the client for TB treatment", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:investigate_for_tb": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "prompt_for_screening_for_tb", + "type": "toaster_notes", + "text": "Please screen the client for TB and manage according standard guideline", + "openmrs_entity_id": "prompt_for_screening_for_tb", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:was_client_screened_for_tb": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "tb_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tb_status", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_tb_screening_calculation.yml" + } + } + } + }, + { + "key": "tb_screening_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "tb_screening_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_fv_tt_vaccination.json b/opensrp-chw-hf/src/main/assets/json.form/anc_fv_tt_vaccination.json new file mode 100644 index 000000000..4df8ae985 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_fv_tt_vaccination.json @@ -0,0 +1,173 @@ +{ + "count": "1", + "encounter_type": "Vaccination", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Td Vaccination", + "fields": [ + { + "key": "completed_tt_vaccination", + "type": "native_radio", + "label": "Has the client completed all vaccinations for Td?", + "openmrs_entity": "concept", + "openmrs_entity_id": "completed_tt_vaccination", + "openmrs_entity_parent": "", + "options": [ + { + "text": "Yes", + "key": "yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ] + }, + { + "key": "tt_vaccination", + "type": "native_radio", + "label": "Has the client been vaccinated for Td?", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt_vaccination", + "openmrs_entity_parent": "", + "options": [ + { + "text": "Yes", + "key": "yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "step1:completed_tt_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "tt1_vaccination_prompt", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "toaster_notes", + "text": "Provide Td1 vaccination dose and follow-up immunization doses to the client according to immunization schedule", + "toaster_type": "warning", + "relevance": { + "step1:tt_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "tt_vaccination_type", + "type": "check_box", + "label": "What Td Vaccinations were given?", + "combine_checkbox_option_values": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt_vaccination_type", + "openmrs_entity_parent": "", + "options": [ + { + "text": "Td1", + "key": "tt1", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt1" + }, + { + "key": "tt2", + "text": "Td2", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt2" + }, + { + "key": "tt3", + "text": "Td3", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt3" + }, + { + "key": "tt4", + "text": "Td4", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt4" + }, + { + "key": "tt5", + "text": "Td5", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt5" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "step1:tt_vaccination": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "tt_vaccination_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt_vaccination_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_counselling.json b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_counselling.json index e85a438b2..69944b441 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_counselling.json +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_counselling.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -53,133 +48,107 @@ "key": "counselling_given", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1379AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "counselling_given", "type": "check_box", "label": "Counselling provided to the mother and family members ", "label_text_style": "normal", "text_color": "#C0C0C0", - "exclusive": [ - "chk_none" - ], "options": [ { "key": "chk_attended_anc_contacts", - "text": "1. Attend ANC contacts early", - "value": false, + "text": "Attend ANC contacts early", "openmrs_entity": "concept", - "openmrs_entity_id": "161013AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_attended_anc_contacts" }, { "key": "chk_anc_danger_signs", - "text": "2. Pregnancy danger signs", - "value": false, + "text": "Pregnancy danger signs", "openmrs_entity": "concept", - "openmrs_entity_id": "161050AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_anc_danger_signs" }, { "key": "chk_maternal_nutrition", - "text": "3. Maternal nutrition during pregnancy and breast feeding", - "value": false, + "text": "Maternal nutrition during pregnancy and breast feeding", "openmrs_entity": "concept", - "openmrs_entity_id": "1380AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_maternal_nutrition" }, { "key": "chk_personal_delivery", - "text": "4. Personal delivery plan", - "value": false, + "text": "Personal delivery plan", "openmrs_entity": "concept", - "openmrs_entity_id": "5630AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_personal_delivery" }, { "key": "chk_hiv_aids", - "text": "5. HIV/AIDS general information", - "value": false, + "text": "HIV/AIDS general information", "openmrs_entity": "concept", - "openmrs_entity_id": "1914AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_hiv_aids" }, { "key": "chk_pmtct_for_mother", - "text": "6. PMTCT for the mother", - "value": false, + "text": "PMTCT for the mother", "openmrs_entity": "concept", - "openmrs_entity_id": "160538AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_pmtct_for_mother" }, { "key": "chk_preventing_malaria", - "text": "7. Preventing malaria for pregnant mothers", - "value": false, + "text": "Preventing malaria for pregnant mothers", "openmrs_entity": "concept", - "openmrs_entity_id": "164884AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_preventing_malaria" }, { "key": "chk_physical_changes", - "text": "8. Physical changes for a mother after giving birth", - "value": false, + "text": "Physical changes for a mother after giving birth", "openmrs_entity": "concept", - "openmrs_entity_id": "162093AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_physical_changes" }, { "key": "chk_pnc_danger_signs", - "text": "10. PNC danger signs", - "value": false, + "text": "PNC danger signs", "openmrs_entity": "concept", - "openmrs_entity_id": "161541AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_pnc_danger_signs" }, { "key": "chk_care_of_infant", - "text": "11. Care of infant after birth", - "value": false, + "text": "Care of infant after birth", "openmrs_entity": "concept", - "openmrs_entity_id": "160413AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_care_of_infant" }, { "key": "chk_infant_danger_signs", - "text": "14. Infant danger signs", - "value": false, + "text": "Infant danger signs", "openmrs_entity": "concept", - "openmrs_entity_id": "161071AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_infant_danger_signs" }, { "key": "chk_hiv_exposed_infant", - "text": "15. Follow-up for the HIV-exposed infant", - "value": false, + "text": "Follow-up for the HIV-exposed infant", "openmrs_entity": "concept", - "openmrs_entity_id": "164818AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_hiv_exposed_infant" }, { "key": "chk_breastfeeding", - "text": "16. Breastfeeding", - "value": false, + "text": "Breastfeeding", "openmrs_entity": "concept", - "openmrs_entity_id": "1910AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_breastfeeding" }, { "key": "chk_exclusive_breast_feeding ", - "text": "17. Plan for family planning using exclusive breast feeding for 6 months after birth", - "value": false, + "text": "Plan for family planning using exclusive breast feeding for 6 months after birth", "openmrs_entity": "concept", - "openmrs_entity_id": "161096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_exclusive_breast_feeding" }, { "key": "chk_family_planning", - "text": "18. Family planning", - "value": false, + "text": "Family planning", "openmrs_entity": "concept", - "openmrs_entity_id": "1382AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_family_planning" }, { "key": "chk_infection_prevention", - "text": "24. Infection prevention and control", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "1906AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_none", - "text": "None", - "value": false, + "text": "Infection prevention and control", "openmrs_entity": "concept", - "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_infection_prevention" } ], "v_required": { diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_danger_signs.json b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_danger_signs.json index d6e16db77..28a4b005a 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_danger_signs.json +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_danger_signs.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -53,7 +48,7 @@ "key": "danger_signs_present", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "160939AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "danger_signs_present", "type": "check_box", "label": "Does the mother have any danger signs?", "label_text_style": "normal", @@ -65,93 +60,80 @@ { "key": "chk_fever", "text": "Fever", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "140238AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_fever" }, { "key": "chk_bleeding_vaginally", "text": "Bleeding vaginally", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "150802AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_bleeding_vaginally" }, { "key": "chk_server_headache", "text": "Severe headache", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "139081AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_server_headache" }, { "key": "chk_blurred_vision", "text": "Blurred vision", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "147104AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_blurred_vision" }, { "key": "chk_convulsions", "text": "Convulsions", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "164483AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_convulsions" }, { "key": "chk_difficulty_breathing", "text": "Difficulty breathing", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "142373AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_difficulty_breathing" }, { "key": "chk_severe_abdominal_pain", "text": "Severe abdominal pain", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "165271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_severe_abdominal_pain" }, { "key": "chk_loss_consciousness", "text": "Loss of consciousness", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "135592AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_loss_consciousness" }, { "key": "chk_swelling", "text": "Swelling of the face and/or hands", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "460AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_swelling" }, { "key": "chk_early_labour", "text": "Early labour pains before 9 months", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "151687AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_early_labour" }, { "key": "chk_vaginal_discharge", "text": "Discoloured or watery, liquid vaginal discharge with a bad smell", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "123395AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_vaginal_discharge" }, { "key": "chk_unusual_movement", "text": "No movement / unusual movement for a child in the womb", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "113377AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_unusual_movement" }, { "key": "chk_none", "text": "None", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_none" } ], "v_required": { @@ -195,7 +177,7 @@ "key": "danger_signs_counseling", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "165310AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "danger_signs_counseling", "openmrs_data_type": "select one", "type": "spinner", "label_info_title": "Did the mother receive counselling", @@ -210,8 +192,8 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1267AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1118AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" }, "v_required": { "value": "true", diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_family_planning.json b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_family_planning.json index 0fbda7e7e..7d5bc1532 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_family_planning.json +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_family_planning.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_health_facility_visit.json b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_health_facility_visit.json index 8754fc057..811a91bed 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_health_facility_visit.json +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_health_facility_visit.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -118,63 +113,54 @@ { "key": "chk_haemoglobin", "text": "Haemoglobin level", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "21AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_urine_analysis_uti", "text": "Urine analysis for UTI", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "302AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_urine_analysis_protein", "text": "Urine analysis for protein and sugar", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1875AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_hiv", "text": "HIV test", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1356AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_syphilis", "text": "Syphilis test", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "299AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_malaria", "text": "Malaria test", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1643AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_tb", "text": "TB screening", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164800AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_other", "text": "Other test", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_none", "text": "None", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } @@ -205,50 +191,43 @@ "options": [ { "key": "chk_tetanus", - "text": "Tetanus toxoid (TT)", - "value": false, + "text": "Tetanus toxoid (Td)", "openmrs_entity": "concept", "openmrs_entity_id": "84879AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_malaria", "text": "Malaria prevention (IPTp-SP)", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "105232AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_iron", "text": "Iron and Folic acid (FEFO) tablets", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "773AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_albendazole", "text": "Albendazole / Medandozle", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "159922AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_calcuim", "text": "Calcium supplement", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "72650AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_other", "text": "Other immunisation or medicine", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_none", "text": "None", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_malaria.json b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_malaria.json index 57407020a..1788eb892 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_malaria.json +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_malaria.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_nutrition_status.json b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_nutrition_status.json index 5bead34fb..0d11ed444 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_nutrition_status.json +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_nutrition_status.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_observations.json b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_observations.json index a3850ba64..15a9256b4 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_observations.json +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_observations.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -92,42 +87,36 @@ { "key": "chk_ors", "text": "ORS 5", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "351AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_zinc", "text": "Zinc 10", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "86672AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_paracetamol", "text": "Panadol", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "70116AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_referred", "text": "Referred", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "163762AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_other_treatment", "text": "Other treatment", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_none", "text": "No treatment given", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_remarks_and_comments.json b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_remarks_and_comments.json index 035eb693e..a5d6688a1 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/anc_hv_remarks_and_comments.json +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_hv_remarks_and_comments.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_member_registration.json b/opensrp-chw-hf/src/main/assets/json.form/anc_member_registration.json index 21aa58554..9e6385ec3 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/anc_member_registration.json +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_member_registration.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -174,21 +169,18 @@ { "key": "chk_vaginally", "text": "Vaginally", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_cesarean_section", "text": "Cesarean section", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1171AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_miscarriage", "text": "Miscarriage", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1171AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } @@ -218,21 +210,18 @@ { "key": "chk_vaginally", "text": "Vaginally", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_cesarean_section", "text": "Cesarean section", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1171AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_miscarriage", "text": "Miscarriage", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1171AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_member_transfer_in_registration.json b/opensrp-chw-hf/src/main/assets/json.form/anc_member_transfer_in_registration.json new file mode 100644 index 000000000..5e97fe9c8 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_member_transfer_in_registration.json @@ -0,0 +1,1085 @@ +{ + "count": "2", + "skip_blank_steps": true, + "encounter_type": "ANC Followup Client Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Medical and Surgical History", + "next": "step2", + "fields": [ + { + "key": "is_transfer_in", + "type": "native_radio", + "label": "Client registration type", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_transfer_in", + "openmrs_entity_parent": "", + "options": [ + { + "key": "true", + "text": "On Transit", + "openmrs_entity": "concept", + "openmrs_entity_id": "true" + }, + { + "key": "false", + "text": "Continuing Client", + "openmrs_entity": "concept", + "openmrs_entity_id": "false" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "pregnancy_confirmation_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnancy_confirmation_status", + "type": "hidden", + "value": "Confirmed" + }, + { + "key": "pregnancy_confirmation_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnancy_confirmation_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "medical_surgical_history", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "medical_surgical_history", + "type": "check_box", + "label": "Any Medical and surgical History of the Client?", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "known_on_art", + "text": "On ART before this pregnancy", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_on_art" + }, + { + "key": "diabetes_mellitus", + "text": "Diabetes Mellitus", + "openmrs_entity": "concept", + "openmrs_entity_id": "diabetes_mellitus" + }, + { + "key": "sickle_cell_disease", + "text": "Sickle Cell Disease", + "openmrs_entity": "concept", + "openmrs_entity_id": "sickle_cell_disease" + }, + { + "key": "heart_diseases", + "text": "Heart Diseases", + "openmrs_entity": "concept", + "openmrs_entity_id": "heart_diseases" + }, + { + "key": "thyroid_diseases", + "text": "Thyroid Diseases", + "openmrs_entity": "concept", + "openmrs_entity_id": "thyroid_diseases" + }, + { + "key": "blood_transfusion", + "text": "Blood transfusion", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_transfusion" + }, + { + "key": "epilepsy", + "text": "Epilepsy", + "openmrs_entity": "concept", + "openmrs_entity_id": "epilepsy" + }, + { + "key": "previous_c_s", + "text": "Previous C/S", + "openmrs_entity": "concept", + "openmrs_entity_id": "previous_c_s" + }, + { + "key": "myomectomy", + "text": "Myomectomy", + "openmrs_entity": "concept", + "openmrs_entity_id": "myomectomy" + }, + { + "key": "third_degree_tear", + "text": "Third Degree Tear", + "openmrs_entity": "concept", + "openmrs_entity_id": "third_degree_tear" + }, + { + "key": "repaired_fistula", + "text": "Repaired Fistula", + "openmrs_entity": "concept", + "openmrs_entity_id": "repaired_fistula" + }, + { + "key": "female_genital_mutilation", + "text": "Female Genital Mutilation", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_genital_mutilation" + }, + { + "key": "closely_spaced_pregnancy", + "text": "Closely spaced pregnancy (within 2 years)", + "openmrs_entity": "concept", + "openmrs_entity_id": "closely_spaced_pregnancy" + }, + { + "key": "pregnant_more_than_four", + "text": "Pregnant four or more times", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnant_more_than_four" + }, + { + "key": "hx_hemorrhage", + "text": "History of Hemorrhage", + "openmrs_entity": "concept", + "openmrs_entity_id": "hx_hemorrhage" + }, + { + "key": "history_of_high_blood_pressure", + "text": "History of high blood pressure", + "openmrs_entity": "concept", + "openmrs_entity_id": "history_of_high_blood_pressure" + }, + { + "key": "anaemia", + "text": "Anaemia", + "openmrs_entity": "concept", + "openmrs_entity_id": "anaemia" + }, + { + "key": "difficult_delivery", + "text": "Difficult delivery (Vacuum, episiotomy)", + "openmrs_entity": "concept", + "openmrs_entity_id": "difficult_delivery" + }, + { + "key": "hx_abortions", + "text": "History of Abortions", + "openmrs_entity": "concept", + "openmrs_entity_id": "hx_abortions" + }, + { + "key": "other", + "text": "Others (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + }, + { + "key": "none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ], + "v_required": { + "value": "true", + "err": "Please pick at least one" + } + }, + { + "key": "other_medical_surgical_history", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_medical_surgical_history", + "type": "edit_text", + "hint": "Specify other medical and surgical history", + "v_required": { + "value": "true", + "err": "Please specify the other medical surgical history" + }, + "relevance": { + "step1:medical_surgical_history": { + "ex-checkbox": [ + { + "or": [ + "other" + ] + } + ] + } + } + }, + { + "key": "ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "CTC ID", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "CTC ID should be of the format (XX-XX-XXXX-XXXXXX)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid CTC ID" + }, + "v_required": { + "value": true, + "err": "Please enter a valid CTC ID" + }, + "relevance": { + "step1:medical_surgical_history": { + "ex-checkbox": [ + { + "or": [ + "known_on_art" + ] + } + ] + } + } + }, + { + "key": "gravida", + "type": "edit_text", + "hint": "Gravida", + "openmrs_entity": "concept", + "openmrs_entity_id": "gravida", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the gravida number" + }, + "v_required": { + "value": true, + "err": "Please enter the gravida number" + }, + "v_max": { + "value": "35", + "err": "Gravida must be equal to or less than 35" + } + }, + { + "key": "parity", + "type": "edit_text", + "hint": "Parity", + "openmrs_entity": "concept", + "openmrs_entity_id": "parity", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter parity number" + }, + "v_required": { + "value": true, + "err": "Please enter the parity number" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:gravida)", + "err": "Parity must be less than gravida" + } + ] + }, + { + "key": "prompt_for_grand_multiparity", + "type": "toaster_notes", + "text": "Counsel on the risk of uterine rupture and closely monitor the client", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_relevance.yml" + } + } + } + }, + { + "key": "no_surv_children", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_surv_children", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of living children", + "v_required": { + "value": "true", + "err": "Please enter the number of living children" + }, + "v_numeric": { + "value": "true", + "err": "Please enter the number of living children" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_relevance.yml" + } + } + } + }, + { + "key": "visit_number", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "openmrs_entity_parent": "", + "value": 1 + }, + { + "key": "hiv", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "known_on_art", + "type": "hidden", + "openmrs_entity_id": "known_on_art", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + } + ] + }, + "step2": { + "title": "ANC Followup Client Registration", + "fields": [ + { + "key": "known_last_menstrual_period", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_last_menstrual_period", + "type": "date_picker", + "hint": "Last Normal Menstrual Period (LNMP)", + "label_info_title": "LNMP", + "label_info_text": "LNMP = first day of Last Normal Menstrual Period. If the exact date is unknown, but the period of the month is known, use day 5 for beginning of the month, day 15 for middle of the month and day 25 for end of the month.", + "expanded": false, + "max_date": "today", + "min_date": "today-50w", + "v_required": { + "value": "true", + "err": "LNMP required" + } + }, + { + "key": "last_menstrual_period", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_menstrual_period", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "gest_age_note", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Gestational Age (GA) in Weeks", + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "edd", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "edd", + "type": "edit_text", + "hint": "Expected Date of Delivery (EDD)", + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "gest_age", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gest_age", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "height", + "type": "edit_text", + "hint": "Height (CM)", + "openmrs_entity": "concept", + "openmrs_entity_id": "height", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the height" + }, + "v_min": { + "value": "60", + "err": "The height must be equal or greater than 60 (CM)" + }, + "v_max": { + "value": "200", + "err": "The height must be equal or less than 200 (CM)" + }, + "v_required": { + "value": true, + "err": "Please enter the height" + } + }, + { + "key": "prompt_for_short_stature", + "type": "toaster_notes", + "text": "Counsel the client on her risk of obstructed labour and advise her to deliver at a health care facility", + "openmrs_entity_id": "prompt_for_short_stature", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step2:height": { + "type": "numeric", + "ex": "lessThan(.,\"145\")" + } + } + }, + { + "key": "has_the_client_received_ipt_doses_from_previous_facility", + "type": "native_radio", + "label": "Has the client received any IPT doses in the previous clinic", + "openmrs_entity": "concept", + "openmrs_entity_id": "has_the_client_received_ipt_doses_from_previous_facility", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step2:gest_age_note": { + "type": "numeric", + "ex": "greaterThanEqualTo(.,\"13\")" + } + } + }, + { + "key": "malaria_preventive_therapy", + "type": "native_radio", + "label": "Please select the last IPT dose provided from the previous facility", + "openmrs_entity": "concept", + "openmrs_entity_id": "malaria_preventive_therapy", + "openmrs_entity_parent": "", + "options": [ + { + "key": "ipt1", + "text": "IPT1", + "openmrs_entity": "concept", + "openmrs_entity_id": "ipt1" + }, + { + "key": "ipt2", + "text": "IPT2", + "openmrs_entity": "concept", + "openmrs_entity_id": "ipt2" + }, + { + "key": "ipt3", + "text": "IPT3", + "openmrs_entity": "concept", + "openmrs_entity_id": "ipt3" + }, + { + "key": "ipt4", + "text": "IPT4", + "openmrs_entity": "concept", + "openmrs_entity_id": "ipt4" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step2:has_the_client_received_ipt_doses_from_previous_facility": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "has_the_client_received_deworming_from_previous_facility", + "type": "native_radio", + "label": "Has the client received Deworming doses in the previous clinic", + "openmrs_entity": "concept", + "openmrs_entity_id": "has_the_client_received_deworming_from_previous_facility", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step2:gest_age_note": { + "type": "numeric", + "ex": "greaterThanEqualTo(.,\"13\")" + } + } + }, + { + "key": "deworming", + "type": "check_box", + "label": "Deworming", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "deworming", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "mebendazole", + "albendazole" + ], + "options": [ + { + "text": "Mebendazole(500Mg)", + "key": "mebendazole", + "openmrs_entity": "concept", + "openmrs_entity_id": "mebendazole" + }, + { + "text": "Albendazole(400Mg)", + "key": "albendazole", + "openmrs_entity": "concept", + "openmrs_entity_id": "albendazole" + } + ], + "relevance": { + "step2:has_the_client_received_deworming_from_previous_facility": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "hiv", + "type": "native_radio", + "label": "Client HIV Test Results from the previous clinic", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "The client had not yet been tested for HIV in the previous Clinic", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + } + }, + { + "key": "hepatitis_b", + "type": "native_radio", + "label": "Client Hepatitis B Results from the previous clinic?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hepatitis_b", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "The Client was not tested for Hepatitis B in the previous clinic", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "syphilis", + "type": "native_radio", + "label": "Client Syphilis Results from the previous clinic?", + "openmrs_entity": "concept", + "openmrs_entity_id": "syphilis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "The Client was not tested for Syphilis in the previous clinic", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "is_test_at_32", + "type": "native_radio", + "label": "Was this the second HIV test?", + "openmrs_entity_id": "is_test_at_32", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + } + }, + { + "key": "ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "CTC ID", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "CTC ID should be of the format (XX-XX-XXXX-XXXXXX)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid CTC ID" + }, + "v_required": { + "value": true, + "err": "Please enter a valid CTC ID" + }, + "relevance": { + "step2:hiv": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "hiv_test_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_number", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "hiv_test_at_32", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_at_32", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_member_transfer_in_registration_calculation.yml" + } + } + } + }, + { + "key": "abdominal_scars", + "type": "native_radio", + "label": "Are there any lower abdominal caesarian scars?", + "openmrs_entity_id": "abdominal_scars", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_abdominal_scars", + "type": "toaster_notes", + "text": "Counsel the client on her risk of uterine rupture during labour and advise her to deliver at a health care facility", + "openmrs_entity_id": "prompt_for_abdominal_scars", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step2:abdominal_scars": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "abdominal_movement_with_respiration", + "type": "native_radio", + "label": "Does the Abdomen Move with respiration", + "openmrs_entity_id": "abdominal_movement_with_respiration", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_abdominal_movement_with_respiration", + "type": "toaster_notes", + "text": "Refer the client for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step2:abdominal_movement_with_respiration": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "abnormal_vaginal_discharge", + "type": "native_radio", + "label": "Abnormal Vaginal Discharge", + "openmrs_entity_id": "abnormal_vaginal_discharge", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_vaginal_discharge", + "type": "toaster_notes", + "text": "Identify the cause of vaginal discharge and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_vaginal_discharge", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step2:abnormal_vaginal_discharge": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "vaginal_sores", + "type": "native_radio", + "label": "Vaginal Sores", + "openmrs_entity_id": "vaginal_sores", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_vaginal_sores", + "type": "toaster_notes", + "text": "Identify the cause of vaginal sores and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_vaginal_sores", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step2:vaginal_sores": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "vaginal_swelling", + "type": "native_radio", + "label": "Vaginal Swelling", + "openmrs_entity_id": "vaginal_swelling", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_vaginal_swelling", + "type": "toaster_notes", + "text": "Identify the cause of vaginal swelling and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_vaginal_swelling", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step2:vaginal_swelling": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_partner_community_followup_referral.json b/opensrp-chw-hf/src/main/assets/json.form/anc_partner_community_followup_referral.json new file mode 100644 index 000000000..14293726d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_partner_community_followup_referral.json @@ -0,0 +1,102 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "ANC Partner Community Followup Referral", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "ANC Partner Community Followup", + "fields": [ + { + "key": "toast_refer_to_chw", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "toaster_notes", + "text": "Client will be referred to CHW for Partner Followup\n\nSave the form to send the referral", + "toaster_info_text": "The client is about to be referred to the CHW tied to client's village for follow-up at the community level.\n\nAdd any additional comments that should be sent the the CHW", + "toaster_type": "info" + }, + { + "key": "chw_location", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "chw_location", + "type": "spinner", + "hint": "CHW/Mother Champion Location", + "v_required": { + "value": true, + "err": "Please enter the Mother Champion Location" + } + }, + { + "key": "anc_partner_followup_comment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "anc_partner_followup_comment", + "type": "edit_text", + "hint": "Remarks/Comments", + "v_required": { + "value": "false", + "err": "Please enter the your remarks/comments" + } + }, + { + "key": "anc_partner_community_referral_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "anc_partner_community_referral_date", + "type": "hidden", + "is_problem": false, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_community_followup_calculation.yml" + } + } + } + } + ] + } +} + + diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_partner_testing.json b/opensrp-chw-hf/src/main/assets/json.form/anc_partner_testing.json new file mode 100644 index 000000000..37577dcae --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_partner_testing.json @@ -0,0 +1,636 @@ +{ + "count": "1", + "encounter_type": "Partner Testing", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": { + "hiv_testing_done": false, + "syphilis_testing_done": false, + "hepatitis_testing_done": false, + "partner_hiv_status": "", + "partner_hiv_test_at_32_done": false + }, + "step1": { + "title": "Partner Testing", + "fields": [ + { + "key": "partner_hiv", + "type": "native_radio", + "label": "HIV Test Results", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_hiv", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "HIV Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_testing_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "reason_for_not_conducting_partner_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_partner_hiv_test", + "type": "spinner", + "hint": "Reason as to why the HIV test was not conducted", + "values": [ + "Test kits out of stock", + "A client was in an emergency situation", + "Client refused to be tested", + "We are still counselling a client", + "Known positive", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "known_on_art", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "known_on_art": "known_on_art", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:partner_hiv": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_partner_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_partner_hiv_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting HIV test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_partner_hiv_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "register_for_hiv_services", + "type": "toaster_notes", + "text": "Refer the client to CTC for HIV care", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:partner_hiv": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "partner_ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "CTC Number", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "CTC number should be of the format (XX-XX-XXXX-XXXXXX)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid CTC Number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_testing_relevance.yml" + } + } + } + }, + { + "key": "couple_testing", + "type": "native_radio", + "label": "Did the partner test together with the mother? (Couple testing)", + "openmrs_entity": "concept", + "openmrs_entity_id": "couple_testing", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_testing_relevance.yml" + } + } + } + }, + { + "key": "partner_syphilis", + "type": "native_radio", + "label": "Syphilis Test Results", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_syphilis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Syphilis Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_testing_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prescribe_anti_sy", + "type": "toaster_notes", + "text": "Prescribe the partner on antibiotics according to standard guidelines", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:partner_syphilis": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_partner_syphilis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_partner_syphilis_test", + "type": "spinner", + "hint": "Reason as to why the Syphilis test was not conducted", + "values": [ + "Test kits out of stock", + "A client was in an emergency situation", + "Client refused to be tested", + "We are still counselling a client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:partner_syphilis": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_partner_syphilis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_partner_syphilis_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting Syphilis test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_partner_syphilis_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "partner_syphilis_treatment", + "type": "native_radio", + "label": "Was syphilis treatment provided?", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_syphilis_treatment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:partner_syphilis": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "partner_hepatitis", + "type": "native_radio", + "label": "Hepatitis B Test Results", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_hepatitis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Hepatitis B Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_testing_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_partner_hepatitis", + "type": "toaster_notes", + "text": "Prescribe ARVs to the client according to standard guidelines", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:partner_hepatitis": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_partner_hepatitis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_partner_hepatitis_test", + "type": "spinner", + "hint": "Reason as to why the Hepatitis B test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:partner_hepatitis": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_partner_hepatitis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_partner_hepatitis_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting Hepatitis B test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_partner_hepatitis_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "partner_other_stds", + "type": "native_radio", + "label": "Has the client tested positive for other STIs?", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_other_stds", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_testing_relevance.yml" + } + } + } + }, + { + "key": "partner_other_stds_treatment", + "type": "native_radio", + "label": "Was treatment provided for other STIs?", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_other_stds_treatment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:partner_other_stds": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "partner_reason_for_not_giving_medication_for_other_stds", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_reason_for_not_giving_medication_for_other_stds", + "type": "spinner", + "hint": "Reason as to why treatment was not given", + "values": [ + "Out of stock", + "The client did not agree to take the medication", + "The client is allergic to medication", + "Other (Specify)" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:partner_other_stds_treatment": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "partner_other_reason_for_not_giving_medication_for_other_stds", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_other_reason_for_not_giving_medication_for_other_stds", + "type": "edit_text", + "hint": "Specify other reasons for not giving treatment", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:partner_reason_for_not_giving_medication_for_other_stds": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "partner_hiv_test_at_32", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_hiv_test_at_32", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_partner_testing_calculation.yml" + } + } + } + }, + { + "key": "partner_hiv_test_number", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_hiv_test_number", + "openmrs_entity_parent": "" + }, + { + "key": "gest_age", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "gest_age", + "openmrs_entity_parent": "" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_pregnancy_confirmation.json b/opensrp-chw-hf/src/main/assets/json.form/anc_pregnancy_confirmation.json new file mode 100644 index 000000000..fedae0a19 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_pregnancy_confirmation.json @@ -0,0 +1,600 @@ +{ + "count": "3", + "skip_blank_steps": true, + "encounter_type": "Pregnancy Confirmation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Triage", + "next": "step2", + "fields": [ + { + "key": "danger_signs", + "type": "check_box", + "label": "The HCW performs a quick analysis/examination to identify clients with danger signs", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "danger_signs", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "bleeding_vag", + "text": "Bleeding Vaginally", + "openmrs_entity": "concept", + "openmrs_entity_id": "bleeding_vag" + }, + { + "key": "headache_visual_disturbance", + "text": "Headache and Visual Disturbance", + "openmrs_entity": "concept", + "openmrs_entity_id": "headache_visual_disturbance" + }, + { + "key": "severely_pale", + "text": "Severely Pale", + "openmrs_entity": "concept", + "openmrs_entity_id": "severely_pale" + }, + { + "key": "dizziness", + "text": "Dizziness", + "openmrs_entity": "concept", + "openmrs_entity_id": "dizziness" + }, + { + "key": "severe_vomiting", + "text": "Severe Vomiting", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_vomiting" + }, + { + "key": "convulsion", + "text": "Convulsion", + "openmrs_entity": "concept", + "openmrs_entity_id": "convulsion" + }, + { + "key": "looking_very_ill", + "text": "Looking Very Ill", + "openmrs_entity": "concept", + "openmrs_entity_id": "looking_very_ill" + }, + { + "key": "fever", + "text": "Fever", + "openmrs_entity": "concept", + "openmrs_entity_id": "fever" + }, + { + "key": "unconscious", + "text": "Unconscious", + "openmrs_entity": "concept", + "openmrs_entity_id": "unconscious" + }, + { + "key": "severe_pain", + "text": "Severe Pain", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_pain" + }, + { + "key": "severe_breathing_difficulty", + "text": "Severe Breathing Difficulty", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_breathing_difficulty" + }, + { + "key": "in_labour", + "text": "In Labour", + "openmrs_entity": "concept", + "openmrs_entity_id": "in_labour" + }, + { + "key": "imminent_labour", + "text": "Imminent Labour", + "openmrs_entity": "concept", + "openmrs_entity_id": "imminent_labour" + }, + { + "key": "oedema_of_legs_and_sacrum", + "text": "Oedema of the legs and sacrum", + "openmrs_entity": "concept", + "openmrs_entity_id": "oedema_of_legs_and_sacrum" + }, + { + "key": "none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ], + "v_required": { + "value": "true", + "err": "Please select the danger sings" + } + }, + { + "key": "danger_signs_present_toaster", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "toaster_notes", + "text": "Danger sign! \nRefer immediately to Emergency Ward.", + "text_color": "#CF0800", + "toaster_type": "problem", + "relevance": { + "step1:danger_signs": { + "ex-checkbox": [ + { + "or": [ + "bleeding_vag", + "headache_visual_disturbance", + "severely_pale", + "severe_vomiting", + "severe_breathing_difficulty", + "convulsion", + "looking_very_ill", + "fever", + "unconscious", + "severe_pain", + "in_labour", + "imminent_labour", + "oedema_of_legs_and_sacrum", + "dizziness" + ] + } + ] + } + } + }, + { + "key": "task_id", + "type": "hidden", + "openmrs_entity_id": "task_id", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + } + ] + }, + "step2": { + "title": "Pregnancy Confirmation", + "next": "step3", + "fields": [ + { + "key": "type_of_pregnancy_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_pregnancy_test", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Select the type of test conducted", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "fundal_palpation" + ], + "options": [ + { + "key": "fundal_palpation", + "text": "Fundal Palpation", + "openmrs_entity": "concept", + "openmrs_entity_id": "fundal_palpation" + }, + { + "key": "upt", + "text": "UPT", + "openmrs_entity": "concept", + "openmrs_entity_id": "upt" + }, + { + "key": "uss", + "text": "USS", + "openmrs_entity": "concept", + "openmrs_entity_id": "uss" + } + ], + "v_required": { + "value": "true", + "err": "Please select the type of pregnancy conducted" + } + }, + { + "key": "fundal_palpation", + "type": "native_radio", + "openmrs_entity_id": "fundal_palpation", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "label": "Fundal Palpation Results", + "options": [ + { + "text": "Fetal parts detected", + "key": "fetal_parts_detected", + "openmrs_entity": "concept", + "openmrs_entity_id": "fetal_parts_detected" + }, + { + "text": "Fetal parts not detected", + "key": "fetal_parts_not_detected", + "openmrs_entity": "concept", + "openmrs_entity_id": "fetal_parts_not_detected" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Please select the Fundal Palpation results" + } + }, + { + "key": "upt", + "type": "native_radio", + "openmrs_entity_id": "upt", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "label": "Please select UPT Results", + "options": [ + { + "text": "Positive", + "key": "positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "text": "Negative", + "key": "negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Please select the UPT test results" + } + }, + { + "key": "uss", + "type": "native_radio", + "openmrs_entity_id": "uss", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "label": "Please select USS results", + "options": [ + { + "key": "present_gestation_sac", + "text": "Present Gestation Sac", + "openmrs_entity": "concept", + "openmrs_entity_id": "present_gestation_sac" + }, + { + "key": "absent_gestation_sac", + "text": "Absent Gestation Sac", + "openmrs_entity": "concept", + "openmrs_entity_id": "absent_gestation_sac" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Please select the USS test results" + } + } + ] + }, + "step3": { + "title": "End", + "fields": [ + { + "key": "known_last_menstrual_period", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_last_menstrual_period", + "type": "date_picker", + "hint": "Last Normal Menstrual Period (LNMP)", + "label_info_title": "LNMP", + "label_info_text": "LNMP = first day of Last Normal Menstrual Period. If the exact date is unknown, but the period of the month is known, use day 5 for beginning of the month, day 15 for middle of the month and day 25 for end of the month.", + "expanded": false, + "max_date": "today", + "min_date": "today-50w", + "v_required": { + "value": "true", + "err": "LNMP required" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + } + }, + { + "key": "last_menstrual_period_unknown", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_menstrual_period_unknown", + "openmrs_data_type": "text", + "type": "check_box", + "options": [ + { + "key": "lmp_unknown", + "text": "LNMP unknown?", + "text_size": "18px", + "value": "false", + "openmrs_entity": "concept", + "openmrs_entity_id": "lmp_unknown" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + } + }, + { + "key": "fundal_height", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fundal_height", + "type": "edit_text", + "hint": "Fundal Height (CM)", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Required" + }, + "v_numeric": { + "value": "true", + "err": "Has to be a number" + }, + "v_min": { + "value": "12", + "err": "Fundal height must be equal or more than 12 CM" + }, + "v_max": { + "value": "50", + "err": "Fundal height must be equal or less than 50 CM" + } + }, + { + "key": "estimated_last_menstrual_period", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "estimated_last_menstrual_period", + "type": "edit_text", + "read_only": true, + "hint": "Estimated Last Normal Menstrual Period (LNMP)", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + } + }, + { + "key": "last_menstrual_period", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_menstrual_period", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + } + }, + { + "key": "gest_age_note", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Gestational Age (GA) in Weeks", + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + } + }, + { + "key": "edd", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "edd", + "type": "edit_text", + "hint": "Expected Date of Delivery (EDD)", + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + } + }, + { + "key": "gest_age", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gest_age", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + } + }, + { + "key": "not_pregnant", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "toaster_notes", + "text": "The client is not pregnant. \nPlease refer the client to Family Planning Services", + "toaster_info_text": "The client is not pregnant. Please refer the client to Family Planning Services", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + } + }, + { + "key": "see_a_doctor", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "toaster_notes", + "text": "Refer the client for a gynaecological review", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_relevance.yml" + } + } + } + }, + { + "key": "pregnancy_confirmation_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnancy_confirmation_status", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + } + }, + { + "key": "pregnancy_confirmation_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnancy_confirmation_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_confirmation_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_pregnancy_outcome.json b/opensrp-chw-hf/src/main/assets/json.form/anc_pregnancy_outcome.json index a2b985054..61a500852 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/anc_pregnancy_outcome.json +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_pregnancy_outcome.json @@ -4,6 +4,7 @@ "count": "1", "encounter_type": "Pregnancy Outcome", "entity_id": "", + "global": {}, "metadata": { "start": { "openmrs_entity_parent": "", @@ -17,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -58,11 +54,80 @@ "openmrs_entity_id": "relational_id", "type": "hidden" }, + { + "key": "mothers_condition", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mothers_condition", + "type": "native_radio", + "label": "Mother's Condition", + "label_text_style": "bold", + "text_color": "#000000", + "options": [ + { + "key": "alive", + "text": "Alive", + "openmrs_entity": "concept", + "openmrs_entity_id": "alive", + "openmrs_entity_parent": "" + }, + { + "key": "deceased", + "text": "Deceased", + "openmrs_entity": "concept", + "openmrs_entity_id": "deceased", + "openmrs_entity_parent": "" + } + ], + "v_required": { + "value": "true", + "err": "Please select the mother's condition" + } + }, + { + "key": "date_of_death", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "date_of_death", + "type": "date_picker", + "hint": "Date Mother Died", + "expanded": false, + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please provide the date the mother died" + }, + "relevance": { + "step1:mothers_condition": { + "type": "string", + "ex": "equalTo(., \"deceased\")" + } + } + }, + { + "key": "time_of_death", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "time_of_death", + "type": "time_picker", + "hint": "Time mother died", + "expanded": false, + "v_required": { + "value": "true", + "err": "Please provide the time the mother died" + }, + "relevance": { + "step1:mothers_condition": { + "type": "string", + "ex": "equalTo(., \"deceased\")" + } + } + }, { "key": "preg_outcome", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "161033AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "preg_outcome", "type": "native_radio", "label": "Pregnancy outcome", "label_text_style": "bold", @@ -71,41 +136,36 @@ { "key": "born_alive", "text": "Child was born alive", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "151849AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "born_alive", "openmrs_entity_parent": "" }, { "key": "born_alive_died", "text": "Child was born alive, but died", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "164816AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "born_alive_died", "openmrs_entity_parent": "" }, { "key": "still_born", "text": "Child was stillborn", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "125872AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "still_born", "openmrs_entity_parent": "" }, { "key": "alive_with_problem", "text": "Child was born alive, but they have a problem (i.e. disability, respiratory issues, etc.)", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "161599AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "alive_with_problem", "openmrs_entity_parent": "" }, { "key": "miscarriage", "text": "Miscarriage", - "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "48AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "miscarriage", "openmrs_entity_parent": "" } ], @@ -114,11 +174,116 @@ "err": "Please select pregnancy outcome" } }, + { + "key": "prompt_for_child_with_problem", + "type": "toaster_notes", + "text": "Manage the condition as per standard guidelines", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:preg_outcome": { + "type": "string", + "ex": "equalTo(., \"alive_with_problem\")" + } + } + }, + { + "key": "sex_of_the_deceased_child", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sex_of_the_deceased_child", + "type": "spinner", + "hint": "Sex of the Deceased Child", + "values": [ + "Male", + "Female", + "Ambiguous" + ], + "keys": [ + "Male", + "Female", + "Ambiguous" + ], + "openmrs_choice_ids": { + "Male": "Male", + "Female": "Female", + "Ambiguous": "Ambiguous" + }, + "relevance": { + "step1:preg_outcome": { + "type": "string", + "ex": "equalTo(., \"born_alive_died\")" + } + }, + "v_required": { + "value": "true", + "err": "Please select the sex" + } + }, + { + "key": "reason_child_died", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_child_died", + "type": "spinner", + "hint": "Reason as to why the child died", + "values": [ + "Birth Asphyxia", + "Neonatal Respiratory Distress", + "Prematurity", + "Early Neonatal Sepsis", + "Others (Specify)" + ], + "keys": [ + "birth_asphyxia", + "neonatal_respiratory_distress", + "prematurity", + "early_neonatal_sepsis", + "others" + ], + "openmrs_choice_ids": { + "birth_asphyxia": "birth_asphyxia", + "neonatal_respiratory_distress": "neonatal_respiratory_distress", + "prematurity": "prematurity", + "early_neonatal_sepsis": "early_neonatal_sepsis", + "others": "others" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:preg_outcome": { + "type": "string", + "ex": "equalTo(., \"born_alive_died\")" + } + } + }, + { + "key": "other_reasons_for_child_death", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reasons_for_child_death", + "type": "edit_text", + "hint": "Specify other reasons as to why the child died", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_child_died": { + "type": "string", + "ex": "equalTo(., \"others\")" + } + } + }, { "key": "miscarriage_date", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "165248AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "miscarriage_date", "type": "date_picker", "hint": "Date of miscarriage", "expanded": false, @@ -136,17 +301,35 @@ } }, { - "key": "delivery_date", - "openmrs_entity_parent": "", + "key": "hiv_status_question", + "type": "native_radio", + "label": "Mother's HIV status", + "openmrs_entity_id": "hiv_status_question", "openmrs_entity": "concept", - "openmrs_entity_id": "5599AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "date_picker", - "hint": "Delivery date", - "expanded": false, - "max_date": "today", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity_id": "positive", + "openmrs_entity": "concept" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity_id": "negative", + "openmrs_entity": "concept" + }, + { + "key": "unknown", + "text": "Unknown", + "openmrs_entity": "concept", + "openmrs_entity_id": "unknown" + } + ], "v_required": { - "value": "true", - "err": "Please enter date the woman delivered" + "value": true, + "err": "Please answer this question" }, "relevance": { "rules-engine": { @@ -157,28 +340,66 @@ } }, { - "key": "no_children", - "openmrs_entity_parent": "", + "key": "risk_category", + "type": "native_radio", + "label": "HIV exposure risk of the newborn(s)", + "openmrs_entity_id": "risk_category", "openmrs_entity": "concept", - "openmrs_entity_id": "164894AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_data_type": "select one", - "type": "spinner", - "hint": "Number of children born alive", - "values": [ - "1", - "2+" - ], - "keys": [ - "1", - "2+" + "openmrs_entity_parent": "", + "options": [ + { + "key": "high", + "text": "High", + "openmrs_entity_id": "high", + "openmrs_entity": "concept" + }, + { + "key": "low", + "text": "Low", + "openmrs_entity_id": "low", + "openmrs_entity": "concept" + } ], - "openmrs_choice_ids": { - "1": "159913AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "2+": "159914AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "v_required": { + "value": true, + "err": "Please answer this question" }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_outcome_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_high_risk_results", + "type": "toaster_notes", + "text": "Conduct birth HIV testing, provide triple ARV prophylaxis for 6-weeks followed by monoprophylaxis for the next 6-weeks, care and monitor the newborn as per guidelines until the end of exposure.", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:risk_category": { + "type": "string", + "ex": "equalTo(., \"high\")" + } + } + }, + { + "key": "delivery_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_date", + "type": "date_picker", + "hint": "Delivery date", + "expanded": false, + "min_date": "today-42d", + "max_date": "today", "v_required": { "value": "true", - "err": "Please select one option" + "err": "Please enter date the woman delivered" }, "relevance": { "rules-engine": { @@ -188,31 +409,38 @@ } } }, + { + "key": "no_children", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_children", + "type": "hidden" + }, { "key": "delivery_place", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1572AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "delivery_place", "openmrs_data_type": "select one", "type": "spinner", "hint": "The place the mother gave birth", "values": [ - "At home", "At a health facility", - "On the way to the health facility", - "Other" + "Birth before Arrival (BBA)", + "At home", + "Traditional birth attendant" ], "keys": [ - "At home", "At a health facility", - "On the way to the health facility", - "Other" + "Birth before Arrival (BBA)", + "At home", + "Traditional birth attendant" ], "openmrs_choice_ids": { - "At Home": "1536AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "At a health facility": "1588AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "On the way to the health facility": "1601AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "Other": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "At a health facility": "At a health facility", + "Birth before Arrival (BBA)": "Birth before Arrival (BBA)", + "At home": "At home", + "Traditional birth attendant": "Traditional birth attendant" }, "v_required": { "value": "true", @@ -230,7 +458,7 @@ "key": "delivery_home", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1573AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "delivery_home", "type": "native_radio", "label": "Who helped the mother with a home delivery?", "label_text_style": "bold", @@ -249,27 +477,24 @@ "options": [ { "key": "gave_birth_alone", - "text": "She gave birth at home alone", - "value": false, + "text": "She gave birth alone", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "gave_birth_alone" }, { "key": "gave_birth_with_help", - "text": "She gave birth at home with the help of a family member/friend/neighbor", - "value": false, + "text": "She gave birth with the help of a family member/friend/neighbor", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1575AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "gave_birth_with_help" }, { "key": "midwife_help", - "text": "She gave birth at home with the help of a traditional midwife", - "value": false, + "text": "She gave birth with the help of a traditional midwife", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "125872AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "midwife_help" } ] }, @@ -277,7 +502,7 @@ "key": "delivery_hf", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "159771AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "delivery_hf", "type": "native_radio", "label": "The mother gave birth in a health facility. Who accompanied the mother to the health facility?", "label_text_style": "bold", @@ -296,43 +521,38 @@ "options": [ { "key": "facility_family_member", - "text": "She gave birth in a health facility, and she was accompanied by family member(s)", - "value": false, + "text": "She was accompanied by family member(s)", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "969AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "facility_family_member" }, { "key": "facility_midwife", - "text": "She gave birth in a health facility, and she was accompanied by a traditional midwife", - "value": false, + "text": "She was accompanied by a traditional midwife", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1575AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "facility_midwife" }, { "key": "alone", - "text": "She gave birth in a health facility, and she came by herself", - "value": false, + "text": "She came by herself", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "alone" }, { "key": "other_pple", - "text": "She gave birth in a health facility, and she was accompanied by other people", - "value": false, + "text": "She was accompanied by other people", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1582AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "other_pple" }, { "key": "other_chw", - "text": "She gave birth in a health facility, and she was accompanied by the CHW", - "value": false, + "text": "She was accompanied by the CHW", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "other_chw" } ] }, @@ -340,10 +560,9 @@ "key": "baby_label", "type": "label", "text": "BABY DETAILS", - "has_bg": true, "left_padding": "20dp", "right_padding": "20dp", - "text_size": "5sp", + "text_size": "7sp", "text_color": "#000000", "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -357,317 +576,1046 @@ } }, { - "key": "temp_unique_id", + "key": "fam_name", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "temp_unique_id", + "openmrs_entity_id": "fam_name", "type": "hidden" }, { - "key": "unique_id", - "openmrs_entity_parent": "", - "openmrs_entity": "person_identifier", - "openmrs_entity_id": "opensrp_id", - "type": "barcode", - "barcode_type": "qrcode", - "hint": "Boresha Afya ID", - "scanButtonText": "Scan QR Code", - "v_numeric": { - "value": "true", - "err": "Please enter a valid ID" - }, - "v_required": { - "value": "true", - "err": "Please enter the UNIQUE ID" - }, - "calculation": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_calculation.yml" - } - } - }, - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" - } - } - } - }, - { - "key": "surname", + "key": "no_immediate_new_born", + "type": "repeating_group", + "reference_edit_text_hint": "Number of new born(s)", + "repeating_group_label": "Baby Details #", "openmrs_entity_parent": "", - "openmrs_entity": "concept", + "openmrs_entity": "", "openmrs_entity_id": "", - "type": "edit_text", - "hint": "Surname", - "edit_type": "name", - "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Please enter a valid name" - }, - "v_required": { - "value": "true", - "err": "Please enter the surname" - }, + "repeating_group_max": "4", + "expand_on_text_change": "true", "relevance": { "rules-engine": { "ex-rules": { "rules-file": "anc_pregnancy_outcome_relevance.yml" } } - } - }, - { - "key": "same_as_fam_name_chk", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "", - "openmrs_data_type": "text", - "type": "check_box", - "options": [ + }, + "value": [ { - "key": "same_as_fam_name", - "text": "Surname same as family name", + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "15dp" + }, + { + "key": "apgar_score_label", + "type": "label", + "text": "AGPAR score", + "text_size": "7sp", + "text_color": "#000000", + "label_info_title": "APGAR score", + "label_info_text": "0 - 6: Emergency \n7 - 10: The baby is Okay", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "" + }, + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp" + }, + { + "key": "apgar_score", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "apgar_score", + "type": "numbers_selector", + "number_of_selectors": "11", + "start_number": "0", + "max_value": "10", "text_size": "18px", - "value": "false" - } - ], - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" + "text_color": "#000000", + "selected_text_color": "#ffffff", + "v_required": { + "value": true, + "err": "Please enter the agpar score" } - } - } - }, - { - "key": "fam_name", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "fam_name", - "type": "hidden" - }, - { - "key": "surname_calculation", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "last_name", - "type": "hidden", - "hint": "Surname as Family name", - "calculation": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_calculation.yml" + }, + { + "key": "apgar_score_calculated", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "apgar_score_calculated", + "type": "edit_text", + "hidden": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } } - } - } - }, - { - "key": "first_name", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "first_name", - "type": "edit_text", - "hint": "First name", - "edit_type": "name", - "v_required": { - "value": "true", - "err": "Please enter the first name" - }, - "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Please enter a valid name" - }, - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" + }, + { + "key": "prompt_for_normal_apgar_score", + "type": "toaster_notes", + "text": "APGAR score, Normal: {apgar_score}", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "positive", + "relevance": { + "step1:apgar_score_calculated": { + "type": "numeric", + "ex": "greaterThanEqualTo(.,\"7\")" + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } } - } - } - }, - { - "key": "middle_name", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "middle_name", - "type": "edit_text", - "hint": "Middle name", - "edit_type": "name", - "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Please enter a valid name" - }, - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" + }, + { + "key": "prompt_for_abnormal_apgar_score", + "type": "toaster_notes", + "text": "APGAR score, Abnormal: {apgar_score}. \nGo to emergency", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:apgar_score_calculated": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"6\")" + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } } - } - } - }, - { - "key": "dob", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "birthdate", - "type": "hidden", - "calculation": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_calculation.yml" + }, + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "15dp" + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Surname", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the surname" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } } - } - } - }, - { - "key": "gender", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "gender", - "type": "spinner", - "hint": "Sex", - "values": [ - "Male", - "Female" - ], - "keys": [ - "Male", - "Female" - ], - "v_required": { - "value": "true", - "err": "Please enter the sex" - }, - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" + }, + { + "key": "same_as_fam_name_chk", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "openmrs_data_type": "text", + "type": "check_box", + "options": [ + { + "key": "same_as_fam_name", + "text": "Surname same as family name", + "text_size": "18px", + "value": "false" + } + ] + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "First name", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the first name" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Middle name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the middle name" + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "hidden" + }, + { + "key": "gender", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Sex", + "values": [ + "Male", + "Female", + "Ambiguous" + ], + "keys": [ + "Male", + "Female", + "Ambiguous" + ], + "v_required": { + "value": "true", + "err": "Gender required" + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Weight (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the weight" + }, + "v_min": { + "value": "1.5", + "err": "The weight must be equal or greater than 1.5 (KGs)" + }, + "v_max": { + "value": "6", + "err": "The weight must be equal or less than 6 (KGs)" + }, + "v_required": { + "value": true, + "err": "Please enter the weight" + } + }, + { + "key": "disabilities", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabilities", + "type": "spinner", + "hint": "Physical disabilities", + "values": [ + "Yes", + "No" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Required" + } + }, + { + "key": "prompt_for_disabilities", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:disabilities": { + "type": "string", + "ex": "equalTo(.,\"Yes\")" + } + } + }, + { + "key": "type_of_disability", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Type of disability", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Mobility and Physical Impairments", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Spinal Cord Disability", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Head Injuries - Brain Disability", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Vision Disability", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Hearing Disability", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Cognitive or Learning Disabilities", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Psychological Disorders", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Invisible Disabilities", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } + } + }, + { + "key": "early_bf_1hr", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "early_bf_1hr", + "type": "spinner", + "hint": "Breastfed within 1 hour?", + "values": [ + "Yes", + "No" + ], + "keys": [ + "yes", + "no" + ], + "openmrs_choice_ids": { + "Yes": "yes", + "No": "no" + } + }, + { + "key": "reason_for_not_breast_feeding_within_one_hour", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_breast_feeding_within_one_hour", + "type": "spinner", + "hint": "Reason why the child was not breast fed within one hour", + "values": [ + "Mother Died", + "Baby unable to breast feed", + "Replacement Feeding", + "Other (Specify)" + ], + "keys": [ + "mother_died", + "baby_unable_to_breast_feed", + "replacement_feeding", + "other" + ], + "openmrs_choice_ids": { + "mother_died": "mother_died", + "baby_unable_to_breast_feed": "baby_unable_to_breast_feed", + "replacement_feeding": "replacement_feeding", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:early_bf_1hr": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_for_not_breast_feeding_within_one_hour", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_breast_feeding_within_one_hour", + "type": "edit_text", + "hint": "Specify other reasons for not breast feeding the child within one hour", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_breast_feeding_within_one_hour": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "child_bcg_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_bcg_vaccination", + "type": "native_radio", + "label": "Was BCG vaccination administered?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "prompt_for_bcg_vacc_not_provided", + "type": "toaster_notes", + "text": "Provide BCG vaccination to the infant at the first Postnatal care visit or as soon as the BCG vaccine will be available. BCG should not be provided beyond 12-months of infant age", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:child_bcg_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "reason_for_not_providing_bcg_vacc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_bcg_vacc", + "type": "spinner", + "hint": "Reason as to why the BCG vaccination was not given", + "values": [ + "Out of stock vaccine", + "Home delivery" + ], + "keys": [ + "out_of_stock_vaccine", + "home_delivery" + ], + "openmrs_choice_ids": { + "out_of_stock_vaccine": "out_of_stock_vaccine", + "home_delivery": "home_delivery" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:child_bcg_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "child_opv0_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_opv0_vaccination", + "type": "native_radio", + "label": "Was OPV 0 vaccination administered?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "prompt_for_opv0_vacc_not_provided", + "type": "toaster_notes", + "text": "Provide OPV 0 vaccination to the infant at the first Postnatal care visit or as soon as the OPV 0 vaccine will be available. OPV 0 should not be provided beyond 14 days", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:child_opv0_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } } } - } - }, - { - "key": "disabilities", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "159522AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "spinner", - "hint": "Physical disabilities", - "values": [ - "Yes", - "No" ], - "keys": [ - "Yes", - "No" - ], - "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, "v_required": { "value": "true", - "err": "Please enter the sex" - }, - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" - } - } + "err": "Please enter the number of children" } }, { - "key": "type_of_disability", + "key": "no_children_no", + "type": "repeating_group", + "reference_edit_text_hint": "Number of children born alive", + "repeating_group_label": "Baby Details #", "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "hint": "Type of physical disabilities", - "edit_type": "name", + "openmrs_entity": "", + "openmrs_entity_id": "", + "repeating_group_max": "4", + "expand_on_text_change": "true", "relevance": { "rules-engine": { "ex-rules": { "rules-file": "anc_pregnancy_outcome_relevance.yml" } } - } - }, - { - "key": "early_bf_1hr", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "164819AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "spinner", - "hint": "Early initiation of breastfeeding (1 hr)?", - "values": [ - "Yes", - "No" - ], - "keys": [ - "Yes", - "No" - ], - "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" + "value": [ + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Surname", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the surname" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } } - } - } - }, - { - "key": "vacc_birth", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "check_box", - "label": "Which vaccinations were given?", - "label_text_style": "normal", - "text_color": "#C0C0C0", - "exclusive": [ - "chk_none" - ], - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "anc_pregnancy_outcome_relevance.yml" + }, + { + "key": "same_as_fam_name_chk", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "openmrs_data_type": "text", + "type": "check_box", + "options": [ + { + "key": "same_as_fam_name", + "text": "Surname same as family name", + "text_size": "18px", + "value": "false" + } + ] + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "First name", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the first name" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" } - } - }, - "options": [ + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Middle name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the middle name" + } + }, { - "key": "chk_none", - "text": "None", - "value": false, + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "hidden" + }, + { + "key": "gender", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Sex", + "values": [ + "Male", + "Female", + "Ambiguous" + ], + "keys": [ + "Male", + "Female", + "Ambiguous" + ], + "v_required": { + "value": "true", + "err": "Gender required" + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Weight (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the weight" + }, + "v_min": { + "value": "0", + "err": "The weight must be equal or greater than 0 (KG)" + }, + "v_max": { + "value": "30", + "err": "The weight must be equal or less than 30 (KG)" + } + }, + { + "key": "disabilities", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabilities", + "type": "spinner", + "hint": "Physical disabilities", + "values": [ + "Yes", + "No" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Required" + } + }, + { + "key": "prompt_for_disabilities", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:disabilities": { + "type": "string", + "ex": "equalTo(.,\"Yes\")" + } + } + }, + { + "key": "type_of_disability", + "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "label": "Type of disability", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Mobility and Physical Impairments", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Spinal Cord Disability", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Head Injuries - Brain Disability", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Vision Disability", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Hearing Disability", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Cognitive or Learning Disabilities", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Psychological Disorders", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Invisible Disabilities", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } + } }, { - "key": "chk_opv_0", - "text": "OPV 0", - "value": false, + "key": "early_bf_1hr", + "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "783AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "early_bf_1hr", + "type": "spinner", + "hint": "Breastfed within 1 hour?", + "values": [ + "Yes", + "No" + ], + "keys": [ + "yes", + "no" + ], + "openmrs_choice_ids": { + "Yes": "yes", + "No": "no" + } }, { - "key": "chk_bcg", - "text": "BCG", - "value": false, + "key": "reason_for_not_breast_feeding_within_one_hour", + "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "886AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "reason_for_not_breast_feeding_within_one_hour", + "type": "spinner", + "hint": "Reason why the child was not breast fed within one hour", + "values": [ + "Mother Died", + "Baby unable to breast feed", + "Replacement Feeding", + "Other (Specify)" + ], + "keys": [ + "mother_died", + "baby_unable_to_breast_feed", + "replacement_feeding", + "other" + ], + "openmrs_choice_ids": { + "mother_died": "mother_died", + "baby_unable_to_breast_feed": "baby_unable_to_breast_feed", + "replacement_feeding": "replacement_feeding", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:early_bf_1hr": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_for_not_breast_feeding_within_one_hour", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_breast_feeding_within_one_hour", + "type": "edit_text", + "hint": "Specify other reasons for not breast feeding the child within one hour", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_breast_feeding_within_one_hour": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "child_bcg_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_bcg_vaccination", + "type": "native_radio", + "label": "Was BCG vaccination administered?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "prompt_for_bcg_vacc_not_provided", + "type": "toaster_notes", + "text": "Provide BCG vaccination to the infant at the first Postnatal care visit or as soon as the BCG vaccine will be available. BCG should not be provided beyond 12-months of infant age", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:child_bcg_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "reason_for_not_providing_bcg_vacc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_bcg_vacc", + "type": "spinner", + "hint": "Reason as to why the BCG vaccination was not given", + "values": [ + "Out of stock vaccine", + "Home delivery" + ], + "keys": [ + "out_of_stock_vaccine", + "home_delivery" + ], + "openmrs_choice_ids": { + "out_of_stock_vaccine": "out_of_stock_vaccine", + "home_delivery": "home_delivery" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:child_bcg_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "child_opv0_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_opv0_vaccination", + "type": "native_radio", + "label": "Was OPV 0 vaccination administered?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "prompt_for_opv0_vacc_not_provided", + "type": "toaster_notes", + "text": "Provide OPV 0 vaccination to the infant at the first Postnatal care visit or as soon as the OPV 0 vaccine will be available. OPV 0 should not be provided beyond 14 days", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:child_opv0_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } } ], "v_required": { "value": "true", - "err": "Please enter the current weight" + "err": "Please enter the number of children" + } + }, + { + "key": "hiv", + "type": "hidden", + "openmrs_entity_id": "hiv", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_pregnancy_outcome_calculation.yml" + } + } } } ] diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_rv_birth_review_and_emergency_plan.json b/opensrp-chw-hf/src/main/assets/json.form/anc_rv_birth_review_and_emergency_plan.json new file mode 100644 index 000000000..bfbb15e64 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_rv_birth_review_and_emergency_plan.json @@ -0,0 +1,291 @@ +{ + "count": "1", + "encounter_type": "Emergency Plan", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": { + "delivery_place_identified": false, + "transport_identified": false, + "birth_companion_identified": false, + "emergency_funds_identified": false, + "household_support_identified": false, + "blood_donor_identified": false + }, + "step1": { + "title": "Review birth and emergency plan", + "fields": [ + { + "key": "delivery_place", + "type": "native_radio", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_place", + "openmrs_entity_parent": "", + "label": "Delivery Place Identified?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "text": "Identified and Prepared", + "key": "prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "prepared" + }, + { + "text": "Not Prepared", + "key": "not_prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_prepared" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_emergency_plan_relevance.yml" + } + } + } + }, + { + "key": "name_of_hf", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "name_of_hf", + "buttonText": "Select Health Facility", + "sort": true, + "maxSelectable": 1, + "dialogTitle": "Health Facility", + "searchHint": "Type Health Facility Name", + "options": [ + ], + "type": "multi_select_list", + "v_required": { + "value": true, + "err": "Please select the health facility" + }, + "relevance": { + "step1:delivery_place": { + "type": "string", + "ex": "equalTo(., \"prepared\")" + } + } + }, + { + "key": "transport", + "type": "native_radio", + "openmrs_entity": "concept", + "openmrs_entity_id": "transport", + "openmrs_entity_parent": "", + "label": "Prepare and Identify Method Of Transport", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "text": "Identified and Prepared", + "key": "prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "prepared" + }, + { + "text": "Not Prepared", + "key": "not_prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_prepared" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_emergency_plan_relevance.yml" + } + } + } + }, + { + "key": "birth_companion", + "type": "native_radio", + "openmrs_entity": "concept", + "openmrs_entity_id": "birth_companion", + "openmrs_entity_parent": "", + "label": "Prepare a Birth Companion and Notify", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "text": "Birth Companion Identified and notified", + "key": "prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "prepared" + }, + { + "text": "Birth Companion Not Identified", + "key": "not_prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_prepared" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_emergency_plan_relevance.yml" + } + } + } + }, + { + "key": "emergency_funds", + "type": "native_radio", + "openmrs_entity": "concept", + "openmrs_entity_id": "emergency_funds", + "openmrs_entity_parent": "", + "label": "Prepare money for delivery and other delivery needs", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "prepared", + "text": "Prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "prepared" + }, + { + "key": "not_prepared", + "text": "Not Prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_prepared" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_emergency_plan_relevance.yml" + } + } + } + }, + { + "key": "household_support", + "type": "native_radio", + "openmrs_entity": "concept", + "openmrs_entity_id": "household_support", + "openmrs_entity_parent": "", + "label": "Prepare A Household Caregiver For Support", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "text": "Prepared", + "key": "prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "prepared" + }, + { + "text": "Not Prepared", + "key": "not_prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_prepared" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_emergency_plan_relevance.yml" + } + } + } + }, + { + "key": "blood_donor", + "type": "native_radio", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_donor", + "openmrs_entity_parent": "", + "label": "Prepare Blood donor standby for blood transfusion", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "prepared", + "text": "Prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "prepared" + }, + { + "key": "not_prepared", + "text": "Not Prepared", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_prepared" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_emergency_plan_relevance.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_rv_consultation.json b/opensrp-chw-hf/src/main/assets/json.form/anc_rv_consultation.json new file mode 100644 index 000000000..dfe9022a2 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_rv_consultation.json @@ -0,0 +1,707 @@ +{ + "count": "1", + "encounter_type": "ANC Consultation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Consultation (ANC assessment and Update Maternal Handbook)", + "fields": [ + { + "key": "examination_findings", + "type": "check_box", + "label": "Examination Findings on current visit", + "combine_checkbox_option_values": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "examination_findings", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "puffy_face", + "text": "Face is puffy", + "openmrs_entity": "concept", + "openmrs_entity_id": "puffy_face" + }, + { + "key": "pallor", + "text": "Pallor (conjunctiva, palms, tip of the tongue, gums)", + "openmrs_entity": "concept", + "openmrs_entity_id": "pallor" + }, + { + "key": "none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ] + }, + { + "key": "prompt_for_examination_findings", + "type": "toaster_notes", + "openmrs_entity": "concept", + "openmrs_entity_id": "prompt_for_examination_findings", + "openmrs_entity_parent": "", + "text": "Provide emergency care for severe anaemia with heart/renal failure, elicit the cause and manage according to standard guidelines", + "toaster_type": "problem", + "relevance": { + "step1:examination_findings": { + "ex-checkbox": [ + { + "or": [ + "pallor", + "puffy_face" + ] + } + ] + } + } + }, + { + "key": "gest_age_consultation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gest_age_consultation", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_calculation.yml" + } + } + } + }, + { + "key": "height", + "type": "edit_text", + "hint": "Height (CM)", + "openmrs_entity": "concept", + "openmrs_entity_id": "height", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the height" + }, + "v_min": { + "value": "60", + "err": "The height must be equal or greater than 60 (CM)" + }, + "v_max": { + "value": "200", + "err": "The height must be equal or less than 200 (CM)" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "height_calculated", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "height_calculated", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_calculation.yml" + } + } + } + }, + { + "key": "prompt_for_short_stature", + "type": "toaster_notes", + "text": "Counsel the client on her risk of obstructed labour and advise her to deliver at a health care facility", + "openmrs_entity_id": "prompt_for_short_stature", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:height": { + "type": "numeric", + "ex": "lessThan(.,\"145\")" + } + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Weight (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the weight" + }, + "v_min": { + "value": "20", + "err": "The weight must be equal or greater than 20 (KG)" + }, + "v_max": { + "value": "300", + "err": "The weight must be equal or less than 300 (KG)" + } + }, + { + "key": "bmi", + "type": "edit_text", + "hint": "Body Mass Index (BMI)", + "read_only": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "bmi", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the height" + }, + "v_required": { + "value": true, + "err": "Please enter the height" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_underweight", + "type": "toaster_notes", + "text": "Manage the undernourished client using standard guidelines", + "openmrs_entity_id": "prompt_for_underweight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:bmi": { + "type": "numeric", + "ex": "lessThan(.,\"18.5\")" + } + } + }, + { + "key": "prompt_for_overweight", + "type": "toaster_notes", + "text": "Manage the overweight client using standard guidelines", + "openmrs_entity_id": "prompt_for_overweight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:bmi": { + "type": "numeric", + "ex": "greaterThanEqualTo(.,\"29\")" + } + } + }, + { + "key": "fundal_height", + "type": "edit_text", + "openmrs_entity_id": "fundal_height", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Fundal Height (CM)", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + }, + "v_numeric": { + "value": "true", + "err": "Please enter the fundal height" + }, + "v_min": {}, + "v_max": { + "value": "50", + "err": "Fundal height must be equal or less than 50 CM" + } + }, + { + "key": "fetal_heart_rate", + "type": "edit_text", + "hint": "Count Fetal Heart Rate(bpm)", + "openmrs_entity_id": "fetal_heart_rate", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the fetal heart rate" + }, + "v_min": { + "value": "0", + "err": "Fetal heart rate must be equal or greater than 0" + }, + "v_max": { + "value": "300", + "err": "Fetal heart rate must be equal or less than 300" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_fetal_distress", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "prompt_for_fetal_distress", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "lie", + "type": "spinner", + "openmrs_entity_id": "lie", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Lie", + "values": [ + "Transverse", + "Oblique", + "Longitudinal" + ], + "keys": [ + "transverse", + "oblique", + "longitudinal" + ], + "openmrs_choice_ids": { + "transverse": "transverse", + "oblique": "oblique", + "longitudinal": "longitudinal" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_lie", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "presentation", + "type": "spinner", + "openmrs_entity_id": "presentation", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Presentation", + "values": [ + "Breech Presentation", + "Cephalic Presentation" + ], + "keys": [ + "breech", + "cephalic" + ], + "openmrs_choice_ids": { + "breech": "breech", + "cephalic": "cephalic" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_presentation", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:presentation": { + "type": "string", + "ex": "equalTo(., \"breech\")" + } + } + }, + { + "key": "systolic", + "type": "edit_text", + "hint": "Systolic (Blood Pressure)", + "openmrs_entity_id": "systolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the systolic value" + }, + "v_min": { + "value": "0", + "err": "Systolic value must be equal or greater than 0" + }, + "v_max": { + "value": "320", + "err": "Systolic value must be equal or less than 320" + } + }, + { + "key": "diastolic", + "type": "edit_text", + "hint": "Diastolic (Blood Pressure)", + "openmrs_entity_id": "diastolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the diastolic value" + }, + "v_min": { + "value": "0", + "err": "Diastolic value must be equal or greater than 0" + }, + "v_max": { + "value": "200", + "err": "Diastolic value must be equal or less than 200" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:systolic)", + "err": "The diastolic value must be less than the systolic value" + } + ] + }, + { + "key": "prompt_for_management_of_hypertension", + "type": "toaster_notes", + "text": "Manage the hypertension according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypertension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_management_of_hypotension", + "type": "toaster_notes", + "text": "Elicit the cause of hypotension and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypotension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_consultation_relevance.yml" + } + } + } + }, + { + "key": "pulse_rate", + "type": "edit_text", + "hint": "Pulse Rate (Beats per minute)", + "openmrs_entity_id": "pulse_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the pulse rate" + }, + "v_min": { + "value": "0", + "err": "The pulse rate must be equal or greater than 0 (bpm)" + }, + "v_max": { + "value": "200", + "err": "The pulse rate must be equal or less than 200 (bpm)" + } + }, + { + "key": "prompt_for_Bradycardia", + "type": "toaster_notes", + "text": "Elicit the cause of bradycardia and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_Bradycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "lessThan(.,\"60\")" + } + } + }, + { + "key": "prompt_for_Tachycardia", + "type": "toaster_notes", + "text": "Elicit the cause of tachycardia and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_Tachycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "greaterThan(.,\"100\")" + } + } + }, + { + "key": "temperature", + "type": "edit_text", + "hint": "Temperature (\u2103)", + "openmrs_entity_id": "temperature", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the temperature" + }, + "v_min": { + "value": "10", + "err": "Temperature must be equal or greater than 10" + }, + "v_max": { + "value": "50", + "err": "Temperature must be equal or less than 50" + } + }, + { + "key": "notify_client_has_fever", + "type": "toaster_notes", + "text": "Conduct relevant laboratory tests to elicit the cause of fever and manage according to standard guidelines ", + "openmrs_entity_id": "notify_client_has_fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "greaterThan(.,\"37.8\")" + } + } + }, + { + "key": "notify_client_has_hypothermia", + "type": "toaster_notes", + "text": "Manage the hypothermia according to standard guidelines", + "openmrs_entity_id": "notify_client_has_hypothermia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "lessThan(.,\"36.5\")" + } + } + }, + { + "key": "breast", + "type": "native_radio", + "label": "Breasts", + "openmrs_entity": "concept", + "openmrs_entity_id": "breast", + "openmrs_entity_parent": "", + "options": [ + { + "key": "normal", + "text": "Normal", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + }, + { + "key": "abnormal", + "text": "Abnormal", + "openmrs_entity": "concept", + "openmrs_entity_id": "abnormal" + } + ] + }, + { + "key": "prompt_for_breasts", + "type": "toaster_notes", + "text": "Palpate the breast to elicit mastitis or breast lump.\nProvide antibiotics for mastitis and manage according to standard guidelines.\nRefer for further management if she has a breast lump", + "openmrs_entity_id": "prompt_for_breasts", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:breast": { + "type": "string", + "ex": "equalTo(.,\"abnormal\")" + } + } + }, + { + "key": "lymph_node_under_arm", + "type": "native_radio", + "label": "Lymph Node (under the arm)", + "openmrs_entity": "concept", + "openmrs_entity_id": "lymph_node_under_arm", + "openmrs_entity_parent": "", + "options": [ + { + "key": "normal", + "text": "Normal", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + }, + { + "key": "abnormal", + "text": "Abnormal", + "openmrs_entity": "concept", + "openmrs_entity_id": "abnormal" + } + ] + }, + { + "key": "prompt_for_lymph_under_the_arm", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "prompt_for_lymph_under_the_arm", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:lymph_node_under_arm": { + "type": "string", + "ex": "equalTo(.,\"abnormal\")" + } + } + }, + { + "key": "lymph_node_cervical", + "type": "native_radio", + "label": "Lymph Node (cervical)", + "openmrs_entity": "concept", + "openmrs_entity_id": "lymph_node_cervical", + "openmrs_entity_parent": "", + "options": [ + { + "key": "normal", + "text": "Normal", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + }, + { + "key": "abnormal", + "text": "Abnormal", + "openmrs_entity": "concept", + "openmrs_entity_id": "abnormal" + } + ] + }, + { + "key": "prompt_for_lymph_cervical", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "prompt_for_lymph_cervical", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:lymph_node_cervical": { + "type": "string", + "ex": "equalTo(.,\"abnormal\")" + } + } + }, + { + "key": "consultation_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "consultation_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_rv_lab_test.json b/opensrp-chw-hf/src/main/assets/json.form/anc_rv_lab_test.json new file mode 100644 index 000000000..b2b03d1dc --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_rv_lab_test.json @@ -0,0 +1,1226 @@ +{ + "count": "1", + "encounter_type": "ANC Lab Tests", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "ANC Lab Tests", + "fields": [ + { + "key": "hb_level_test", + "type": "native_radio", + "label": "HB Level Test", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "test_conducted", + "text": "HB Level Test conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted", + "openmrs_entity_parent": "" + }, + { + "key": "test_not_conducted", + "text": "HB Level Test not conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "hb_level", + "type": "edit_text", + "hint": "HB Level (g/dl)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the HB level" + }, + "v_min": { + "value": "0", + "err": "HB level must be equal or greater than 0 (g/dl)" + }, + "v_max": { + "value": "20", + "err": "HB level must be equal or less than 20 (g/dl)" + }, + "v_required": { + "value": true, + "err": "Please provide a value" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_conducted\")" + } + } + }, + { + "key": "prompt_for_severe_anaemia_treatment", + "type": "toaster_notes", + "text": "Manage the severe anaemia according to standard guidelines", + "openmrs_entity_id": "prompt_for_severe_anaemia_treatment", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_moderate_anaemia_management", + "type": "toaster_notes", + "text": "Manage the mild anaemia according to standard guidelines", + "openmrs_entity_id": "prompt_for_moderate_anaemia_management", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hb_test", + "type": "spinner", + "hint": "Reason as to why the HB Level test was not conducted", + "values": [ + "Cuvette Cartridges Out of Stock", + "Haemoque machine out of order", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other" + ], + "keys": [ + "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "stock_out_of_cuvettes_cartridges": "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order": "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_hb_test_not_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_hb_test_not_conducted", + "type": "edit_text", + "hint": "Other reason for why the HB Level test was not conducted", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_hb_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "blood_for_glucose_test", + "type": "native_radio", + "label": "Blood For Glucose Test", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_for_glucose_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "test_conducted", + "text": "Blood for Glucose Test conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted", + "openmrs_entity_parent": "" + }, + { + "key": "test_not_conducted", + "text": "Blood for Glucose Test not conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "type_of_blood_for_glucose_test", + "type": "native_radio", + "label": "Type Of Blood For Glucose Test Conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_blood_for_glucose_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "rbg", + "text": " Random Blood Glucose Test (rbg)", + "openmrs_entity": "concept", + "openmrs_entity_id": "rbg", + "openmrs_entity_parent": "" + }, + { + "key": "gtt", + "text": "Glucose Tolerance test (GTT)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gtt" + }, + { + "key": "fbg", + "text": "Fasting Blood Glucose Test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fbg" + } + ], + "v_required": { + "value": true, + "err": "Please answer this question" + }, + "relevance": { + "step1:blood_for_glucose_test": { + "type": "string", + "ex": "equalTo(., \"test_conducted\")" + } + } + }, + { + "key": "blood_for_glucose", + "type": "edit_text", + "hint": "Blood For Glucose (mmol/L)", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_for_glucose", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the blood for glucose (mmol/L)" + }, + "v_min": { + "value": "0", + "err": "Blood for glucose must be equal or greater than 0 (mmol/L)" + }, + "v_max": { + "value": "45", + "err": "Blood for glucose must be equal or less than 45 (mmol/L)" + }, + "v_required": { + "value": "true", + "err": "Please enter the blood for glucose (mmol/L)" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_gestational_diabetes_mellitus", + "type": "toaster_notes", + "text": "Manage the gestational diabetes mellitus according to standard guidelines", + "openmrs_entity_id": "prompt_for_gestational_diabetes_mellitus", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_hypoglycaemia", + "type": "toaster_notes", + "text": "Manage the hypoglycaemia according to standard guidelines", + "openmrs_entity_id": "prompt_for_hypoglycaemia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_blood_glucose_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_blood_glucose_test", + "type": "spinner", + "hint": "Reason as to why the Blood for Glucose test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other" + ], + "keys": [ + "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_are_out_of_stock": "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:blood_for_glucose_test": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_blood_glucose_test_not_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_blood_glucose_test_not_conducted", + "type": "edit_text", + "hint": "Other reason for why the Blood for Glucose test was not conducted", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_blood_glucose_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "glucose_in_urine", + "type": "native_radio", + "label": "Glucose In Urine", + "openmrs_entity": "concept", + "openmrs_entity_id": "glucose_in_urine", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive", + "openmrs_entity_parent": "" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Glucose In Urine Test not conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "prompt_for_glucose_in_urine", + "type": "toaster_notes", + "text": "Check Random Blood Glucose to rule-out gestational diabetes ", + "openmrs_entity_id": "prompt_for_glucose_in_urine", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:glucose_in_urine": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_glucose_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_glucose_in_urine_test", + "type": "spinner", + "hint": "Reason as to why the Glucose in Urine test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other" + ], + "keys": [ + "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_are_out_of_stock": "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:glucose_in_urine": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_glucose_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_glucose_in_urine_test", + "type": "edit_text", + "hint": "Other reason for why the Glucose in Urine test was not conducted", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_glucose_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "protein_in_urine", + "type": "native_radio", + "label": "Protein In Urine", + "openmrs_entity": "concept", + "openmrs_entity_id": "protein_in_urine", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive", + "openmrs_entity_parent": "" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative", + "openmrs_entity_parent": "" + }, + { + "key": "test_not_conducted", + "text": "Protein In Urine Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted", + "openmrs_entity_parent": "" + } + ] + }, + { + "key": "prompt_for_protein_in_urine", + "type": "toaster_notes", + "text": "Monitor Blood Pressure to rule out pre-eclampsia, elicit symptoms of Urinary Tract Infection and manage the cause of proteinuria according to standard guidelines", + "openmrs_entity_id": "prompt_for_protein_in_urine", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:protein_in_urine": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_protein_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_protein_in_urine_test", + "type": "spinner", + "hint": "Reason as to why the Protein in Urine test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other" + ], + "keys": [ + "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_are_out_of_stock": "test_kits_are_out_of_stock", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:protein_in_urine": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_protein_in_urine_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_protein_in_urine_test", + "type": "edit_text", + "hint": "Other reason for why the Protein in Urine test was not conducted", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_protein_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "blood_group", + "type": "spinner", + "hint": "Blood Group", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_group", + "openmrs_entity_parent": "", + "values": [ + "A", + "B", + "AB", + "O", + "Blood Type Test Not Conducted" + ], + "keys": [ + "A", + "B", + "AB", + "O", + "test_not_conducted" + ], + "openmrs_choice_ids": { + "A": "A", + "B": "B", + "AB": "AB", + "O": "O", + "test_not_conducted": "test_not_conducted" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_blood_group_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_blood_group_test", + "type": "spinner", + "hint": "Reason as to why the Blood Type Test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:blood_group": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_blood_group_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_blood_group_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting the Blood Type Test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_blood_group_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "rh_factor", + "type": "native_radio", + "label": "Rh", + "openmrs_entity": "concept", + "openmrs_entity_id": "rh_factor", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_rh_factor", + "type": "toaster_notes", + "text": "Refer the client for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:rh_factor": { + "type": "string", + "ex": "equalTo(., \"negative\")" + } + } + }, + { + "key": "hiv", + "type": "native_radio", + "label": "HIV Test Results", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "HIV Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hiv_test", + "type": "spinner", + "hint": "Reason as to why the HIV test was not conducted", + "values": [ + "Test kits out of stock", + "A client was in an emergency situation", + "Client refused to be tested", + "We are still counselling a client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:hiv": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_hiv_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting HIV test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_hiv_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "register_pmtct", + "type": "toaster_notes", + "text": "Register the client for PMTCT care and follow up", + "openmrs_entity_id": "register_pmtct", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hiv": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "prescribe_arv", + "type": "toaster_notes", + "text": "Prescribe ARVs to the client according to standard guidelines", + "openmrs_entity_id": "prescribe_arv", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hiv": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "hiv_counselling_before_testing", + "type": "native_radio", + "label": "Was the client provided with counselling before HIV testing?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_counselling_before_testing", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "hiv_counselling_after_testing", + "type": "native_radio", + "label": "Was the client provided with counselling after HIV testing?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_counselling_after_testing", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "syphilis", + "type": "native_radio", + "label": "Syphilis Test Results", + "openmrs_entity": "concept", + "openmrs_entity_id": "syphilis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Syphilis Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "prescribe_anti_sy", + "type": "toaster_notes", + "text": "Prescribe client to Antibiotics", + "openmrs_entity_id": "prescribe_anti_sy", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:syphilis": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "syphilis_treatment", + "type": "native_radio", + "label": "Was syphilis treatment provided?", + "openmrs_entity": "concept", + "openmrs_entity_id": "syphilis_treatment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:syphilis": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "reason_for_not_conducting_syphilis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_syphilis_test", + "type": "spinner", + "hint": "Reason as to why the Syphilis test was not conducted", + "values": [ + "Test kits out of stock", + "A client was in an emergency situation", + "Client refused to be tested", + "We are still counselling a client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:syphilis": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_syphilis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_syphilis_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting Syphilis test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_syphilis_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "hepatitis", + "type": "native_radio", + "label": "Hepatitis B Test Results", + "openmrs_entity": "concept", + "openmrs_entity_id": "hepatitis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Hepatitis B Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "prescribe_arv_hepb_at_above_twenty_eight", + "type": "toaster_notes", + "text": "Prescribe ARVs to the client according to standard guidelines", + "openmrs_entity_id": "prescribe_arv_hepb_at_above_twenty_eight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "counsel_arv_hepb_below_twenty_eight", + "type": "toaster_notes", + "text": "Counsel on ARVs uptake at 28-weeks of gestation", + "openmrs_entity_id": "counsel_arv_hepb_below_twenty_eight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hepatitis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hepatitis_test", + "type": "spinner", + "hint": "Reason as to why the Hepatitis B test was not conducted", + "values": [ + "Test kits out of stock", + "A client was in an emergency situation", + "Client refused to be tested", + "We are still counselling a client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:hepatitis": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_hepatitis_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_hepatitis_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting Hepatitis B test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_hepatitis_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "hiv_test_at_32", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_at_32", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_calculation.yml" + } + } + } + }, + { + "key": "hiv_test_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_number", + "type": "hidden" + }, + { + "key": "date_anc_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "date_anc_hiv_test", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_lab_test_calculation.yml" + } + } + } + }, + { + "key": "lab_test_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "lab_test_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_rv_malaria_investigation_form.json b/opensrp-chw-hf/src/main/assets/json.form/anc_rv_malaria_investigation_form.json new file mode 100644 index 000000000..f9db36162 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_rv_malaria_investigation_form.json @@ -0,0 +1,606 @@ +{ + "count": "1", + "encounter_type": "Malaria Investigation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": { + }, + "step1": { + "title": "Malaria Investigation", + "fields": [ + { + "key": "client_on_malaria_medication", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_on_malaria_medication", + "type": "native_radio", + "label": "Is the client on malaria medication", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ] + }, + { + "key": "malaria_symptoms_screening", + "type": "check_box", + "label": "Please select if the client has any of the following Malaria symptoms", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "malaria_symptoms_screening", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "fever_and_chills", + "text": "Fever and chills", + "openmrs_entity_id": "fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "headache", + "text": "Headache", + "openmrs_entity_id": "headache", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "pallor", + "text": "Pallor", + "opemrs_entity_id": "pallor", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "diarrhea", + "text": "Diarrhea", + "openmrs_entity_id": "diarrhea", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "nausea_and_vomiting", + "text": "Nausea And Vomiting", + "openmrs_entity_id": "nausea_and_vomiting", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "joint_pains", + "text": "Joint Pains", + "openmrs_entity_id": "joint_pains", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "body_ache", + "text": "Body Ache", + "openmrs_entity_id": "body_ache", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "poor_appetite", + "text": "Poor Appetite", + "openmrs_entity_id": "poor_appetite", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "body_weakness", + "text": "Body Weakness", + "openmrs_entity_id": "body_weakness", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "enlarged_spleen", + "text": "Enlarged Spleen", + "openmrs_entity_id": "enlarged_spleen", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "none", + "text": "None of the above", + "openmrs_entity_id": "none", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:client_on_malaria_medication": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "mRDT_for_malaria", + "type": "native_radio", + "label": "mRDT for Malaria Results", + "openmrs_entity": "concept", + "openmrs_entity_id": "mRDT_for_malaria", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Malaria Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "step1:malaria_symptoms_screening": { + "ex-checkbox": [ + { + "or": [ + "fever_and_chills", + "headache", + "pallor", + "diarrhea", + "nausea_and_vomiting", + "joint_pains", + "body_ache", + "poor_appetite", + "body_weakness", + "enlarged_spleen" + ] + } + ] + } + }, + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_mRDT", + "type": "toaster_notes", + "text": "Provide anti-malaria medication and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_mRDT", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:mRDT_for_malaria": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "prompt_for_further_management", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "prompt_for_mRDT", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:mRDT_for_malaria": { + "type": "string", + "ex": "equalTo(., \"negative\")" + } + } + }, + { + "key": "reason_for_not_conducting_malaria_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_malaria_test", + "type": "spinner", + "hint": "Reason as to why the Malaria test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:mRDT_for_malaria": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_malaria_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_malaria_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting Malaria test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_malaria_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "malaria_preventive_therapy", + "type": "hidden", + "openmrs_entity_id": "malaria_preventive_therapy", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_fv_malaria_investigation_calculation.yml" + } + } + } + }, + { + "key": "malaria_preventive_therapy_ipt1", + "type": "native_radio", + "openmrs_entity_id": "malaria_preventive_therapy_ipt1", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Malaria Preventive Therapy", + "options": [ + { + "key": "ipt1", + "text": "IPT1", + "openmrs_entity_id": "ipt1", + "openmrs_entity": "concept" + }, + { + "key": "medication_not_given", + "text": "Malaria preventive therapy not given", + "openmrs_entity_id": "medication_not_given", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Please select the medication for Malaria Preventive Therapy" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "malaria_preventive_therapy_ipt2", + "type": "native_radio", + "openmrs_entity_id": "malaria_preventive_therapy_ipt2", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Malaria Preventive Therapy", + "options": [ + { + "key": "ipt2", + "text": "IPT2", + "openmrs_entity_id": "ipt2", + "openmrs_entity": "concept" + }, + { + "key": "medication_not_given", + "text": "Malaria preventive therapy not given", + "openmrs_entity_id": "medication_not_given", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Please select the medication for Malaria Preventive Therapy" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "malaria_preventive_therapy_ipt3", + "type": "native_radio", + "openmrs_entity_id": "malaria_preventive_therapy_ipt3", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Malaria Preventive Therapy", + "options": [ + { + "key": "ipt3", + "text": "IPT3", + "openmrs_entity_id": "ipt3", + "openmrs_entity": "concept" + }, + { + "key": "medication_not_given", + "text": "Malaria preventive therapy not given", + "openmrs_entity_id": "medication_not_given", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Please select the medication for Malaria Preventive Therapy" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "malaria_preventive_therapy_ipt4", + "type": "native_radio", + "openmrs_entity_id": "malaria_preventive_therapy_ipt4", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Malaria Preventive Therapy", + "options": [ + { + "key": "ipt4", + "text": "IPT4", + "openmrs_entity_id": "ipt4", + "openmrs_entity": "concept" + }, + { + "key": "medication_not_given", + "text": "Malaria preventive therapy not given", + "openmrs_entity_id": "medication_not_given", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": "true", + "err": "Please select the medication for Malaria Preventive Therapy" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_giving_malaria_medication", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_malaria_medication", + "type": "spinner", + "hint": "Reason as to why the Malaria medication was not given", + "values": [ + "Out of stock", + "The client did not agree to take the medication", + "The client is allergic to medication", + "Other (Specify)" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "other_reason_malaria_medication_not_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_malaria_medication_not_given", + "type": "edit_text", + "hint": "Specify other reasons for not giving the Malaria medication", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_giving_malaria_medication": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "llin_provision", + "type": "native_radio", + "openmrs_entity_id": "llin_provision", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Was the client provided with LLINs(Long lasting insecticidal nets)?", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_malaria_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_providing_llin", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_llin", + "type": "spinner", + "hint": "Reason as to why the client was not provided with LLINs", + "values": [ + "Out of stock", + "The client refused", + "Other (Specify)" + ], + "keys": [ + "out_of_stock", + "the_client_refused", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "the_client_refused": "the_client_refused", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:llin_provision": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_llin_not_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_llin_not_given", + "type": "edit_text", + "hint": "Specify other reasons for not providing the LLINs", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_providing_llin": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "malaria_investigation_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "malaria_investigation_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_rv_pharmacy.json b/opensrp-chw-hf/src/main/assets/json.form/anc_rv_pharmacy.json new file mode 100644 index 000000000..432199f6e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_rv_pharmacy.json @@ -0,0 +1,305 @@ +{ + "count": "1", + "encounter_type": "Medication and Supplements", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Medication and Supplements", + "fields": [ + { + "key": "pharmacy", + "type": "label", + "text": "Prescribe and issue supplements and prophylactic medications", + "text_color": "#000000", + "openmrs_entity": "", + "openmrs_entity_id": "", + "openmrs_entity_parent": "" + }, + { + "key": "iron_folate_supplements", + "type": "native_radio", + "label": "Iron and Folate Supplement", + "openmrs_entity_id": "iron_folate_supplements", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "text": "FeFo", + "key": "FeFo", + "openmrs_entity": "concept", + "openmrs_entity_id": "FeFo" + }, + { + "text": "Folic Acid", + "key": "folic", + "openmrs_entity": "concept", + "openmrs_entity_id": "folic" + }, + { + "text": "Medication not given", + "key": "medication_not_given", + "openmrs_entity": "concept", + "openmrs_entity_id": "medication_not_given" + } + ] + }, + { + "key": "reason_for_giving_folic_acid", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_giving_folic_acid", + "type": "spinner", + "hint": "Reason as to why Folic Acid was given instead of FEFO", + "values": [ + "Out of stock", + "Sickle Cell", + "Other (Specify)" + ], + "keys": [ + "out_of_stock", + "sickle_cell", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "sickle_cell": "sickle_cell", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:iron_folate_supplements": { + "type": "string", + "ex": "equalTo(., \"folic\")" + } + } + }, + { + "key": "other_reason_for_giving_folic_acid", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_giving_folic_acid", + "type": "edit_text", + "hint": "Specify other reasons for giving Folic Acid medication", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_giving_folic_acid": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "reason_for_not_giving_iron_folate_supplements", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_iron_folate_supplements", + "type": "spinner", + "hint": "Reason as to why Iron and Folate Supplement was not given", + "values": [ + "Out of stock", + "The client did not agree to take the medication", + "The client is allergic to medication", + "Other (Specify)" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:iron_folate_supplements": { + "type": "string", + "ex": "equalTo(., \"medication_not_given\")" + } + } + }, + { + "key": "other_reason_fefo_medication_not_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_fefo_medication_not_given", + "type": "edit_text", + "hint": "Specify other reasons for not giving FEFO medication", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_giving_iron_folate_supplements": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "deworming", + "type": "check_box", + "label": "Deworming", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "deworming", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "mebendazole", + "albendazole", + "medication_not_given" + ], + "options": [ + { + "text": "Mebendazole(500Mg)", + "key": "mebendazole", + "openmrs_entity": "concept", + "openmrs_entity_id": "mebendazole" + }, + { + "text": "Albendazole(400Mg)", + "key": "albendazole", + "openmrs_entity": "concept", + "openmrs_entity_id": "albendazole" + }, + { + "text": "Deworming medication not given", + "key": "medication_not_given", + "openmrs_entity": "concept", + "openmrs_entity_id": "medication_not_given" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_pharmacy_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_giving_deworming_medication", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_deworming_medication", + "type": "spinner", + "hint": "Reason as to why the Deworming medication was not given", + "values": [ + "Out of stock", + "The client did not agree to take the medication", + "The client is allergic to medication", + "Other (Specify)" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:deworming": { + "ex-checkbox": [ + { + "or": [ + "medication_not_given" + ] + } + ] + } + } + }, + { + "key": "other_reason_deworming_medication_not_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_deworming_medication_not_given", + "type": "edit_text", + "hint": "Specify other reasons for not giving the Deworming medication", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_giving_deworming_medication": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "pharmacy_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "pharmacy_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_rv_pregnancy_status.json b/opensrp-chw-hf/src/main/assets/json.form/anc_rv_pregnancy_status.json new file mode 100644 index 000000000..c804cc3b3 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_rv_pregnancy_status.json @@ -0,0 +1,188 @@ +{ + "count": "1", + "encounter_type": "Pregnancy Status", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Pregnancy Status", + "fields": [ + { + "key": "pregnancy_status", + "type": "native_radio", + "label": "Pregnancy Status", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnancy_status", + "openmrs_entity_parent": "", + "options": [ + { + "key": "viable", + "text": "Viable", + "openmrs_entity": "concept", + "openmrs_entity_id": "viable" + }, + { + "key": "spontaneous_abortion", + "text": "Spontaneous Abortion", + "openmrs_entity": "concept", + "openmrs_entity_id": "spontaneous_abortion" + }, + { + "key": "intrauterine_fetal_death", + "text": "Intrauterine Fetal Death (Still Birth)", + "openmrs_entity": "concept", + "openmrs_entity_id": "intrauterine_fetal_death" + } + ] + }, + { + "key": "reg_cpac", + "type": "toaster_notes", + "text": "Provide comprehensive post-abortal care (cPAC) according to standard guidelines", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:pregnancy_status": { + "type": "string", + "ex": "equalTo(.,\"spontaneous_abortion\")" + } + } + }, + { + "key": "still_birth", + "type": "toaster_notes", + "text": "Manage the client according to Standard Guidelines and counsel the client on appropriate Family Planning methods", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:pregnancy_status": { + "type": "string", + "ex": "equalTo(.,\"intrauterine_fetal_death\")" + } + } + }, + { + "key": "pregnancy_status_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnancy_status_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + }, + { + "key": "delivery_place", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_place", + "openmrs_data_type": "select one", + "type": "spinner", + "hint": "The place the mother gave birth", + "values": [ + "At a health facility", + "Birth before Arrival (BBA)", + "At home", + "Traditional birth attendant" + ], + "keys": [ + "At a health facility", + "Birth before Arrival (BBA)", + "At home", + "Traditional birth attendant" + ], + "openmrs_choice_ids": { + "At a health facility": "At a health facility", + "Birth before Arrival (BBA)": "Birth before Arrival (BBA)", + "At home": "At home", + "Traditional birth attendant": "Traditional birth attendant" + }, + "v_required": { + "value": "true", + "err": "Please select one option" + }, + "relevance": { + "step1:pregnancy_status": { + "type": "string", + "ex": "equalTo(.,\"intrauterine_fetal_death\")" + } + } + }, + { + "key": "delivery_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_date", + "type": "date_picker", + "hint": "Delivery Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "relevance": { + "step1:pregnancy_status": { + "type": "string", + "ex": "equalTo(.,\"intrauterine_fetal_death\")" + } + }, + "v_required": { + "value": "true", + "err": "Please select the delivery date" + } + }, + { + "key": "preg_outcome", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "type": "hidden", + "openmrs_entity_id": "preg_outcome", + "value": "still_born", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_pregnancy_status_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/anc_rv_triage.json b/opensrp-chw-hf/src/main/assets/json.form/anc_rv_triage.json new file mode 100644 index 000000000..78e4a512c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/anc_rv_triage.json @@ -0,0 +1,389 @@ +{ + "count": "1", + "encounter_type": "Triage", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Triage", + "fields": [ + { + "key": "gest_age", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gest_age", + "hint": "Gestational Age (GA) in Weeks", + "type": "edit_text", + "editable": true, + "read_only": true + }, + { + "key": "edd", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "edd", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_triage_calculation.yml" + } + } + } + }, + { + "key": "last_menstrual_period", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_menstrual_period", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_triage_calculation.yml" + } + } + } + }, + { + "key": "rapid_examination", + "type": "check_box", + "label": "Assess general condition of the woman immediately on arrival at antenatal clinic", + "combine_checkbox_option_values": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "rapid_examination", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "facial_expression", + "text": "Facial Expression (pain expression)", + "openmrs_entity": "concept", + "openmrs_entity_id": "facial_expression" + }, + { + "key": "pallor", + "text": "Pallor", + "openmrs_entity": "concept", + "openmrs_entity_id": "pallor" + }, + { + "key": "sweating", + "text": "Sweating", + "openmrs_entity": "concept", + "openmrs_entity_id": "sweating" + }, + { + "key": "shivering", + "text": "Shivering", + "openmrs_entity": "concept", + "openmrs_entity_id": "shivering" + }, + { + "key": "difficulty_in_breathing", + "text": "Difficulty in breathing", + "openmrs_entity": "concept", + "openmrs_entity_id": "difficulty_in_breathing" + }, + { + "key": "none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ] + }, + { + "key": "prompt_for_rapid_examination", + "type": "toaster_notes", + "openmrs_entity": "concept", + "openmrs_entity_id": "prompt_for_rapid_examination", + "openmrs_entity_parent": "", + "text": "Provide supportive care and refer the client for advanced emergency care", + "toaster_type": "problem", + "relevance": { + "step1:rapid_examination": { + "ex-checkbox": [ + { + "or": [ + "pallor", + "sweating", + "shivering", + "difficulty_in_breathing", + "facial_expression" + ] + } + ] + } + } + }, + { + "key": "reasons_to_clinic", + "type": "native_radio", + "label": "Why did you come to the clinic today?", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_to_clinic", + "openmrs_entity_parent": "", + "options": [ + { + "text": "Routine Scheduled Visit", + "key": "routine_visit", + "openmrs_entity": "concept", + "openmrs_entity_id": "routine_visit" + }, + { + "text": "Sick/Concerned", + "key": "sick_concerned", + "openmrs_entity": "concept", + "openmrs_entity_id": "sick_concerned" + } + ] + }, + { + "key": "client_concern", + "type": "edit_text", + "edit_type": "text", + "hint": "What is your concern?", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_concern", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_triage_relevance.yml" + } + } + } + }, + { + "key": "danger_signs", + "type": "check_box", + "label": "Ask, look, and feel if the woman is/has: ", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "danger_signs", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "bleeding_vag", + "text": "Bleeding Vaginally", + "openmrs_entity": "concept", + "openmrs_entity_id": "bleeding_vag" + }, + { + "key": "headache_visual_disturbance", + "text": "Headache and Visual Disturbance", + "openmrs_entity": "concept", + "openmrs_entity_id": "headache_visual_disturbance" + }, + { + "key": "severely_pale", + "text": "Severely Pale", + "openmrs_entity": "concept", + "openmrs_entity_id": "severely_pale" + }, + { + "key": "severe_vomiting", + "text": "Severe Vomiting", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_vomiting" + }, + { + "key": "convulsion", + "text": "Convulsion", + "openmrs_entity": "concept", + "openmrs_entity_id": "convulsion" + }, + { + "key": "looking_very_ill", + "text": "Looking Very Ill (lethargic, drowsy)", + "openmrs_entity": "concept", + "openmrs_entity_id": "looking_very_ill" + }, + { + "key": "fever", + "text": "A Fever", + "openmrs_entity": "concept", + "openmrs_entity_id": "fever" + }, + { + "key": "unconscious", + "text": "Unconscious", + "openmrs_entity": "concept", + "openmrs_entity_id": "unconscious" + }, + { + "key": "severe_pain", + "text": "Severe Pain", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_pain" + }, + { + "key": "severe_breathing_difficulty", + "text": "Severe Breathing Difficulty", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_breathing_difficulty" + }, + { + "key": "in_labour", + "text": "In Labour", + "openmrs_entity": "concept", + "openmrs_entity_id": "in_labour" + }, + { + "key": "imminent_labour", + "text": "Imminent Labour", + "openmrs_entity": "concept", + "openmrs_entity_id": "imminent_labour" + }, + { + "key": "reduced_fetal_movement", + "text": "Reduced or no fetal movement", + "openmrs_entity": "concept", + "openmrs_entity_id": "reduced_fetal_movement" + }, + { + "key": "sacrum_oedema", + "text": "Oedema of the face and sacrum", + "openmrs_entity": "concept", + "openmrs_entity_id": "sacrum_oedema" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + }, + { + "key": "none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ] + }, + { + "key": "is_emergency", + "type": "toaster_notes", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_emergency", + "openmrs_entity_parent": "", + "text": "Provide emergency care to the client", + "toaster_type": "problem", + "toaster_info": "The client exhibits one or more of the emergency signs and needs emergency care", + "relevance": { + "step1:danger_signs": { + "ex-checkbox": [ + { + "or": [ + "bleeding_vag", + "headache_visual_disturbance", + "severely_pale", + "severe_vomiting", + "severe_breathing_difficulty", + "convulsion", + "looking_very_ill", + "fever", + "unconscious", + "severe_pain", + "in_labour", + "imminent_labour", + "reduced_fetal_movement", + "sacrum_oedema" + ] + } + ] + } + } + }, + { + "key": "other_danger_signs", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_danger_signs", + "type": "edit_text", + "hint": "Other danger sign(s)", + "v_required": { + "value": "true", + "err": "Please specify the other danger sign(s)" + }, + "relevance": { + "step1:danger_signs": { + "ex-checkbox": [ + { + "or": [ + "other" + ] + } + ] + } + } + }, + { + "key": "visit_number", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "anc_rv_triage_calculation.yml" + } + } + } + }, + { + "key": "triage_completion_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "triage_completion_status", + "openmrs_entity_parent": "", + "value": "pending" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/birth_certification.json b/opensrp-chw-hf/src/main/assets/json.form/birth_certification.json index 7ec9b260d..568a5487a 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/birth_certification.json +++ b/opensrp-chw-hf/src/main/assets/json.form/birth_certification.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/cdp_condom_distribution_outside.json b/opensrp-chw-hf/src/main/assets/json.form/cdp_condom_distribution_outside.json new file mode 100644 index 000000000..16e368301 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/cdp_condom_distribution_outside.json @@ -0,0 +1,488 @@ +{ + "count": "1", + "encounter_type": "CDP Distribution Outside Facility", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Condom Distribution", + "fields": [ + { + "key": "number_of_condoms_available", + "type": "toaster_notes", + "text": "", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info" + }, + { + "key": "condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_brand", + "label": "Select condom brand", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "public_sc", + "text": "Public sector condom", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "public_sc" + }, + { + "key": "dume", + "text": "Dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "dume" + }, + { + "key": "salama", + "text": "Salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "salama" + }, + { + "key": "familia", + "text": "Familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "familia" + }, + { + "key": "others", + "text": "Others", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + } + ], + "v_required": { + "value": "true", + "err": "Please select the condom brand" + } + }, + { + "key": "male_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condom_brand", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + }, + { + "key": "female_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condom_brand", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + }, + { + "key": "other_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_condom_brand", + "type": "edit_text", + "hint": "Other condom brand", + "v_required": { + "value": "true", + "err": "Please enter the other condom brand" + }, + "relevance": { + "step1:condom_brand": { + "type": "string", + "ex": "equalTo(., \"others\")" + } + } + }, + { + "key": "condom_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + }, + { + "key": "provided_male_condoms_public_sc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_public_sc", + "type": "edit_text", + "hint": "Number of male condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_public_sc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_public_sc", + "type": "edit_text", + "hint": "Number of female condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_dume", + "type": "edit_text", + "hint": "Number of male condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_dume", + "type": "edit_text", + "hint": "Number of female condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_salama", + "type": "edit_text", + "hint": "Number of male condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_salama", + "type": "edit_text", + "hint": "Number of female condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_familia", + "type": "edit_text", + "hint": "Number of male condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_familia", + "type": "edit_text", + "hint": "Number of female condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_other", + "type": "edit_text", + "hint": "Number of male condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_other", + "type": "hidden", + "hint": "Number of female condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms_offset", + "type": "hidden", + "hint": "Number of male condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + }, + { + "key": "provided_female_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms_offset", + "type": "hidden", + "hint": "Number of female condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + }, + { + "key": "quantity_response", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "quantity_response", + "type": "hidden", + "hint": "Number of condoms distributed (Pieces)", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + }, + { + "key": "stock_event_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "stock_event_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + }, + { + "key": "condom_restock_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_restock_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/cdp_condom_distribution_within.json b/opensrp-chw-hf/src/main/assets/json.form/cdp_condom_distribution_within.json new file mode 100644 index 000000000..8882d0983 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/cdp_condom_distribution_within.json @@ -0,0 +1,657 @@ +{ + "count": "1", + "encounter_type": "CDP Distribution Within Facility", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Condom Distribution", + "fields": [ + { + "key": "condom_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_type", + "label": "Select condom type", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "male_condom", + "text": "Male", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condom" + }, + { + "key": "female_condom", + "text": "Female", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condom" + } + ], + "v_required": { + "value": "true", + "err": "Please select the condom type" + } + }, + { + "key": "number_of_condoms_available", + "type": "toaster_notes", + "text": "", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info" + }, + { + "key": "condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_brand", + "label": "Select condom brand", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "public_sc", + "text": "Public sector condom", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "public_sc" + }, + { + "key": "dume", + "text": "Dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "dume" + }, + { + "key": "salama", + "text": "Salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "salama" + }, + { + "key": "familia", + "text": "Familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "familia" + }, + { + "key": "others", + "text": "Others", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + } + ], + "v_required": { + "value": "true", + "err": "Please select the condom brand" + } + }, + { + "key": "male_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condom_brand", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "female_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condom_brand", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "other_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_condom_brand", + "type": "edit_text", + "hint": "Other condom brand", + "v_required": { + "value": "true", + "err": "Please enter the other condom brand" + }, + "relevance": { + "step1:condom_brand": { + "type": "string", + "ex": "equalTo(., \"others\")" + } + } + }, + { + "key": "provided_male_condoms_public_sc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_public_sc", + "type": "edit_text", + "hint": "Number of male condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_public_sc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_public_sc", + "type": "edit_text", + "hint": "Number of female condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_dume", + "type": "edit_text", + "hint": "Number of male condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_dume", + "type": "edit_text", + "hint": "Number of female condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_salama", + "type": "edit_text", + "hint": "Number of male condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_salama", + "type": "edit_text", + "hint": "Number of female condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_familia", + "type": "edit_text", + "hint": "Number of male condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_familia", + "type": "edit_text", + "hint": "Number of female condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms_other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_male_condoms_other", + "type": "edit_text", + "hint": "Number of male condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_female_condoms_other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_female_condoms_other", + "type": "hidden", + "hint": "Number of female condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_relevance.yml" + } + } + } + }, + { + "key": "provided_male_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms_offset", + "type": "hidden", + "hint": "Number of male condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "provided_female_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms_offset", + "type": "hidden", + "hint": "Number of female condoms distributed (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "quantity_response", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "quantity_response", + "type": "hidden", + "hint": "Number of condoms distributed (Pieces)", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "stock_event_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "stock_event_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "condom_restock_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_restock_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "condom_restock_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_restock_date", + "type": "date_picker", + "hint": "Condom distribution date", + "expanded": false, + "min_date": "today-1m", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the distribution date" + } + }, + { + "key": "stock_event_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "stock_event_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_distribution_within_calculation.yml" + } + } + } + }, + { + "key": "point_of_service", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "point_of_service", + "label": "Select point of service", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "ctc", + "text": "CTC", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc" + }, + { + "key": "rch_clinic", + "text": "RCH Clinic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rch_clinic" + }, + { + "key": "opd", + "text": "OPD", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "opd" + }, + { + "key": "tb_clinic", + "text": "TB Clinic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tb_clinic" + }, + { + "key": "outreach", + "text": "Outreach", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "outreach" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Please select the point of service" + } + }, + { + "key": "other_pos", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_pos", + "type": "edit_text", + "hint": "Other point of service", + "v_required": { + "value": "true", + "err": "Please enter the other condom brand" + }, + "relevance": { + "step1:point_of_service": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "distributing_person_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "distributing_person_name", + "type": "edit_text", + "hint": "Distributing person's name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the name" + } + }, + { + "key": "distributing_person_position", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "distributing_person_position", + "type": "edit_text", + "hint": "Distributing person's position", + "v_required": { + "value": "true", + "err": "Please enter the position" + } + }, + { + "key": "distributing_person_phone", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "distributing_person_phone", + "type": "edit_text", + "hint": "Distributing person's phone number", + "edit_type": "number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + }, + "v_required": { + "value": "true", + "err": "Please enter the phone number" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/cdp_facility_order_form.json b/opensrp-chw-hf/src/main/assets/json.form/cdp_facility_order_form.json new file mode 100644 index 000000000..9569a4274 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/cdp_facility_order_form.json @@ -0,0 +1,160 @@ +{ + "count": "1", + "encounter_type": "CDP Order From Facility", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Request Condoms", + "fields": [ + { + "key": "condom_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_type", + "label": "Select condom type", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "male_condom", + "text": "Male", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condom" + }, + { + "key": "female_condom", + "text": "Female", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condom" + } + ], + "v_required": { + "value": "true", + "err": "Please select the condom type" + } + }, + { + "key": "other_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_condom_brand", + "type": "edit_text", + "hint": "Other condom brand", + "v_required": { + "value": "true", + "err": "Please enter the other condom brand" + }, + "relevance": { + "step1:condom_brand": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "requested_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "requested_condoms", + "type": "edit_text", + "hint": "Number of condoms ordered (Pieces)", + "edit_type": "number", + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "v_numeric": { + "value": "true", + "err":"Please enter the number" + } + }, + { + "key": "receiving_order_facility", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receiving_order_facility", + "buttonText": "Select Facility", + "sort": true, + "maxSelectable": 1, + "dialogTitle": "Choose Health Facility Receiving Order", + "searchHint": "Type Health Facility Name", + "options": [ + ], + "type": "multi_select_list", + "v_required": { + "value": true, + "err": "Please select the health facility" + } + }, + { + "key": "request_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "request_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_order_calculation.yml" + } + } + } + }, + { + "key": "condom_order_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_order_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_condom_order_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/cdp_receive_condom_facility.json b/opensrp-chw-hf/src/main/assets/json.form/cdp_receive_condom_facility.json new file mode 100644 index 000000000..c3ed3f735 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/cdp_receive_condom_facility.json @@ -0,0 +1,211 @@ +{ + "count": "1", + "encounter_type": "CDP Receive From Facility", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Receive Condom from Facility", + "fields": [ + { + "key": "condom_receive_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_receive_date", + "type": "date_picker", + "hint": "Condom receive date", + "expanded": false, + "min_date": "today-1m", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the receiving date" + } + }, + { + "key": "receiving_person_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receiving_person_name", + "type": "edit_text", + "hint": "Condom receiving person's name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the name" + } + }, + { + "key": "receiving_person_position", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receiving_person_position", + "type": "edit_text", + "hint": "Condom receiving person's position", + "v_required": { + "value": "true", + "err": "Please enter the position" + } + }, + { + "key": "receiving_person_phone", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receiving_person_phone", + "type": "edit_text", + "hint": "Condom receiving person's phone number", + "edit_type": "number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + }, + "v_required": { + "value": "true", + "err": "Please enter the phone number" + } + }, + { + "key": "condom_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_receive_condom_calculation.yml" + } + } + } + }, + { + "key": "provided_male_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms_offset", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_receive_condom_calculation.yml" + } + } + } + }, + { + "key": "provided_female_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms_offset", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_receive_condom_calculation.yml" + } + } + } + }, + { + "key": "batch_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "batch_number", + "type": "edit_text", + "hint": "Batch Number", + "v_required": { + "value": "true", + "err": "Please enter the batch number" + } + }, + { + "key": "expiry_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "expiry_date", + "type": "date_picker", + "hint": "Expiry Date", + "expanded": false, + "min_date": "today", + "v_required": { + "value": true, + "err": "Expiry date is required" + } + }, + { + "key": "stock_event_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "stock_event_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_receive_condom_calculation.yml" + } + } + } + }, + { + "key": "condom_restock_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_restock_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_receive_condom_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/cdp_receive_condom_from_organizations.json b/opensrp-chw-hf/src/main/assets/json.form/cdp_receive_condom_from_organizations.json new file mode 100644 index 000000000..031371a71 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/cdp_receive_condom_from_organizations.json @@ -0,0 +1,523 @@ +{ + "count": "1", + "encounter_type": "CDP Restock", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Receive Condom from Organizations", + "fields": [ + { + "key": "condom_receive_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_receive_date", + "type": "date_picker", + "hint": "Condom receive date", + "expanded": false, + "min_date": "today-1m", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the receiving date" + } + }, + { + "key": "condom_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_type", + "type": "check_box", + "label": "Select condom type", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "male_condom", + "text": "Male", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condom" + }, + { + "key": "female_condom", + "text": "Female", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condom" + } + ], + "v_required": { + "value": "true", + "err": "Please select the condom type" + } + }, + { + "key": "male_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condom_brand", + "label": "Select the Male condom brand", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "public_sc", + "text": "Public sector condom", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "public_sc" + }, + { + "key": "dume", + "text": "Dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "dume" + }, + { + "key": "salama", + "text": "Salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "salama" + }, + { + "key": "familia", + "text": "Familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "familia" + }, + { + "key": "other", + "text": "Other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Please select the condom brand" + }, + "relevance": { + "step1:condom_type": { + "ex-checkbox": [ + { + "or": [ + "male_condom" + ] + } + ] + } + } + }, + { + "key": "other_male_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_male_condom_brand", + "type": "edit_text", + "hint": "Other condom brand", + "v_required": { + "value": "true", + "err": "Please enter the brand" + }, + "relevance": { + "step1:male_condom_brand": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "restocked_male_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms_offset", + "type": "edit_text", + "hint": "Number of restocked Male condoms (Pieces)", + "edit_type": "number", + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "v_numeric": { + "value": "true", + "err":"Please enter the number" + }, + "relevance": { + "step1:condom_type": { + "ex-checkbox": [ + { + "or": [ + "male_condom" + ] + } + ] + } + } + }, + { + "key": "female_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condom_brand", + "label": "Select the Female condom brand", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "public_sc", + "text": "Public sector condom", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "public_sc" + }, + { + "key": "dume", + "text": "Dume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "dume" + }, + { + "key": "salama", + "text": "Salama", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "salama" + }, + { + "key": "familia", + "text": "Familia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "familia" + }, + { + "key": "other", + "text": "Other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Please select the condom brand" + }, + "relevance": { + "step1:condom_type": { + "ex-checkbox": [ + { + "or": [ + "female_condom" + ] + } + ] + } + } + }, + { + "key": "other_female_condom_brand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_female_condom_brand", + "type": "edit_text", + "hint": "Other condom brand", + "v_required": { + "value": "true", + "err": "Please enter the brand" + }, + "relevance": { + "step1:female_condom_brand": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "restocked_female_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms_offset", + "type": "edit_text", + "hint": "Number of restocked Female condoms (Pieces)", + "edit_type": "number", + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "v_numeric": { + "value": "true", + "err":"Please enter the number" + }, + "relevance": { + "step1:condom_type": { + "ex-checkbox": [ + { + "or": [ + "female_condom" + ] + } + ] + } + } + }, + { + "key": "issuing_organization", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "issuing_organization", + "label": "Select issuing organization", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "MSD", + "text": "MSD", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "MSD" + }, + { + "key": "PSI", + "text": "PSI", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "PSI" + }, + { + "key": "T-MARC", + "text": "T-MARC", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "T-MARC" + }, + { + "key": "other", + "text": "Other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Please select the organization" + } + }, + { + "key": "other_issuing_organization", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_issuing_organization", + "type": "edit_text", + "hint": "Other issuing organization", + "v_required": { + "value": "true", + "err": "Please enter the name" + }, + "relevance": { + "step1:issuing_organization": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "batch_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "batch_number", + "type": "edit_text", + "hint": "Batch Number", + "v_required": { + "value": "true", + "err": "Please enter the batch number" + } + }, + { + "key": "expiry_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "expiry_date", + "type": "date_picker", + "hint": "Expiry Date", + "expanded": false, + "min_date": "today", + "v_required": { + "value": true, + "err": "Expiry date is required" + } + }, + { + "key": "delivering_person_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivering_person_name", + "type": "edit_text", + "hint": "Condom delivering person's name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the name" + } + }, + { + "key": "delivering_person_position", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivering_person_position", + "type": "edit_text", + "hint": "Condom delivering person's position", + "v_required": { + "value": "true", + "err": "Please enter the position" + } + }, + { + "key": "delivering_person_phone", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivering_person_phone", + "type": "edit_text", + "hint": "Condom delivering person's phone number", + "edit_type": "number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + }, + "v_required": { + "value": "true", + "err": "Please enter the phone number" + } + }, + { + "key": "receiving_person_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receiving_person_name", + "type": "edit_text", + "hint": "Condom receiving person's name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the name" + } + }, + { + "key": "receiving_person_position", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receiving_person_position", + "type": "edit_text", + "hint": "Condom receiving person's position", + "v_required": { + "value": "true", + "err": "Please enter the position" + } + }, + { + "key": "receiving_person_phone", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receiving_person_phone", + "type": "edit_text", + "hint": "Condom receiving person's phone number", + "edit_type": "number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + }, + "v_required": { + "value": "true", + "err": "Please enter the phone number" + } + }, + { + "key": "stock_event_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "stock_event_type", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_receive_condom_msd_calculation.yml" + } + } + } + }, + { + "key": "condom_restock_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_restock_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "cdp_receive_condom_msd_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/child_enrollment.json b/opensrp-chw-hf/src/main/assets/json.form/child_enrollment.json index d43ddb333..e6a135991 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/child_enrollment.json +++ b/opensrp-chw-hf/src/main/assets/json.form/child_enrollment.json @@ -16,11 +16,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -54,35 +49,14 @@ "step1": { "title": "Add Child Under 5", "fields": [ - { - "key": "sync_location_id", - "openmrs_entity_parent": "", - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "sync_location_id", - "type": "spinner", - "hint": "Select CHW Location", - "v_required": { - "value": "true", - "err": "Please select CHW Location" - } - }, - { - "key": "photo", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "", - "type": "choose_image", - "uploadButtonText": "Take a picture of the person" - }, { "key": "unique_id", "openmrs_entity_parent": "", "openmrs_entity": "person_identifier", "openmrs_entity_id": "opensrp_id", - "type": "barcode", - "barcode_type": "qrcode", - "hint": "Boresha Afya ID", - "scanButtonText": "Scan QR Code", + "type": "edit_text", + "read_only": true, + "hint": "Kituoni ID", "v_numeric": { "value": "true", "err": "Please enter a valid ID" @@ -101,7 +75,7 @@ "hint": "Surname", "edit_type": "name", "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", "err": "Please enter a valid name" }, "v_required": { @@ -174,7 +148,7 @@ "err": "Please enter first name" }, "v_regex": { - "value": "[A-Za-z\\s\\-]*", + "value": "[A-Za-z\\s\\-\\']*", "err": "Please enter a valid name" } }, @@ -193,7 +167,7 @@ "err": "Please enter middle name" }, "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", "err": "Please Enter a Valid Name" } }, @@ -237,7 +211,14 @@ "text_size": "18px", "value": "false" } - ] + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family-child-relevance.yml" + } + } + } }, { "key": "age", @@ -278,9 +259,9 @@ "type": "spinner", "hint": "Health insurance provider", "values": [ - "Community Health Fund (CHF)", - "iCHF", + "Community Health Fund (CHF)/(iCHF)", "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", "Tiba Kwa Kadi (TIKA)", "AAR Healthcare", "Strategies Insurance", @@ -294,8 +275,8 @@ ], "keys": [ "Community Health Fund (CHF)", - "iCHF", "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", "Tiba Kwa Kadi (TIKA)", "AAR Healthcare", "Strategies Insurance", @@ -309,8 +290,8 @@ ], "openmrs_choice_ids": { "Community Health Fund (CHF)": "Community_Health_Fund", - "iCHF": "iCHF", "National Social Security Fund - Social Health Insurance Benefit (SHIB)": "National_Social_Security_Fund", + "National Health Insurance Fund (NHIF)": "National_Health_Insurance_Fund", "Tiba Kwa Kadi (TIKA)": "Tiba_kwa_Kadi", "AAR Healthcare": "AAR_Healthcare", "AAR Strategies Insurance": "Strategies_Insurance", @@ -389,7 +370,7 @@ "key": "disabilities", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "162558AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "disabilities", "type": "spinner", "hint": "Physical disabilities", "values": [ @@ -401,8 +382,8 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" }, "v_required": { "value": "true", @@ -413,10 +394,62 @@ "key": "type_of_disability", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "edit_type": "name", - "hint": "Type of physical disabilities", + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "label": "Type of physical disabilities", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Mobility and Physical Impairments", + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Spinal Cord Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Head Injuries - Brain Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Vision Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Hearing Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Cognitive or Learning Disabilities", + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Psychological Disorders", + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Invisible Disabilities", + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], "relevance": { "rules-engine": { "ex-rules": { @@ -426,14 +459,14 @@ }, "v_required": { "value": true, - "err": "Please enter type of physical disabilities" + "err": "Please select the type of physical disabilities" } }, { "key": "birth_cert_available", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "165406AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "birth_cert_available", "type": "spinner", "hint": "Birth registration/certificate", "values": [ @@ -445,15 +478,22 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family-child-relevance.yml" + } + } } }, { "key": "birth_regist_number", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "162052AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "birth_regist_number", "type": "edit_text", "hint": "Birth registration number", "relevance": { @@ -468,7 +508,7 @@ "key": "rhc_card", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "164147AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "rhc_card", "type": "spinner", "hint": "Does the child have RCH card 1/child growth booklet?", "values": [ @@ -480,15 +520,15 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" } }, { "key": "nutrition_status", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "163301AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "nutrition_status", "type": "spinner", "hint": "Nutrition status", "values": [ @@ -502,9 +542,9 @@ "Red" ], "openmrs_choice_ids": { - "Green": "160909AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "Grey": "163639AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "Red": "127778AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Green": "Green", + "Grey": "Grey", + "Red": "Red" }, "v_required": { "value": "true", diff --git a/opensrp-chw-hf/src/main/assets/json.form/child_hv_deworming.json b/opensrp-chw-hf/src/main/assets/json.form/child_hv_deworming.json index d9b992c42..a93986677 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/child_hv_deworming.json +++ b/opensrp-chw-hf/src/main/assets/json.form/child_hv_deworming.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/child_hv_vaccine_card_received.json b/opensrp-chw-hf/src/main/assets/json.form/child_hv_vaccine_card_received.json index d919375b1..19e68a3ce 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/child_hv_vaccine_card_received.json +++ b/opensrp-chw-hf/src/main/assets/json.form/child_hv_vaccine_card_received.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/child_hv_vitamin_a.json b/opensrp-chw-hf/src/main/assets/json.form/child_hv_vitamin_a.json index 589d44171..890cde9ab 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/child_hv_vitamin_a.json +++ b/opensrp-chw-hf/src/main/assets/json.form/child_hv_vitamin_a.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/child_sick_form.json b/opensrp-chw-hf/src/main/assets/json.form/child_sick_form.json index 685882890..2b72a5ee3 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/child_sick_form.json +++ b/opensrp-chw-hf/src/main/assets/json.form/child_sick_form.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -206,32 +201,27 @@ { "key": "Bloody_diarrhoea", "openmrs_choice_id": "138868AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Bloody diarrhoea", - "value": false + "text": "Bloody diarrhoea" }, { "key": "Fever", "openmrs_choice_id": "140238AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Fever", - "value": false + "text": "Fever" }, { "key": "Vomiting", "openmrs_choice_id": "122983AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Vomiting", - "value": false + "text": "Vomiting" }, { "key": "Other", "openmrs_choice_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Other", - "value": false + "text": "Other" }, { "key": "None", "openmrs_choice_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "None", - "value": false + "text": "None" } ], "exclusive": [ @@ -356,32 +346,27 @@ { "key": "ORS_solution", "openmrs_choice_id": "351AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "ORS solution", - "value": false + "text": "ORS solution" }, { "key": "IV_infusion_drip", "openmrs_choice_id": "162651AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "IV infusion (drip)", - "value": false + "text": "IV infusion (drip)" }, { "key": "Zinc", "openmrs_choice_id": "86672AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Zinc", - "value": false + "text": "Zinc" }, { "key": "Other_treatments", "openmrs_choice_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Other treatments", - "value": false + "text": "Other treatments" }, { "key": "None", "openmrs_choice_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "None", - "value": false + "text": "None" } ], "exclusive": [ @@ -471,20 +456,17 @@ { "key": "ORS_Packs", "openmrs_choice_id": "351AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "ORS Packs", - "value": false + "text": "ORS Packs" }, { "key": "Zinc_pills", "openmrs_choice_id": "86672AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Zinc (pills)", - "value": false + "text": "Zinc (pills)" }, { "key": "Other_drugs", "openmrs_choice_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "text": "Other drugs", - "value": false + "text": "Other drugs" } ], "relevance": { diff --git a/opensrp-chw-hf/src/main/assets/json.form/family_details_register.json b/opensrp-chw-hf/src/main/assets/json.form/family_details_register.json index cf37fb39e..5498da3ab 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/family_details_register.json +++ b/opensrp-chw-hf/src/main/assets/json.form/family_details_register.json @@ -16,11 +16,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -54,30 +49,13 @@ "step1": { "title": "Family Details", "fields": [ - { - "key": "fam_name", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "first_name", - "type": "edit_text", - "hint": "Family name", - "edit_type": "name", - "v_required": { - "value": "true", - "err": "Please enter the family name" - }, - "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Please enter a valid name" - } - }, { "key": "unique_id", "openmrs_entity_parent": "", "openmrs_entity": "person_identifier", "openmrs_entity_id": "opensrp_id", "hidden": "true", - "type": "barcode", + "type": "edit_text", "barcode_type": "qrcode", "hint": "ID *", "scanButtonText": "Scan QR Code", @@ -92,10 +70,10 @@ "openmrs_entity": "person_address", "openmrs_entity_id": "cityVillage", "type": "edit_text", - "hint": "Village/Town", + "hint": "Area name", "v_required": { "value": "true", - "err": "Please enter the village or town" + "err": "Please enter the name of area or town" } }, { @@ -107,25 +85,15 @@ "hint": "Landmark" }, { - "key": "gps", + "key": "sync_location_id", "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_data_type": "text", - "type": "gps" - }, - { - "key": "nearest_facility", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "162724AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_data_type": "text", - "type": "tree", - "hint": "Nearest health facility", - "tree": [], + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "sync_location_id", + "type": "spinner", + "hint": "Select CHW Location", "v_required": { - "value": true, - "err": "Please enter the nearest health facility" + "value": "true", + "err": "Please select CHW Location" } } ] diff --git a/opensrp-chw-hf/src/main/assets/json.form/family_details_remove_child.json b/opensrp-chw-hf/src/main/assets/json.form/family_details_remove_child.json index 2aa281f5f..0b041f686 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/family_details_remove_child.json +++ b/opensrp-chw-hf/src/main/assets/json.form/family_details_remove_child.json @@ -16,11 +16,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -114,6 +109,25 @@ "Other": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } }, + { + "key": "other_reason_for_removing_the_client", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_removing_the_client", + "type": "edit_text", + "hint": "Specify other reasons", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:remove_reason": { + "type": "string", + "ex": "equalTo(., \"Other\")" + } + } + }, { "key": "dob", "openmrs_entity_parent": "", diff --git a/opensrp-chw-hf/src/main/assets/json.form/family_details_remove_family.json b/opensrp-chw-hf/src/main/assets/json.form/family_details_remove_family.json index d9c23b6bd..1f6687eca 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/family_details_remove_family.json +++ b/opensrp-chw-hf/src/main/assets/json.form/family_details_remove_family.json @@ -16,11 +16,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/family_details_remove_member.json b/opensrp-chw-hf/src/main/assets/json.form/family_details_remove_member.json index 2176efa5c..773b656e4 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/family_details_remove_member.json +++ b/opensrp-chw-hf/src/main/assets/json.form/family_details_remove_member.json @@ -16,11 +16,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -114,6 +109,25 @@ "Other": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } }, + { + "key": "other_reason_for_removing_the_client", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_removing_the_client", + "type": "edit_text", + "hint": "Specify other reasons", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:remove_reason": { + "type": "string", + "ex": "equalTo(., \"Other\")" + } + } + }, { "key": "dob", "openmrs_entity_parent": "", diff --git a/opensrp-chw-hf/src/main/assets/json.form/family_member_register.json b/opensrp-chw-hf/src/main/assets/json.form/family_member_register.json index f4e80e3ca..7e33e4f70 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/family_member_register.json +++ b/opensrp-chw-hf/src/main/assets/json.form/family_member_register.json @@ -16,11 +16,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -54,35 +49,14 @@ "step1": { "title": "Add Family Member", "fields": [ - { - "key": "sync_location_id", - "openmrs_entity_parent": "", - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "sync_location_id", - "type": "spinner", - "hint": "Select CHW Location", - "v_required": { - "value": "true", - "err": "Please select CHW Location" - } - }, - { - "key": "photo", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "", - "type": "choose_image", - "uploadButtonText": "Take a picture of the person" - }, { "key": "unique_id", "openmrs_entity_parent": "", "openmrs_entity": "person_identifier", "openmrs_entity_id": "opensrp_id", - "type": "barcode", - "barcode_type": "qrcode", - "hint": "Boresha Afya ID", - "scanButtonText": "Scan QR Code", + "type": "edit_text", + "read_only": true, + "hint": "Kituoni ID", "v_numeric": { "value": "true", "err": "Please enter a valid ID" @@ -95,13 +69,13 @@ { "key": "surname", "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "", + "openmrs_entity": "person", + "openmrs_entity_id": "last_name", "type": "edit_text", "hint": "Surname", "edit_type": "name", "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", "err": "Please enter a valid name" }, "v_required": { @@ -172,7 +146,7 @@ "err": "Please enter the first name" }, "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", "err": "Please enter a valid name" } }, @@ -185,7 +159,7 @@ "hint": "Middle name", "edit_type": "name", "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", "err": "Please enter a valid name" }, "v_required": { @@ -246,7 +220,14 @@ "text_size": "18px", "value": "false" } - ] + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_member_relevance.yml" + } + } + } }, { "key": "age", @@ -255,6 +236,11 @@ "openmrs_entity_id": "age", "type": "edit_text", "hint": "Age", + "v_max_length": { + "value": "3", + "is_fixed_size": "true", + "err": "Please enter a valid age" + }, "v_numeric": { "value": "true", "err": "Number must begin with 0 and must be a total of 10 digits in length" @@ -279,13 +265,106 @@ "err": "Please enter the age" } }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Sex", + "values": [ + "Male", + "Female" + ], + "keys": [ + "Male", + "Female" + ], + "v_required": { + "value": "true", + "err": "Please enter the sex" + } + }, + { + "key": "marital_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "marital_status", + "type": "spinner", + "hint": "Client's Marital Status?", + "values": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "keys": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "openmrs_choice_ids": { + "Single": "Single", + "Married": "Married", + "Divorced": "Divorced", + "Widowed": "Widowed", + "Cohabitation": "Cohabitation" + }, + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_member_relevance.yml" + } + } + } + }, + { + "key": "phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "phone_number", + "type": "edit_text", + "hint": "Phone number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + } + }, + { + "key": "other_phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_phone_number", + "type": "edit_text", + "hint": "Alternative phone number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + } + }, { "key": "id_avail", "openmrs_entity_parent": "", "openmrs_entity": "person_attribute", "openmrs_entity_id": "id_avail", "type": "check_box", - "label": "Do have any of the following IDs?", + "combine_checkbox_option_values": "true", + "label": "Do you have any of the following IDs?", "label_text_style": "normal", "text_color": "#C0C0C0", "exclusive": [ @@ -295,35 +374,24 @@ { "key": "chk_national_id", "text": "National ID", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_national_id" }, { "key": "chk_voters_id", "text": "Voter's registration ID", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_voters_id" }, { "key": "chk_drivers_license", "text": "Driver's license", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_drivers_license" }, - { - "key": "chk_passport", - "text": "Passport", - "value": false, - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "chk_passport" - }, { "key": "chk_none", "text": "None", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_none" } @@ -341,9 +409,25 @@ "openmrs_entity_parent": "", "openmrs_entity": "person_attribute", "openmrs_entity_id": "National_ID", - "type": "edit_text", - "hint": "National ID number", - "edit_type": "name", + "type": "mask_edit_text", + "mask": "########-#####-#####-##", + "mask_hint": "12345678912345678912", + "allowed_chars": "0123456789", + "hint": "National ID number e.g 12345678-91234-56789-12", + "edit_type": "number", + "v_max_length": { + "value": "23", + "is_fixed_size": "true", + "err": "Please enter a valid national id" + }, + "v_regex": { + "value": "^\\d{8}-\\d{5}-\\d{5}-\\d{2}$", + "err": "National ID number should be of the format (XXXXXXXX-XXXXX-XXXXX-XX)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid national ID" + }, "relevance": { "step1:id_avail": { "ex-checkbox": [ @@ -361,9 +445,25 @@ "openmrs_entity_parent": "", "openmrs_entity": "person_attribute", "openmrs_entity_id": "Voter_Registration_Number", - "type": "edit_text", - "hint": "Voter's registration number", - "edit_type": "name", + "type": "mask_edit_text", + "mask": "T-####-####-###-#", + "mask_hint": "123456789123", + "allowed_chars": "0123456789", + "hint": "Voter's registration number e.g T-1234-5678-912-3", + "edit_type": "number", + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid voters registration" + }, + "v_regex": { + "value": "^T-\\d{4}-\\d{4}-\\d{3}-\\d{1}$", + "err": "Voter's registration number should be of the format (T-XXXX-XXXX-XXX-X)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid voters registration number" + }, "relevance": { "step1:id_avail": { "ex-checkbox": [ @@ -381,9 +481,25 @@ "openmrs_entity_parent": "", "openmrs_entity": "person_attribute", "openmrs_entity_id": "Driver_License_Number", - "type": "edit_text", - "hint": "Driver's license number", - "edit_type": "name", + "type": "mask_edit_text", + "mask": "##########", + "mask_hint": "1234567891", + "allowed_chars": "0123456789", + "hint": "Driver's license number e.g 1234567891", + "edit_type": "number", + "v_max_length": { + "value": "10", + "is_fixed_size": "true", + "err": "Please enter a valid drivers license number" + }, + "v_regex": { + "value": "^([0-9]{10})", + "err": "Driver's license number should be of the format (XXXXXXXXXX)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid driver's license number" + }, "relevance": { "step1:id_avail": { "ex-checkbox": [ @@ -396,26 +512,6 @@ } } }, - { - "key": "passport", - "openmrs_entity_parent": "", - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "Passport_Number", - "type": "edit_text", - "hint": "Passport number", - "edit_type": "name", - "relevance": { - "step1:id_avail": { - "ex-checkbox": [ - { - "or": [ - "chk_passport" - ] - } - ] - } - } - }, { "key": "insurance_provider", "openmrs_entity_parent": "", @@ -424,9 +520,9 @@ "type": "spinner", "hint": "Health insurance provider", "values": [ - "Community Health Fund (CHF)", - "iCHF", + "Community Health Fund (CHF)/(iCHF)", "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", "Tiba Kwa Kadi (TIKA)", "AAR Healthcare", "Strategies Insurance", @@ -440,8 +536,8 @@ ], "keys": [ "Community Health Fund (CHF)", - "iCHF", "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", "Tiba Kwa Kadi (TIKA)", "AAR Healthcare", "Strategies Insurance", @@ -455,8 +551,8 @@ ], "openmrs_choice_ids": { "Community Health Fund (CHF)": "Community_Health_Fund", - "iCHF": "iCHF", "National Social Security Fund - Social Health Insurance Benefit (SHIB)": "National_Social_Security_Fund", + "National Health Insurance Fund (NHIF)": "National_Health_Insurance_Fund", "Tiba Kwa Kadi (TIKA)": "Tiba_kwa_Kadi", "AAR Healthcare": "AAR_Healthcare", "AAR Strategies Insurance": "Strategies_Insurance", @@ -511,26 +607,6 @@ } } }, - { - "key": "sex", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "gender", - "type": "spinner", - "hint": "Sex", - "values": [ - "Male", - "Female" - ], - "keys": [ - "Male", - "Female" - ], - "v_required": { - "value": "true", - "err": "Please enter the sex" - } - }, { "key": "wra", "openmrs_entity_parent": "", @@ -563,7 +639,7 @@ "key": "preg_1yr", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "160692AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "preg_1yr", "type": "spinner", "hint": "Has the woman delivered in the last 1 year?", "values": [ @@ -575,8 +651,8 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" }, "v_required": { "value": "true", @@ -594,7 +670,7 @@ "key": "disabilities", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "162558AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "disabilities", "type": "spinner", "hint": "Physical disabilities", "values": [ @@ -606,8 +682,8 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" }, "v_required": { "value": "true", @@ -616,15 +692,64 @@ }, { "key": "type_of_disability", - "openmrs_entity_parent": "162558AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "hint": "Type of disability", - "v_required": { - "value": "true", - "err": "Please enter type of disability" - }, + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Type of disability", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Mobility and Physical Impairments", + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Spinal Cord Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Head Injuries - Brain Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Vision Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Hearing Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Cognitive or Learning Disabilities", + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Psychological Disorders", + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Invisible Disabilities", + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], "relevance": { "rules-engine": { "ex-rules": { @@ -637,7 +762,7 @@ "key": "is_primary_caregiver", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "", + "openmrs_entity_id": "is_primary_caregiver", "type": "spinner", "hint": "Is primary caregiver?", "values": [ @@ -653,145 +778,46 @@ "err": "Please select one" } }, - { - "key": "phone_number", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "hint": "Phone number", - "v_numeric": { - "value": "true", - "err": "Number must be a total of 10 digits in length" - }, - "v_regex": { - "value": "(0[0-9]{9})|\\s*", - "err": "Number must be 10 digits and must start with 0." - }, - "v_required": { - "value": false, - "err": "Please specify the phone number" - } - }, - { - "key": "other_phone_number", - "openmrs_entity_parent": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept", - "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "hint": "Other phone number", - "v_numeric": { - "value": "true", - "err": "Number must be a total of 10 digits in length" - }, - "v_regex": { - "value": "(0[0-9]{9})|\\s*", - "err": "Number must be 10 digits and must start with 0." - } - }, { "key": "service_provider", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1542AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "check_box", + "openmrs_entity_id": "service_provider", + "type": "native_radio", "label": "Occupation of the family member", "label_text_style": "normal", "text_color": "#C0C0C0", - "exclusive": [ - "chk_none" - ], "options": [ { - "key": "chk_farmer", - "text": "Farmer", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "1538AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_cs", - "text": "Civil Servant", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "162944AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_nurse", - "text": "Nurse", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "1577AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_teacher", - "text": "Teacher", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "162946AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_th", - "text": "Traditional Healer", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "1821AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_chw", - "text": "Community Health Worker (CHW)", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "1555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_tba", - "text": "Traditional Birth Attendant", - "value": false, + "key": "chk_self_employed", + "text": "Self-Employed", "openmrs_entity": "concept", - "openmrs_entity_id": "1575AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_self_employed" }, { - "key": "chk_chmis", - "text": "Community HMIS (cHMIS)", - "value": false, + "key": "chk_employed", + "text": "Employed", "openmrs_entity": "concept", - "openmrs_entity_id": "163334AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_employed" }, { - "key": "chk_cbd", - "text": "Community Based Distributor", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "1744AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_hbc", - "text": "Home Based Care (HBC)", - "value": false, + "key": "chk_unemployed", + "text": "Unemployed", "openmrs_entity": "concept", - "openmrs_entity_id": "161359AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_unemployed" }, { - "key": "chk_cimmci", - "text": "Community IMCI", - "value": false, + "key": "chk_farmer", + "text": "Farmer", "openmrs_entity": "concept", - "openmrs_entity_id": "163096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_farmer" }, { - "key": "chk_other", - "text": "Other", + "key": "chk_traditional_healer", + "text": "Traditional healer", "value": false, "openmrs_entity": "concept", - "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_none", - "text": "None", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_traditional_healer" } ], "v_required": { @@ -805,6 +831,7 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "Community_Leader", "type": "check_box", + "combine_checkbox_option_values": "true", "label": "Any leadership role in the community?", "label_text_style": "normal", "text_color": "#C0C0C0", @@ -815,42 +842,36 @@ { "key": "chk_religious", "text": "Religious leader", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Religious_Leader" }, { "key": "chk_traditional", "text": "Traditional leader", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Traditional_leader" }, { "key": "chk_political", "text": "Political leader", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Political_leader" }, { "key": "chk_influential", "text": "Influential leader", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Influential_Leader" }, { "key": "chk_other", "text": "Other", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Other_Community_Leader_Type" }, { "key": "chk_none", "text": "None", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Not_a_Community_Leader" } diff --git a/opensrp-chw-hf/src/main/assets/json.form/family_planning_change_method.json b/opensrp-chw-hf/src/main/assets/json.form/family_planning_change_method.json index 8b1028a8e..a58e7d994 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/family_planning_change_method.json +++ b/opensrp-chw-hf/src/main/assets/json.form/family_planning_change_method.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -119,7 +114,6 @@ "openmrs_entity": "concept", "openmrs_entity_id": "163494AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "value": false, "text": "Decided to change method" }, { @@ -225,7 +219,6 @@ } } }, - { "key": "no_condoms", "openmrs_entity_parent": "190AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", diff --git a/opensrp-chw-hf/src/main/assets/json.form/family_register.json b/opensrp-chw-hf/src/main/assets/json.form/family_register.json index a038f7862..4206930f6 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/family_register.json +++ b/opensrp-chw-hf/src/main/assets/json.form/family_register.json @@ -1,6 +1,4 @@ { - "validate_on_submit": true, - "show_errors_on_submit": false, "count": "2", "encounter_type": "Family Registration", "entity_id": "", @@ -18,11 +16,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -63,24 +56,58 @@ "openmrs_entity": "person", "openmrs_entity_id": "first_name", "type": "edit_text", - "hint": "Family name", + "hint": "Family name (Family Head's Surname)", "edit_type": "name", "v_required": { "value": "true", "err": "Please enter the family name" }, "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", "err": "Please enter a valid name" } }, + { + "key": "client_first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "Family Head's First name", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the first name" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + } + }, + { + "key": "client_middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Family Head's Middle name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the middle name" + } + }, { "key": "unique_id", "openmrs_entity_parent": "", "openmrs_entity": "person_identifier", "openmrs_entity_id": "opensrp_id", "hidden": "true", - "type": "barcode", + "type": "edit_text", "barcode_type": "qrcode", "hint": "ID", "scanButtonText": "Scan QR Code", @@ -96,14 +123,10 @@ "openmrs_entity_id": "cityVillage", "type": "edit_text", "edit_type": "name", - "hint": "Village", + "hint": "Area Name", "v_required": { "value": "true", - "err": "Please enter the village or town" - }, - "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", - "err": "Please enter a valid village name" + "err": "Please enter the area name" } }, { @@ -112,21 +135,12 @@ "openmrs_entity": "person_address", "openmrs_entity_id": "landmark", "type": "edit_text", - "edit_type": "name", - "hint": "Landmark/ description of house location", + "hint": "Landmark/Description of house location", "v_required": { "value": true, "err": "Please enter the landmark/description of location." } }, - { - "key": "gps", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_data_type": "text", - "type": "gps" - }, { "key": "spacer", "openmrs_entity_parent": "", @@ -152,14 +166,6 @@ "step2": { "title": "Family head", "fields": [ - { - "key": "photo", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "", - "type": "choose_image", - "uploadButtonText": "Take a picture of the person" - }, { "key": "unique_id", "openmrs_entity_parent": "", @@ -191,8 +197,16 @@ "err": "Please enter the first name" }, "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", "err": "Please enter a valid name" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_calculation.yml" + } + } } }, { @@ -208,21 +222,29 @@ "err": "Please enter the middle name" }, "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", "err": "Please enter a valid name" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_calculation.yml" + } + } } }, { "key": "surname", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "", + "openmrs_entity_id": "last_name", "type": "edit_text", "hint": "Surname", "edit_type": "name", "read_only": "true", "v_regex": { - "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", "err": "Please enter a valid name" }, "calculation": { @@ -286,7 +308,14 @@ "text_size": "18px", "value": "false" } - ] + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_relevance.yml" + } + } + } }, { "key": "age", @@ -319,6 +348,82 @@ "err": "Please enter the age" } }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Sex", + "values": [ + "Male", + "Female" + ], + "keys": [ + "Male", + "Female" + ], + "v_required": { + "value": "true", + "err": "Please enter the sex" + } + }, + { + "key": "marital_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "marital_status", + "type": "spinner", + "hint": "Client's Marital Status?", + "values": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "keys": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "openmrs_choice_ids": { + "Single": "Single", + "Married": "Married", + "Divorced": "Divorced", + "Widowed": "Widowed", + "Cohabitation": "Cohabitation" + }, + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_relevance.yml" + } + } + } + }, + { + "key": "phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "phone_number", + "type": "edit_text", + "hint": "Phone number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + } + }, { "key": "id_avail", "openmrs_entity_parent": "", @@ -326,6 +431,7 @@ "openmrs_entity_id": "id_avail", "type": "check_box", "label": "Does he/she have any of the following IDs?", + "combine_checkbox_option_values": "true", "label_text_style": "normal", "text_color": "#C0C0C0", "exclusive": [ @@ -335,48 +441,60 @@ { "key": "chk_national_id", "text": "National ID", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_national_id" }, { "key": "chk_voters_id", "text": "Voter's registration ID", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_voters_id" }, { "key": "chk_drivers_license", "text": "Driver's license", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_drivers_license" }, - { - "key": "chk_passport", - "text": "Passport", - "value": false, - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "chk_passport" - }, { "key": "chk_none", "text": "None", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "chk_none" } - ] + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_relevance.yml" + } + } + } }, { "key": "national_id", "openmrs_entity_parent": "", "openmrs_entity": "person_attribute", "openmrs_entity_id": "National_ID", - "type": "edit_text", - "hint": "National ID number", - "edit_type": "name", + "type": "mask_edit_text", + "mask": "########-#####-#####-##", + "mask_hint": "12345678912345678912", + "allowed_chars": "0123456789", + "hint": "National ID number e.g 12345678-91234-56789-12", + "edit_type": "number", + "v_regex": { + "value": "^\\d{8}-\\d{5}-\\d{5}-\\d{2}$", + "err": "National ID number should be of the format (XXXXXXXX-XXXXX-XXXXX-XX)" + }, + "v_max_length": { + "value": "23", + "is_fixed_size": "true", + "err": "Please enter a valid national id" + }, + "v_required": { + "value": true, + "err": "Please enter a valid national ID" + }, "relevance": { "step2:id_avail": { "ex-checkbox": [ @@ -394,9 +512,25 @@ "openmrs_entity_parent": "", "openmrs_entity": "person_attribute", "openmrs_entity_id": "Voter_Registration_Number", - "type": "edit_text", - "hint": "Voter's registration number", - "edit_type": "name", + "type": "mask_edit_text", + "mask": "T-####-####-###-#", + "mask_hint": "123456789123", + "allowed_chars": "0123456789", + "hint": "Voter's registration number e.g T-1234-5678-912-3", + "edit_type": "number", + "v_regex": { + "value": "^T-\\d{4}-\\d{4}-\\d{3}-\\d{1}$", + "err": "Voter's registration number should be of the format (T-XXXX-XXXX-XXX-X)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid voters registration" + }, + "v_required": { + "value": true, + "err": "Please enter a valid voters registration number" + }, "relevance": { "step2:id_avail": { "ex-checkbox": [ @@ -414,9 +548,25 @@ "openmrs_entity_parent": "", "openmrs_entity": "person_attribute", "openmrs_entity_id": "Driver_License_Number", - "type": "edit_text", - "hint": "Driver's license number", - "edit_type": "name", + "type": "mask_edit_text", + "mask": "##########", + "mask_hint": "1234567891", + "allowed_chars": "0123456789", + "hint": "Driver's license number e.g 1234567891", + "edit_type": "number", + "v_max_length": { + "value": "10", + "is_fixed_size": "true", + "err": "Please enter a valid drivers license number" + }, + "v_regex": { + "value": "^([0-9]{10})", + "err": "Driver's license number should be of the format (XXXXXXXXXX)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid driver's license number" + }, "relevance": { "step2:id_avail": { "ex-checkbox": [ @@ -429,26 +579,6 @@ } } }, - { - "key": "passport", - "openmrs_entity_parent": "", - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "Passport_Number", - "type": "edit_text", - "hint": "Passport number", - "edit_type": "name", - "relevance": { - "step2:id_avail": { - "ex-checkbox": [ - { - "or": [ - "chk_passport" - ] - } - ] - } - } - }, { "key": "insurance_provider", "openmrs_entity_parent": "", @@ -457,9 +587,9 @@ "type": "spinner", "hint": "Health insurance provider", "values": [ - "Community Health Fund (CHF)", - "iCHF", + "Community Health Fund (CHF)/(iCHF)", "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", "Tiba Kwa Kadi (TIKA)", "AAR Healthcare", "Strategies Insurance", @@ -473,8 +603,8 @@ ], "keys": [ "Community Health Fund (CHF)", - "iCHF", "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", "Tiba Kwa Kadi (TIKA)", "AAR Healthcare", "Strategies Insurance", @@ -488,8 +618,8 @@ ], "openmrs_choice_ids": { "Community Health Fund (CHF)": "Community_Health_Fund", - "iCHF": "iCHF", "National Social Security Fund - Social Health Insurance Benefit (SHIB)": "National_Social_Security_Fund", + "National Health Insurance Fund (NHIF)": "National_Health_Insurance_Fund", "Tiba Kwa Kadi (TIKA)": "Tiba_kwa_Kadi", "AAR Healthcare": "AAR_Healthcare", "AAR Strategies Insurance": "Strategies_Insurance", @@ -544,26 +674,6 @@ } } }, - { - "key": "sex", - "openmrs_entity_parent": "", - "openmrs_entity": "person", - "openmrs_entity_id": "gender", - "type": "spinner", - "hint": "Sex", - "values": [ - "Male", - "Female" - ], - "keys": [ - "Male", - "Female" - ], - "v_required": { - "value": "true", - "err": "Please enter the sex" - } - }, { "key": "wra", "openmrs_entity_parent": "", @@ -590,7 +700,7 @@ "key": "preg_1yr", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "160692AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "preg_1yr", "type": "spinner", "hint": "Has the woman delivered in the last 1 year?", "values": [ @@ -602,8 +712,8 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" }, "v_required": { "value": "true", @@ -621,7 +731,7 @@ "key": "disabilities", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "162558AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "disabilities", "type": "spinner", "hint": "Physical disabilities", "values": [ @@ -633,8 +743,8 @@ "No" ], "openmrs_choice_ids": { - "Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "Yes": "Yes", + "No": "No" }, "v_required": { "value": "true", @@ -643,163 +753,133 @@ }, { "key": "type_of_disability", - "openmrs_entity_parent": "162558AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept", - "openmrs_entity_id": "160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "hint": "Type of disability", - "v_required": { - "value": "true", - "err": "Please enter type of disability" - }, - "relevance": { - "rules-engine": { - "ex-rules": { - "rules-file": "family_register_relevance.yml" - } - } - } - }, - { - "key": "phone_number", - "openmrs_entity_parent": "", - "openmrs_entity": "concept", - "openmrs_entity_id": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "hint": "Phone number", - "v_numeric": { - "value": "true", - "err": "Number must be a total of 10 digits in length" - }, - "v_regex": { - "value": "(0[0-9]{9})|\\s*", - "err": "Number must be 10 digits and must start with 0." - } - }, - { - "key": "other_phone_number", - "openmrs_entity_parent": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "openmrs_entity": "concept", - "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", - "type": "edit_text", - "hint": "Other phone number", - "v_numeric": { - "value": "true", - "err": "Number must be a total of 10 digits in length" - }, - "v_regex": { - "value": "(0[0-9]{9})|\\s*", - "err": "Number must be 10 digits and must start with 0." - } - }, - { - "key": "service_provider", "openmrs_entity_parent": "", "openmrs_entity": "concept", - "openmrs_entity_id": "1542AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "openmrs_entity_id": "type_of_disability", "type": "check_box", - "label": "Occupation of the family member", + "label": "Type of disability", + "combine_checkbox_option_values": "true", "label_text_style": "normal", "text_color": "#C0C0C0", - "exclusive": [ - "chk_none" - ], "options": [ { - "key": "chk_farmer", - "text": "Farmer", - "value": false, + "key": "physical_impairments", + "text": "Mobility and Physical Impairments", "openmrs_entity": "concept", - "openmrs_entity_id": "1538AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "physical_impairments" }, { - "key": "chk_cs", - "text": "Civil Servant", - "value": false, + "key": "spinal_cord_disability", + "text": "Spinal Cord Disability", "openmrs_entity": "concept", - "openmrs_entity_id": "162944AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "spinal_cord_disability" }, { - "key": "chk_nurse", - "text": "Nurse", - "value": false, + "key": "brain_disability", + "text": "Head Injuries - Brain Disability", "openmrs_entity": "concept", - "openmrs_entity_id": "1577AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "brain_disability" }, { - "key": "chk_teacher", - "text": "Teacher", - "value": false, + "key": "vision_disability", + "text": "Vision Disability", "openmrs_entity": "concept", - "openmrs_entity_id": "162946AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "vision_disability" }, { - "key": "chk_th", - "text": "Traditional Healer", - "value": false, + "key": "hearing_disability", + "text": "Hearing Disability", "openmrs_entity": "concept", - "openmrs_entity_id": "1821AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "hearing_disability" }, { - "key": "chk_chw", - "text": "Community Health Worker (CHW)", - "value": false, + "key": "learning_disabilities", + "text": "Cognitive or Learning Disabilities", "openmrs_entity": "concept", - "openmrs_entity_id": "1555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "learning_disabilities" }, { - "key": "chk_tba", - "text": "Traditional Birth Attendant", - "value": false, + "key": "psychological_disorders", + "text": "Psychological Disorders", "openmrs_entity": "concept", - "openmrs_entity_id": "1575AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "psychological_disorders" }, { - "key": "chk_chmis", - "text": "Community HMIS (cHMIS)", - "value": false, + "key": "invisible_disabilities", + "text": "Invisible Disabilities", "openmrs_entity": "concept", - "openmrs_entity_id": "163334AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, - { - "key": "chk_cbd", - "text": "Community Based Distributor", - "value": false, - "openmrs_entity": "concept", - "openmrs_entity_id": "1744AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - }, + "openmrs_entity_id": "invisible_disabilities" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_relevance.yml" + } + } + } + }, + { + "key": "other_phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_phone_number", + "type": "edit_text", + "hint": "Other phone number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + } + }, + { + "key": "service_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "service_provider", + "type": "native_radio", + "label": "Occupation of the family head", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ { - "key": "chk_hbc", - "text": "Home Based Care (HBC)", - "value": false, + "key": "chk_self_employed", + "text": "Self-Employed", "openmrs_entity": "concept", - "openmrs_entity_id": "161359AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_self_employed" }, { - "key": "chk_cimmci", - "text": "Community IMCI", - "value": false, + "key": "chk_employed", + "text": "Employed", "openmrs_entity": "concept", - "openmrs_entity_id": "163096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_employed" }, { - "key": "chk_other", - "text": "Other", - "value": false, + "key": "chk_unemployed", + "text": "Unemployed", "openmrs_entity": "concept", - "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_unemployed" }, { - "key": "chk_none", - "text": "None", - "value": false, + "key": "chk_farmer", + "text": "Farmer", "openmrs_entity": "concept", - "openmrs_entity_id": "164369AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "openmrs_entity_id": "chk_farmer" } ], "v_required": { "value": "true", "err": "Please pick at least one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_relevance.yml" + } + } } }, { @@ -808,6 +888,7 @@ "openmrs_entity": "person_attribute", "openmrs_entity_id": "Community_Leader", "type": "check_box", + "combine_checkbox_option_values": "true", "label": "Any leadership role in the community?", "label_text_style": "normal", "text_color": "#C0C0C0", @@ -818,42 +899,36 @@ { "key": "chk_religious", "text": "Religious leader", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Religious_Leader" }, { "key": "chk_traditional", "text": "Traditional leader", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Traditional_leader" }, { "key": "chk_political", "text": "Political leader", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Political_leader" }, { "key": "chk_influential", "text": "Influential leader", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Influential_Leader" }, { "key": "chk_other", "text": "Other", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Other_Community_Leader_Type" }, { "key": "chk_none", "text": "None", - "value": false, "openmrs_entity": "person_attribute", "openmrs_entity_id": "Not_a_Community_Leader" } @@ -861,6 +936,13 @@ "v_required": { "value": "true", "err": "Please pick at least one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "family_register_relevance.yml" + } + } } }, { diff --git a/opensrp-chw-hf/src/main/assets/json.form/female_family_planning_change_method.json b/opensrp-chw-hf/src/main/assets/json.form/female_family_planning_change_method.json index 8b1028a8e..a58e7d994 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/female_family_planning_change_method.json +++ b/opensrp-chw-hf/src/main/assets/json.form/female_family_planning_change_method.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -119,7 +114,6 @@ "openmrs_entity": "concept", "openmrs_entity_id": "163494AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "value": false, "text": "Decided to change method" }, { @@ -225,7 +219,6 @@ } } }, - { "key": "no_condoms", "openmrs_entity_parent": "190AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", diff --git a/opensrp-chw-hf/src/main/assets/json.form/female_family_planning_registration.json b/opensrp-chw-hf/src/main/assets/json.form/female_family_planning_registration.json index 601ebe6fe..c2118a35a 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/female_family_planning_registration.json +++ b/opensrp-chw-hf/src/main/assets/json.form/female_family_planning_registration.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -57,18 +52,6 @@ "title": "Family planning registration Info", "next": "step2", "fields": [ - { - "key": "sync_location_id", - "openmrs_entity_parent": "", - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "sync_location_id", - "type": "spinner", - "hint": "Select CHW Location", - "v_required": { - "value": "true", - "err": "Please select CHW Location" - } - }, { "key": "fp_reg_date", "openmrs_entity_parent": "", @@ -128,8 +111,7 @@ "options": [ { "key": "pregnant_option", - "text": "Verify that the woman is not pregnant", - "value": false + "text": "Verify that the woman is not pregnant" } ] }, @@ -139,7 +121,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "couselling_HIV_STI", "openmrs_entity_parent": "", - "label": "Was she counselled on HIV and STI prevention?", + "label": "Was she counselled on HIV and STI/RTI prevention?", "options": [ { "key": "yes", @@ -253,8 +235,7 @@ "openmrs_entity_parent": "190AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_condom", - "type": "edit_text", - "hidden": true, + "type": "hidden", "calculation": { "rules-engine": { "ex-rules": { diff --git a/opensrp-chw-hf/src/main/assets/json.form/hei_arv_prescription_high_or_low_risk_infant.json b/opensrp-chw-hf/src/main/assets/json.form/hei_arv_prescription_high_or_low_risk_infant.json new file mode 100644 index 000000000..d636caa38 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hei_arv_prescription_high_or_low_risk_infant.json @@ -0,0 +1,196 @@ +{ + "count": "1", + "encounter_type": "HEI ARV prophylaxis for low risk infants", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "ARV prophylaxis", + "fields": [ + { + "key": "prompt_for_nvp_syrup", + "type": "toaster_notes", + "text": "Please provide NVP Syrup", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info" + }, + { + "key": "provided_nvp_syrup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_nvp_syrup", + "type": "native_radio", + "label": "Has the infant been provided NVP Syrup?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + } + }, + { + "key": "number_of_nvp_days_dispensed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_nvp_days_dispensed", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of days dispensed", + "v_required": { + "value": "true", + "err": "Please enter number of days dispensed" + }, + "v_numeric_integer": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "1", + "err": "Number of dispensed days should be greater than 0" + }, + "v_max": { + "value": "180", + "err": "Number of dispensed days should be less than or equal to 180" + }, + "relevance": { + "step1:provided_nvp_syrup": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "reason_for_not_providing_nvp_syrup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_nvp_syrup", + "type": "native_radio", + "label": "Please specify the reasons", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_stock", + "text": "Out of stock", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_stock" + }, + { + "key": "medication_expired", + "text": "Medication expired", + "openmrs_entity": "concept", + "openmrs_entity_id": "medication_expired" + }, + { + "key": "home_delivery", + "text": "Home delivery", + "openmrs_entity": "concept", + "openmrs_entity_id": "home_delivery" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:provided_nvp_syrup": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_for_not_providing_nvp_syrup", + "type": "edit_text", + "hint": "Please specify the other reason(s)", + "openmrs_entity_id": "other_reason_for_not_providing_nvp_syrup", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify the other reason(s)" + }, + "relevance": { + "step1:reason_for_not_providing_nvp_syrup": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "visit_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "type": "hidden" + }, + { + "key": "prophylaxis_arv_for_high_and_low_risk_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prophylaxis_arv_for_high_and_low_risk_given", + "type": "hidden", + "value": "true" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/hei_arv_prescription_high_risk_infant.json b/opensrp-chw-hf/src/main/assets/json.form/hei_arv_prescription_high_risk_infant.json new file mode 100644 index 000000000..4db3f2491 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hei_arv_prescription_high_risk_infant.json @@ -0,0 +1,243 @@ +{ + "count": "1", + "encounter_type": "HEI ARV prophylaxis for high risk infants", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "ARV prophylaxis", + "fields": [ + { + "key": "prompt_for_azt_nvp_syrup", + "type": "toaster_notes", + "text": "Please provide AZT + 3TC and NVP Syrup", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info" + }, + { + "key": "provided_azt_nvp_syrup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_azt_nvp_syrup", + "type": "native_radio", + "label": "Has the infant been provided AZT + 3TC and NVP Syrup?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + } + }, + { + "key": "provided_other_combinations", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_other_combinations", + "type": "native_radio", + "label": "Has the infant been provided other combinations?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:provided_azt_nvp_syrup": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "specify_the_combinations", + "type": "edit_text", + "hint": "Please specify the combinations", + "openmrs_entity_id": "specify_the_combinations", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify the combinations" + }, + "relevance": { + "step1:provided_other_combinations": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "number_of_azt_nvp_days_dispensed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_azt_nvp_days_dispensed", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of days dispensed", + "v_required": { + "value": "true", + "err": "Please enter number of days dispensed" + }, + "v_numeric_integer": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "1", + "err": "Number of dispensed days should be greater than 0" + }, + "v_max": { + "value": "180", + "err": "Number of dispensed days should be less than or equal to 180" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_arv_prescription_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_providing_other_combination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_other_combination", + "type": "native_radio", + "label": "Please specify the reasons", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_stock", + "text": "Out of stock", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_stock" + }, + { + "key": "medication_expired", + "text": "Medication expired", + "openmrs_entity": "concept", + "openmrs_entity_id": "medication_expired" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:provided_other_combinations": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_for_not_providing_other_combination", + "type": "edit_text", + "hint": "Please specify the other reason(s)", + "openmrs_entity_id": "other_reason_for_not_providing_other_combination", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify the other reason(s)" + }, + "relevance": { + "step1:reason_for_not_providing_other_combination": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "visit_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "type": "hidden" + }, + { + "key": "prophylaxis_arv_for_high_risk_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prophylaxis_arv_for_high_risk_given", + "type": "hidden", + "value": "true" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/hei_baseline_investigation.json b/opensrp-chw-hf/src/main/assets/json.form/hei_baseline_investigation.json new file mode 100644 index 000000000..4e8239d05 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hei_baseline_investigation.json @@ -0,0 +1,281 @@ +{ + "count": "1", + "encounter_type": "HEI Baseline Investigation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "HEI Baseline Investigation", + "fields": [ + { + "key": "followup_status", + "openmrs_entity_id": "followup_status", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Visit Type", + "type": "spinner", + "values": [ + "Infant and Mother (IM)", + "Infant with other caregiver (IC)", + "Transit (O)", + "Lost to Followup" + ], + "keys": [ + "infant_and_mother", + "infant_with_other_caregiver", + "transfer_out", + "lost_to_followup" + ], + "openmrs_choice_ids": { + "infant_and_mother": "infant_and_mother", + "infant_with_other_caregiver": "infant_with_other_caregiver", + "transfer_out": "transfer_out", + "lost_to_followup": "lost_to_followup" + }, + "v_required": { + "value": true, + "err": "Please select the visit type" + } + }, + { + "key": "name_of_hf", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "name_of_hf", + "buttonText": "Select Health Facility", + "sort": true, + "maxSelectable": 1, + "dialogTitle": "Health Facility", + "searchHint": "Type Health Facility Name", + "options": [ + ], + "type": "multi_select_list", + "v_required": { + "value": true, + "err": "Please select the health facility" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "health_status", + "openmrs_entity_id": "health_status", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Health Status", + "type": "spinner", + "values": [ + "Diarrhoea", + "DEAR Draining Ears", + "Fever", + "KS Kaposi Sarcoma", + "MAL Malnutrition", + "OC Oesophageal Candidiasis", + "Pneumonia", + "SD Skin Disease", + "Thrush (Oral Candidiasis)", + "TB Tuberculosis", + "Well", + "LN Lymphadenopathy" + ], + "keys": [ + "diarrhoea", + "draining_ears", + "fever", + "kaposi_sarcoma", + "malnutrition", + "oesophageal_candidiasis", + "pneumonia", + "skin_disease", + "thrush", + "tuberculosis", + "well", + "lymphadenopathy" + ], + "openmrs_choice_ids": { + "diarrhoea": "diarrhoea", + "draining_ears": "draining_ears", + "fever": "fever", + "kaposi_sarcoma": "kaposi_sarcoma", + "malnutrition": "malnutrition", + "oesophageal_candidiasis": "oesophageal_candidiasis", + "pneumonia": "pneumonia", + "skin_disease": "skin_disease", + "thrush": "thrush", + "tuberculosis": "tuberculosis", + "well": "well", + "lymphadenopathy": "lymphadenopathy" + }, + "v_required": { + "value": true, + "err": "Please select the health status" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_health_status", + "type": "toaster_notes", + "text": "Refer the client for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "infant_feeding_practice", + "openmrs_entity_id": "infant_feeding_practice", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "hint": "Infant Feeding Practice", + "type": "spinner", + "values": [ + "EBF: Infant fed by only breast milk", + "RF: Infant fed only by formula milk", + "MF: Infant fed by breast milk and formula milk", + "BF + additional food: Infant fed by breast milk as well as other complementary food", + "RF + additional food: Infant fed by formula milk and complementary food", + "SBF: Child has stopped breast milk completely" + ], + "keys": [ + "ebf", + "rf", + "mf", + "bf+", + "rf+", + "sbf" + ], + "openmrs_choice_ids": { + "ebf": "ebf", + "rf": "rf", + "mf": "mf", + "bf+": "bf+", + "rf+": "rf+", + "sbf": "sbf" + }, + "v_required": { + "value": true, + "err": "Please select the infant feeding practice" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Weight (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the weight" + }, + "v_min": { + "value": "0", + "err": "The weight must be equal or greater than 0 (KG)" + }, + "v_max": { + "value": "20", + "err": "The weight must be equal or less than 20 (KG)" + }, + "v_max_length": { + "value": "5", + "is_fixed_size": "true", + "err": "Please enter a valid weight." + }, + "v_required": { + "value": true, + "err": "Please enter the weight" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "followup_visit_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "followup_visit_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_followup_visit_date_calculation.yml" + } + } + } + }, + { + "key": "visit_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "type": "hidden" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/hei_community_followup_referral.json b/opensrp-chw-hf/src/main/assets/json.form/hei_community_followup_referral.json new file mode 100644 index 000000000..256f3f4c1 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hei_community_followup_referral.json @@ -0,0 +1,134 @@ +{ + "count": "1", + "encounter_type": "HEI Community Followup", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "HEI Community Followup Referral", + "fields": [ + { + "key": "last_client_visit_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_client_visit_date", + "type": "date_picker", + "hint": "Client's last facility visit date", + "expanded": false, + "max_date": "today", + "editable": false, + "read_only": true, + "v_required": { + "value": "true", + "err": "Please specify the client's last facility visit date" + } + }, + { + "key": "reasons_for_issuing_community_referral", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_issuing_community_referral", + "type": "native_radio", + "label": "Reasons for issuing community followup referral", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "missed_appointment", + "text": "Missed Appointment", + "openmrs_entity": "concept", + "openmrs_entity_id": "missed_appointment" + }, + { + "key": "lost_to_followup", + "text": "Lost to followup client", + "openmrs_entity": "concept", + "openmrs_entity_id": "lost_to_followup" + } + ], + "v_required": { + "value": "true", + "err": "Please select reason for issuing the referral" + } + }, + { + "key": "mother_champion_location", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_champion_location", + "type": "spinner", + "hint": "Mother Champion Location", + "v_required": { + "value": true, + "err": "Please enter the Mother Champion Location" + } + }, + { + "key": "comment_pmtct_community_followup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "comment_pmtct_community_followup", + "type": "edit_text", + "hint": "Remarks/Comments" + }, + { + "key": "pmtct_community_referral_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_community_referral_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_community_followup_referral_calculation.yml" + } + } + } + }, + { + "key": "child_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_name", + "type": "hidden" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/hei_dna_pcr_sample_collection.json b/opensrp-chw-hf/src/main/assets/json.form/hei_dna_pcr_sample_collection.json new file mode 100644 index 000000000..ca8cd8bab --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hei_dna_pcr_sample_collection.json @@ -0,0 +1,179 @@ +{ + "count": "1", + "encounter_type": "HEI DNA PCR Sample Collection", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "DNA-PCR Sample Collection", + "fields": [ + { + "key": "clinician_name", + "type": "edit_text", + "hint": "Healthcare Provider's Name", + "openmrs_entity_id": "clinician_name", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter the healthcare provider's name" + }, + "v_required": { + "value": true, + "err": "Please enter the healthcare provider's name" + } + }, + { + "key": "clinician_position", + "type": "spinner", + "hint": "Healthcare Provider's Title", + "openmrs_entity_id": "clinician_position", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "Medical Officer", + "Assistant Medical Officer", + "Clinical Officer", + "Assistant Clinical Officer", + "Nurse" + ], + "keys": [ + "medical_officer", + "assistant_medical_officer", + "clinical_officer", + "assistant_clinical_officer", + "nurse" + ], + "openmrs_choice_ids": { + "medical_officer": "medical_officer", + "assistant_medical_officer": "assistant_medical_officer", + "clinical_officer": "clinical_officer", + "assistant_clinical_officer": "assistant_clinical_officer", + "nurse": "nurse" + }, + "v_required": { + "value": true, + "err": "Please enter the healthcare provider's title" + } + }, + { + "key": "clinician_phone_number", + "type": "edit_text", + "hint": "Healthcare Provider's Phone Number", + "edit_type": "number", + "openmrs_entity_id": "clinician_phone_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits and must start with 06 au 07." + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + }, + "v_required": { + "value": true, + "err": "Please enter the healthcare provider's phone number" + } + }, + { + "key": "sample_collection_date", + "type": "date_picker", + "hint": "DNA-PCR Sample Collection Date", + "openmrs_entity_id": "sample_collection_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "min_date": "today-5y", + "max_date": "today", + "v_required": { + "value": true, + "err": "Please enter the collection date" + } + }, + { + "key": "dna_pcr_collection_time", + "type": "time_picker", + "hint": "DNA-PCR Sample Collection Time", + "openmrs_entity_id": "dna_pcr_collection_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please enter the collection time" + } + }, + { + "key": "sample_id", + "type": "edit_text", + "hint": "DNA-PCR Sample ID", + "openmrs_entity_id": "sample_id", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please enter the sample ID" + } + }, + { + "key": "type_of_hiv_test", + "type": "hidden", + "openmrs_entity_id": "type_of_hiv_test", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "value": "DNA PCR" + }, + { + "key": "test_at_age", + "type": "hidden", + "openmrs_entity_id": "test_at_age", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "actual_age", + "type": "hidden", + "openmrs_entity_id": "actual_age", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/hei_hiv_test_results.json b/opensrp-chw-hf/src/main/assets/json.form/hei_hiv_test_results.json new file mode 100644 index 000000000..3429054d2 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hei_hiv_test_results.json @@ -0,0 +1,333 @@ +{ + "count": "1", + "encounter_type": "HEI HIV Test Results", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "HIV Test Results", + "fields": [ + { + "key": "sample_id", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "sample_id", + "openmrs_entity_parent": "" + }, + { + "key": "hiv_test_result", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_status", + "type": "native_radio", + "label": "Select the test result", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + } + }, + { + "key": "confirmation_hiv_test_result", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "confirmation_hiv_test_result", + "type": "native_radio", + "label": "Is this a confirmation test result?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "step1:hiv_test_result": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "prompt_for_confirm_hiv_results", + "type": "toaster_notes", + "text": "Conduct another DNA PCR test on the child to confirm the HIV status", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:confirmation_hiv_test_result": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "prompt_for_hiv_test_results", + "type": "toaster_notes", + "text": "The Child is HIV-infected, refer to HIV Care and Treatment services", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:confirmation_hiv_test_result": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "hiv_test_result_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_result_date", + "type": "date_picker", + "hint": "Date of receiving results", + "expanded": false, + "min_date": "today-3y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please select the date of receiving the results" + } + }, + { + "key": "results_provided_to_parents", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "results_provided_to_parents", + "type": "native_radio", + "label": "Have the results been provided to the parents?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_hiv_test_results_relevance.yml" + } + } + } + }, + { + "key": "hiv_test_result_to_parent_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_result_to_parent_date", + "type": "date_picker", + "hint": "Date Results given to Mother/Caregiver", + "expanded": false, + "min_date": "today-3y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Tafadhali chagua Tarehe ya majibu kupewa mzazi" + }, + "relevance": { + "step1:results_provided_to_parents": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "prompt_provide_results_to_parents", + "type": "toaster_notes", + "text": "Provide the results to the parents", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:results_provided_to_parents": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "linkage_to_ctc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "linkage_to_ctc", + "type": "native_radio", + "label": "Is the child linked to CTC services?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:confirmation_hiv_test_result": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "CTC Number", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "CTC number should be of the format (XX-XX-XXXX-XXXXXX)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid CTC Number" + }, + "v_required": { + "value": true, + "err": "Please enter a valid CTC Number" + }, + "relevance": { + "step1:linkage_to_ctc": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "prompt_for_linkage_to_ctc", + "type": "toaster_notes", + "text": "Link the child to CTC services and issue a CTC number", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:linkage_to_ctc": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "type_of_hiv_test", + "type": "hidden", + "openmrs_entity_id": "type_of_hiv_test", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "value": "Antibody Test" + }, + { + "key": "test_at_age", + "type": "hidden", + "openmrs_entity_id": "test_at_age", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "actual_age", + "type": "hidden", + "openmrs_entity_id": "actual_age", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/hei_number_registration.json b/opensrp-chw-hf/src/main/assets/json.form/hei_number_registration.json new file mode 100644 index 000000000..e1a1d4ba8 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hei_number_registration.json @@ -0,0 +1,74 @@ +{ + "count": "1", + "encounter_type": "HEI Number Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "HEI Number Registration", + "fields": [ + { + "key": "hei_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hei_number", + "type": "mask_edit_text", + "mask": "##-##-####-######-C##", + "mask_hint": "1234567891234567", + "allowed_chars": "0123456789", + "hint": "HEI Number", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6}-C\\d{2})?", + "err": "HEI number should be of the format (XX-XX-XXXX-XXXXXX-CXX)" + }, + "v_max_length": { + "value": "21", + "is_fixed_size": "true", + "err": "Please enter a valid HEI Number" + }, + "v_required": { + "value": true, + "err": "Please enter a valid HEI Number" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/hei_rv_ctx.json b/opensrp-chw-hf/src/main/assets/json.form/hei_rv_ctx.json new file mode 100644 index 000000000..d8fcfa47e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hei_rv_ctx.json @@ -0,0 +1,173 @@ +{ + "count": "1", + "encounter_type": "HEI CTX Prescription", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "CTX Prescription", + "fields": [ + { + "key": "prescribed_ctx", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prescribed_ctx", + "type": "native_radio", + "label": "Has the infant been prescribed CTX?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + } + }, + { + "key": "number_of_ctx_days_dispensed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_ctx_days_dispensed", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of days dispensed", + "v_required": { + "value": "true", + "err": "Please enter number of days dispensed" + }, + "v_numeric_integer": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "1", + "err": "Number of dispensed days should be greater than 0" + }, + "v_max": { + "value": "180", + "err": "Number of dispensed days should be less than or equal to 180" + }, + "relevance": { + "step1:prescribed_ctx": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "reason_for_not_prescribing_ctx", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_prescribing_ctx", + "type": "native_radio", + "label": "Reason for not prescribing CTX", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_stock", + "text": "Out of stock", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_stock" + }, + { + "key": "medication_expired", + "text": "Medication expired", + "openmrs_entity": "concept", + "openmrs_entity_id": "medication_expired" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:prescribed_ctx": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_for_not_prescribing_ctx", + "type": "edit_text", + "hint": "Please specify the other reason(s)", + "openmrs_entity_id": "other_reason_for_not_prescribing_ctx", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify the other reason(s)" + }, + "relevance": { + "step1:reason_for_not_prescribing_ctx": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "visit_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "type": "hidden" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/hiv_client_update_ctc_number.json b/opensrp-chw-hf/src/main/assets/json.form/hiv_client_update_ctc_number.json new file mode 100644 index 000000000..0cd736e07 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hiv_client_update_ctc_number.json @@ -0,0 +1,83 @@ +{ + "form": "Update CTC Number", + "count": "1", + "encounter_type": "Update CTC Number", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_index_contact_ctc_enrollment_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Update CTC Number", + "fields": [ + { + "name": "ctc_number", + "type": "masked_edit_text", + "properties": { + "hint": "CTC Number e.g 12-34-5678-912345", + "type": "Care and Treatment Clinic registration number (CTC Number)", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "input_type": "number", + "allowed_chars": "0123456789" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "openmrs_entity_parent": "" + }, + "validation": [ + { + "condition": "value.matches(\"(\\\\d{2}-\\\\d{2}-\\\\d{4}-\\\\d{6})?\")", + "message": "CTC Number should be of the format (XX-XX-XXXX-XXXXXX)." + } + ], + "required_status": "yes:Please specify client's CTC number" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form/hiv_community_followup_referral.json b/opensrp-chw-hf/src/main/assets/json.form/hiv_community_followup_referral.json new file mode 100644 index 000000000..3217df13d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hiv_community_followup_referral.json @@ -0,0 +1,151 @@ +{ + "form": "HIV Community Followup", + "count": "1", + "encounter_type": "HIV Community Followup", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_community_followup_referral_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "HIV Community Followup Referral", + "fields": [ + { + "name": "reasons_for_issuing_community_referral", + "type": "radio_group", + "properties": { + "text": "Reasons for issuing community followup referral" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_issuing_community_referral", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "missed_appointment", + "text": "Missed Appointment", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "missed_appointment", + "openmrs_entity_parent": "" + } + }, + { + "name": "lost_to_followup", + "text": "Lost to followup client", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "lost_to_followup", + "openmrs_entity_parent": "" + } + }, + { + "name": "Other", + "text": "Other", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "Other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select reason for issuing the referral", + "dependent_calculations": [ + "hiv_community_referral_date" + ] + }, + { + "name": "reason_for_issuing_community_referral_other", + "type": "text_input_edit_text", + "properties": { + "hint": "Other Reasons", + "type": "name" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_issuing_community_referral_other", + "openmrs_entity_parent": "reasons_for_issuing_community_referral" + }, + "required_status": "true:Please specify other reasons", + "subjects": "reasons_for_issuing_community_referral:map" + }, + { + "name": "last_client_visit_date", + "type": "datetime_picker", + "properties": { + "hint": "Clients last facility visit date", + "type": "date_picker", + "display_format": "dd/MM/yyyy", + "max_date": "today" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "last_client_visit_date", + "openmrs_entity_parent": "" + }, + "required_status": "true:Please specify the clients last facility visit date", + "subjects": "reasons_for_issuing_community_referral:map" + }, + { + "name": "comment_hiv_community_followup", + "type": "text_input_edit_text", + "properties": { + "hint": "Remarks/Comments" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment_hiv_community_followup", + "openmrs_entity_parent": "" + }, + "required_status": "false" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form/hiv_index_clients_contacts_registration_form.json b/opensrp-chw-hf/src/main/assets/json.form/hiv_index_clients_contacts_registration_form.json new file mode 100644 index 000000000..c0a04defc --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hiv_index_clients_contacts_registration_form.json @@ -0,0 +1,949 @@ +{ + "count": "2", + "encounter_type": "Family Registration", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "global": {}, + "step1": { + "title": "Location details", + "next": "step2", + "fields": [ + { + "key": "fam_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "fam_name", + "type": "edit_text", + "hint": "Surname", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the surname" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter surname" + } + }, + { + "key": "client_first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "First name", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the first name" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + } + }, + { + "key": "client_middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Middle name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the middle name" + } + }, + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "hidden": "true", + "type": "edit_text", + "barcode_type": "qrcode", + "hint": "ID", + "scanButtonText": "Scan QR Code", + "v_numeric": { + "value": "true", + "err": "Please enter a valid ID" + } + }, + { + "key": "fam_village", + "openmrs_entity_parent": "", + "openmrs_entity": "person_address", + "openmrs_entity_id": "cityVillage", + "type": "edit_text", + "edit_type": "name", + "hint": "Area Name", + "v_required": { + "value": "true", + "err": "Please enter the area name" + } + }, + { + "key": "landmark", + "openmrs_entity_parent": "", + "openmrs_entity": "person_address", + "openmrs_entity_id": "landmark", + "type": "edit_text", + "hint": "Landmark/Description of house location", + "v_required": { + "value": true, + "err": "Please enter the landmark/description of location." + } + }, + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "15dp" + }, + { + "key": "sync_location_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "sync_location_id", + "type": "spinner", + "hint": "Select CHW Location", + "v_required": { + "value": "true", + "err": "Please select CHW Location" + } + } + ] + }, + "step2": { + "title": "Client details", + "fields": [ + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "type": "edit_text", + "read_only": true, + "hint": "Kituoni ID", + "v_numeric": { + "value": "true", + "err": "Please enter a valid ID" + }, + "v_required": { + "value": "true", + "err": "Please enter the UNIQUE ID" + } + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "last_name", + "type": "edit_text", + "hint": "Surname", + "edit_type": "name", + "read_only": true, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the surname" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_client_contacts_calculation.yml" + } + } + } + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "First name", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the first name" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "err": "Please enter a valid name" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_client_contacts_calculation.yml" + } + } + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Middle name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-]*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the middle name" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_client_contacts_calculation.yml" + } + } + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "hidden", + "hint": "Date of birth (DOB)", + "expanded": false, + "duration": { + "label": "Age" + }, + "min_date": "today-120y", + "max_date": "today-5y", + "v_required": { + "value": "true", + "err": "Please enter the date of birth" + } + }, + { + "key": "age_calculated", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_client_contacts_calculation.yml" + } + } + } + }, + { + "key": "dob_unknown", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdateApprox", + "type": "hidden", + "label": "", + "value": "true", + "options": [ + { + "key": "dob_unknown", + "text": "DOB unknown?", + "text_size": "18px", + "value": "true" + } + ] + }, + { + "key": "age", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "age", + "type": "edit_text", + "hint": "Age", + "v_numeric_integer": { + "value": "true", + "err": "Must be a rounded number" + }, + "v_min": { + "value": "0", + "err": "Enter a valid age" + }, + "v_max": { + "value": "120", + "err": "Age must be equal or less than 120" + }, + "v_required": { + "value": "true", + "err": "Please enter the age" + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Sex", + "values": [ + "Male", + "Female" + ], + "keys": [ + "Male", + "Female" + ], + "v_required": { + "value": "true", + "err": "Please enter the sex" + } + }, + { + "key": "wra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_client_contacts_calculation.yml" + } + } + } + }, + { + "key": "mra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_client_contacts_calculation.yml" + } + } + } + }, + { + "key": "phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "phone_number", + "type": "edit_text", + "hint": "Client phone number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + }, + "v_required": { + "value": false, + "err": "Please specify the phone number" + } + }, + { + "key": "other_phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_phone_number", + "type": "edit_text", + "hint": "Alternative phone number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + }, + "v_required": { + "value": false, + "err": "Please specify the alternative phone number" + } + }, + { + "key": "relationship_under_15_for_possible_children", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relationship", + "type": "native_radio", + "label": "Relationship", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "biological_child", + "text": "Biological child", + "openmrs_entity": "concept", + "openmrs_entity_id": "biological_child" + }, + { + "key": "siblings", + "text": "Siblings", + "openmrs_entity": "concept", + "openmrs_entity_id": "siblings" + } + ], + "v_required": { + "value": "true", + "err": "Relationship is required" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "relationship_under_15", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relationship", + "type": "native_radio", + "label": "Relationship", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "siblings", + "text": "Siblings", + "openmrs_entity": "concept", + "openmrs_entity_id": "siblings" + } + ], + "v_required": { + "value": "true", + "err": "Relationship is required" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "relationship_above_15_to_18_possible_children", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relationship", + "type": "native_radio", + "label": "Relationship", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "biological_child", + "text": "Biological child", + "openmrs_entity": "concept", + "openmrs_entity_id": "biological_child" + }, + { + "key": "siblings", + "text": "Siblings", + "openmrs_entity": "concept", + "openmrs_entity_id": "siblings" + }, + { + "key": "sexual_partner", + "text": "Sexual partner", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner" + }, + { + "key": "needle_sharing_partner", + "text": "Needle Sharing partner", + "openmrs_entity": "concept", + "openmrs_entity_id": "needle_sharing_partner" + } + ], + "v_required": { + "value": "true", + "err": "Relationship is required" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "relationship_above_15_to_18", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relationship", + "type": "native_radio", + "label": "Relationship", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "siblings", + "text": "Siblings", + "openmrs_entity": "concept", + "openmrs_entity_id": "siblings" + }, + { + "key": "sexual_partner", + "text": "Sexual partner", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner" + }, + { + "key": "needle_sharing_partner", + "text": "Needle Sharing partner", + "openmrs_entity": "concept", + "openmrs_entity_id": "needle_sharing_partner" + } + ], + "v_required": { + "value": "true", + "err": "Relationship is required" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "relationship_above_18_possible_parents_female", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relationship", + "type": "native_radio", + "label": "Relationship", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "biological_mother", + "text": "Biological Mother", + "openmrs_entity": "concept", + "openmrs_entity_id": "biological_mother" + }, + { + "key": "sexual_partner", + "text": "Sexual partner", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner" + }, + { + "key": "needle_sharing_partner", + "text": "Needle Sharing partner", + "openmrs_entity": "concept", + "openmrs_entity_id": "needle_sharing_partner" + } + ], + "v_required": { + "value": "true", + "err": "Relationship is required" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "relationship_above_18_possible_parents_male", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relationship", + "type": "native_radio", + "label": "Relationship", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "biological_father", + "text": "Biological Father (If the mother is deceased)", + "openmrs_entity": "concept", + "openmrs_entity_id": "biological_father" + }, + { + "key": "sexual_partner", + "text": "Sexual partner", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner" + }, + { + "key": "needle_sharing_partner", + "text": "Needle Sharing partner", + "openmrs_entity": "concept", + "openmrs_entity_id": "needle_sharing_partner" + } + ], + "v_required": { + "value": "true", + "err": "Relationship is required" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "relationship_above_18", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relationship", + "type": "native_radio", + "label": "Relationship", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "sexual_partner", + "text": "Sexual partner", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner" + }, + { + "key": "needle_sharing_partner", + "text": "Needle Sharing partner", + "openmrs_entity": "concept", + "openmrs_entity_id": "needle_sharing_partner" + } + ], + "v_required": { + "value": "true", + "err": "Relationship is required" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "relationship", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relationship", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_client_contacts_calculation.yml" + } + } + } + }, + { + "key": "gbv_analysis", + "type": "toaster_notes", + "text": "Conduct GBV Screening", + "text_color": "#1199F9", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "physical_abuse", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_abuse", + "type": "native_radio", + "label": "Has the contact client ever emotionally or physically hurt you in your lifetime?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "The answer to this question is required" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "threatened_to_be_hurt", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "threatened_to_be_hurt", + "type": "native_radio", + "label": "Has the contact client ever hit, kicked, slapped, or physically hurt you within the last year?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "The answer to this question is required" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "sexual_assault", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_assault", + "type": "native_radio", + "label": "Has the contact client ever forced you to have sexual activities within the last year?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "The answer to this question is required" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "fearful_of_contact_client", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fearful_of_contact_client", + "type": "native_radio", + "label": "Are you threatened or fear the contact client?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "The answer to this question is required" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "additional_details", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fearful_of_contact_client", + "type": "native_radio", + "label": "Do you have any complimentary information regarding the violence you have been subjected to?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_ipv_service", + "type": "toaster_notes", + "text": "Refer the client for post-IPV Services\n\nDiscuss with the client on the appropriate referral to communicate with Index Contact", + "openmrs_entity_id": "prompt_for_ipv_service", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hiv_index_contacts_registration_relevance.yml" + } + } + } + }, + { + "key": "how_to_notify_the_contact_client", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "how_to_notify_the_contact_client", + "type": "native_radio", + "label": "How to communicate with contact client", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "client_referral", + "text": "Client Referral", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_referral" + }, + { + "key": "provider_referral", + "text": "Provider Referral", + "openmrs_entity": "concept", + "openmrs_entity_id": "provider_referral" + }, + { + "key": "contract_referral", + "text": "Contract Referral", + "openmrs_entity": "concept", + "openmrs_entity_id": "contract_referral" + }, + { + "key": "dual_referral", + "text": "Dual Referral", + "openmrs_entity": "concept", + "openmrs_entity_id": "dual_referral" + } + ], + "v_required": { + "value": "true", + "err": "The answer to this question is required" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/hiv_index_contact_community_followup_referral.json b/opensrp-chw-hf/src/main/assets/json.form/hiv_index_contact_community_followup_referral.json new file mode 100644 index 000000000..82ac719fa --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hiv_index_contact_community_followup_referral.json @@ -0,0 +1,102 @@ +{ + "form": "HIV Index Contact Community Followup Referral", + "count": "1", + "encounter_type": "HIV Index Contact Community Followup Referral", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_index_contact_community_followup_referral_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Index Contact Community Followup", + "fields": [ + { + "name": "toast_refer_to_chw", + "type": "toast_notification", + "properties": { + "notification_type": "info", + "dismissible": "no", + "title": "Client will be referred to CHW", + "text": "The client is about to be referred to the CHW tied to client's village for follow-up at the community level.\n\nAdd any additional comments that should be sent the the CHW\n\nSave the form to send the referral", + "background_color": "#082455", + "text_color": "#EBEE2F" + } + }, + { + "name": "chw_referral_hf", + "type": "spinner", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "chw_referral_hf", + "openmrs_entity_parent": "" + }, + "properties": { + "text": "CHW Location" + }, + "options": [], + "dependent_calculations": [ + "hiv_index_contact_community_followup_referral_date", + "refer_to_chw" + ], + "required_status": "yes:Please specify" + }, + { + "name": "comment", + "type": "text_input_edit_text", + "properties": { + "hint": "Remarks/Comments" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment", + "openmrs_entity_parent": "" + }, + "required_status": "false" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form/hiv_index_contact_ctc_enrollment.json b/opensrp-chw-hf/src/main/assets/json.form/hiv_index_contact_ctc_enrollment.json new file mode 100644 index 000000000..aeb84c977 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hiv_index_contact_ctc_enrollment.json @@ -0,0 +1,120 @@ +{ + "form": "HIV Index Contact CTC Enrollment", + "count": "1", + "encounter_type": "Update HIV Index Contact Testing Followup", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_index_contact_ctc_enrollment_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Index Contact HIV Outcome", + "fields": [ + { + "name": "ctc_number", + "type": "masked_edit_text", + "properties": { + "hint": "CTC Number e.g 12-34-5678-912345", + "type": "Care and Treatment Clinic registration number (CTC Number)", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "input_type": "number", + "allowed_chars": "0123456789" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "openmrs_entity_parent": "" + }, + "validation": [ + { + "condition": "value.matches(\"(\\\\d{2}-\\\\d{2}-\\\\d{4}-\\\\d{6})?\")", + "message": "CTC Number should be of the format (XX-XX-XXXX-XXXXXX)." + } + ], + "required_status": "yes:Please specify client's CTC number" + }, + { + "name": "comment", + "type": "text_input_edit_text", + "properties": { + "hint": "Remarks/Comments" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment", + "openmrs_entity_parent": "" + }, + "required_status": "false" + }, + { + "name": "place_where_test_was_conducted", + "type": "text_input_edit_text", + "properties": { + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "place_where_test_was_conducted", + "openmrs_entity_parent": "" + }, + "subjects": "place_where_test_was_conducted:map" + }, + { + "name": "test_results", + "type": "text_input_edit_text", + "properties": { + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "test_results", + "openmrs_entity_parent": "" + }, + "subjects": "test_results:map" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form/hiv_index_contact_followup.json b/opensrp-chw-hf/src/main/assets/json.form/hiv_index_contact_followup.json new file mode 100644 index 000000000..9ed32e8b4 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hiv_index_contact_followup.json @@ -0,0 +1,483 @@ +{ + "form": "HIV Index Contact Testing Followup", + "count": "1", + "encounter_type": "HIV Index Contact Testing Followup", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_index_contact_followup_for_non_sex_partner_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Index Contact HIV Outcome", + "fields": [ + { + "name": "has_the_client_been_reached", + "type": "radio_group", + "properties": { + "text": "Has the Index Contact been reached?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "has_the_client_been_reached", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Yes", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "No", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the answer", + "dependent_calculations": [ + "relationship" + ] + }, + { + "name": "eligibility_for_testing", + "type": "radio_group", + "properties": { + "text": "Is the Index Contact Eligible for testing?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "eligibility_for_testing", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Yes", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "No", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the answer", + "subjects": "has_the_client_been_reached:map" + }, + { + "name": "has_the_contact_client_been_tested", + "type": "radio_group", + "properties": { + "text": "Has the Index Contact been tested for HIV?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "has_the_contact_client_been_tested", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Yes", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "No", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the answer", + "subjects": "has_the_client_been_reached:map, eligibility_for_testing:map" + }, + { + "name": "reasons_conducting_testing_for_index_contact", + "type": "spinner", + "properties": { + "text": "Reasons as to why the Index Contact was not tested" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_conducting_testing_for_index_contact", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "test_kits_are_out_of_stock", + "text": "Test kits are out of stock", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "test_kits_are_out_of_stock", + "openmrs_entity_parent": "" + } + }, + { + "name": "the_client_refused_to_be_tested", + "text": "The client refused to be tested", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "the_client_refused_to_be_tested", + "openmrs_entity_parent": "" + } + }, + { + "name": "we_are_still_counselling_the_client", + "text": "We are still counselling the client", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "we_are_still_counselling_the_client", + "openmrs_entity_parent": "" + } + }, + { + "name": "other", + "text": "Other", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select a reason", + "subjects": "eligibility_for_testing:map,has_the_contact_client_been_tested:map,has_the_client_been_reached:map" + }, + { + "name": "other_reason_for_not_testing", + "type": "text_input_edit_text", + "properties": { + "hint": "Specify the other reason for not testing the Index Contact" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_testing", + "openmrs_entity_parent": "" + }, + "required_status": "yes:Please enter the reason", + "subjects": "reasons_conducting_testing_for_index_contact:map,eligibility_for_testing:map,has_the_contact_client_been_tested:map,has_the_client_been_reached:map" + }, + { + "name": "test_results", + "type": "radio_group", + "properties": { + "text": "What are the HIV test results?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "test_results", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "positive", + "text": "Positive", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "positive", + "openmrs_entity_parent": "" + } + }, + { + "name": "negative", + "text": "Negative", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "negative", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the test results", + "subjects": "has_the_contact_client_been_tested:map, eligibility_for_testing:map, has_the_client_been_reached:map" + }, + { + "name": "place_where_test_was_conducted", + "type": "radio_group", + "properties": { + "text": "Where was the test conducted?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "place_where_test_was_conducted", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "outpatient_department", + "text": "Outpatient department", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "outpatient_department", + "openmrs_entity_parent": "" + } + }, + { + "name": "inpatient_department", + "text": "Inpatient department", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "inpatient_department", + "openmrs_entity_parent": "" + } + }, + { + "name": "community_based_hiv_testing_service", + "text": "Community Based HIV Testing Service", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "community_based_hiv_testing_service", + "openmrs_entity_parent": "" + } + }, + { + "name": "ctc", + "text": "CTC", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc", + "openmrs_entity_parent": "" + } + }, + { + "name": "outreach_services", + "text": "Outreach services", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "outreach_services", + "openmrs_entity_parent": "" + } + }, + { + "name": "other", + "text": "Other", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the answer", + "subjects": "test_results:map, eligibility_for_testing:map, has_the_contact_client_been_tested:map, has_the_client_been_reached:map" + }, + { + "name": "client_test_date", + "type": "datetime_picker", + "properties": { + "hint": "Client's test date", + "type": "date_picker", + "display_format": "dd/MM/yyyy", + "max_date": "today" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "client_test_date", + "openmrs_entity_parent": "" + }, + "required_status": "true:Please specify the client's test date", + "subjects": "test_results:map, eligibility_for_testing:map, has_the_contact_client_been_tested:map, has_the_client_been_reached:map" + }, + { + "name": "toast_enroll_the_client_to_prep", + "type": "toast_notification", + "properties": { + "notification_type": "info", + "dismissible": "no", + "title": "Client should be enrolled to KVP/PrEP", + "text": "The client is a sex partner of a HIV Positive client and should be enrolled to KVP/PrEP", + "background_color": "#082455", + "text_color": "#EBEE2F" + }, + "subjects": "relationship:text, test_results:map, has_the_contact_client_been_tested:map, eligibility_for_testing:map, has_the_client_been_reached:map" + }, + { + "name": "enrolled_to_clinic", + "type": "radio_group", + "properties": { + "text": "Has the client been enrolled to care and treatment?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "enrolled_to_clinic", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Yes", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "No", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the answer", + "subjects": "test_results:map, eligibility_for_testing:map, has_the_contact_client_been_tested:map, has_the_client_been_reached:map" + }, + { + "name": "reasons_for_ineligibility_for_testing", + "type": "spinner", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_ineligibility_for_testing", + "openmrs_entity_parent": "" + }, + "properties": { + "text": "Reasons for Ineligibility for testing" + }, + "options": [ + { + "name": "known_positive", + "text": "The contact is known HIV positive", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "known_positive", + "openmrs_entity_parent": "" + } + }, + { + "name": "other", + "text": "Other", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes: Please Select", + "subjects": "has_the_client_been_reached:map,eligibility_for_testing:map" + }, + { + "name": "other_reason_for_ineligibility", + "type": "text_input_edit_text", + "properties": { + "hint": "Other" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_ineligibility", + "openmrs_entity_parent": "" + }, + "required_status": "yes: Please input the other reason", + "subjects": "reasons_for_ineligibility_for_testing:map, eligibility_for_testing:map, has_the_client_been_reached:map" + }, + { + "name": "ctc_number", + "type": "masked_edit_text", + "properties": { + "hint": "CTC Number e.g 12-34-5678-912345", + "type": "Care and Treatment Clinic registration number (CTC Number)", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "input_type": "number", + "allowed_chars": "0123456789" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "openmrs_entity_parent": "" + }, + "validation": [ + { + "condition": "value.matches(\"(\\\\d{2}-\\\\d{2}-\\\\d{4}-\\\\d{6})?\")", + "message": "CTC Number should be of the format (XX-XX-XXXX-XXXXXX)." + } + ], + "required_status": "yes:Please specify client's CTC number", + "subjects": "enrolled_to_clinic:map, reasons_for_ineligibility_for_testing:map, eligibility_for_testing:map, test_results:map, has_the_contact_client_been_tested:map, has_the_client_been_reached:map" + }, + { + "name": "comment", + "type": "text_input_edit_text", + "properties": { + "hint": "Remarks/Comments" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment", + "openmrs_entity_parent": "" + }, + "required_status": "false" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form/hiv_outcome.json b/opensrp-chw-hf/src/main/assets/json.form/hiv_outcome.json new file mode 100644 index 000000000..6e74955a9 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hiv_outcome.json @@ -0,0 +1,401 @@ +{ + "form": "HIV Outcome", + "count": "1", + "encounter_type": "HIV Outcome", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_outcome_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "HIV Testing Outcome", + "fields": [ + { + "name": "action_taken_hiv_problems", + "type": "radio_group", + "properties": { + "text": "Action taken by health facility." + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "action_taken_hiv_problems", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "no_action_taken", + "text": "Not Tested", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no_action_taken", + "openmrs_entity_parent": "" + } + }, + { + "name": "tested", + "text": "Tested", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "tested", + "openmrs_entity_parent": "" + } + }, + { + "name": "referred", + "text": "Referred", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "referred", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select action taken", + "dependent_calculations": [ + "hiv_facility_visit_date", + "test_results_calculation" + ] + }, + { + "name": "where_was_test_conducted", + "type": "radio_group", + "properties": { + "text": "Where was the test conducted?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "where_was_test_conducted", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "outpatient_department", + "text": "Outpatient department", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "outpatient_department", + "openmrs_entity_parent": "" + } + }, + { + "name": "inpatient_department", + "text": "Inpatient department", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "inpatient_department", + "openmrs_entity_parent": "" + } + }, + { + "name": "community_based_hiv_testing_services", + "text": "Community Based HIV Testing Services", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "community_based_hiv_testing_services", + "openmrs_entity_parent": "" + } + }, + { + "name": "ctc", + "text": "CTC", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc", + "openmrs_entity_parent": "" + } + }, + { + "name": "outreach_services", + "text": "Outreach Services", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "outreach_services", + "openmrs_entity_parent": "" + } + }, + { + "name": "other", + "text": "Other", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select where the test was conducted" + }, + { + "name": "other_where_was_test_conducted", + "type": "text_input_edit_text", + "properties": { + "hint": "Others (Specify)" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other_where_was_test_conducted", + "openmrs_entity_parent": "" + }, + "required_status": "true:Please specity where was the test conducted", + "subjects": "where_was_test_conducted:map" + }, + { + "name": "reason_no_action_was_taken", + "type": "radio_group", + "properties": { + "text": "Reasons client was not tested" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_no_action_was_taken", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "known_positive", + "text": "Known Positive", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "known_positive", + "openmrs_entity_parent": "" + } + }, + { + "name": "client_declined", + "text": "Client Declined", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "client_declined", + "openmrs_entity_parent": "" + } + }, + { + "name": "test_not_required_based_on_risk_assessment", + "text": "Test not required based on risk assessment", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_required_based_on_risk_assessment", + "openmrs_entity_parent": "" + } + }, + { + "name": "other", + "text": "Other", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select action taken", + "subjects": "action_taken_hiv_problems:map", + "dependent_calculations": [ + "test_results_calculation" + ] + }, + { + "name": "other_reason_no_action_was_taken", + "type": "text_input_edit_text", + "properties": { + "hint": "Others (Specify)" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_no_action_was_taken", + "openmrs_entity_parent": "" + }, + "required_status": "true:Please specity other reason", + "subjects": "reason_no_action_was_taken:map, action_taken_hiv_problems:map" + }, + { + "name": "test_results", + "type": "radio_group", + "properties": { + "text": "Select client’s HIV test results." + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "test_results", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "positive", + "text": "Positive", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "positive", + "openmrs_entity_parent": "" + } + }, + { + "name": "negative", + "text": "Negative", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "negative", + "openmrs_entity_parent": "" + } + }, + { + "name": "inconclusive", + "text": "Inconclusive", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "inconclusive", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the test results", + "subjects": "action_taken_hiv_problems:map" + }, + { + "name": "prompt_for_hiv_inconclusive", + "type": "toast_notification", + "properties": { + "notification_type": "warning", + "dismissible": "no", + "text": "Counsel the client to re-test after 2 weeks", + "background_color": "#ffc107", + "text_color": "#000000" + }, + "subjects": "test_results:map, action_taken_hiv_problems:map" + }, + { + "name": "enrolled_to_clinic", + "type": "radio_group", + "properties": { + "text": "Is the client enrolled to CTC clinic?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "enrolled_to_clinic", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Yes", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "No", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the answer", + "subjects": "test_results:map, action_taken_hiv_problems:map" + }, + { + "name": "ctc_number", + "type": "masked_edit_text", + "properties": { + "hint": "CTC Number e.g 12-34-5678-912345", + "type": "name", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "input_type": "number", + "allowed_chars": "0123456789" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "openmrs_entity_parent": "" + }, + "validation": [ + { + "condition": "value.matches(\"(\\\\d{2}-\\\\d{2}-\\\\d{4}-\\\\d{6})?\")", + "message": "CTC Number should be of the format (XX-XX-XXXX-XXXXXX)." + } + ], + "required_status": "true:Please fill client's CTC number", + "subjects": "reason_no_action_was_taken:map, enrolled_to_clinic:map,test_results:map, action_taken_hiv_problems:map" + }, + { + "name": "prompt_for_ctc_enrollment", + "type": "toast_notification", + "properties": { + "notification_type": "info", + "dismissible": "no", + "text": "Continue with counseling until the client is ready to be enrolled", + "background_color": "#082455", + "text_color": "#EBEE2F" + }, + "subjects": "enrolled_to_clinic:map, test_results:map, action_taken_hiv_problems:map" + }, + { + "name": "comment_hiv_problems", + "type": "text_input_edit_text", + "properties": { + "hint": "Remarks/Comments" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment_hiv_problems", + "openmrs_entity_parent": "" + }, + "required_status": "false" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form/hiv_registration.json b/opensrp-chw-hf/src/main/assets/json.form/hiv_registration.json new file mode 100644 index 000000000..3fa69cb52 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hiv_registration.json @@ -0,0 +1,267 @@ +{ + "form": "HIV Registration form", + "count": "1", + "encounter_type": "HIV Registration", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/hiv_registration_form_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "HIV Clients Registration form", + "fields": [ + { + "name": "new_or_current_hiv_client", + "type": "radio_group", + "properties": { + "text": "Is the registered client a new HIV Client or an existing HIV Client?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "new_or_current_hiv_client", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "new", + "text": "New HIV client", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "new", + "openmrs_entity_parent": "" + } + }, + { + "name": "existing", + "text": "Existing HIV Client", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "existing", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the answer" + }, + { + "name": "place_where_test_was_conducted", + "type": "radio_group", + "properties": { + "text": "Where was the test conducted?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "place_where_test_was_conducted", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "tb_clinic_outpatient", + "text": "Tuberculosis clinic (out patient)", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "tb_clinic_outpatient", + "openmrs_entity_parent": "" + } + }, + { + "name": "sexual_transmitted_diseases_clinic", + "text": "Sexual transmitted diseases clinic", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_transmitted_diseases_clinic", + "openmrs_entity_parent": "" + } + }, + { + "name": "outpatient_department", + "text": "Outpatient department", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "outpatient_department", + "openmrs_entity_parent": "" + } + }, + { + "name": "inpatient_department", + "text": "Inpatient department", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "inpatient_department", + "openmrs_entity_parent": "" + } + }, + { + "name": "blood_transfusion_service", + "text": "Blood transfusion service", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_transfusion_service", + "openmrs_entity_parent": "" + } + }, + { + "name": "community_based_hiv_testing_service", + "text": "Community Based HIV Testing Service", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "community_based_hiv_testing_service", + "openmrs_entity_parent": "" + } + }, + { + "name": "voluntary_patients", + "text": "Voluntary patients", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "voluntary_patients", + "openmrs_entity_parent": "" + } + }, + { + "name": "family_planning_clinic", + "text": "Family planning clinic", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "family_planning_clinic", + "openmrs_entity_parent": "" + } + }, + { + "name": "ctc", + "text": "CTC", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc", + "openmrs_entity_parent": "" + } + }, + { + "name": "men_circumcision", + "text": "Men circumcision", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "men_circumcision", + "openmrs_entity_parent": "" + } + }, + { + "name": "outreach_services", + "text": "Outreach services", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "outreach_services", + "openmrs_entity_parent": "" + } + }, + { + "name": "reproductive_an_child_health", + "text": "Reproductive and child health", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reproductive_an_child_health", + "openmrs_entity_parent": "" + } + }, + { + "name": "other", + "text": "Other", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the answer" + }, + { + "name": "place_where_test_was_conducted_other", + "type": "text_input_edit_text", + "properties": { + "hint": "Other (Specify)", + "type": "name" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "place_where_test_was_conducted_other", + "openmrs_entity_parent": "" + }, + "required_status": "true:Please specify the place where the test was conducted", + "subjects": "place_where_test_was_conducted:map" + }, + { + "name": "ctc_number", + "type": "masked_edit_text", + "properties": { + "hint": "CTC Number e.g 12-34-5678-912345", + "type": "Care and Treatment Clinic registration number (CTC Number)", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "input_type": "number", + "allowed_chars": "0123456789" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "openmrs_entity_parent": "" + }, + "validation": [ + { + "condition": "value.matches(\"(\\\\d{2}-\\\\d{2}-\\\\d{4}-\\\\d{6})?\")", + "message": "CTC Number should be of the format (XX-XX-XXXX-XXXXXX)." + } + ], + "required_status": "yes:Please specify client's CTC number", + "dependent_calculations": [ + "hiv_registration_date", + "client_hiv_status_during_registration", + "test_results" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/hivst_issue_kits.json b/opensrp-chw-hf/src/main/assets/json.form/hivst_issue_kits.json new file mode 100644 index 000000000..ab353f3da --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hivst_issue_kits.json @@ -0,0 +1,502 @@ +{ + "count": "1", + "encounter_type": "Self Testing Kits Issue", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Providing Self Test Kits", + "fields": [ + { + "key": "pre_test_counselling_and_instructions", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pre_test_counselling_and_instructions", + "label": "Has the client been offered pre-test counselling and instructions?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_relevance.yml" + } + } + } + }, + { + "key": "self_test_kit_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "self_test_kit_given", + "label": "Was the client provided with HIVST kit?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_relevance.yml" + } + } + } + }, + { + "key": "kit_code", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "kit_code", + "type": "edit_text", + "hint": "Kit code", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_relevance.yml" + } + } + } + }, + { + "key": "client_testing_approach", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_testing_approach", + "label": "Client's testing approach", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "assisted_testing_on_site", + "text": "Assisted testing on site", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "assisted_testing_on_site" + }, + { + "key": "assisted_testing_off_site", + "text": "Assisted testing off site", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "assisted_testing_off_site" + }, + { + "key": "unassisted_testing_on_site", + "text": "Unassisted testing on site", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "unassisted_testing_on_site" + }, + { + "key": "unassisted_testing_off_site", + "text": "Unassisted testing off site", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "unassisted_testing_off_site" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_relevance.yml" + } + } + } + }, + { + "key": "extra_kits_required", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "extra_kits_required", + "label": "Does the client require kits for peer or sexual partner?'", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "extra_kits_issued_for", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "extra_kits_issued_for", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Extra Kits were issued for?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "peer_friend", + "text": "Peer Friend", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "peer_friend" + }, + { + "key": "sexual_partner", + "text": "Sexual Partner", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:extra_kits_required": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "peer_friend_kit_code", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "peer_friend_kit_code", + "type": "edit_text", + "hint": "Peer Friend Kit code", + "relevance": { + "step1:extra_kits_issued_for": { + "ex-checkbox": [ + { + "or": [ + "peer_friend" + ] + } + ] + } + } + }, + { + "key": "sexual_partner_kit_code", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner_kit_code", + "type": "edit_text", + "hint": "Sexual Partner Kit code", + "relevance": { + "step1:extra_kits_issued_for": { + "ex-checkbox": [ + { + "or": [ + "sexual_partner" + ] + } + ] + } + } + }, + { + "key": "kits_batch_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "kit_batch_number", + "type": "edit_text", + "hint": "HIVST Kits Batch Number", + "v_required": { + "value": true, + "err": "Please fill the batch number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_relevance.yml" + } + } + } + }, + { + "key": "kits_expiry_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "kits_expiry_date", + "type": "date_picker", + "hint": "HIVST Kits Expiry Date", + "expanded": false, + "min_date": "today", + "v_required": { + "value": true, + "err": "Please select the Expiry date" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_relevance.yml" + } + } + } + }, + { + "key": "condoms_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condoms_given", + "label": "Was the client given condoms?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "type_of_issued_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_issued_condoms", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Select the type of condoms issued", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "male_condoms", + "text": "Male Condoms", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms" + }, + { + "key": "female_condoms", + "text": "Female Condoms", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:condoms_given": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "number_of_male_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_male_condoms_issued", + "type": "edit_text", + "hint": "Number of Male condoms issued (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "1", + "err": "The number must be equal or greater than 0" + }, + "v_required": { + "value": true, + "err": "Please enter the number" + }, + "relevance": { + "step1:type_of_issued_condoms": { + "ex-checkbox": [ + { + "or": [ + "male_condoms" + ] + } + ] + } + } + }, + { + "key": "number_of_female_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_female_condoms_issued", + "type": "edit_text", + "hint": "Number of Female condoms issued (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "1", + "err": "The number must be equal or greater than 0" + }, + "v_required": { + "value": true, + "err": "Please enter the number" + }, + "relevance": { + "step1:type_of_issued_condoms": { + "ex-checkbox": [ + { + "or": [ + "female_condoms" + ] + } + ] + } + } + }, + { + "key": "sms_notification_service", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sms_notification_service", + "label": "Has the client opted for sms notification service?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "collection_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "collection_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_issue_kits_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/hivst_mobilization_session.json b/opensrp-chw-hf/src/main/assets/json.form/hivst_mobilization_session.json new file mode 100644 index 000000000..e112d4316 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hivst_mobilization_session.json @@ -0,0 +1,196 @@ +{ + "count": "1", + "encounter_type": "HIVST Mobilization Session", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Self Testing Mobilization Session", + "fields": [ + { + "key": "mobilization_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mobilization_date", + "type": "date_picker", + "hint": "Mobilization Date", + "expanded": false, + "min_date": "today-6m", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the mobilization date" + } + }, + { + "key": "female_clients_reached", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_clients_reached", + "type": "edit_text", + "hint": "Number of Female clients reached", + "v_numeric": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "0", + "err": "The number must be equal or greater than 0" + }, + "v_required": { + "value": true, + "err": "Please enter the number" + } + }, + { + "key": "male_clients_reached", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_clients_reached", + "type": "edit_text", + "hint": "Number of Male clients reached", + "v_numeric": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "0", + "err": "The number must be equal or greater than 0" + }, + "v_required": { + "value": true, + "err": "Please enter the number" + } + }, + { + "key": "gps", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gps", + "openmrs_data_type": "text", + "type": "gps" + }, + { + "key": "female_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms_issued", + "type": "edit_text", + "hint": "Female condoms issued", + "v_numeric": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "0", + "err": "The number must be equal or greater than 0" + }, + "v_required": { + "value": true, + "err": "Please enter the number" + } + }, + { + "key": "male_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms_issued", + "type": "edit_text", + "hint": "Male condoms issued", + "v_numeric": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "0", + "err": "The number must be equal or greater than 0" + }, + "v_required": { + "value": true, + "err": "Please enter the number" + } + }, + { + "key": "kit_used_in_demonstration", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "kit_used_in_demonstration", + "label": "Was a kit used for demonstration in this session?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "kit_code", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "kit_code", + "type": "edit_text", + "hint": "Kit code", + "relevance": { + "step1:kit_used_in_demonstration": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/hivst_registration.json b/opensrp-chw-hf/src/main/assets/json.form/hivst_registration.json new file mode 100644 index 000000000..c717c8b97 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hivst_registration.json @@ -0,0 +1,271 @@ +{ + "count": "1", + "encounter_type": "Self Testing Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "HIVST Enrollment", + "fields": [ + { + "key": "client_testing_history", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_testing_history", + "label": "Select the client's testing history", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "new_client", + "text": "New Client (MP)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "new_client" + }, + { + "key": "returning_client", + "text": "Returning Client (HM)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "returning_client" + }, + { + "key": "known_positive", + "text": "Known Positive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_positive" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "client_group", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_group", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_registration_calculation.yml" + } + } + } + }, + { + "key": "client_group_female_15_24", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_group_female_15_24", + "label": "Select the client's group as screened by the health care provider", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "fsw", + "text": "FSW", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fsw" + }, + { + "key": "pwid", + "text": "PWID", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwid" + }, + { + "key": "prisoners", + "text": "Prisoners", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoners" + }, + { + "key": "agyw", + "text": "AGYW", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "agyw" + }, + { + "key": "others", + "text": "Others", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_registration_relevance.yml" + } + } + } + }, + { + "key": "client_group_female", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_group_female", + "label": "Select the client's group as screened by the health care provider", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "fsw", + "text": "FSW", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fsw" + }, + { + "key": "pwid", + "text": "PWID", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwid" + }, + { + "key": "prisoners", + "text": "Prisoners", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoners" + }, + { + "key": "others", + "text": "Others", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_registration_relevance.yml" + } + } + } + }, + { + "key": "client_group_male", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_group_male", + "label": "Select the client's group as screened by the health care provider", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "msm", + "text": "High Risk Men", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "msm" + }, + { + "key": "pwid", + "text": "PWID", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwid" + }, + { + "key": "prisoners", + "text": "Prisoners", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoners" + }, + { + "key": "others", + "text": "Others", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_registration_relevance.yml" + } + } + } + }, + { + "key": "known_positive_during_reg", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_positive_during_reg", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_registration_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/hivst_results.json b/opensrp-chw-hf/src/main/assets/json.form/hivst_results.json new file mode 100644 index 000000000..c3b22f142 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/hivst_results.json @@ -0,0 +1,394 @@ +{ + "count": "1", + "encounter_type": "Self Testing Results", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Record HIVST results", + "fields": [ + { + "key": "has_the_client_been_found", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "has_the_client_been_found", + "label": "Has the client been found?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + } + }, + { + "key": "disclose_result", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disclose_result", + "label": "Did the client disclose the result?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + } + }, + { + "key": "client_test_result", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_test_result", + "label": "Select the client's test result", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "reactive", + "text": "Reactive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reactive" + }, + { + "key": "non_reactive", + "text": "Non-reactive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "non_reactive" + }, + { + "key": "invalid", + "text": "Invalid", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "invalid" + }, + { + "key": "wastage", + "text": "Wastage", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "wastage" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "prompt_for_referral", + "type": "toaster_notes", + "text": "The client should be linked for HIV conventional test", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_invalid_or_wastage_for_client", + "type": "toaster_notes", + "text": "Provide additional kit", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + } + }, + { + "key": "peer_test_result", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "peer_test_result", + "label": "Select the peer's test result", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "reactive", + "text": "Reactive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reactive" + }, + { + "key": "non_reactive", + "text": "Non-reactive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "non_reactive" + }, + { + "key": "invalid", + "text": "Invalid", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "invalid" + }, + { + "key": "wastage", + "text": "Wastage", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "wastage" + }, + { + "key": "not_returned", + "text": "Results not returned", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_returned" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + } + }, + { + "key": "sexual_partner_test_result", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_partner_test_result", + "label": "Select the sexual partner's test result", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "reactive", + "text": "Reactive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reactive" + }, + { + "key": "non_reactive", + "text": "Non-reactive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "non_reactive" + }, + { + "key": "invalid", + "text": "Invalid", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "invalid" + }, + { + "key": "wastage", + "text": "Wastage", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "wastage" + }, + { + "key": "not_returned", + "text": "Results not returned", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_returned" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + } + }, + { + "key": "hivst_result", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hivst_result", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_calculation.yml" + } + } + } + }, + { + "key": "prompt_for_referral_for_peer_or_sexual_partner", + "type": "toaster_notes", + "text": "Counsel the client to advise their Sexual Partner/Peer Friend to visit health facility for Confirmatory tests", + "toaster_info_text": "Counsel the client to advise their Sexual Partner/Peer Friend to visit health facility for Confirmatory tests", + "toaster_info_title": "Counsel the client", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_invalid_or_wastage_for_peer_or_sexual_partner", + "type": "toaster_notes", + "text": "Provide additional kit for Sexual Partner/Peer Friend", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_relevance.yml" + } + } + } + }, + { + "key": "register_to_hts", + "type": "hidden", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "register_to_hts", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_calculation.yml" + } + } + } + }, + { + "key": "result_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "result_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "hivst_results_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/in_app_monthly_tallies_report.json b/opensrp-chw-hf/src/main/assets/json.form/in_app_monthly_tallies_report.json index 1d410e402..f3ca2ea6d 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/in_app_monthly_tallies_report.json +++ b/opensrp-chw-hf/src/main/assets/json.form/in_app_monthly_tallies_report.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_cervical_cancer_screening.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_cervical_cancer_screening.json new file mode 100644 index 000000000..7f784382b --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_cervical_cancer_screening.json @@ -0,0 +1,88 @@ +{ + "count": "1", + "encounter_type": "KVP Cervical Cancer Screening", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Cervical Cancer Screening", + "fields": [ + { + "key": "cervical_cancer_screening", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cervical_cancer_screening", + "type": "native_radio", + "label": "Was the client screened for Cervical Cancer?", + "options": [ + { + "key": "screened", + "text": "Screened", + "openmrs_entity": "concept", + "openmrs_entity_id": "screened" + }, + { + "key": "not_screened", + "text": "Not screened", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_provided" + }, + { + "key": "referred", + "text": "Referred for treatment", + "openmrs_entity": "concept", + "openmrs_entity_id": "referred" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_client_status.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_client_status.json new file mode 100644 index 000000000..80e53f8f7 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_client_status.json @@ -0,0 +1,183 @@ +{ + "count": "1", + "encounter_type": "KVP Client Status", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Client Status", + "fields": [ + { + "key": "client_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_status", + "label": "Type of visit", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "new_client", + "text": "New client", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "new_visit" + }, + { + "key": "transfer_in", + "text": "Transfer-in", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "transfer_in" + }, + { + "key": "return", + "text": "Return", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "return" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "other_kvp_category", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_kvp_category", + "type": "check_box", + "label": "Other client's KVP category", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "pwud", + "text": "PWUD", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwud" + }, + { + "key": "pwid", + "text": "PWID", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwid" + }, + { + "key": "fsw", + "text": "FSW", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fsw" + }, + { + "key": "msm", + "text": "High Risk Men", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "msm" + }, + { + "key": "agyw", + "text": "AGYW", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "agyw" + }, + { + "key": "prisoner", + "text": "Prisoners", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoner" + }, + { + "key": "rumandee", + "text": "Rumandee", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rumandee" + }, + { + "key": "mobile_population", + "text": "Mobile population", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mobile_population" + }, + { + "key": "serodiscordant_couple", + "text": "Serodiscordant couple", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "serodiscordant_couple" + }, + { + "key": "other_vulnerable_population", + "text": "Other vulnerable population", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_vulnerable_population" + }, + { + "key": "none", + "text": "None", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ], + "v_required": { + "value": "true", + "err": "Please pick at least one" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_condom_provision.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_condom_provision.json new file mode 100644 index 000000000..437429421 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_condom_provision.json @@ -0,0 +1,178 @@ +{ + "count": "1", + "encounter_type": "KVP Condom Provision", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Condom Provision", + "fields": [ + { + "key": "condoms_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condoms_given", + "label": "Was the client given condoms?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "type_of_issued_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_issued_condoms", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Select the type of condoms issued", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "male_condoms", + "text": "Male Condoms", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms" + }, + { + "key": "female_condoms", + "text": "Female Condoms", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:condoms_given": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "number_of_male_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_male_condoms_issued", + "type": "edit_text", + "hint": "Number of Male condoms issued (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "0", + "err": "The number must be equal or greater than 0" + }, + "v_required": { + "value": true, + "err": "Please enter the number" + }, + "relevance": { + "step1:type_of_issued_condoms": { + "ex-checkbox": [ + { + "or": [ + "male_condoms" + ] + } + ] + } + } + }, + { + "key": "number_of_female_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_female_condoms_issued", + "type": "edit_text", + "hint": "Number of Female condoms issued (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "0", + "err": "The number must be equal or greater than 0" + }, + "v_required": { + "value": true, + "err": "Please enter the number" + }, + "relevance": { + "step1:type_of_issued_condoms": { + "ex-checkbox": [ + { + "or": [ + "female_condoms" + ] + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_female_family_planning_services.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_female_family_planning_services.json new file mode 100644 index 000000000..6edce2b06 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_female_family_planning_services.json @@ -0,0 +1,159 @@ +{ + "count": "1", + "encounter_type": "KVP Family Planning", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Family Planning", + "fields": [ + { + "key": "family_planning_service", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "family_planning_service", + "type": "native_radio", + "label": "Family planning service provided", + "options": [ + { + "key": "pill", + "text": "Pill", + "openmrs_entity": "concept", + "openmrs_entity_id": "pill" + }, + { + "key": "injectable", + "text": "Injectables", + "openmrs_entity": "concept", + "openmrs_entity_id": "injectable" + }, + { + "key": "implanon", + "text": "Implanon", + "openmrs_entity": "concept", + "openmrs_entity_id": "implanon" + }, + { + "key": "jadelle", + "text": "Jadelle", + "openmrs_entity": "concept", + "openmrs_entity_id": "jadelle" + }, + { + "key": "iucd", + "text": "IUCD", + "openmrs_entity": "concept", + "openmrs_entity_id": "iucd" + }, + { + "key": "traditional", + "text": "Traditional", + "openmrs_entity": "concept", + "openmrs_entity_id": "traditional" + }, + { + "key": "tube_ligation", + "text": "Tube Ligation", + "openmrs_entity": "concept", + "openmrs_entity_id": "tube_ligation" + }, + { + "key": "referral", + "text": "Referral", + "openmrs_entity": "concept", + "openmrs_entity_id": "referral" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + }, + { + "key": "refused", + "text": "Refused", + "openmrs_entity": "concept", + "openmrs_entity_id": "refused" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "condom_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_provided", + "label": "Was the client also provided with condom as a family planning method?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:family_planning_service": { + "type": "string", + "ex": "notEqualTo(., \"tube_ligation\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_gbv_analysis.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_gbv_analysis.json new file mode 100644 index 000000000..47c3f9287 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_gbv_analysis.json @@ -0,0 +1,88 @@ +{ + "count": "1", + "encounter_type": "KVP GBV Analysis", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "GBV Analysis", + "fields": [ + { + "key": "gbv_screening", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gbv_screening", + "type": "native_radio", + "label": "Gender Based Violence (GBV) screening (physical, psychological, emotional)", + "options": [ + { + "key": "case_not_reported", + "text": "The client has not reported any gender-based violence (GBV) cases.", + "openmrs_entity": "concept", + "openmrs_entity_id": "case_not_reported" + }, + { + "key": "case_reported", + "text": "The client reported a case of gender-based violence (GBV).", + "openmrs_entity": "concept", + "openmrs_entity_id": "case_reported" + }, + { + "key": "received_post_gbv_care", + "text": "The client received post-GBV care for a reported case of gender-based violence (GBV)", + "openmrs_entity": "concept", + "openmrs_entity_id": "received_post_gbv_care" + }, + { + "key": "referred", + "text": "The client was referred for further assistance after reporting a case of gender-based violence (GBV)", + "openmrs_entity": "concept", + "openmrs_entity_id": "referred" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_health_education.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_health_education.json new file mode 100644 index 000000000..3d949784e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_health_education.json @@ -0,0 +1,154 @@ +{ + "count": "1", + "encounter_type": "KVP Health Education", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Health Education", + "fields": [ + { + "key": "health_education_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "health_education_provided", + "type": "check_box", + "label": "Health education provided to the client", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "sti", + "text": "STI", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sti" + }, + { + "key": "hbv_hcv", + "text": "HBV and HCV", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hbv_hcv" + }, + { + "key": "tb", + "text": "TB", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tb" + }, + { + "key": "gbv", + "text": "GBV", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gbv" + }, + { + "key": "pep", + "text": "PEP", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pep" + }, + { + "key": "prep", + "text": "PrEP", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep" + }, + { + "key": "vmmc", + "text": "VMMC", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "vmmc" + }, + { + "key": "cacx", + "text": "CaCx", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cacx" + }, + { + "key": "drug_use_disorder", + "text": "Drug use disorder", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_use_disorder" + }, + { + "key": "hiv_aids", + "text": "HIV and AIDS couple", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_aids" + }, + { + "key": "others", + "text": "Others", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + }, + { + "key": "none", + "text": "None", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ], + "v_required": { + "value": "true", + "err": "Please pick at least one" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_hepatitis.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_hepatitis.json new file mode 100644 index 000000000..283858845 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_hepatitis.json @@ -0,0 +1,126 @@ +{ + "count": "1", + "encounter_type": "KVP Hepatitis", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Hepatitis B&C", + "fields": [ + { + "key": "hep_b_testing", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hep_b_testing", + "type": "native_radio", + "label": "Client tested for Hepatitis B virus (HBV)", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "positive_and_referred", + "text": "Positive and referred", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive_and_referred" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "not_tested", + "text": "Not tested", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_tested" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "hep_c_testing", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hep_c_testing", + "type": "native_radio", + "label": "Client tested for Hepatitis C virus (HCV)", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "positive_and_referred", + "text": "Positive and referred", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive_and_referred" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "not_tested", + "text": "Not tested", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_tested" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_hts.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_hts.json new file mode 100644 index 000000000..ff08ee473 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_hts.json @@ -0,0 +1,426 @@ +{ + "count": "1", + "encounter_type": "KVP HTS", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "HTS", + "fields": [ + { + "key": "previous_hiv_testing_method", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "previous_hiv_testing_method", + "label": "Previous HIV testing method", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "hivst", + "text": "HIVST", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hivst" + }, + { + "key": "hiv_cv_test", + "text": "HIV conventional test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_cv_test" + }, + { + "key": "hivst_and_hiv_cv_test", + "text": "HIVST and HIV conventional test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hivst_and_hiv_cv_test" + }, + { + "key": "other_method", + "text": "Other method", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_method" + }, + { + "key": "not_tested", + "text": "Not tested", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_tested" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "other_previous_hiv_testing_method", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_previous_hiv_testing_method", + "type": "edit_text", + "hint": "Other(Specify)", + "v_required": { + "value": "true", + "err": "Please specify" + }, + "relevance": { + "step1:previous_hiv_testing_method": { + "type": "string", + "ex": "equalTo(., \"other_method\")" + } + } + }, + { + "key": "testing_site", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "testing_site", + "label": "Client's testing site", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "community", + "text": "Community", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "community" + }, + { + "key": "facility", + "text": "Facility", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "facility" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_hts_relevance.yml" + } + } + } + }, + { + "key": "tested_hiv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tested_hiv", + "label": "Has the client tested for HIV?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "testing_approach", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "testing_approach", + "label": "Client's testing approach", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "citc", + "text": "CITC", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "citc" + }, + { + "key": "pitc", + "text": "PITC", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pitc" + }, + { + "key": "cbhts", + "text": "CBHTS", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "CBHTS" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_hts_relevance.yml" + } + } + } + }, + { + "key": "received_test_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "received_test_results", + "label": "Has the client received post-test counseling and results?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "step1:tested_hiv": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "hiv_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_status", + "label": "HIV testing results", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "inconclusive", + "text": "Inconclusive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "inconclusive" + }, + { + "key": "known_positive", + "text": "Known Positive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_positive" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_hts_relevance.yml" + } + } + } + }, + { + "key": "ctc_services", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_services", + "label": "Enrollment to CTC services", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "enrolled_but_not_on_arv", + "text": "Enrolled but not initiated on ARV", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "enrolled_but_not_on_arv" + }, + { + "key": "enrolled_and_on_arv", + "text": "Enrolled and initiated on ARV", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "enrolled_and_on_arv" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_hts_relevance.yml" + } + } + } + }, + { + "key": "ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "CTC Number", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "CTC number should be of the format (XX-XX-XXXX-XXXXXX)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid CTC Number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_hts_relevance.yml" + } + } + } + }, + { + "key": "kits_distributed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "kits_distributed", + "label": "HIVST kits distributed", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "prompt_for_hivst", + "type": "toaster_notes", + "text": "Please use HIVST Module to record the Information", + "openmrs_entity_id": "prompt_for_hivst", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:kits_distributed": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_iec_sbcc.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_iec_sbcc.json new file mode 100644 index 000000000..297be0f22 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_iec_sbcc.json @@ -0,0 +1,66 @@ +{ + "count": "1", + "encounter_type": "KVP IEC/SBCC", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "IEC/SBCC", + "fields": [ + { + "key": "iec_sbcc_materials", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "iec_sbcc_materials", + "type": "edit_text", + "hint": "Number of IEC/SBCC materials provided to the client", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_male_family_planning_services.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_male_family_planning_services.json new file mode 100644 index 000000000..2f98523df --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_male_family_planning_services.json @@ -0,0 +1,129 @@ +{ + "count": "1", + "encounter_type": "KVP Family Planning", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Family Planning", + "fields": [ + { + "key": "family_planning_service", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "family_planning_service", + "type": "native_radio", + "label": "Family planning service provided", + "options": [ + { + "key": "vasectomy", + "text": "Vasectomy", + "openmrs_entity": "concept", + "openmrs_entity_id": "vasectomy" + }, + { + "key": "traditional", + "text": "Traditional", + "openmrs_entity": "concept", + "openmrs_entity_id": "traditional" + }, + { + "key": "referral", + "text": "Referral", + "openmrs_entity": "concept", + "openmrs_entity_id": "referral" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + }, + { + "key": "refused", + "text": "Refused", + "openmrs_entity": "concept", + "openmrs_entity_id": "refused" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "condom_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom_provided", + "label": "Was the client also provided with condom as a family planning method?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:family_planning_service": { + "type": "string", + "ex": "notEqualTo(., \"vasectomy\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_mat.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_mat.json new file mode 100644 index 000000000..01331fbd4 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_mat.json @@ -0,0 +1,82 @@ +{ + "count": "1", + "encounter_type": "KVP MAT", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "MAT", + "fields": [ + { + "key": "mat_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mat_provided", + "type": "native_radio", + "label": "Was the client provided with MAT services?", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no_but_referral_given", + "text": "No, but the client was issued a referral", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_but_referral_given" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_other_services_and_referrals.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_other_services_and_referrals.json new file mode 100644 index 000000000..b874dca01 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_other_services_and_referrals.json @@ -0,0 +1,142 @@ +{ + "count": "1", + "encounter_type": "KVP Other Services", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Other Services and Referral", + "fields": [ + { + "key": "other_services_referrals_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_services_referrals_provided", + "type": "check_box", + "label": "Other services/referrals provided to the client", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "rch", + "text": "RCH", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rch" + }, + { + "key": "mental_health", + "text": "Mental health", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mental_health" + }, + { + "key": "covid_vaccine", + "text": "Covid-19 vaccine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "covid_vaccine" + }, + { + "key": "legal_services", + "text": "Legal services", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "legal_services" + }, + { + "key": "iga", + "text": "IGA", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "iga" + }, + { + "key": "other", + "text": "Other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + }, + { + "key": "none", + "text": "None", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ], + "v_required": { + "value": "true", + "err": "Please pick at least one" + } + }, + { + "key": "other_other_services_referrals_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_other_services_referrals_provided", + "type": "edit_text", + "hint": "Other(Specify)", + "v_required": { + "value": "true", + "err": "Please specify" + }, + "relevance": { + "step1:other_services_referrals_provided": { + "ex-checkbox": [ + { + "or": [ + "other" + ] + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_prep_pep.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_prep_pep.json new file mode 100644 index 000000000..b9ced5a9e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_prep_pep.json @@ -0,0 +1,107 @@ +{ + "count": "1", + "encounter_type": "KVP PrEP and PEP", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "PEP assesment", + "fields": [ + { + "key": "enrolled_to_prep", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "enrolled_to_prep", + "text_color": "#000000", + "type": "hidden" + }, + { + "key": "pep_provision", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pep_provision", + "label": "PEP provision after the client was at risk of contracting HIV", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "provided", + "text": "Provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "community" + }, + { + "key": "not_provided", + "text": "Not provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "facility" + }, + { + "key": "referred", + "text": "Referred", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "referred" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "step1:enrolled_to_prep": { + "type": "string", + "ex": "notEqualTo(., \"true\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_screening_female.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_screening_female.json new file mode 100644 index 000000000..ad21049e6 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_screening_female.json @@ -0,0 +1,1088 @@ +{ + "count": "9", + "skip_blank_steps": true, + "encounter_type": "KVP Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "PWUD", + "next": "step2", + "fields": [ + { + "key": "drug_use", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_use", + "label": "Has the client used illegal drugs in the past 12 months?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "is_pwud", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_pwud", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_calculation.yml" + } + } + } + } + ] + }, + "step2": { + "title": "PWID", + "next": "step3", + "fields": [ + { + "key": "drug_injection", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_injection", + "label": "Has the client ever injected him or herself with drugs?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "is_pwid", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_pwid", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_calculation.yml" + } + } + } + } + ] + }, + "step3": { + "title": "Sexual Behavior", + "next": "step4", + "fields": [ + { + "key": "sexual_intercourse", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_intercourse", + "label": "Has the client ever had sexual intercourse?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + } + ] + }, + "step4": { + "title": "Serodiscordant Couple", + "next": "step5", + "fields": [ + { + "key": "hiv_status_on_screening", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_status_on_screening", + "label": "What is the client's HIV status?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "unknown", + "text": "Unknown", + "openmrs_entity": "concept", + "openmrs_entity_id": "unknown" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "hiv_positive_partner", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_positive_partner", + "label": "Is the client in a sexual relationship with a partner who is HIV positive?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "partner_hiv_care_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_hiv_care_status", + "label": "Select the partner's criteria of HIV care status", + "text_color": "#000000", + "type": "check_box", + "options": [ + { + "key": "not_started_art", + "text": "Has not started ART", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_started_art" + }, + { + "key": "art_more_than_six_months_unused", + "text": "Has not taken ART for more than six months", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "art_more_than_six_months_unused" + }, + { + "key": "art_adherence_doubt", + "text": "Doubt about adherence/use of ART", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "art_adherence_doubt" + }, + { + "key": "no_evidence_low_vl", + "text": "The partner has no evidence of low viral load count", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_evidence_low_vl" + } + ], + "relevance": { + "step4:hiv_positive_partner": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "prompt_counsel_for_testing", + "type": "toaster_notes", + "text": "Counsel for HIV testing", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step4:hiv_status": { + "type": "string", + "ex": "equalTo(., \"unknown\")" + } + } + }, + { + "key": "is_sdc", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_sdc", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_calculation.yml" + } + } + } + } + ] + }, + "step5": { + "title": "FSW", + "next": "step6", + "fields": [ + { + "key": "sex_for_money", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sex_for_money", + "label": "In the last six months has the client had sex to get things, money or favors?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "main_income_source_is_sex", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "main_income_source_is_sex", + "label": "Is sex work the main source of income?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step5:sex_for_money": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "is_fsw", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_fsw", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_calculation.yml" + } + } + } + } + ] + }, + "step6": { + "title": "AGYW", + "next": "step7", + "fields": [ + { + "key": "client_in_school", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_in_school", + "label": "Is the client currently in school?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "harsh_condition_impact", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "harsh_condition_impact", + "type": "check_box", + "label": "Impact and vulnerability of living in harsh conditions", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "not_applicable" + ], + "options": [ + { + "key": "sex_for_material", + "text": "In the last 6 months the client has had sex to get things or money", + "openmrs_entity": "concept", + "openmrs_entity_id": "sex_for_material" + }, + { + "key": "sexually_abused", + "text": "A victim who continues to be sexually abused", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexually_abused" + }, + { + "key": "sex_last_three_months", + "text": "Has had sex in the last 3 months", + "openmrs_entity": "concept", + "openmrs_entity_id": "sex_last_three_months" + }, + { + "key": "infected_with_sexual_disease", + "text": "Infected with a sexual disease in the last 3 months", + "openmrs_entity": "concept", + "openmrs_entity_id": "infected_with_sexual_disease" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step6:client_in_school": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "is_agyw", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_agyw", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_calculation.yml" + } + } + } + } + ] + }, + "step7": { + "title": "Other Vulnerable Population", + "next": "step8", + "fields": [ + { + "key": "prisoner_or_rumandee", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoner_or_rumandee", + "label": "Is the client a prisoner or a rumandee?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "prisoner", + "text": "Prisoner", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoner" + }, + { + "key": "rumandee", + "text": "Rumandee", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rumandee" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "mobile_population", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mobile_population", + "label": "Mobile population", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "long_distance_drivers", + "text": "Long distance drivers", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "long_distance_drivers" + }, + { + "key": "fishermen", + "text": "Fishermen", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fishermen" + }, + { + "key": "mining_workers", + "text": "Mining workers", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mining_workers" + }, + { + "key": "large_farm_farmers", + "text": "Farmers in large farms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "large_farm_farmers" + }, + { + "key": "road_builders", + "text": "Road builders", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "road_builders" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "other_groups_at_risk", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_groups_at_risk", + "label": "Other groups at risk of HIV infection", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "disabled", + "text": "Disabled", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabled" + }, + { + "key": "street_children_or_orphans", + "text": "Street children or orphans", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "street_children_or_orphans" + }, + { + "key": "street_working_children", + "text": "Young working children on the streets", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "street_working_children" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "is_ovp_kvp", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_ovp_kvp", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_calculation.yml" + } + } + } + } + ] + }, + "step8": { + "title": "PrEP Assessment", + "next": "step9", + "fields": [ + { + "key": "should_enroll", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "should_enroll", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_calculation.yml" + } + } + } + }, + { + "key": "prep_assessment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_assessment", + "label": "Has the client been assessed for the use of PrEP?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "prep_qualified", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_qualified", + "label": "Is the client eligible to receive PrEP?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step8:prep_assessment": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + }, + "step9": { + "title": "KVP Enrollment", + "fields": [ + { + "key": "prompt_for_sdc_kvp", + "type": "toaster_notes", + "text": "The client falls in SDC KVP group\nThe client should be enrolled to KVP friendly services", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_agyw_kvp", + "type": "toaster_notes", + "text": "The client falls in AGYW KVP group\nThe client should be enrolled to KVP friendly services", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_ovp_kvp", + "type": "toaster_notes", + "text": "The client falls in Other vulnerable population KVP group\nThe client should be enrolled to KVP friendly services", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_fsw_kvp", + "type": "toaster_notes", + "text": "The client falls in FSW KVP group\nThe client should be enrolled to KVP friendly services", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_pwud_kvp", + "type": "toaster_notes", + "text": "The client falls in PWUD KVP group\nThe client should be enrolled to KVP friendly services", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_pwid_kvp", + "type": "toaster_notes", + "text": "The client falls in PWID KVP group\nThe client should be enrolled to KVP friendly services", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "prompt_no_group", + "type": "toaster_notes", + "text": "The client does not fall in any of the KVP groups and won't be enrolled to KVP friendly services", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "birth_region", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "birth_region", + "openmrs_data_type": "select one", + "type": "spinner", + "label_info_title": "Client's Region of Birth", + "label_info_text": "", + "hint": "Select the client's Region of Birth", + "values": [ + "Arusha", + "Dar es Salaam", + "Dodoma", + "Geita", + "Iringa", + "Kagera", + "Katavi", + "Kigoma", + "Kilimanjaro", + "Lindi", + "Manyara", + "Mara", + "Mbeya", + "Morogoro", + "Mtwara", + "Mwanza", + "Njombe", + "Pwani", + "Rukwa", + "Ruvuma", + "Shinyanga", + "Simiyu", + "Singida", + "Songwe", + "Tabora", + "Tanga" + + ], + "keys": [ + "Arusha", + "Dar es Salaam", + "Dodoma", + "Geita", + "Iringa", + "Kagera", + "Katavi", + "Kigoma", + "Kilimanjaro", + "Lindi", + "Manyara", + "Mara", + "Mbeya", + "Morogoro", + "Mtwara", + "Mwanza", + "Njombe", + "Pwani", + "Rukwa", + "Ruvuma", + "Shinyanga", + "Simiyu", + "Singida", + "Songwe", + "Tabora", + "Tanga" + ], + "v_required": { + "value": "true", + "err": "Please select the region" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "enrollment_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "enrollment_date", + "type": "date_picker", + "hint": "Enrollment date", + "expanded": false, + "min_date": "today-1m", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + }, + { + "key": "client_group", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_group", + "label": "Select the client group as screened by the health care provider", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "fsw", + "text": "FSW", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fsw" + }, + { + "key": "pwud", + "text": "PWUD", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwud" + }, + { + "key": "pwid", + "text": "PWID", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwid" + }, + { + "key": "prisoner", + "text": "Prisoners", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoner" + }, + { + "key": "rumandee", + "text": "Rumandee", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rumandee" + }, + { + "key": "agyw", + "text": "AGYW", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "agyw" + }, + { + "key": "serodiscordant_couple", + "text": "Serodiscordant couple", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "serodiscordant_couple" + }, + { + "key": "mobile_population", + "text": "Mobile population", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mobile_population" + }, + { + "key": "other_vulnerable_population", + "text": "Other vulnerable population", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_vulnerable_population" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_female_relevance.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_screening_male.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_screening_male.json new file mode 100644 index 000000000..ea66c6cde --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_screening_male.json @@ -0,0 +1,924 @@ +{ + "count": "8", + "skip_blank_steps": true, + "encounter_type": "KVP Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "PWUD", + "next": "step2", + "fields": [ + { + "key": "drug_use", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_use", + "label": "Has the client used illegal drugs in the past 12 months?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "is_pwud", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_pwud", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_calculation.yml" + } + } + } + } + ] + }, + "step2": { + "title": "PWID", + "next": "step3", + "fields": [ + { + "key": "drug_injection", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_injection", + "label": "Has the client ever injected him or herself with drugs?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "is_pwid", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_pwid", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_calculation.yml" + } + } + } + } + ] + }, + "step3": { + "title": "Sexual Behavior", + "next": "step4", + "fields": [ + { + "key": "sexual_intercourse", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_intercourse", + "label": "Has the client ever had sexual intercourse?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + } + ] + }, + "step4": { + "title": "High Risk Men", + "next": "step5", + "fields": [ + { + "key": "sexual_intercourse_with", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sexual_intercourse_with", + "label": "Does the client have sexual intercourse with man, woman or both?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "man", + "text": "Man", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "man" + }, + { + "key": "woman", + "text": "Woman", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "woman" + }, + { + "key": "both", + "text": "Both", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "both" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "is_msm", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_msm", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_calculation.yml" + } + } + } + } + ] + }, + "step5": { + "title": "Serodiscordant Couple", + "next": "step6", + "fields": [ + { + "key": "hiv_status_on_screening", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_status_on_screening", + "label": "What is the client's HIV status?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "unknown", + "text": "Unknown", + "openmrs_entity": "concept", + "openmrs_entity_id": "unknown" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "hiv_positive_partner", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_positive_partner", + "label": "Is the client in a sexual relationship with a partner who is HIV positive?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "partner_hiv_care_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "partner_hiv_care_status", + "label": "Select the partner's criteria of HIV care status", + "text_color": "#000000", + "type": "check_box", + "options": [ + { + "key": "not_started_art", + "text": "Has not started ART", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_started_art" + }, + { + "key": "art_more_than_six_months_unused", + "text": "Has not taken ART for more than six months", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "art_more_than_six_months_unused" + }, + { + "key": "art_adherence_doubt", + "text": "Doubt about adherence/use of ART", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "art_adherence_doubt" + }, + { + "key": "no_evidence_low_vl", + "text": "The partner has no evidence of low viral load count", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_evidence_low_vl" + } + ], + "relevance": { + "step5:hiv_positive_partner": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "prompt_counsel_for_testing", + "type": "toaster_notes", + "text": "Counsel for HIV testing", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step5:hiv_status": { + "type": "string", + "ex": "equalTo(., \"unknown\")" + } + } + }, + { + "key": "is_sdc", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_sdc", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_calculation.yml" + } + } + } + } + ] + }, + "step6": { + "title": "Other Vulnerable Population", + "next": "step7", + "fields": [ + { + "key": "prisoner_or_rumandee", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoner_or_rumandee", + "label": "Is the client a prisoner or a rumandee?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "prisoner", + "text": "Prisoner", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoner" + }, + { + "key": "rumandee", + "text": "Rumandee", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rumandee" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "mobile_population", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mobile_population", + "label": "Mobile population", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "long_distance_drivers", + "text": "Long distance drivers", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "long_distance_drivers" + }, + { + "key": "fishermen", + "text": "Fishermen", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fishermen" + }, + { + "key": "mining_workers", + "text": "Mining workers", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mining_workers" + }, + { + "key": "large_farm_farmers", + "text": "Farmers in large farms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "large_farm_farmers" + }, + { + "key": "road_builders", + "text": "Road builders", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "road_builders" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "other_groups_at_risk", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_groups_at_risk", + "label": "Other groups at risk of HIV infection", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "disabled", + "text": "Disabled", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabled" + }, + { + "key": "street_children_or_orphans", + "text": "Street children or orphans", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "street_children_or_orphans" + }, + { + "key": "street_working_children", + "text": "Young working children on the streets", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "street_working_children" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "is_ovp_kvp", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_ovp_kvp", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_calculation.yml" + } + } + } + } + ] + }, + "step7": { + "title": "PrEP Assessment", + "next": "step8", + "fields": [ + { + "key": "should_enroll", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "should_enroll", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_calculation.yml" + } + } + } + }, + { + "key": "prep_assessment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_assessment", + "label": "Has the client been assessed for the use of PrEP?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "prep_qualified", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_qualified", + "label": "Is the client eligible to receive PrEP?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step7:prep_assessment": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + }, + "step8": { + "title": "KVP Enrollment", + "fields": [ + { + "key": "prompt_for_sdc_kvp", + "type": "toaster_notes", + "text": "The client falls in SDC KVP group\nThe client should be enrolled to KVP friendly services", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_msm_kvp", + "type": "toaster_notes", + "text": "The client falls in High Risk Men KVP group\nThe client should be enrolled to KVP friendly services", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_pwud_kvp", + "type": "toaster_notes", + "text": "The client falls in PWUD KVP group\nThe client should be enrolled to KVP friendly services", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_pwid_kvp", + "type": "toaster_notes", + "text": "The client falls in PWID KVP group\nThe client should be enrolled to KVP friendly services", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "prompt_no_group", + "type": "toaster_notes", + "text": "The client does not fall in any of the KVP groups and won't be enrolled to KVP friendly services", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_ovp_kvp", + "type": "toaster_notes", + "text": "The client falls in Other vulnerable population KVP group\nThe client should be enrolled to KVP friendly services", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "birth_region", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "birth_region", + "openmrs_data_type": "select one", + "type": "spinner", + "label_info_title": "Client's Region of Birth", + "label_info_text": "", + "hint": "Select the client's Region of Birth", + "values": [ + "Arusha", + "Dar es Salaam", + "Dodoma", + "Geita", + "Iringa", + "Kagera", + "Katavi", + "Kigoma", + "Kilimanjaro", + "Lindi", + "Manyara", + "Mara", + "Mbeya", + "Morogoro", + "Mtwara", + "Mwanza", + "Njombe", + "Pwani", + "Rukwa", + "Ruvuma", + "Shinyanga", + "Simiyu", + "Singida", + "Songwe", + "Tabora", + "Tanga" + ], + "keys": [ + "Arusha", + "Dar es Salaam", + "Dodoma", + "Geita", + "Iringa", + "Kagera", + "Katavi", + "Kigoma", + "Kilimanjaro", + "Lindi", + "Manyara", + "Mara", + "Mbeya", + "Morogoro", + "Mtwara", + "Mwanza", + "Njombe", + "Pwani", + "Rukwa", + "Ruvuma", + "Shinyanga", + "Simiyu", + "Singida", + "Songwe", + "Tabora", + "Tanga" + ], + "v_required": { + "value": "true", + "err": "Please select the region" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "enrollment_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "enrollment_date", + "type": "date_picker", + "hint": "Enrollment date", + "expanded": false, + "min_date": "today-1m", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + }, + { + "key": "client_group", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_group", + "label": "Select the client group as screened by the health care provider", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "msm", + "text": "High Risk Men", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "msm" + }, + { + "key": "pwud", + "text": "PWUD", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwud" + }, + { + "key": "pwid", + "text": "PWID", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pwid" + }, + { + "key": "prisoner", + "text": "Prisoners", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prisoner" + }, + { + "key": "rumandee", + "text": "Rumandee", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rumandee" + }, + { + "key": "serodiscordant_couple", + "text": "Serodiscordant couple", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "serodiscordant_couple" + }, + { + "key": "mobile_population", + "text": "Mobile population", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mobile_population" + }, + { + "key": "other_vulnerable_population", + "text": "Other vulnerable population", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_vulnerable_population" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "kvp_screening_male_relevance.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_sti_screening.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_sti_screening.json new file mode 100644 index 000000000..510f8c17b --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_sti_screening.json @@ -0,0 +1,135 @@ +{ + "count": "1", + "encounter_type": "KVP STI", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "STI", + "fields": [ + { + "key": "sti_screening", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sti_screening", + "type": "native_radio", + "label": "Sexual Transmitted Infection (STI) screening", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "screening_not_conducted", + "text": "Screening Not Conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "screening_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "treatment_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "treatment_provided", + "type": "native_radio", + "label": "Select the treatment provided to the client", + "options": [ + { + "key": "treated", + "text": "Treated", + "openmrs_entity": "concept", + "openmrs_entity_id": "treated" + }, + { + "key": "referral", + "text": "Referral", + "openmrs_entity": "concept", + "openmrs_entity_id": "referral" + }, + { + "key": "not_treated", + "text": "Not Treated", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_treated" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:sti_screening": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "prompt_for_further_management", + "type": "toaster_notes", + "text": "Refer for Further Management", + "openmrs_entity_id": "prompt_for_further_management", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:treatment_provided": { + "type": "string", + "ex": "equalTo(., \"not_treated\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_tb_investigation.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_tb_investigation.json new file mode 100644 index 000000000..936f251b1 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_tb_investigation.json @@ -0,0 +1,97 @@ +{ + "count": "1", + "encounter_type": "KVP TB Investigation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "TB Investigation", + "fields": [ + { + "key": "tb_screening", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tb_screening", + "type": "native_radio", + "label": "TB screening conducted on client", + "options": [ + { + "key": "presumptive", + "text": "Presumptive", + "openmrs_entity": "concept", + "openmrs_entity_id": "presumptive" + }, + { + "key": "not_presumptive", + "text": "Not presumptive", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_presumptive" + }, + { + "key": "not_screened", + "text": "Not screened", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_screened" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "prompt_for_tb_investigation", + "type": "toaster_notes", + "text": "Refer for TB investigation", + "openmrs_entity_id": "prompt_for_Tachycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:tb_screening": { + "type": "string", + "ex": "equalTo(., \"presumptive\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/kvp_vmmc_services.json b/opensrp-chw-hf/src/main/assets/json.form/kvp_vmmc_services.json new file mode 100644 index 000000000..1d1c7d2f2 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/kvp_vmmc_services.json @@ -0,0 +1,88 @@ +{ + "count": "1", + "encounter_type": "KVP VMMC", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "VMMC", + "fields": [ + { + "key": "vmcc_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "vmcc_provided", + "type": "native_radio", + "label": "Was the client provided with VMMC services?", + "options": [ + { + "key": "provided", + "text": "Provided", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided" + }, + { + "key": "not_provided", + "text": "Not provided", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_provided" + }, + { + "key": "referred", + "text": "Referred", + "openmrs_entity": "concept", + "openmrs_entity_id": "referred" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_blood_group_test.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_blood_group_test.json new file mode 100644 index 000000000..2e9cb8c6b --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_blood_group_test.json @@ -0,0 +1,187 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Blood Group Test", + "entity_id": "", + "relational_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Blood Group Test", + "fields": [ + { + "key": "blood_group", + "type": "spinner", + "hint": "Blood Group", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_group", + "openmrs_entity_parent": "", + "values": [ + "A", + "B", + "AB", + "O", + "Test not conducted" + ], + "keys": [ + "A", + "B", + "AB", + "O", + "test_not_conducted" + ], + "openmrs_choice_ids": { + "A": "A", + "B": "B", + "AB": "AB", + "O": "O", + "test_not_conducted": "test_not_conducted" + }, + "v_required": { + "value": "true", + "err": "Please choose a blood group" + } + }, + { + "key": "rh_factor", + "type": "native_radio", + "label": "Rh", + "openmrs_entity": "concept", + "openmrs_entity_id": "rh_factor", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:blood_group": { + "type": "string", + "ex": "notEqualTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "management_provided_for_rh", + "type": "native_radio", + "label": "Was management provided for negative RH?", + "openmrs_entity": "concept", + "openmrs_entity_id": "management_provided_for_rh", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:rh_factor": { + "type": "string", + "ex": "equalTo(., \"negative\")" + } + } + }, + { + "key": "prompt_for_rh_negative", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:management_provided_for_rh": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "reason_for_not_conducting_blood_group_test", + "type": "edit_text", + "hint": "Why was the Blood Group Test not conducted?", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_blood_group_test", + "openmrs_entity_parent": "", + "relevance": { + "step1:blood_group": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + }, + "v_required": { + "value": true, + "err": "Please enter the reason" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_cervix_dilation_monitoring.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_cervix_dilation_monitoring.json new file mode 100644 index 000000000..f2b79403d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_cervix_dilation_monitoring.json @@ -0,0 +1,170 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Cervix Dilation Monitoring", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "global": { + "last_vaginal_exam_time": "12:00" + }, + "step1": { + "title": "Cervix Dilation Monitoring", + "fields": [ + { + "key": "vaginal_exam_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "vaginal_exam_date", + "type": "date_picker", + "hint": "Vaginal examination Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the vaginal examination date" + } + }, + { + "key": "last_vaginal_exam_time", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_vaginal_exam_time", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_cervix_dilation_monitoring_calculation.yml" + } + } + } + }, + { + "key": "vaginal_exam_time", + "type": "time_picker", + "hint": "Vaginal examination Time", + "openmrs_entity_id": "vaginal_exam_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "constraints": [ + { + "type": "time", + "ex": "greaterThan(., step1:last_vaginal_exam_time)", + "err": "The vaginal examination time cannot be less than the previous vaginal examination time" + } + ], + "v_required": { + "value": "true", + "err": "Please enter vaginal examination time" + } + }, + { + "key": "cervix_state", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cervix_state", + "label": "Cervix (State)", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "soft_thin", + "text": "Soft and thin", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "soft_thin" + }, + { + "key": "hard", + "text": "Hard", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hard" + } + ], + "v_required": { + "value": true, + "err": "Please select the cervix (state) option" + } + }, + { + "key": "cervix_dilation_label", + "type": "label", + "text": "Cervix (Dilation)", + "text_size": "7sp", + "text_color": "#000000", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "" + }, + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp" + }, + { + "key": "cervix_dilation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cervix_dilation", + "type": "numbers_selector", + "start_number": "1", + "max_value": "10", + "text_size": "18px", + "text_color": "#000000", + "selected_text_color": "#ffffff", + "v_required": { + "value": true, + "err": "Please enter the cervix dilation number" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_eclampsia_management_form.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_eclampsia_management_form.json new file mode 100644 index 000000000..e8416e01c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_eclampsia_management_form.json @@ -0,0 +1,195 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Uterus Massage", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Pre-Eclampsia and Eclampsia Management", + "fields": [ + { + "key": "has_signs_of_eclampsia", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "has_signs_of_eclampsia", + "label": "Does the client have signs of pre-eclampsia/eclampsia?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + } + }, + { + "key": "administered_magnesium_sulphate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "administered_magnesium_sulphate", + "label": "Was the client administered Magnesium Sulphate?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + }, + "relevance": { + "step1:has_signs_of_eclampsia": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "reason_for_not_administering_magnesium_sulphate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_administering_magnesium_sulphate", + "type": "native_radio", + "label": "Please specify the reasons", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_stock", + "text": "Out of stock", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_stock" + }, + { + "key": "lack_of_skills", + "text": "Lack of Skills", + "openmrs_entity": "concept", + "openmrs_entity_id": "lack_of_skills" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "relevance": { + "step1:administered_magnesium_sulphate": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + }, + "v_required": { + "value": true, + "err": "Please select an option" + } + }, + { + "key": "prompt_for_not_administering_magnesium_sulphate", + "type": "toaster_notes", + "text": "Refer the client for further management.", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_eclampsia_management_relevance.yml" + } + } + } + }, + { + "key": "other_reason_for_for_not_administering_magnesium_sulphate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_for_not_administering_magnesium_sulphate", + "type": "edit_text", + "hint": "Specify other reasons for not administering Magnesium Sulphate", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_administering_magnesium_sulphate": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_fetal_well_being.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_fetal_well_being.json new file mode 100644 index 000000000..083593bdd --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_fetal_well_being.json @@ -0,0 +1,263 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "LD Partograph - Fetal Well-being", + "entity_id": "", + "relational_id": "", + "global": { + }, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Well-being of a fetal", + "fields": [ + { + "key": "fetal_heart_rate", + "type": "edit_text", + "hint": "Count Fetal Heart Rate (bpm)", + "openmrs_entity_id": "fetal_heart_rate", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the fetal heart rate" + }, + "v_min": { + "value": "0", + "err": "Fetal heart rate must be equal or greater than 0" + }, + "v_max": { + "value": "300", + "err": "Fetal heart rate must be equal or less than 300" + }, + "v_required": { + "value": true, + "err": "Please input the fetal heart rate" + } + }, + { + "key": "prompt_for_fetal_distress", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "prompt_for_fetal_distress", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_fetal_wellbeing_relevance.yml" + } + } + } + }, + { + "key": "moulding_options", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "moulding_options", + "label": "Moulding", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "Ø", + "text": "Ø", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "Ø" + }, + { + "key": "+", + "text": "+", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "+" + }, + { + "key": "++", + "text": "++", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "++" + }, + { + "key": "+++", + "text": "+++", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "+++" + } + ] + }, + { + "key": "prompt_for_moulding", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_fetal_wellbeing_relevance.yml" + } + } + } + }, + { + "key": "caput", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "caput", + "label": "Caput", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "Ø", + "text": "Ø", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "Ø" + }, + { + "key": "+", + "text": "+", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "+" + }, + { + "key": "++", + "text": "++", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "++" + }, + { + "key": "+++", + "text": "+++", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "+++" + } + ] + }, + { + "key": "prompt_for_caput", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_fetal_wellbeing_relevance.yml" + } + } + } + }, + { + "key": "amniotic_fluid", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "amniotic_fluid", + "label": "Amniotic fluid", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "membrane_intact", + "text": "Membrane Intact (I)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "membrane_intact" + }, + { + "key": "membrane_ruptured_liquor_clear", + "text": "Membrane ruptured liquor clear (C)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "membrane_ruptured_liquor_clear" + }, + { + "key": "meconium_stained_liquor", + "text": "Meconium Stained Liquor (M)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "meconium_stained_liquor" + }, + { + "key": "blood_stained_liquor", + "text": "Blood-Stained Liquor (B)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_stained_liquor" + } + ] + }, + { + "key": "prompt_for_amniotic_fluid", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_fetal_wellbeing_relevance.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_general_examination.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_general_examination.json new file mode 100644 index 000000000..d5cb5df7d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_general_examination.json @@ -0,0 +1,783 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "General Examination", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "General Examination", + "fields": [ + { + "key": "general_condition", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "general_condition", + "label": "General Condition", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "good", + "text": "Good", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "good" + }, + { + "key": "fair", + "text": "Fair", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fair" + }, + { + "key": "bad", + "text": "Serious", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "bad" + } + ], + "v_required": { + "value": "true", + "err": "Please select the general condition of the client" + } + }, + { + "key": "prompt_for_general_condition", + "type": "toaster_notes", + "text": "Take action according to standard guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:general_condition": { + "type": "string", + "ex": "equalTo(., \"bad\")" + } + } + }, + { + "key": "pulse_rate", + "type": "edit_text", + "hint": "Pulse Rate (Beats per minute)", + "openmrs_entity_id": "pulse_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the pulse rate" + }, + "v_min": { + "value": "0", + "err": "The pulse rate must be equal or greater than 0 (bpm)" + }, + "v_max": { + "value": "200", + "err": "The pulse rate must be equal or less than 200 (bpm)" + } + }, + { + "key": "prompt_for_Bradycardia", + "type": "toaster_notes", + "text": "Elicit the cause of bradycardia and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_Bradycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "lessThan(.,\"60\")" + } + } + }, + { + "key": "prompt_for_Tachycardia", + "type": "toaster_notes", + "text": "Elicit the cause of tachycardia and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_Tachycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "greaterThan(.,\"100\")" + } + } + }, + { + "key": "respiratory_rate", + "type": "edit_text", + "hint": "Respiratory Rate (Breaths per minute)", + "openmrs_entity_id": "respiratory_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the respiratory rate" + }, + "v_min": { + "value": "0", + "err": "The respiratory rate must be equal or greater than 0 (Breaths per minute)" + }, + "v_max": { + "value": "100", + "err": "The respiratory rate must be equal or less than 100 (Breaths per minute)" + } + }, + { + "key": "prompt_for_respiratory_rate", + "type": "toaster_notes", + "text": "Manage according to SOP and National guideline", + "openmrs_entity_id": "prompt_for_respiratory_rate", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_general_examination_relevance.yml" + } + } + } + }, + { + "key": "temperature", + "type": "edit_text", + "hint": "Temperature (\u2103)", + "openmrs_entity_id": "temperature", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the temperature" + }, + "v_min": { + "value": "10", + "err": "Temperature must be equal or greater than 10" + }, + "v_max": { + "value": "50", + "err": "Temperature must be equal or less than 50" + } + }, + { + "key": "notify_client_has_fever", + "type": "toaster_notes", + "text": "Conduct relevant laboratory tests to elicit the cause of fever and manage according to standard guidelines ", + "openmrs_entity_id": "notify_client_has_fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "greaterThan(.,\"37.8\")" + } + } + }, + { + "key": "notify_client_has_hypothermia", + "type": "toaster_notes", + "text": "Manage the hypothermia according to standard guidelines", + "openmrs_entity_id": "notify_client_has_hypothermia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "lessThan(.,\"36.5\")" + } + } + }, + { + "key": "systolic", + "type": "edit_text", + "hint": "Systolic (Blood Pressure)", + "openmrs_entity_id": "systolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the systolic value" + }, + "v_min": { + "value": "0", + "err": "Systolic value must be equal or greater than 0" + }, + "v_max": { + "value": "320", + "err": "Systolic value must be equal or less than 320" + } + }, + { + "key": "diastolic", + "type": "edit_text", + "hint": "Diastolic (Blood Pressure)", + "openmrs_entity_id": "diastolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the diastolic value" + }, + "v_min": { + "value": "0", + "err": "Diastolic value must be equal or greater than 0" + }, + "v_max": { + "value": "200", + "err": "Diastolic value must be equal or less than 200" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:systolic)", + "err": "The diastolic value must be less than the systolic value" + } + ] + }, + { + "key": "prompt_for_management_of_hypertension", + "type": "toaster_notes", + "text": "Manage the hypertension according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypertension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_general_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_management_of_hypotension", + "type": "toaster_notes", + "text": "Elicit the cause of hypotension and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypotension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_general_examination_relevance.yml" + } + } + } + }, + { + "key": "urine_protein", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "urine_protein", + "label": "Urine Protein", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "nil", + "text": "Nil", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "nil" + }, + { + "key": "+", + "text": "+", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "+" + }, + { + "key": "++", + "text": "++", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "++" + }, + { + "key": "+++", + "text": "+++", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "+++" + }, + { + "key": "not_tested", + "text": "Not Tested", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_tested" + } + ] + }, + { + "key": "urine_acetone", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "urine_acetone", + "label": "Urine Acetone", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "nil", + "text": "Nil", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "nil" + }, + { + "key": "+", + "text": "+", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "+" + }, + { + "key": "++", + "text": "++", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "++" + }, + { + "key": "+++", + "text": "+++", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "+++" + }, + { + "key": "not_tested", + "text": "Not Tested", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_tested" + } + ] + }, + { + "key": "prompt_for_urine", + "type": "toaster_notes", + "text": "Manage or refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_general_examination_relevance.yml" + } + } + } + }, + { + "key": "fundal_height", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fundal_height", + "type": "edit_text", + "hint": "Fundal Height (CM)", + "v_numeric": { + "value": "true", + "err": "Has to be a number" + }, + "v_min": { + "value": "12", + "err": "Fundal height must be equal or more than 12 CM" + }, + "v_max": { + "value": "50", + "err": "Fundal height must be equal or less than 50 CM" + } + }, + { + "key": "prompt_for_fundal_height", + "type": "toaster_notes", + "text": "Abnormal fundal height", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:fundal_height": { + "type": "numeric", + "ex": "greaterThan(.,\"36\")" + } + } + }, + { + "key": "lie", + "type": "native_radio", + "openmrs_entity_id": "lie", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Lie", + "options": [ + { + "key": "transverse", + "openmrs_entity": "concept", + "openmrs_entity_id": "transverse", + "openmrs_entity_parent": "", + "text": "Transverse" + }, + { + "key": "oblique", + "openmrs_entity": "concept", + "openmrs_entity_id": "oblique", + "openmrs_entity_parent": "", + "text": "Oblique" + }, + { + "key": "longitudinal", + "openmrs_entity": "concept", + "openmrs_entity_id": "longitudinal", + "openmrs_entity_parent": "", + "text": "Longitudinal" + } + ] + }, + { + "key": "prompt_for_lie", + "type": "toaster_notes", + "text": "Refer for further consultation", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_general_examination_relevance.yml" + } + } + } + }, + { + "key": "presentation", + "type": "native_radio", + "openmrs_entity_id": "presentation", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Presentation", + "options": [ + { + "key": "breech", + "openmrs_entity": "concept", + "openmrs_entity_id": "breech", + "openmrs_entity_parent": "", + "text": "Breech Presentation" + }, + { + "key": "cephalic", + "openmrs_entity": "concept", + "openmrs_entity_id": "cephalic", + "openmrs_entity_parent": "", + "text": "Cephalic Presentation" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_general_examination_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Please select the presentation" + } + }, + { + "key": "prompt_for_presentation", + "type": "toaster_notes", + "text": "Manage according to standard guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:presentation": { + "type": "string", + "ex": "equalTo(.,\"breech\")" + } + } + }, + { + "key": "contraction_frequency", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "contraction_frequency", + "label": "Contraction Frequency", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "no_contraction", + "text": "No contraction", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_contraction" + }, + { + "key": "1", + "text": "1", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "1" + }, + { + "key": "2", + "text": "2", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "2" + }, + { + "key": "3", + "text": "3", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "3" + }, + { + "key": "4", + "text": "4", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "4" + }, + { + "key": "5", + "text": "5", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "5" + } + ] + }, + { + "key": "contraction_in_ten_minutes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "contraction_in_ten_minutes", + "label": "Contraction in ten minutes", + "type": "native_radio", + "options": [ + { + "key": "less_than_20_secs", + "text": "<20 secs", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "less_than_20_secs" + }, + { + "key": "over_20_less_40_secs", + "text": "20-40 secs", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "over_20_less_40_secs" + }, + { + "key": "over_40_secs", + "text": ">40 secs", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "over_40_secs" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_general_examination_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Please select the contraction time" + } + }, + { + "key": "prompt_for_contraction_less_than_20_secs", + "type": "toaster_notes", + "text": "Slight contraction", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "step1:contraction_in_ten_minutes": { + "type": "string", + "ex": "equalTo(., \"less_than_20_secs\")" + } + } + }, + { + "key": "prompt_for_contraction_over_10_less_40_secs", + "type": "toaster_notes", + "text": "Moderate contraction", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "step1:contraction_in_ten_minutes": { + "type": "string", + "ex": "equalTo(., \"over_20_less_40_secs\")" + } + } + }, + { + "key": "prompt_for_contraction_over_40_secs", + "type": "toaster_notes", + "text": "Strong contraction", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "step1:contraction_in_ten_minutes": { + "type": "string", + "ex": "equalTo(., \"over_40_secs\")" + } + } + }, + { + "key": "fetal_heart_rate", + "type": "edit_text", + "hint": "Count Fetal Heart Rate (bpm)", + "openmrs_entity_id": "fetal_heart_rate", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the fetal heart rate" + }, + "v_min": { + "value": "0", + "err": "Fetal heart rate must be equal or greater than 0" + }, + "v_max": { + "value": "300", + "err": "Fetal heart rate must be equal or less than 300" + } + }, + { + "key": "prompt_for_fetal_distress", + "type": "toaster_notes", + "text": "Take action or refer for further management", + "openmrs_entity_id": "prompt_for_fetal_distress", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_general_examination_relevance.yml" + } + } + } + }, + { + "key": "level", + "type": "native_radio", + "label": "Level", + "openmrs_entity_id": "level", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "5", + "text": "5/5", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + }, + { + "key": "4", + "text": "4/5", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "4" + }, + { + "key": "3", + "text": "3/5", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "3" + }, + { + "key": "2", + "text": "2/5", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "2" + }, + { + "key": "1", + "text": "1/5", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "1" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_hb_test_form.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_hb_test_form.json new file mode 100644 index 000000000..2a7bf4c04 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_hb_test_form.json @@ -0,0 +1,248 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "HB Test", + "entity_id": "", + "relational_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "HB Test", + "fields": [ + { + "key": "hb_test_conducted", + "type": "native_radio", + "label": "Has the HB test been conducted?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_test_conducted", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ] + }, + { + "key": "reason_for_not_conducting_hb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hb_test", + "type": "spinner", + "hint": "Reason as to why the HB Level test was not conducted", + "values": [ + "Cuvette Cartridges Out of Stock", + "Haemoque machine out of order", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other" + ], + "keys": [ + "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "stock_out_of_cuvettes_cartridges": "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order": "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:hb_test_conducted": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_hb_test_not_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_hb_test_not_conducted", + "type": "edit_text", + "hint": "Specify other reasons for not conducting the HB Level Test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_hb_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "hb_level", + "type": "edit_text", + "hint": "Enter Measured HB Level (g/dl)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the HB level" + }, + "v_min": { + "value": "0", + "err": "HB level must be equal or greater than 0 (g/dl)" + }, + "v_max": { + "value": "20", + "err": "HB level must be equal or less than 20 (g/dl)" + }, + "relevance": { + "step1:hb_test_conducted": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + }, + "v_required": { + "value": "true", + "err": "Please enter the HB level results" + } + }, + { + "key": "management_provided_for_hb_level", + "type": "native_radio", + "label": "Was management provided for abnormal HB Level?", + "openmrs_entity": "concept", + "openmrs_entity_id": "management_provided_for_hb_level", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:hb_level": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"8.5\")" + } + } + }, + { + "key": "prompt_to_provide_management", + "type": "toaster_notes", + "text": "Provide management according to SOP and standard guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:management_provided_for_hb_level": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "prompt_for_moderate_anaemia_management", + "type": "toaster_notes", + "text": "Manage the mild anaemia according to standard guidelines", + "openmrs_entity_id": "prompt_for_moderate_anaemia_management", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_test_rules.yml" + } + } + } + }, + { + "key": "hb_test_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_test_date", + "type": "hidden", + "hint": "HB Measurement Date", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_test_rules.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_hiv_test.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_hiv_test.json new file mode 100644 index 000000000..efd4354ba --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_hiv_test.json @@ -0,0 +1,200 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "HIV Test", + "entity_id": "", + "relational_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "HIV Test", + "fields": [ + { + "key": "hiv_test_conducted", + "type": "native_radio", + "label": "Has the client been tested for HIV?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_conducted", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ] + }, + { + "key": "reason_for_no_hiv_test", + "type": "edit_text", + "hint": "Why was the client not tested for HIV?", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_no_hiv_test", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_hiv_test_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please enter the reason" + } + }, + { + "key": "hiv_counselling_before_testing", + "type": "native_radio", + "label": "Was the client provided with counselling before HIV testing?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_counselling_before_testing", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_hiv_test_relevance.yml" + } + } + } + }, + { + "key": "hiv", + "type": "native_radio", + "label": "HIV Test Results", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_hiv_test_relevance.yml" + } + } + } + }, + { + "key": "pmtct_test_date", + "type": "hidden", + "label": "HIV Test Results", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_test_date", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_hiv_test_relevance.yml" + } + } + } + }, + { + "key": "hiv_counselling_after_testing", + "type": "native_radio", + "label": "Was the client provided with counselling after HIV testing?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_counselling_after_testing", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_hiv_test_relevance.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_labour_progress.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_labour_progress.json new file mode 100644 index 000000000..f8b566ad6 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_labour_progress.json @@ -0,0 +1,290 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "LD Partograph : Labour Progress", + "entity_id": "", + "relational_id": "", + "global": { + }, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Progress of Labour", + "fields": [ + { + "key": "cervix_dilation_label", + "type": "label", + "text": "Cervix (Dilation)", + "text_size": "10sp", + "text_color": "#000000", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "" + }, + { + "key": "cervix_dilation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cervix_dilation", + "type": "numbers_selector", + "start_number": "1", + "number_of_selectors": "10", + "max_value": "10", + "text_size": "18px", + "text_color": "#000000", + "selected_text_color": "#ffffff" + }, + { + "key": "notify_cervix_dilation_alert", + "type": "toaster_notes", + "text": "ALERT:\n\nCloser monitoring is required for this client", + "openmrs_entity_id": "notify_alert", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_labour_progress_relevance.yml" + } + } + } + }, + { + "key": "notify_cervix_dilation_action", + "type": "toaster_notes", + "text": "ACTION REQUIRED:\n\nAn immediate action needs to be taken for this client!", + "openmrs_entity_id": "notify_action_required", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_labour_progress_relevance.yml" + } + } + } + }, + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "20dp" + }, + { + "key": "descent_presenting_part", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "descent_presenting_part", + "label": "Descent of the Presenting Part (Every 4 hours)", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "5", + "text": "5", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "5" + }, + { + "key": "4", + "text": "4", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "4" + }, + { + "key": "3", + "text": "3", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "3" + }, + { + "key": "2", + "text": "2", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "2" + }, + { + "key": "1", + "text": "1", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "1" + }, + { + "key": "0", + "text": "0", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "0" + } + ] + }, + { + "key": "head_descent_alert", + "type": "toaster_notes", + "text": "ALERT:\n\nManage according to guideline", + "openmrs_entity_id": "notify_alert", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_labour_progress_relevance.yml" + } + } + } + }, + { + "key": "contraction_every_half_hour_label", + "type": "label", + "text": "Contraction (Every half an hour)", + "text_size": "7sp", + "text_color": "#000000", + "label_text_style": "bold", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "" + }, + { + "key": "contraction_every_half_hour_frequency", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "contraction_every_half_hour_frequency", + "label": "Contraction Frequency", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "1", + "text": "1", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "1" + }, + { + "key": "2", + "text": "2", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "2" + }, + { + "key": "3", + "text": "3", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "3" + }, + { + "key": "4", + "text": "4", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "4" + }, + { + "key": "5", + "text": "5", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "5" + } + ] + }, + { + "key": "contraction_every_half_hour_time", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "contraction_every_half_hour_time", + "label": "Contraction Time", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "less_than_20_secs", + "text": "<20 secs", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "less_than_20_secs" + }, + { + "key": "over_20_less_40_secs", + "text": "20-40 secs", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "over_20_less_40_secs" + }, + { + "key": "over_40_secs", + "text": ">40 secs", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "over_40_secs" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_labour_progress_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Please select the Contraction Time" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_labour_stage.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_labour_stage.json new file mode 100644 index 000000000..c12e22f75 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_labour_stage.json @@ -0,0 +1,99 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Labour Stage Assessment", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Labour Stage", + "fields": [ + { + "key": "labour_stage", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "labour_stage", + "label": "What is the client Labour Stage?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "1", + "text": "Stage 1", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "1" + }, + { + "key": "2", + "text": "Stage 2", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "2" + }, + { + "key": "3", + "text": "Stage 3", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "3" + }, + { + "key": "4", + "text": "Stage 4", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "4" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_malaria_test.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_malaria_test.json new file mode 100644 index 000000000..932174b27 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_malaria_test.json @@ -0,0 +1,183 @@ +{ + "count": "1", + "skip_blank_steps": true, + "encounter_type": "Labour and Delivery Malaria Test", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Malaria Test", + "fields": [ + { + "key": "malaria", + "type": "native_radio", + "label": "Malaria test results", + "openmrs_entity": "concept", + "openmrs_entity_id": "malaria", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "management_provided_for_malaria", + "type": "native_radio", + "label": "Was management provided for malaria?", + "openmrs_entity": "concept", + "openmrs_entity_id": "management_provided_for_malaria", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:malaria": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "prompt_for_malaria_management_not_done", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:management_provided_for_malaria": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "reason_for_not_conducting_malaria_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_malaria_test", + "type": "spinner", + "hint": "Reason as to why the Malaria test was not conducted", + "values": [ + "Test kits are out of stock", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:malaria_test": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_malaria_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_malaria_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting Malaria test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_malaria_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_maternal_complications.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_maternal_complications.json new file mode 100644 index 000000000..feb3e8157 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_maternal_complications.json @@ -0,0 +1,286 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Mother Observation", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Maternal Complications During Labour", + "fields": [ + { + "key": "maternal_complications_before_delivery", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "maternal_complications_before_delivery", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Complications before delivery", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_aph", + "text": "APH", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_aph" + }, + { + "key": "chk_prom", + "text": "Pre-mature Rupture of Membrane (PROM)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_prom" + }, + { + "key": "chk_high_bp", + "text": "High BP", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_high_bp" + }, + { + "key": "chk_pre_eclampsia", + "text": "Pre-eclampsia", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_pre_eclampsia" + }, + { + "key": "chk_eclampsia", + "text": "Eclampsia", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_eclampsia" + }, + { + "key": "chk_anaemia", + "text": "Anaemia", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_anaemia" + }, + { + "key": "chk_malaria", + "text": "Malaria", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_malaria" + }, + { + "key": "chk_maternal_diabetes", + "text": "Maternal Diabetes", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_maternal_diabetes" + }, + { + "key": "chk_hiv_stage_3_or_4", + "text": "HIV + Stage III or IV", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_hiv_stage_3_or_4" + }, + { + "key": "chk_fgm", + "text": "FGM", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_fgm" + }, + { + "key": "chk_other", + "text": "Other", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_other" + }, + { + "key": "chk_none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_none" + } + ] + }, + { + "key": "maternal_complications_before_delivery_other", + "type": "edit_text", + "hint": "Other complications before delivery", + "openmrs_entity_id": "maternal_complications_before_delivery_other", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:maternal_complications_before_delivery": { + "ex-checkbox": [ + { + "or": [ + "chk_other" + ] + } + ] + } + } + }, + { + "key": "maternal_complications_during_and_after_delivery", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "maternal_complications_during_and_after_delivery", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Complications during and after delivery", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_pph", + "text": "PPH", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_pph" + }, + { + "key": "chk_pre_eclampsia", + "text": "Pre-eclampsia", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_pre_eclampsia" + }, + { + "key": "chk_eclampsia", + "text": "Eclampsia", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_eclampsia" + }, + { + "key": "chk_obstructed_labour", + "text": "Obstructed labour", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_obstructed_labour" + }, + { + "key": "chk_prolonged_labour", + "text": "Prolonged labour", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_prolonged_labour" + }, + { + "key": "chk_retained_placenta", + "text": "Retained placenta", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_retained_placenta" + }, + { + "key": "chk_3_degree_tear", + "text": "Third degree tear", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_3_degree_tear" + }, + { + "key": "chk_ruptured_uterus", + "text": "Ruptured uterus", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_ruptured_uterus" + }, + { + "key": "chk_sepsis", + "text": "Sepsis", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_sepsis" + }, + { + "key": "chk_meconium_stained_liquor", + "text": "Meconium Stained Liquor", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_meconium_stained_liquor" + }, + { + "key": "chk_other", + "text": "Other", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_other" + }, + { + "key": "chk_none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_none" + } + ] + }, + { + "key": "maternal_complications_during_and_after_delivery_other", + "type": "edit_text", + "hint": "Other complications during and after delivery", + "openmrs_entity_id": "maternal_complications_during_and_after_delivery_other", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:maternal_complications_during_and_after_delivery": { + "ex-checkbox": [ + { + "or": [ + "chk_other" + ] + } + ] + } + } + }, + { + "key": "maternal_complications_module_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "maternal_complications_module_status", + "type": "hidden", + "value": "PENDING" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_mode_of_delivery.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_mode_of_delivery.json new file mode 100644 index 000000000..8b921b231 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_mode_of_delivery.json @@ -0,0 +1,205 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Mode of Delivery", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Mode of Delivery", + "fields": [ + { + "key": "mode_of_delivery", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mode_of_delivery", + "label": "Mode of delivery", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "spontaneous_vaginal_delivery", + "text": "Spontaneous vertex delivery", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "spontaneous_vaginal_delivery" + }, + { + "key": "cesarean", + "text": "Caesarian", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cesarean" + }, + { + "key": "vacuum_extraction", + "text": "Vacuum Extraction", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "vacuum_extraction" + }, + { + "key": "breech_delivery", + "text": "Breech Delivery", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "breech_delivery" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + } + }, + { + "key": "labour_stage", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "labour_stage", + "type": "hidden", + "value": 3 + }, + { + "key": "delivery_mode_caesarian_reason", + "type": "check_box", + "label": "Reason for caesarian", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "delivery_mode_caesarian_reason", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "fetal_distress", + "text": "Fetal distress", + "openmrs_entity": "concept", + "openmrs_entity_id": "fetal_distress" + }, + { + "key": "previous_scar", + "text": "Previous Scar", + "openmrs_entity": "concept", + "openmrs_entity_id": "previous_scar" + }, + { + "key": "maternal_request", + "text": "Maternal request", + "openmrs_entity": "concept", + "openmrs_entity_id": "maternal_request" + }, + { + "key": "failed_induction", + "text": "Failed induction", + "openmrs_entity": "concept", + "openmrs_entity_id": "failed_induction" + }, + { + "key": "malpresentation", + "text": "Malpresentation", + "openmrs_entity": "concept", + "openmrs_entity_id": "malpresentation" + }, + { + "key": "prolonged_labor", + "text": "Prolonged labor", + "openmrs_entity": "concept", + "openmrs_entity_id": "prolonged_labor" + }, + { + "key": "obstructed_labor", + "text": "Obstructed labor", + "openmrs_entity": "concept", + "openmrs_entity_id": "obstructed_labor" + }, + { + "key": "multiple_gestation", + "text": "Multiple Gestation", + "openmrs_entity": "concept", + "openmrs_entity_id": "multiple_gestation" + }, + { + "key": "others", + "text": "Others", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + } + ], + "v_required": { + "value": "true", + "err": "Please select the reason for caesarian" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_mode_of_delivery_relevance.yml" + } + } + } + }, + { + "key": "delivery_mode_caesarian_reason_other", + "type": "edit_text", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "openmrs_entity_id": "delivery_mode_reason", + "hint": "Specify other reason for caesarian delivery mode", + "v_required": { + "value": true, + "err": "Value is required" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_mode_of_delivery_relevance.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_mother_observation.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_mother_observation.json new file mode 100644 index 000000000..4aa923925 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_mother_observation.json @@ -0,0 +1,628 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Mother Observation", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Mother - Observation", + "fields": [ + { + "key": "vagina_observation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "vagina_observation", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Vagina", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_intact" + ], + "options": [ + { + "key": "chk_intact", + "text": "Intact", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_intact" + }, + { + "key": "chk_bleeding", + "text": "Bleeding", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_bleeding" + }, + { + "key": "chk_tear", + "text": "Tear", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_tear" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_vagina_observation", + "type": "toaster_notes", + "text": "Action to be taken per National guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:vagina_observation": { + "ex-checkbox": [ + { + "or": [ + "chk_tear" + ] + } + ] + } + } + }, + { + "key": "vaginal_bleeding_observation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "vaginal_bleeding_observation", + "label": "Vaginal bleeding observation", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "normal", + "text": "Normal", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + }, + { + "key": "abnormal", + "text": "Abnormal", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "abnormal" + } + ], + "relevance": { + "step1:vagina_observation": { + "ex-checkbox": [ + { + "or": [ + "chk_bleeding" + ] + } + ] + } + } + }, + { + "key": "prompt_for_abnormal_bleeding", + "type": "toaster_notes", + "text": "Abnormal bleeding, take action per National guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:vaginal_bleeding_observation": { + "type": "string", + "ex": "equalTo(.,\"abnormal\")" + } + } + }, + { + "key": "perineum_observation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "perineum_observation", + "label": "Perineum", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "intact", + "text": "Intact", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "intact" + }, + { + "key": "bruised_laceration", + "text": "Bruised/Laceration", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "bruised_laceration" + }, + { + "key": "tear", + "text": "Tear", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tear" + } + ] + }, + { + "key": "degree_of_perineum_tear", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "degree_of_perineum_tear", + "label": "Degree of tear", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "first_degree", + "text": "1st degree tear", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "first_degree" + }, + { + "key": "second_degree", + "text": "2nd degree tear", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "second_degree" + }, + { + "key": "third_degree", + "text": "3rd degree tear", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "third_degree" + }, + { + "key": "fourth_degree", + "text": "4th degree tear", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fourth_degree" + } + ], + "relevance": { + "step1:perineum_observation": { + "type": "string", + "ex": "equalTo(.,\"tear\")" + } + } + }, + { + "key": "perineum_repair_person_name", + "type": "edit_text", + "hint": "Name of doctor/nurse who repaired the perineum", + "openmrs_entity_id": "perineum_repair_person_name", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify the name of doctor/nurse who repaired the perineum" + }, + "relevance": { + "step1:perineum_observation": { + "type": "string", + "ex": "equalTo(., \"tear\")" + } + } + }, + { + "key": "perineum_repair_occupation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "perineum_repair_occupation", + "openmrs_data_type": "select one", + "type": "spinner", + "hint": "Perineum repaired by", + "values": [ + "A doctor", + "A nurse" + ], + "keys": [ + "doctor", + "nurse" + ], + "openmrs_choice_ids": { + "doctor": "A Doctor", + "nurse": "A Nurse" + }, + "relevance": { + "step1:perineum_observation": { + "type": "string", + "ex": "equalTo(., \"tear\")" + } + } + }, + { + "key": "prompt_for_perineum_observation", + "type": "toaster_notes", + "text": "Action to be taken per National guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:perineum_observation": { + "type": "string", + "ex": "equalTo(.,\"tear\")" + } + } + }, + { + "key": "cervix_observation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cervix_observation", + "label": "Cervix observation", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "normal", + "text": "Normal", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + }, + { + "key": "tear", + "text": "Tear", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tear" + } + ] + }, + { + "key": "prompt_for_cervix_observation", + "type": "toaster_notes", + "text": "Manage according to standard guidelines", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:cervix_observation": { + "type": "string", + "ex": "equalTo(.,\"tear\")" + } + } + }, + { + "key": "systolic", + "type": "edit_text", + "hint": "Systolic (Blood Pressure)", + "openmrs_entity_id": "systolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the systolic value" + }, + "v_min": { + "value": "0", + "err": "Systolic value must be equal or greater than 0" + }, + "v_max": { + "value": "320", + "err": "Systolic value must be equal or less than 320" + } + }, + { + "key": "diastolic", + "type": "edit_text", + "hint": "Diastolic (Blood Pressure)", + "openmrs_entity_id": "diastolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the diastolic value" + }, + "v_min": { + "value": "0", + "err": "Diastolic value must be equal or greater than 0" + }, + "v_max": { + "value": "200", + "err": "Diastolic value must be equal or less than 200" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:systolic)", + "err": "The diastolic value must be less than the systolic value" + } + ] + }, + { + "key": "prompt_for_management_of_hypertension", + "type": "toaster_notes", + "text": "Manage the hypertension according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypertension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_mother_observation_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_management_of_hypotension", + "type": "toaster_notes", + "text": "Elicit the cause of hypotension and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypotension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_mother_observation_relevance.yml" + } + } + } + }, + { + "key": "pulse_rate", + "type": "edit_text", + "hint": "Pulse Rate (Beats per minute)", + "openmrs_entity_id": "pulse_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the pulse rate" + }, + "v_min": { + "value": "0", + "err": "The pulse rate must be equal or greater than 0 (bpm)" + }, + "v_max": { + "value": "200", + "err": "The pulse rate must be equal or less than 200 (bpm)" + } + }, + { + "key": "prompt_for_Bradycardia", + "type": "toaster_notes", + "text": "Elicit the cause of bradycardia and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_Bradycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "lessThan(.,\"60\")" + } + } + }, + { + "key": "prompt_for_Tachycardia", + "type": "toaster_notes", + "text": "Elicit the cause of tachycardia and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_Tachycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "greaterThan(.,\"100\")" + } + } + }, + { + "key": "temperature", + "type": "edit_text", + "hint": "Temperature (\u2103)", + "openmrs_entity_id": "temperature", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the temperature" + }, + "v_min": { + "value": "10", + "err": "Temperature must be equal or greater than 10" + }, + "v_max": { + "value": "50", + "err": "Temperature must be equal or less than 50" + } + }, + { + "key": "notify_client_has_fever", + "type": "toaster_notes", + "text": "Conduct relevant laboratory tests to elicit the cause of fever and manage according to standard guidelines ", + "openmrs_entity_id": "notify_client_has_fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "greaterThan(.,\"37.8\")" + } + } + }, + { + "key": "notify_client_has_hypothermia", + "type": "toaster_notes", + "text": "Manage the hypothermia according to standard guidelines", + "openmrs_entity_id": "notify_client_has_hypothermia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "lessThan(.,\"36.5\")" + } + } + }, + { + "key": "uterus_contraction", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "uterus_contraction", + "label": "Has Uterus Contracted?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ] + }, + { + "key": "prompt_for_uterus_contraction", + "type": "toaster_notes", + "text": "Manage according to national guidelines", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:uterus_contraction": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "urination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "urination", + "label": "Urination", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ] + }, + { + "key": "prompt_for_urination", + "type": "toaster_notes", + "text": "Action to be taken per National guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:urination": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "observation_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "observation_date", + "type": "date_picker", + "hint": "Observation Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today" + }, + { + "key": "observation_time", + "type": "time_picker", + "hint": "Observation Time", + "openmrs_entity_id": "observation_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "mother_observation_module_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_observation_module_status", + "type": "hidden", + "value": "PENDING" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_mother_status.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_mother_status.json new file mode 100644 index 000000000..835c9cb46 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_mother_status.json @@ -0,0 +1,372 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "PPFP", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Mother - Status", + "fields": [ + { + "key": "status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "status", + "label": "Status", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "alive", + "text": "Alive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "alive" + }, + { + "key": "died", + "text": "Died", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "died" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + } + }, + { + "key": "cause_of_death", + "type": "edit_text", + "hint": "Cause of death", + "openmrs_entity_id": "cause_of_death", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "step1:status": { + "type": "string", + "ex": "equalTo(., \"died\")" + } + } + }, + { + "key": "time_of_death", + "type": "time_picker", + "hint": "Time of death", + "openmrs_entity_id": "time_of_death", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "step1:status": { + "type": "string", + "ex": "equalTo(., \"died\")" + } + } + }, + { + "key": "mode_of_delivery", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mode_of_delivery", + "label": "Mode of delivery", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "spontaneous_vaginal_delivery", + "text": "Spontaneous vertex delivery", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "spontaneous_vaginal_delivery" + }, + { + "key": "vacuum_extraction", + "text": "Vacuum Extraction", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "vacuum_extraction" + }, + { + "key": "breech_delivery", + "text": "Breech Delivery", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "breech_delivery" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + } + }, + { + "key": "delivery_place", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_place", + "openmrs_data_type": "select one", + "type": "spinner", + "hint": "Place of delivery", + "values": [ + "At a health facility (HF)", + "Birth before Arrival (BBA)", + "Home delivery", + "Traditional birth attendant (TBA)" + ], + "keys": [ + "at_a_health_facility", + "bba", + "at_home", + "tba" + ], + "openmrs_choice_ids": { + "at_a_health_facility": "at_a_health_facility", + "bba": "bba", + "at_home": "at_home", + "tba": "tba" + } + }, + { + "key": "designation_of_delivery_personnel", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "designation_of_delivery_personnel", + "openmrs_data_type": "select one", + "type": "spinner", + "hint": "Designation of Delivery Person", + "values": [ + "Obstetrician", + "Gynecologist", + "Medical doctor", + "Assistant Nurse officer", + "Clinical officer", + "Midwife officer", + "Enrolled Nurse", + "Student" + ], + "keys": [ + "obstetrician", + "gynecologist", + "medical_doctor", + "assistant_nurse_officer", + "clinical_officer", + "midwife_officer", + "enrolled_nurse", + "student" + ], + "openmrs_choice_ids": { + "medical_doctor": "medical_doctor", + "obstetrician": "obstetrician", + "assistant_midwife_officer": "assistant_midwife_officer", + "clinical_officer": "clinical_officer", + "midwife_officer": "midwife_officer", + "gynecologist": "gynecologist", + "nurse": "nurse", + "student": "student" + }, + "relevance": { + "step1:delivery_place": { + "type": "string", + "ex": "equalTo(., \"at_a_health_facility\")" + } + } + }, + { + "key": "name_of_delivery_person", + "type": "edit_text", + "hint": "Name of delivery personnel", + "openmrs_entity_id": "name_of_delivery_person", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "step1:delivery_place": { + "type": "string", + "ex": "equalTo(., \"at_a_health_facility\")" + } + } + }, + { + "key": "supervised_by_occupation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "supervised_by_occupation", + "openmrs_data_type": "select one", + "type": "spinner", + "hint": "Supervision by", + "values": [ + "Medical doctor", + "Obstetrician", + "Assistant midwife officer", + "Clinical officer", + "Midwife officer", + "Gynecologist", + "Nurse" + ], + "keys": [ + "medical_doctor", + "obstetrician", + "assistant_midwife_officer", + "clinical_officer", + "midwife_officer", + "gynecologist", + "nurse" + ], + "openmrs_choice_ids": { + "medical_doctor": "medical_doctor", + "obstetrician": "obstetrician", + "assistant_midwife_officer": "assistant_midwife_officer", + "clinical_officer": "clinical_officer", + "midwife_officer": "midwife_officer", + "gynecologist": "gynecologist", + "nurse": "nurse" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_mother_status_relevance.yml" + } + } + } + }, + { + "key": "name_of_supervising_person", + "type": "edit_text", + "hint": "Name of supervisor", + "openmrs_entity_id": "name_of_supervising_person", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_mother_status_relevance.yml" + } + } + } + }, + { + "key": "number_of_children_born", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_children_born", + "type": "edit_text", + "hint": "Number of Children Born", + "v_numeric_integer": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_max": { + "value": "5", + "err": "The number of children born should be equal or less than 5" + }, + "v_min": { + "value": "1", + "err": "The number of children born should greater than 0" + } + }, + { + "key": "delivery_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_date", + "type": "date_picker", + "hint": "Delivery Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "v_required": { + "value": true, + "err": "Please select the delivery date" + } + }, + { + "key": "delivery_time", + "type": "time_picker", + "hint": "Delivery Time", + "openmrs_entity_id": "delivery_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please select the delivery time" + } + }, + { + "key": "mother_status_module_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_status_module_status", + "type": "hidden", + "value": "PENDING" + }, + { + "key": "labour_duration", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "labour_duration", + "label": "Labour information/conditions", + "type": "hidden" + }, + { + "key": "labour_stage", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "labour_stage", + "type": "hidden", + "value": "complete" + }, + { + "key": "hiv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv", + "type": "edit_text", + "hidden": true + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_mother_well_being.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_mother_well_being.json new file mode 100644 index 000000000..2a84c7ae3 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_mother_well_being.json @@ -0,0 +1,436 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "LD Partograph : Mother Well-being", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Well-being of Mother", + "fields": [ + { + "key": "contraction_every_half_hour_label", + "type": "label", + "text": "Pulse rate (Every half an hour)", + "text_size": "7sp", + "text_color": "#000000", + "label_text_style": "bold", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "" + }, + { + "key": "pulse_rate", + "type": "edit_text", + "hint": "Pulse Rate (Beats per minute)", + "openmrs_entity_id": "pulse_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the pulse rate" + }, + "v_min": { + "value": "0", + "err": "The pulse rate must be equal or greater than 0 (bpm)" + }, + "v_max": { + "value": "200", + "err": "The pulse rate must be equal or less than 200 (bpm)" + }, + "v_required": { + "value": true, + "err": "Please input the pulse rate" + } + }, + { + "key": "prompt_for_Bradycardia", + "type": "toaster_notes", + "text": "Elicit the cause of bradycardia and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_Bradycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "lessThan(.,\"60\")" + } + } + }, + { + "key": "prompt_for_Tachycardia", + "type": "toaster_notes", + "text": "Elicit the cause of tachycardia and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_Tachycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "greaterThan(.,\"100\")" + } + } + }, + { + "key": "respiratory_rate", + "type": "edit_text", + "hint": "Respiratory Rate (Breaths per minute)", + "openmrs_entity_id": "respiratory_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the respiratory rate" + }, + "v_min": { + "value": "0", + "err": "The respiratory rate must be equal or greater than 0 (Breaths per minute)" + }, + "v_max": { + "value": "100", + "err": "The respiratory rate must be equal or less than 100 (Breaths per minute)" + } + }, + { + "key": "prompt_for_respiratory_rate", + "type": "toaster_notes", + "text": "Manage according to SOP and National guideline", + "openmrs_entity_id": "prompt_for_respiratory_rate", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_mother_wellbeing_relevance.yml" + } + } + } + }, + { + "key": "temperature", + "type": "edit_text", + "hint": "Temperature (\u2103)", + "openmrs_entity_id": "temperature", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the temperature" + }, + "v_min": { + "value": "10", + "err": "Temperature must be equal or greater than 10" + }, + "v_max": { + "value": "50", + "err": "Temperature must be equal or less than 50" + } + }, + { + "key": "notify_client_has_fever", + "type": "toaster_notes", + "text": "Conduct relevant laboratory tests to elicit the cause of fever and manage according to standard guidelines ", + "openmrs_entity_id": "notify_client_has_fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "greaterThan(.,\"37.8\")" + } + } + }, + { + "key": "notify_client_has_hypothermia", + "type": "toaster_notes", + "text": "Manage the hypothermia according to standard guidelines", + "openmrs_entity_id": "notify_client_has_hypothermia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "lessThan(.,\"36.5\")" + } + } + }, + { + "key": "systolic", + "type": "edit_text", + "hint": "Systolic (Blood Pressure)", + "openmrs_entity_id": "systolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the systolic value" + }, + "v_min": { + "value": "0", + "err": "Systolic value must be equal or greater than 0" + }, + "v_max": { + "value": "320", + "err": "Systolic value must be equal or less than 320" + } + }, + { + "key": "diastolic", + "type": "edit_text", + "hint": "Diastolic (Blood Pressure)", + "openmrs_entity_id": "diastolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the diastolic value" + }, + "v_min": { + "value": "0", + "err": "Diastolic value must be equal or greater than 0" + }, + "v_max": { + "value": "200", + "err": "Diastolic value must be equal or less than 200" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:systolic)", + "err": "The diastolic value must be less than the systolic value" + } + ] + }, + { + "key": "prompt_for_management_of_hypertension", + "type": "toaster_notes", + "text": "Manage the hypertension according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypertension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_mother_wellbeing_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_management_of_hypotension", + "type": "toaster_notes", + "text": "Elicit the cause of hypotension and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypotension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_mother_wellbeing_relevance.yml" + } + } + } + }, + { + "key": "urine_protein", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "urine_protein", + "label": "Urine Protein", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "nil", + "text": "Nil", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "nil" + }, + { + "key": "+", + "text": "+", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "+" + }, + { + "key": "++", + "text": "++", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "++" + }, + { + "key": "+++", + "text": "+++", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "+++" + }, + { + "key": "not_tested", + "text": "Not Tested", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_tested" + } + ] + }, + { + "key": "prompt_for_protein", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_mother_wellbeing_relevance.yml" + } + } + } + }, + { + "key": "urine_acetone", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "urine_acetone", + "label": "Urine Acetone", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "nil", + "text": "Nil", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "nil" + }, + { + "key": "+", + "text": "+", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "+" + }, + { + "key": "++", + "text": "++", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "++" + }, + { + "key": "+++", + "text": "+++", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "+++" + }, + { + "key": "not_tested", + "text": "Not Tested", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_tested" + } + ] + }, + { + "key": "prompt_for_acetone", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_mother_wellbeing_relevance.yml" + } + } + } + }, + { + "key": "urine_volume", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "urine_volume", + "text_color": "#000000", + "type": "edit_text", + "hint": "Urine Volume(Output) in mls", + "v_numeric": { + "value": "true", + "err": "Please enter the urine volume" + } + }, + { + "key": "oral_intake", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "oral_intake", + "text_color": "#000000", + "type": "edit_text", + "hint": "Oral Intake (mls)", + "v_numeric": { + "value": "true", + "err": "Please enter the oral intake" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_partograph_time.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_partograph_time.json new file mode 100644 index 000000000..939a636c7 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_partograph_time.json @@ -0,0 +1,128 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Partograph Period", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "global": {}, + "step1": { + "title": "Partograph Time", + "fields": [ + { + "key": "name_of_the_health_care_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "name_of_the_health_care_provider", + "type": "edit_text", + "edit_type": "name", + "hint": "Name of the Healthcare Provider Conducting the Partograph Session", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please specify the name of the healthcare provider." + } + }, + { + "key": "partograph_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "partograph_date", + "type": "date_picker", + "hint": "Partograph Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today" + }, + { + "key": "last_partograph_monitoring_time", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_partograph_monitoring_time", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_partograph_monitoring_time_calculation.yml" + } + } + } + }, + { + "key": "thirty_minutes_ago", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "thirty_minutes_ago", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_partograph_monitoring_time_calculation.yml" + } + } + } + }, + { + "key": "partograph_time", + "type": "time_picker", + "hint": "Partograph Time", + "openmrs_entity_id": "partograph_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "constraints": [ + { + "type": "time", + "ex": "greaterThan(., step1:last_partograph_monitoring_time)", + "err": "The partograph monitoring time cannot be before the last partograph time" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_past_obstetric_history.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_past_obstetric_history.json new file mode 100644 index 000000000..34afaf759 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_past_obstetric_history.json @@ -0,0 +1,66 @@ +{ + "validate_on_submit": true, + "count": "1", + "encounter_type": "Past Obstetric History", + "entity_id": "", + "relational_id": "", + "form_version": "0.0.1", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Past Obstetric History", + "fields": [ + { + "key": "para_1_obstetric_history", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "para_1_obstetric_history", + "text": "Para 1: Obstetric History", + "type": "expansion_panel", + "content_form": "labour_and_delivery_registration_past_obstetric_history_sub_form", + "container": "anc_test" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_placenta_and_membrane.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_placenta_and_membrane.json new file mode 100644 index 000000000..1ab7f759f --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_placenta_and_membrane.json @@ -0,0 +1,399 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Placenta and Membrane", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Expulsion of the placenta and membranes", + "fields": [ + { + "key": "method_used_to_remove_the_placenta", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "method_used_to_remove_the_placenta", + "label": "The method used to remove/deliver the placenta", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "control_cord_traction", + "text": "Control Cord Traction", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "control_cord_traction" + }, + { + "key": "manual", + "text": "Manual", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "manual" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + } + }, + { + "key": "placenta_and_membrane_expulsion", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "placenta_and_membrane_expulsion", + "label": "Expulsion of the Placenta and Membranes", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "complete_placenta", + "text": "Complete placenta", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "complete_placenta" + }, + { + "key": "incomplete_placenta", + "text": "Incomplete placenta", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "incomplete_placenta" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + } + }, + { + "key": "type_of_incomplete_placenta", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_incomplete_placenta", + "label": "Type of incomplete placenta", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "retained_product", + "text": "Retained Product", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "retained_product" + }, + { + "key": "retained_placenta", + "text": "Retained Placenta", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "retained_placenta" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + }, + "relevance": { + "step1:placenta_and_membrane_expulsion": { + "type": "string", + "ex": "equalTo(., \"incomplete_placenta\")" + } + } + }, + { + "key": "placenta_removed_by_hand", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "placenta_removed_by_hand", + "label": "Was the placenta/product removed by hand?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + }, + "relevance": { + "step1:placenta_and_membrane_expulsion": { + "type": "string", + "ex": "equalTo(., \"incomplete_placenta\")" + } + } + }, + { + "key": "conducted_mva", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "conducted_mva", + "label": "MVA.D&C was conducted?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + }, + "relevance": { + "step1:placenta_removed_by_hand": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "prompt_for_placenta_and_membrane_expulsion", + "type": "toaster_notes", + "text": "Manage according to SOP and National guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:conducted_mva": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "administered_antibiotics", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "administered_antibiotics", + "label": "Was the client administered antibiotics?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + }, + "relevance": { + "step1:placenta_and_membrane_expulsion": { + "type": "string", + "ex": "equalTo(., \"incomplete_placenta\")" + } + } + }, + { + "key": "prompt_for_provision_of_antibiotics", + "type": "toaster_notes", + "text": "Provide the client with antibiotic", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:administered_antibiotics": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "removal_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "removal_date", + "type": "date_picker", + "hint": "Removal Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "v_required": { + "value": true, + "err": "Removal date is required" + } + }, + { + "key": "removal_duration", + "type": "edit_text", + "hint": "How long did it take to remove the placenta? (In minutes)", + "openmrs_entity_id": "removal_duration", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "edit_type": "number", + "v_required": { + "value": true, + "err": "Removal duration is required" + } + }, + { + "key": "estimated_blood_loss", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "estimated_blood_loss", + "hint": "Estimated blood loss (mls)", + "text_color": "#000000", + "type": "edit_text", + "v_numeric": { + "value": true, + "err": "Please enter a valid number" + }, + "v_min": { + "value": 0, + "err": "Please enter a valid number" + } + }, + { + "key": "prompt_for_excessive_blood_loss", + "type": "toaster_notes", + "text": "Manage according to SOP and National guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:estimated_blood_loss": { + "type": "numeric", + "ex": "greaterThan(.,\"500\")" + } + } + }, + { + "key": "provided_blood_transfusion", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_blood_transfusion", + "label": "Provided blood transfusion?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + }, + "relevance": { + "step1:estimated_blood_loss": { + "type": "numeric", + "ex": "greaterThan(.,\"500\")" + } + } + }, + { + "key": "name_of_the_provider_who_removed_the_placenta", + "type": "edit_text", + "hint": "Name of the Provider who removed the placenta", + "openmrs_entity_id": "name_of_the_provider_who_removed_the_placenta", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify the name of the provider" + } + }, + { + "key": "labour_stage", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "labour_stage", + "type": "hidden", + "value": 4 + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_ppfp.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_ppfp.json new file mode 100644 index 000000000..cb977737c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_ppfp.json @@ -0,0 +1,141 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "PPFP", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Post-Partum Family Planning (PPFP)", + "fields": [ + { + "key": "ppfp", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ppfp", + "label": "Post-Partum Family Planning (PPFP)", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + } + }, + { + "key": "ppfp_method", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ppfp_method", + "label": "Post-Partum Family Planning (PPFP) Method", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "iucd", + "text": "IUCD", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "iucd" + }, + { + "key": "implants", + "text": "Implants", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "implants" + }, + { + "key": "btl", + "text": "BTL", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "btl" + }, + { + "key": "pop", + "text": "Progesterone only pills (POP)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pop" + }, + { + "key": "condom", + "text": "Condom", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + }, + "relevance": { + "step1:ppfp": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration.json new file mode 100644 index 000000000..042c37c76 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration.json @@ -0,0 +1,1488 @@ +{ + "count": "6", + "skip_blank_steps": true, + "encounter_type": "Labour and Delivery Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "next": "step2", + "title": "Triage", + "fields": [ + { + "key": "systolic", + "type": "edit_text", + "hint": "Systolic (Blood Pressure)", + "openmrs_entity_id": "systolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the systolic value" + }, + "v_min": { + "value": "0", + "err": "Systolic value must be equal or greater than 0" + }, + "v_max": { + "value": "320", + "err": "Systolic value must be equal or less than 320" + }, + "v_required": { + "value": true, + "err": "Please enter the systolic value" + } + }, + { + "key": "diastolic", + "type": "edit_text", + "hint": "Diastolic (Blood Pressure)", + "openmrs_entity_id": "diastolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the diastolic value" + }, + "v_min": { + "value": "0", + "err": "Diastolic value must be equal or greater than 0" + }, + "v_max": { + "value": "200", + "err": "Diastolic value must be equal or less than 200" + }, + "v_required": { + "value": true, + "err": "Please enter the diastolic value" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:systolic)", + "err": "The diastolic value must be less than the systolic value" + } + ] + }, + { + "key": "prompt_for_management_of_hypertension", + "type": "toaster_notes", + "text": "Manage the hypertension according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypertension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_management_of_hypotension", + "type": "toaster_notes", + "text": "Elicit the cause of hypotension and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypotension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_relevance.yml" + } + } + } + }, + { + "key": "pulse_rate", + "type": "edit_text", + "hint": "Pulse Rate (Beats per minute)", + "openmrs_entity_id": "pulse_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the pulse rate" + }, + "v_min": { + "value": "0", + "err": "The pulse rate must be equal or greater than 0 (bpm)" + }, + "v_max": { + "value": "200", + "err": "The pulse rate must be equal or less than 200 (bpm)" + }, + "v_required": { + "value": true, + "err": "Please enter the pulse rate" + } + }, + { + "key": "prompt_for_Bradycardia", + "type": "toaster_notes", + "text": "Elicit the cause of bradycardia and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_Bradycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "lessThan(.,\"70\")" + } + } + }, + { + "key": "prompt_for_Tachycardia", + "type": "toaster_notes", + "text": "Elicit the cause of tachycardia and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_Tachycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "greaterThan(.,\"140\")" + } + } + }, + { + "key": "respiratory_rate", + "type": "edit_text", + "hint": "Respiratory Rate (Breaths per minute)", + "openmrs_entity_id": "respiratory_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the respiratory rate" + }, + "v_min": { + "value": "0", + "err": "The pulse rate must be equal or greater than 0 (Breaths per minute)" + }, + "v_max": { + "value": "100", + "err": "The pulse rate must be equal or less than 100 (Breaths per minute)" + }, + "v_required": { + "value": true, + "err": "Please enter the pulse rate" + } + }, + { + "key": "fetal_heart_rate", + "type": "edit_text", + "hint": "Count Fetal Heart Rate (bpm)", + "openmrs_entity_id": "fetal_heart_rate", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the fetal heart rate" + }, + "v_min": { + "value": "0", + "err": "Fetal heart rate must be equal or greater than 0" + }, + "v_max": { + "value": "300", + "err": "Fetal heart rate must be equal or less than 300" + }, + "v_required": { + "value": "true", + "err": "Please enter the fetal heart rate" + } + }, + { + "key": "prompt_for_fetal_distress", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "prompt_for_fetal_distress", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_relevance.yml" + } + } + } + }, + { + "key": "temperature", + "type": "edit_text", + "hint": "Temperature (\u2103)", + "openmrs_entity_id": "temperature", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the temperature" + }, + "v_min": { + "value": "10", + "err": "Temperature must be equal or greater than 10" + }, + "v_max": { + "value": "50", + "err": "Temperature must be equal or less than 50" + }, + "v_required": { + "value": true, + "err": "Please enter the temperature" + } + }, + { + "key": "notify_client_has_fever", + "type": "toaster_notes", + "text": "Conduct relevant laboratory tests to elicit the cause of fever and manage according to standard guidelines ", + "openmrs_entity_id": "notify_client_has_fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "greaterThan(.,\"37.8\")" + } + } + }, + { + "key": "notify_client_has_hypothermia", + "type": "toaster_notes", + "text": "Manage the hypothermia according to standard guidelines", + "openmrs_entity_id": "notify_client_has_hypothermia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "lessThan(.,\"36.5\")" + } + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Weight (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the weight" + }, + "v_min": { + "value": "20", + "err": "The weight must be equal or greater than 20 (KG)" + }, + "v_max": { + "value": "300", + "err": "The weight must be equal or less than 300 (KG)" + }, + "v_required": { + "value": true, + "err": "Please enter the weight" + } + }, + { + "key": "height", + "type": "edit_text", + "hint": "Height (CM)", + "openmrs_entity": "concept", + "openmrs_entity_id": "height", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the height" + }, + "v_min": { + "value": "60", + "err": "The height must be equal or greater than 60 (CM)" + }, + "v_max": { + "value": "200", + "err": "The height must be equal or less than 200 (CM)" + }, + "v_required": { + "value": true, + "err": "Please enter the height" + } + }, + { + "key": "prompt_for_short_stature", + "type": "toaster_notes", + "text": "Counsel the client on her risk of obstructed labour and advise her to deliver at a health care facility", + "openmrs_entity_id": "prompt_for_short_stature", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:height": { + "type": "numeric", + "ex": "lessThan(.,\"145\")" + } + } + }, + { + "key": "bmi", + "type": "edit_text", + "hint": "Body Mass Index (BMI)", + "read_only": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "bmi", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the height" + }, + "v_required": { + "value": true, + "err": "Please enter the height" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_calculation.yml" + } + } + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_underweight", + "type": "toaster_notes", + "text": "Manage the undernourished client using standard guidelines", + "openmrs_entity_id": "prompt_for_underweight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:bmi": { + "type": "numeric", + "ex": "lessThan(.,\"18.5\")" + } + } + }, + { + "key": "prompt_for_overweight", + "type": "toaster_notes", + "text": "Manage the overweight client using standard guidelines", + "openmrs_entity_id": "prompt_for_overweight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:bmi": { + "type": "numeric", + "ex": "greaterThanEqualTo(.,\"29\")" + } + } + }, + { + "key": "danger_signs", + "type": "check_box", + "label": "Danger signs present", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "danger_signs", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "bleeding_vag", + "text": "Bleeding Vaginally", + "openmrs_entity": "concept", + "openmrs_entity_id": "bleeding_vag" + }, + { + "key": "severe_headache", + "text": "Severe Headache", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_headache" + }, + { + "key": "severe_abdominal_pain", + "text": "Severe Abdominal Pain", + "openmrs_entity": "concept", + "openmrs_entity_id": "severely_abdominal_pain" + }, + { + "key": "convulsion", + "text": "Convulsion", + "openmrs_entity": "concept", + "openmrs_entity_id": "convulsion" + }, + { + "key": "blurred_vision", + "text": "Blurred Vision", + "openmrs_entity": "concept", + "openmrs_entity_id": "blurred_vision" + }, + { + "key": "severe_breathing_difficulty", + "text": "Severe Breathing Difficulty", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_breathing_difficulty" + }, + { + "key": "unconscious", + "text": "Unconscious", + "openmrs_entity": "concept", + "openmrs_entity_id": "unconscious" + }, + { + "key": "reduced_fetal_movement", + "text": "Reduced Fetal Movement", + "openmrs_entity": "concept", + "openmrs_entity_id": "reduced_fetal_movement" + }, + { + "key": "dizziness", + "text": "Dizziness", + "openmrs_entity": "concept", + "openmrs_entity_id": "dizziness" + }, + { + "key": "pale_anaemic", + "text": "Pale/Anaemic", + "openmrs_entity": "concept", + "openmrs_entity_id": "pale_anaemic" + }, + { + "key": "none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ], + "v_required": { + "value": "true", + "err": "Please select the danger sings" + } + } + ] + }, + "step2": { + "next": "step3", + "title": "True Labour", + "fields": [ + { + "key": "true_labour", + "type": "check_box", + "label": "True labour?", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "true_labour", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "painful_uterine_contraction", + "text": "Painful, increasing frequency and duration", + "openmrs_entity": "concept", + "openmrs_entity_id": "painful_uterine_contraction" + }, + { + "key": "bloody_vaginal_discharge", + "text": "Show (Bloody mucoid vaginal discharge)", + "openmrs_entity": "concept", + "openmrs_entity_id": "bloody_vaginal_discharge" + }, + { + "key": "effacement_and_dilatation", + "text": "Effacement and dilatation of cervix", + "openmrs_entity": "concept", + "openmrs_entity_id": "effacement_and_dilatation" + }, + { + "key": "progressive_descent", + "text": "Progressive descent of the presenting part", + "openmrs_entity": "concept", + "openmrs_entity_id": "progressive_descent" + } + ], + "v_required": { + "value": "true", + "err": "Please select at least one" + } + } + ] + }, + "step3": { + "next": "step4", + "title": "Admission Information", + "fields": [ + { + "key": "admission_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "admission_date", + "type": "date_picker", + "hint": "Admission Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the admission date" + } + }, + { + "key": "admission_time", + "type": "time_picker", + "hint": "Admission Time", + "openmrs_entity_id": "admission_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please enter the admission time" + } + }, + { + "key": "admitting_person_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "admitting_person_name", + "type": "edit_text", + "input_type": "name", + "hint": "Admitting Nurse/Doctor Name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter the admitting nurse/doctor's name" + }, + "v_required": { + "value": "true", + "err": "Please enter the admitting nurse/doctor's name" + } + }, + { + "key": "admission_place", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "admission_place", + "type": "edit_text", + "hint": "Admitted From", + "v_required": { + "value": "true", + "err": "Please enter the admission place" + } + }, + { + "key": "admission_reason", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "admission_reason", + "type": "edit_text", + "hint": "Reason for Admission", + "v_required": { + "value": "true", + "err": "Please enter the admission reason" + } + }, + { + "key": "reason_for_referral", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_referral", + "type": "edit_text", + "hint": "Reason for Referral/Management Received", + "v_required": { + "value": "true", + "err": "Please enter the referral/management reason" + } + }, + { + "key": "danger_signs", + "type": "check_box", + "label": "Danger signs present", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "danger_signs", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "bleeding_vag", + "text": "Bleeding Vaginally", + "openmrs_entity": "concept", + "openmrs_entity_id": "bleeding_vag" + }, + { + "key": "severe_headache", + "text": "Severe Headache", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_headache" + }, + { + "key": "severe_abdominal_pain", + "text": "Severe Abdominal Pain", + "openmrs_entity": "concept", + "openmrs_entity_id": "severely_abdominal_pain" + }, + { + "key": "convulsion", + "text": "Convulsion", + "openmrs_entity": "concept", + "openmrs_entity_id": "convulsion" + }, + { + "key": "blurred_vision", + "text": "Blurred Vision", + "openmrs_entity": "concept", + "openmrs_entity_id": "blurred_vision" + }, + { + "key": "severe_breathing_difficulty", + "text": "Severe Breathing Difficulty", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_breathing_difficulty" + }, + { + "key": "unconscious", + "text": "Unconscious", + "openmrs_entity": "concept", + "openmrs_entity_id": "unconscious" + }, + { + "key": "reduced_fetal_movement", + "text": "Reduced Fetal Movement", + "openmrs_entity": "concept", + "openmrs_entity_id": "reduced_fetal_movement" + }, + { + "key": "dizziness", + "text": "Dizziness", + "openmrs_entity": "concept", + "openmrs_entity_id": "dizziness" + }, + { + "key": "none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ], + "v_required": { + "value": "true", + "err": "Please select the danger sings" + } + }, + { + "key": "danger_signs_present_toaster", + "openmrs_entity_parent": "", + "openmrs_entity": "", + "openmrs_entity_id": "", + "type": "toaster_notes", + "text": "Manage the condition according to standard guideline", + "toaster_type": "problem", + "relevance": { + "step3:danger_signs": { + "ex-checkbox": [ + { + "or": [ + "bleeding_vag", + "severe_headache", + "unconscious", + "reduced_fetal_movement", + "dizziness", + "blurred_vision", + "severe_abdominal_pain", + "severe_breathing_difficulty", + "convulsion" + ] + } + ] + } + } + } + ] + }, + "step4": { + "next": "step5", + "title": "Obstetric History", + "fields": [ + { + "key": "gravida", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gravida", + "type": "edit_text", + "edit_type": "number", + "hint": "Gravida", + "v_required": { + "value": "true", + "err": "Please enter the gravida number" + }, + "v_max": { + "value": "35", + "err": "Temperature must be equal or less than 50" + } + }, + { + "key": "para", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "para", + "type": "edit_text", + "edit_type": "number", + "hint": "Para", + "v_required": { + "value": "true", + "err": "Please enter the para number" + } + }, + { + "key": "children_alive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "children_alive", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of children alive", + "v_required": { + "value": "true", + "err": "Please enter the number of children alive" + } + }, + { + "key": "number_of_abortion", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_abortion", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of abortions", + "v_required": { + "value": "true", + "err": "Please enter the number of abortions" + } + }, + { + "key": "last_menstrual_period", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_menstrual_period", + "type": "date_picker", + "hint": "Last Normal Menstrual Period (LNMP)", + "label_info_title": "LNMP", + "label_info_text": "LNMP = first day of Last Normal Menstrual Period. If the exact date is unknown, but the period of the month is known, use day 5 for beginning of the month, day 15 for middle of the month and day 25 for end of the month.", + "expanded": false, + "max_date": "today", + "min_date": "today-50w", + "v_required": { + "value": "true", + "err": "LMP required" + } + }, + { + "key": "edd", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "edd", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_calculation.yml" + } + } + } + }, + { + "key": "gest_age_note", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Gestational Age (GA) in Weeks", + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_calculation.yml" + } + } + } + }, + { + "key": "edd_note", + "openmrs_entity_parent": "", + "openmrs_entity": "", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Expected Date of Delivery (EDD)", + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_calculation.yml" + } + } + } + }, + { + "key": "gest_age", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gest_age", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_calculation.yml" + } + } + } + } + ] + }, + "step5": { + "next": "step6", + "title": "ANC Clinic Findings", + "fields": [ + { + "key": "visit_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of Visits", + "v_required": { + "value": "true", + "err": "Please enter the visit number" + } + }, + { + "key": "ipt_doses", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ipt_doses", + "type": "edit_text", + "hint": "IPT Doses", + "v_numeric": { + "value": "true", + "err": "Please enter the ipt dose number" + }, + "v_min": { + "value": "0", + "err": "IPT dose must be equal or greater than 0" + }, + "v_max": { + "value": "4", + "err": "IPT dose must be equal or less than 4" + }, + "v_required": { + "value": "true", + "err": "Please enter the ipt dose number" + } + }, + { + "key": "tt_doses", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt_doses", + "type": "edit_text", + "hint": "Td Doses", + "v_numeric": { + "value": "true", + "err": "Please enter the Td dose number" + }, + "v_min": { + "value": "0", + "err": "Td dose must be equal or greater than 0" + }, + "v_max": { + "value": "5", + "err": "Td dose must be equal or less than 5" + }, + "v_required": { + "value": "true", + "err": "Please enter the Td dose number" + } + }, + { + "key": "itn_llin_used", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "itn_llin_used", + "type": "spinner", + "hint": "Was ITN/LLIN used?", + "values": [ + "Yes", + "No" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "hb_level", + "type": "edit_text", + "hint": "Last Measured HB Level (g/dl)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the HB level" + }, + "v_min": { + "value": "0", + "err": "HB level must be equal or greater than 0 (g/dl)" + }, + "v_max": { + "value": "20", + "err": "HB level must be equal or less than 20 (g/dl)" + }, + "v_required": { + "value": true, + "err": "Please provide a value" + } + }, + { + "key": "management_provided_for_hb_level", + "type": "native_radio", + "label": "Was management provided for abnormal HB Level?", + "openmrs_entity": "concept", + "openmrs_entity_id": "management_provided_for_hb_level", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step5:hb_level": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"8.5\")" + } + } + }, + { + "key": "prompt_for_moderate_anaemia_management", + "type": "toaster_notes", + "text": "Manage the mild anaemia according to standard guidelines", + "openmrs_entity_id": "prompt_for_moderate_anaemia_management", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_relevance.yml" + } + } + } + }, + { + "key": "hb_test_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_test_date", + "type": "date_picker", + "hint": "Last Measured HB Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the HB test date" + } + }, + { + "key": "pmtct", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct", + "type": "native_radio", + "label": "PMTCT", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "chk_one", + "text": "1", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_one" + }, + { + "key": "chk_two", + "text": "2", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_two" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "management_provided_for_pmtct", + "type": "native_radio", + "label": "Was management provided for PMTCT?", + "openmrs_entity": "concept", + "openmrs_entity_id": "management_provided_for_pmtct", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step5:pmtct": { + "type": "string", + "ex": "equalTo(., \"chk_one\")" + } + } + }, + { + "key": "pmtct_test_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_test_date", + "type": "date_picker", + "hint": "Last PMTCT test Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the last PMTCT test date" + } + }, + { + "key": "art_prescription", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "art_prescription", + "type": "native_radio", + "label": "ART/Prescription", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "syphilis", + "type": "native_radio", + "label": "VDRL (Syphilis)", + "openmrs_entity": "concept", + "openmrs_entity_id": "syphilis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "management_provided_for_syphilis", + "type": "native_radio", + "label": "Was management provided for syphilis?", + "openmrs_entity": "concept", + "openmrs_entity_id": "management_provided_for_syphilis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step5:syphilis": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "blood_group", + "type": "spinner", + "hint": "Blood Group", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_group", + "openmrs_entity_parent": "", + "values": [ + "A", + "B", + "AB", + "O" + ], + "keys": [ + "A", + "B", + "AB", + "O" + ], + "openmrs_choice_ids": { + "A": "A", + "B": "B", + "AB": "AB", + "O": "O" + }, + "v_required": { + "value": "true", + "err": "Please choose a blood group" + } + }, + { + "key": "rh_factor", + "type": "native_radio", + "label": "Rh", + "openmrs_entity": "concept", + "openmrs_entity_id": "rh_factor", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "management_provided_for_rh", + "type": "native_radio", + "label": "Was management provided for negative RH?", + "openmrs_entity": "concept", + "openmrs_entity_id": "management_provided_for_rh", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step5:rh_factor": { + "type": "string", + "ex": "equalTo(., \"negative\")" + } + } + }, + { + "key": "prompt_for_rh_negative", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step5:management_provided_for_rh": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + } + ] + }, + "step6": { + "title": "Current Labour", + "fields": [ + { + "key": "labour_onset_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "labour_onset_date", + "type": "date_picker", + "hint": "Labour onset Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the labour onset date" + } + }, + { + "key": "labour_onset_time", + "type": "time_picker", + "hint": "Labour onset Time", + "openmrs_entity_id": "labour_onset_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please enter the labour onset time" + } + }, + { + "key": "ruptured_membrane", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ruptured_membrane", + "type": "spinner", + "hint": "Membrane ruptured?", + "values": [ + "Yes", + "No" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "prompt_for_ruptured_membrane", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step6:ruptured_membrane": { + "type": "string", + "ex": "equalTo(., \"Yes\")" + } + } + }, + { + "key": "membrane_ruptured_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "membrane_ruptured_date", + "type": "date_picker", + "hint": "Membrane rupture Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the membrane rupture date" + }, + "relevance": { + "step6:ruptured_membrane": { + "type": "string", + "ex": "equalTo(., \"Yes\")" + } + } + }, + { + "key": "membrane_ruptured_time", + "type": "time_picker", + "hint": "Membrane rupture Time", + "openmrs_entity_id": "membrane_ruptured_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please enter the membrane rupture time" + }, + "relevance": { + "step6:ruptured_membrane": { + "type": "string", + "ex": "equalTo(., \"Yes\")" + } + } + }, + { + "key": "fetal_movement", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fetal_movement", + "type": "spinner", + "hint": "Fetal movement", + "values": [ + "Present", + "Absent" + ], + "keys": [ + "present", + "absent" + ], + "openmrs_choice_ids": { + "present": "present", + "absent": "absent" + }, + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "prompt_for_fetal_movement", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step6:fetal_movement": { + "type": "string", + "ex": "equalTo(., \"absent\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_admission_information.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_admission_information.json new file mode 100644 index 000000000..25f66cf68 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_admission_information.json @@ -0,0 +1,373 @@ +{ + "count": "1", + "skip_blank_steps": true, + "encounter_type": "Labour and Delivery Registration Admission Information", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Admission Information", + "fields": [ + { + "key": "admission_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "admission_date", + "type": "date_picker", + "hint": "Admission Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today" + }, + { + "key": "admission_time", + "type": "time_picker", + "hint": "Admission Time", + "openmrs_entity_id": "admission_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "admitting_person_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "admitting_person_name", + "type": "edit_text", + "input_type": "name", + "hint": "Admitting Nurse/Doctor Name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter the admitting nurse/doctor's name" + } + }, + { + "key": "admission_from", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "admission_from", + "type": "native_radio", + "label": "Admitted From", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "home", + "text": "HOME", + "openmrs_entity": "concept", + "openmrs_entity_id": "home" + }, + { + "key": "antenatal_ward", + "text": "ANTENATAL WARD", + "openmrs_entity": "concept", + "openmrs_entity_id": "antenatal_ward" + }, + { + "key": "referral", + "text": "REFERRAL", + "openmrs_entity": "concept", + "openmrs_entity_id": "referral" + } + ] + }, + { + "key": "name_of_hf", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "name_of_hf", + "buttonText": "Select Referred From", + "sort": true, + "maxSelectable": 1, + "dialogTitle": "Health Facility", + "searchHint": "Referred From", + "options": [ + ], + "type": "multi_select_list", + "v_required": { + "value": true, + "err": "Please Referred From" + }, + "relevance": { + "step1:admission_from": { + "type": "string", + "ex": "equalTo(., \"referral\")" + } + } + }, + { + "key": "reason_for_referral", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_referral", + "type": "edit_text", + "hint": "Reason for Referral/Management Received", + "relevance": { + "step1:admission_from": { + "type": "string", + "ex": "equalTo(., \"referral\")" + } + } + }, + { + "key": "reasons_for_admission", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_admission", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Please select the reason for Admission", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "labour_pain", + "text": "Labor Pain", + "openmrs_entity": "concept", + "openmrs_entity_id": "labour_pain" + }, + { + "key": "observation", + "text": "Observation", + "openmrs_entity": "concept", + "openmrs_entity_id": "observation" + }, + { + "key": "prom", + "text": "PROM", + "openmrs_entity": "concept", + "openmrs_entity_id": "prom" + }, + { + "key": "elective_cesarean_section", + "text": "Elective C/S", + "openmrs_entity": "concept", + "openmrs_entity_id": "elective_cesarean_section" + }, + { + "key": "induction", + "text": "Induction of labor", + "openmrs_entity": "concept", + "openmrs_entity_id": "induction" + }, + { + "key": "other", + "text": "Other", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Please select the reasons" + }, + "relevance": { + "step1:admission_from": { + "type": "string", + "ex": "notEqualTo(., \"referral\")" + } + } + }, + { + "key": "other_reason_for_admission", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_admission", + "type": "edit_text", + "hint": "Specify other reasons for admission", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reasons_for_admission": { + "ex-checkbox": [ + { + "or": [ + "other" + ] + } + ] + } + } + }, + { + "key": "danger_signs", + "type": "check_box", + "label": "Danger signs & Risk factors", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "danger_signs", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "bleeding_vag", + "text": "Bleeding Vaginally", + "openmrs_entity": "concept", + "openmrs_entity_id": "bleeding_vag" + }, + { + "key": "severe_headache", + "text": "Severe Headache", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_headache" + }, + { + "key": "severe_abdominal_pain", + "text": "Severe Abdominal Pain", + "openmrs_entity": "concept", + "openmrs_entity_id": "severely_abdominal_pain" + }, + { + "key": "convulsion", + "text": "Convulsion", + "openmrs_entity": "concept", + "openmrs_entity_id": "convulsion" + }, + { + "key": "blurred_vision", + "text": "Blurred Vision", + "openmrs_entity": "concept", + "openmrs_entity_id": "blurred_vision" + }, + { + "key": "severe_breathing_difficulty", + "text": "Severe Breathing Difficulty", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_breathing_difficulty" + }, + { + "key": "unconscious", + "text": "Unconscious", + "openmrs_entity": "concept", + "openmrs_entity_id": "unconscious" + }, + { + "key": "reduced_fetal_movement", + "text": "Reduced Fetal Movement", + "openmrs_entity": "concept", + "openmrs_entity_id": "reduced_fetal_movement" + }, + { + "key": "dizziness", + "text": "Dizziness", + "openmrs_entity": "concept", + "openmrs_entity_id": "dizziness" + }, + { + "key": "pale_anaemic", + "text": "Pale/Anaemic", + "openmrs_entity": "concept", + "openmrs_entity_id": "pale_anaemic" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + }, + { + "key": "none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ], + "v_required": { + "value": true, + "err": "Please fill this question" + } + }, + { + "key": "other_danger_signs", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_danger_signs", + "type": "edit_text", + "hint": "Specify other danger signs and risk factors", + "v_required": { + "value": "true", + "err": "Please specify the danger signs and risk factors" + }, + "relevance": { + "step1:danger_signs": { + "ex-checkbox": [ + { + "or": [ + "other" + ] + } + ] + } + } + }, + { + "key": "danger_signs_present_toaster", + "openmrs_entity_parent": "", + "openmrs_entity": "", + "openmrs_entity_id": "", + "type": "toaster_notes", + "text": "Manage the condition according to standard guideline", + "toaster_type": "problem", + "relevance": { + "step1:danger_signs": { + "ex-checkbox": [ + { + "or": [ + "bleeding_vag", + "severe_headache", + "unconscious", + "reduced_fetal_movement", + "dizziness", + "blurred_vision", + "severe_abdominal_pain", + "severe_breathing_difficulty", + "convulsion" + ] + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_anc_clinic_findings.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_anc_clinic_findings.json new file mode 100644 index 000000000..cb6f02092 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_anc_clinic_findings.json @@ -0,0 +1,682 @@ +{ + "count": "1", + "skip_blank_steps": true, + "encounter_type": "Labour and Delivery Registration ANC Clinic Findings", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "ANC Clinic Findings", + "fields": [ + { + "key": "number_of_visits", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_visits", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of Visits" + }, + { + "key": "ipt_doses", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ipt_doses", + "type": "edit_text", + "hint": "IPT Doses", + "v_numeric": { + "value": "true", + "err": "Please enter the ipt dose number" + }, + "v_min": { + "value": "0", + "err": "IPT dose must be equal or greater than 0" + }, + "v_max": { + "value": "4", + "err": "IPT dose must be equal or less than 4" + } + }, + { + "key": "tt_doses", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tt_doses", + "type": "edit_text", + "hint": "Td Doses", + "v_numeric": { + "value": "true", + "err": "Please enter the Td dose number" + }, + "v_min": { + "value": "0", + "err": "Td dose must be equal or greater than 0" + }, + "v_max": { + "value": "5", + "err": "Td dose must be equal or less than 5" + } + }, + { + "key": "llin_used", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "llin_used", + "type": "spinner", + "hint": "Was ITN/LLIN used?", + "values": [ + "Yes", + "No" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + } + }, + { + "key": "hb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_test", + "type": "native_radio", + "label": "HB Test done", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "hb_level", + "type": "edit_text", + "hint": "Last Measured HB Level (g/dl)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the HB level" + }, + "v_min": { + "value": "0", + "err": "HB level must be equal or greater than 0 (g/dl)" + }, + "v_max": { + "value": "20", + "err": "HB level must be equal or less than 20 (g/dl)" + }, + "relevance": { + "step1:hb_test": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "management_provided_for_severe_anaemia", + "type": "native_radio", + "label": "Was management provided for severe anaemia?", + "openmrs_entity": "concept", + "openmrs_entity_id": "management_provided_for_severe_anaemia", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:hb_level": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"8.5\")" + } + } + }, + { + "key": "management_provided_for_mild_anaemia", + "type": "native_radio", + "label": "Was management provided for mild anaemia?", + "openmrs_entity": "concept", + "openmrs_entity_id": "management_provided_for_mild_anaemia", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_relevance.yml" + } + } + } + }, + { + "key": "hb_test_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_test_date", + "type": "date_picker", + "hint": "Last Measured HB Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the HB test date" + }, + "relevance": { + "step1:hb_test": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "anc_hiv_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "anc_hiv_status", + "type": "native_radio", + "label": "PMTCT", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "unknown", + "text": "0", + "openmrs_entity": "concept", + "openmrs_entity_id": "unknown" + }, + { + "key": "positive", + "text": "1 (Diagnosed during this pregnancy)", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "2", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "known_on_art_before_this_pregnancy", + "text": "Known on ART before this pregnancy", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_on_art_before_this_pregnancy" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "hiv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_anc_clinic_findings_calculation.yml" + } + } + } + }, + { + "key": "pmtct_test_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_test_date", + "type": "date_picker", + "hint": "Last PMTCT test Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the last PMTCT test date" + }, + "relevance": { + "step1:anc_hiv_status": { + "type": "string", + "ex": "equalTo(., \"negative\")" + } + } + }, + { + "key": "management_provided_for_pmtct", + "type": "native_radio", + "label": "Was management provided for PMTCT?", + "openmrs_entity": "concept", + "openmrs_entity_id": "management_provided_for_pmtct", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:anc_hiv_status": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "art_prescription", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "art_prescription", + "type": "native_radio", + "label": "ART/Prescription", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:management_provided_for_pmtct": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "prompt_for_art_management", + "type": "toaster_notes", + "text": "Provide management according to SOP and standard guideline", + "openmrs_entity_id": "prompt_for_art_management", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_anc_clinic_findings_relevance.yml" + } + } + } + }, + { + "key": "syphilis", + "type": "native_radio", + "label": "VDRL (Syphilis)", + "openmrs_entity": "concept", + "openmrs_entity_id": "syphilis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Test Not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "management_provided_for_syphilis", + "type": "native_radio", + "label": "Was management provided for syphilis?", + "openmrs_entity": "concept", + "openmrs_entity_id": "management_provided_for_syphilis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:syphilis": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "prompt_for_syphilis_management_not_done", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:management_provided_for_syphilis": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "malaria", + "type": "native_radio", + "label": "Malaria test", + "openmrs_entity": "concept", + "openmrs_entity_id": "malaria", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Malaria Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "management_provided_for_malaria", + "type": "native_radio", + "label": "Was management provided for malaria?", + "openmrs_entity": "concept", + "openmrs_entity_id": "management_provided_for_malaria", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:malaria": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "prompt_for_malaria_management_not_done", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:management_provided_for_malaria": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "blood_group", + "type": "spinner", + "hint": "Blood Group", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_group", + "openmrs_entity_parent": "", + "values": [ + "A", + "B", + "AB", + "O", + "Test not conducted" + ], + "keys": [ + "A", + "B", + "AB", + "O", + "test_not_conducted" + ], + "openmrs_choice_ids": { + "A": "A", + "B": "B", + "AB": "AB", + "O": "O", + "test_not_conducted": "test_not_conducted" + }, + "v_required": { + "value": "true", + "err": "Please choose a blood group" + } + }, + { + "key": "rh_factor", + "type": "native_radio", + "label": "Rh", + "openmrs_entity": "concept", + "openmrs_entity_id": "rh_factor", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:blood_group": { + "type": "string", + "ex": "notEqualTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "management_provided_for_rh", + "type": "native_radio", + "label": "Was management provided for negative RH?", + "openmrs_entity": "concept", + "openmrs_entity_id": "management_provided_for_rh", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:rh_factor": { + "type": "string", + "ex": "equalTo(., \"negative\")" + } + } + }, + { + "key": "prompt_for_rh_negative", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:management_provided_for_rh": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_current_labour.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_current_labour.json new file mode 100644 index 000000000..f5240e412 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_current_labour.json @@ -0,0 +1,278 @@ +{ + "count": "1", + "skip_blank_steps": true, + "encounter_type": "Labour and Delivery Registration Current Labour", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Current Labour History", + "fields": [ + { + "key": "labour_onset_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "labour_onset_date", + "type": "date_picker", + "hint": "Labour onset Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today" + }, + { + "key": "labour_onset_time", + "type": "time_picker", + "hint": "Labour onset Time", + "openmrs_entity_id": "labour_onset_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "membrane", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "membrane", + "type": "native_radio", + "label": "Membrane ruptured?", + "options": [ + { + "key": "ruptured", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "ruptured", + "openmrs_entity_id": "ruptured" + }, + { + "key": "intact", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "intact" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "membrane_ruptured_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "membrane_ruptured_date", + "type": "date_picker", + "hint": "Membrane rupture Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the membrane rupture date" + }, + "relevance": { + "step1:membrane": { + "type": "string", + "ex": "equalTo(., \"ruptured\")" + } + } + }, + { + "key": "membrane_ruptured_time", + "type": "time_picker", + "hint": "Membrane rupture Time", + "openmrs_entity_id": "membrane_ruptured_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please enter the membrane rupture time" + }, + "relevance": { + "step1:membrane": { + "type": "string", + "ex": "equalTo(., \"ruptured\")" + } + } + }, + { + "key": "prompt_for_ruptured_membrane", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_registration_current_labour_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_prom", + "type": "toaster_notes", + "text": "The client has Pre-mature Rupture of Membrane (PROM).\nProvide Management according to SOP and National Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_registration_current_labour_relevance.yml" + } + } + } + }, + { + "key": "labour_onset_timestamp", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "labour_onset_timestamp", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_registration_current_labour_calculation.yml" + } + } + } + }, + { + "key": "membrane_raptured_date_timestamp", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "membrane_raptured_date_timestamp", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_registration_current_labour_calculation.yml" + } + } + } + }, + { + "key": "fetal_movement", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fetal_movement", + "type": "spinner", + "hint": "Fetal movement", + "values": [ + "Present", + "Absent" + ], + "keys": [ + "present", + "absent" + ], + "openmrs_choice_ids": { + "present": "present", + "absent": "absent" + } + }, + { + "key": "movement_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "movement_status", + "type": "spinner", + "hint": "Movement status", + "values": [ + "Active", + "Reduced" + ], + "keys": [ + "active", + "reduced" + ], + "openmrs_choice_ids": { + "present": "active", + "absent": "reduced" + }, + "relevance": { + "step1:fetal_movement": { + "type": "string", + "ex": "equalTo(., \"present\")" + } + }, + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "prompt_for_fetal_movement", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_registration_current_labour_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_reduced_fetal_movement", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_registration_current_labour_relevance.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_obstetric_history.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_obstetric_history.json new file mode 100644 index 000000000..e50a435e4 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_obstetric_history.json @@ -0,0 +1,399 @@ +{ + "count": "1", + "encounter_type": "Labour and Delivery Registration Obstretric History", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Obstetric History", + "fields": [ + { + "key": "gravida", + "type": "edit_text", + "hint": "Gravida", + "openmrs_entity": "concept", + "openmrs_entity_id": "gravida", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the gravida number" + }, + "v_max": { + "value": "35", + "err": "Gravida must be equal to or less than 35" + }, + "v_required": { + "value": true, + "err": "Please answer" + } + }, + { + "key": "para", + "type": "edit_text", + "hint": "Parity", + "openmrs_entity": "concept", + "openmrs_entity_id": "para", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter parity number" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThanEqualTo(., step1:gravida)", + "err": "Parity must be equal to or less than gravida" + } + ], + "v_required": { + "value": true, + "err": "Please answer" + } + }, + { + "key": "gravida_minus_para", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gravida_minus_para", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_registration_obstetric_history_calculation.yml" + } + } + } + }, + { + "key": "prompt_for_grand_multiparity", + "type": "toaster_notes", + "text": "Counsel on the risk of uterine rupture and closely monitor the client", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_registration_obstetric_history_relevance.yml" + } + } + } + }, + { + "key": "number_of_abortion", + "type": "edit_text", + "hint": "Number of abortions", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_abortion", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter parity number" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:gravida_minus_para)", + "err": "Sum of Para and Abortions should not exceed the Gravida" + } + ], + "v_required": { + "value": true, + "err": "Please answer" + } + }, + { + "key": "children_alive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "children_alive", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of children alive", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_registration_obstetric_history_calculation.yml" + } + } + } + }, + { + "key": "last_menstrual_period", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_menstrual_period", + "type": "date_picker", + "hint": "Last Normal Menstrual Period (LNMP)", + "label_info_title": "LNMP", + "label_info_text": "LNMP = first day of Last Normal Menstrual Period. If the exact date is unknown, but the period of the month is known, use day 5 for beginning of the month, day 15 for middle of the month and day 25 for end of the month.", + "expanded": false, + "max_date": "today-28w", + "min_date": "today-50w" + }, + { + "key": "edd", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "edd", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_registration_obstetric_history_calculation.yml" + } + } + } + }, + { + "key": "gest_age_note", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Gestational Age (GA) in Weeks", + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_registration_obstetric_history_calculation.yml" + } + } + } + }, + { + "key": "edd_note", + "openmrs_entity_parent": "", + "openmrs_entity": "", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Expected Date of Delivery (EDD)", + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_registration_obstetric_history_calculation.yml" + } + } + } + }, + { + "key": "gest_age", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "gest_age", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_registration_obstetric_history_calculation.yml" + } + } + } + }, + { + "key": "past_medical_surgical_history", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "past_medical_surgical_history", + "type": "check_box", + "label": "Any Medical and surgical History of the Patient?", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "diabetes_mellitus", + "text": "Diabetes Mellitus", + "openmrs_entity": "concept", + "openmrs_entity_id": "diabetes_mellitus" + }, + { + "key": "sickle_cell_disease", + "text": "Sickle Cell Disease", + "openmrs_entity": "concept", + "openmrs_entity_id": "sickle_cell_disease" + }, + { + "key": "heart_diseases", + "text": "Heart Diseases", + "openmrs_entity": "concept", + "openmrs_entity_id": "heart_diseases" + }, + { + "key": "thyroid_diseases", + "text": "Thyroid Diseases", + "openmrs_entity": "concept", + "openmrs_entity_id": "thyroid_diseases" + }, + { + "key": "blood_transfusion", + "text": "Blood transfusion", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_transfusion" + }, + { + "key": "known_on_art", + "text": "On ART", + "openmrs_entity": "concept", + "openmrs_entity_id": "known_on_art" + }, + { + "key": "epilepsy", + "text": "Epilepsy", + "openmrs_entity": "concept", + "openmrs_entity_id": "epilepsy" + }, + { + "key": "previous_c_s", + "text": "Previous C/S", + "openmrs_entity": "concept", + "openmrs_entity_id": "previous_c_s" + }, + { + "key": "myomectomy", + "text": "Myomectomy", + "openmrs_entity": "concept", + "openmrs_entity_id": "myomectomy" + }, + { + "key": "third_degree_tear", + "text": "Third Degree Tear", + "openmrs_entity": "concept", + "openmrs_entity_id": "third_degree_tear" + }, + { + "key": "repaired_fistula", + "text": "Repaired Fistula", + "openmrs_entity": "concept", + "openmrs_entity_id": "repaired_fistula" + }, + { + "key": "female_genital_mutilation", + "text": "Female Genital Mutilation", + "openmrs_entity": "concept", + "openmrs_entity_id": "female_genital_mutilation" + }, + { + "key": "closely_spaced_pregnancy", + "text": "Closely spaced pregnancy (within 2 years)", + "openmrs_entity": "concept", + "openmrs_entity_id": "closely_spaced_pregnancy" + }, + { + "key": "pregnant_more_than_four", + "text": "Pregnant four or more times", + "openmrs_entity": "concept", + "openmrs_entity_id": "pregnant_more_than_four" + }, + { + "key": "hx_hemorrhage", + "text": "History of Hemorrhage", + "openmrs_entity": "concept", + "openmrs_entity_id": "hx_hemorrhage" + }, + { + "key": "history_of_high_blood_pressure", + "text": "History of high blood pressure", + "openmrs_entity": "concept", + "openmrs_entity_id": "history_of_high_blood_pressure" + }, + { + "key": "anaemia", + "text": "Anaemia", + "openmrs_entity": "concept", + "openmrs_entity_id": "anaemia" + }, + { + "key": "difficult_delivery", + "text": "Difficult delivery (Vacuum, episiotomy)", + "openmrs_entity": "concept", + "openmrs_entity_id": "difficult_delivery" + }, + { + "key": "hx_abortions", + "text": "History of Abortions", + "openmrs_entity": "concept", + "openmrs_entity_id": "hx_abortions" + }, + { + "key": "other", + "text": "Others (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + }, + { + "key": "none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ] + }, + { + "key": "other_past_medical_surgical_history", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_past_medical_surgical_history", + "type": "edit_text", + "hint": "Specify other medical and surgical history", + "v_required": { + "value": "true", + "err": "Please specify the other medical surgical history" + }, + "relevance": { + "step1:past_medical_surgical_history": { + "ex-checkbox": [ + { + "or": [ + "other" + ] + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_triage.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_triage.json new file mode 100644 index 000000000..0d5f946a5 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_triage.json @@ -0,0 +1,499 @@ +{ + "count": "1", + "skip_blank_steps": true, + "encounter_type": "Labour and Delivery Registration Triage", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Triage", + "fields": [ + { + "key": "systolic", + "type": "edit_text", + "hint": "Systolic (Blood Pressure)", + "openmrs_entity_id": "systolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the systolic value" + }, + "v_min": { + "value": "0", + "err": "Systolic value must be equal or greater than 0" + }, + "v_max": { + "value": "320", + "err": "Systolic value must be equal or less than 320" + } + }, + { + "key": "diastolic", + "type": "edit_text", + "hint": "Diastolic (Blood Pressure)", + "openmrs_entity_id": "diastolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the diastolic value" + }, + "v_min": { + "value": "0", + "err": "Diastolic value must be equal or greater than 0" + }, + "v_max": { + "value": "200", + "err": "Diastolic value must be equal or less than 200" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:systolic)", + "err": "The diastolic value must be less than the systolic value" + } + ] + }, + { + "key": "prompt_for_management_of_hypertension", + "type": "toaster_notes", + "text": "Manage the hypertension according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypertension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_management_of_hypotension", + "type": "toaster_notes", + "text": "Elicit the cause of hypotension and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypotension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_relevance.yml" + } + } + } + }, + { + "key": "pulse_rate", + "type": "edit_text", + "hint": "Pulse Rate (Beats per minute)", + "openmrs_entity_id": "pulse_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the pulse rate" + }, + "v_min": { + "value": "0", + "err": "The pulse rate must be equal or greater than 0 (bpm)" + }, + "v_max": { + "value": "200", + "err": "The pulse rate must be equal or less than 200 (bpm)" + } + }, + { + "key": "prompt_for_Bradycardia", + "type": "toaster_notes", + "text": "Elicit the cause of bradycardia and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_Bradycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "lessThan(.,\"60\")" + } + } + }, + { + "key": "prompt_for_Tachycardia", + "type": "toaster_notes", + "text": "Elicit the cause of tachycardia and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_Tachycardia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:pulse_rate": { + "type": "numeric", + "ex": "greaterThan(.,\"100\")" + } + } + }, + { + "key": "respiratory_rate", + "type": "edit_text", + "hint": "Respiratory Rate (Breaths per minute)", + "openmrs_entity_id": "respiratory_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the respiratory rate" + }, + "v_min": { + "value": "0", + "err": "The respiratory rate must be equal or greater than 0 (Breaths per minute)" + }, + "v_max": { + "value": "100", + "err": "The respiratory rate must be equal or less than 100 (Breaths per minute)" + } + }, + { + "key": "prompt_for_respiratory_rate", + "type": "toaster_notes", + "text": "Manage according to SOP and National guideline", + "openmrs_entity_id": "prompt_for_respiratory_rate", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_relevance.yml" + } + } + } + }, + { + "key": "oxygen_saturation", + "type": "edit_text", + "hint": "Oxygen Saturation (SPO2) %", + "openmrs_entity_id": "oxygen_saturation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the % of oxygen saturation" + }, + "v_min": { + "value": "0", + "err": "The % of oxygen saturation must be equal or greater than 0%" + }, + "v_max": { + "value": "100", + "err": "The % of oxygen saturation must be equal or less than 100%" + } + }, + { + "key": "prompt_for_oxygen_saturation", + "type": "toaster_notes", + "text": "Manage the condition according to standard guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:oxygen_saturation": { + "type": "numeric", + "ex": "lessThan(.,\"90\")" + } + } + }, + { + "key": "fetal_heart_rate", + "type": "edit_text", + "hint": "Count Fetal Heart Rate (bpm)", + "openmrs_entity_id": "fetal_heart_rate", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the fetal heart rate" + }, + "v_min": { + "value": "0", + "err": "Fetal heart rate must be equal or greater than 0" + }, + "v_max": { + "value": "300", + "err": "Fetal heart rate must be equal or less than 300" + } + }, + { + "key": "prompt_for_fetal_distress", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "prompt_for_fetal_distress", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_triage_relevance.yml" + } + } + } + }, + { + "key": "temperature", + "type": "edit_text", + "hint": "Temperature (\u2103)", + "openmrs_entity_id": "temperature", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the temperature" + }, + "v_min": { + "value": "10", + "err": "Temperature must be equal or greater than 10" + }, + "v_max": { + "value": "50", + "err": "Temperature must be equal or less than 50" + } + }, + { + "key": "notify_client_has_fever", + "type": "toaster_notes", + "text": "Conduct relevant laboratory tests to elicit the cause of fever and manage according to standard guidelines ", + "openmrs_entity_id": "notify_client_has_fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "greaterThan(.,\"37.8\")" + } + } + }, + { + "key": "notify_client_has_hypothermia", + "type": "toaster_notes", + "text": "Manage the hypothermia according to standard guidelines", + "openmrs_entity_id": "notify_client_has_hypothermia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "lessThan(.,\"36.5\")" + } + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Weight (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the weight" + }, + "v_min": { + "value": "20", + "err": "The weight must be equal or greater than 20 (KG)" + }, + "v_max": { + "value": "300", + "err": "The weight must be equal or less than 300 (KG)" + } + }, + { + "key": "height", + "type": "edit_text", + "hint": "Height (CM)", + "openmrs_entity": "concept", + "openmrs_entity_id": "height", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the height" + }, + "v_min": { + "value": "60", + "err": "The height must be equal or greater than 60 (CM)" + }, + "v_max": { + "value": "200", + "err": "The height must be equal or less than 200 (CM)" + } + }, + { + "key": "prompt_for_short_stature", + "type": "toaster_notes", + "text": "Counsel the client on her risk of obstructed labour and advise her to deliver at a health care facility", + "openmrs_entity_id": "prompt_for_short_stature", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:height": { + "type": "numeric", + "ex": "lessThan(.,\"145\")" + } + } + }, + { + "key": "danger_signs", + "type": "check_box", + "label": "Danger signs present", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "danger_signs", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "bleeding_vag", + "text": "Bleeding Vaginally", + "openmrs_entity": "concept", + "openmrs_entity_id": "bleeding_vag" + }, + { + "key": "severe_headache", + "text": "Severe Headache", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_headache" + }, + { + "key": "severe_abdominal_pain", + "text": "Severe Abdominal Pain", + "openmrs_entity": "concept", + "openmrs_entity_id": "severely_abdominal_pain" + }, + { + "key": "convulsion", + "text": "Convulsion", + "openmrs_entity": "concept", + "openmrs_entity_id": "convulsion" + }, + { + "key": "blurred_vision", + "text": "Blurred Vision", + "openmrs_entity": "concept", + "openmrs_entity_id": "blurred_vision" + }, + { + "key": "severe_breathing_difficulty", + "text": "Severe Breathing Difficulty", + "openmrs_entity": "concept", + "openmrs_entity_id": "severe_breathing_difficulty" + }, + { + "key": "unconscious", + "text": "Unconscious", + "openmrs_entity": "concept", + "openmrs_entity_id": "unconscious" + }, + { + "key": "reduced_fetal_movement", + "text": "Reduced Fetal Movement", + "openmrs_entity": "concept", + "openmrs_entity_id": "reduced_fetal_movement" + }, + { + "key": "dizziness", + "text": "Dizziness", + "openmrs_entity": "concept", + "openmrs_entity_id": "dizziness" + }, + { + "key": "pale_anaemic", + "text": "Pale/Anaemic", + "openmrs_entity": "concept", + "openmrs_entity_id": "pale_anaemic" + }, + { + "key": "none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ] + }, + { + "key": "danger_signs_present_toaster", + "openmrs_entity_parent": "", + "openmrs_entity": "", + "openmrs_entity_id": "", + "type": "toaster_notes", + "text": "Manage the condition according to standard guideline", + "toaster_type": "problem", + "relevance": { + "step1:danger_signs": { + "ex-checkbox": [ + { + "or": [ + "bleeding_vag", + "severe_headache", + "unconscious", + "reduced_fetal_movement", + "dizziness", + "blurred_vision", + "severe_abdominal_pain", + "severe_breathing_difficulty", + "convulsion" + ] + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_true_labour_confirmation.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_true_labour_confirmation.json new file mode 100644 index 000000000..83a6cfabb --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_registration_true_labour_confirmation.json @@ -0,0 +1,179 @@ +{ + "count": "1", + "skip_blank_steps": true, + "encounter_type": "Labour and Delivery Registration True Labour", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "True Labour", + "fields": [ + { + "key": "true_labour", + "type": "check_box", + "label": "Asses if the mother has any of the following", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "true_labour", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "painful_uterine_contraction", + "text": "Regular painful uterine contraction with increasing frequency and duration", + "openmrs_entity": "concept", + "openmrs_entity_id": "painful_uterine_contraction" + }, + { + "key": "bloody_vaginal_discharge", + "text": "Show (Bloody mucoid vaginal discharge)", + "openmrs_entity": "concept", + "openmrs_entity_id": "bloody_vaginal_discharge" + }, + { + "key": "effacement_and_dilatation", + "text": "Effacement and dilatation of cervix", + "openmrs_entity": "concept", + "openmrs_entity_id": "effacement_and_dilatation" + }, + { + "key": "progressive_descent", + "text": "Progressive descent of the presenting part", + "openmrs_entity": "concept", + "openmrs_entity_id": "progressive_descent" + }, + { + "key": "none", + "openmrs_entity": "concept", + "openmrs_choice_id": "none", + "text": "None" + } + ], + "v_required": { + "value": "true", + "err": "Please select at least one" + } + }, + { + "key": "prompt_for_true_labor", + "type": "toaster_notes", + "text": "True labor! Register to Labor & Delivery ", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labor_and_delivery_registration_current_labor_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_false_labor", + "type": "toaster_notes", + "text": "Continue monitoring the mother according to guidelines", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labor_and_delivery_registration_current_labor_relevance.yml" + } + } + } + }, + { + "key": "admit_client", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "admit_client", + "type": "native_radio", + "label": "Do you want to admit the client?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labor_and_delivery_registration_current_labor_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Please select at least one" + } + }, + { + "key": "labour_confirmation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "labour_confirmation", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_true_labour_confirmation_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_stage4_family_planning.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_stage4_family_planning.json new file mode 100644 index 000000000..41e1136a2 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_stage4_family_planning.json @@ -0,0 +1,176 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Family Planning", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Family Planning", + "fields": [ + { + "key": "family_planning_counselling_after_delivery", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "family_planning_counselling_after_delivery", + "type": "native_radio", + "label": "Did you receive counselling about family planning", + "text_color": "#000000", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ] + }, + { + "key": "prompt_for_counseling_the_client", + "type": "toaster_notes", + "text": "Provide Counselling according to SOP and National Guidelines", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_info_text": "Provide Counselling according to SOP and National Guidelines", + "toaster_type": "problem", + "relevance": { + "step1:family_planning_counselling_after_delivery": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "family_planning_methods_selected", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "family_planning_methods_selected", + "type": "native_radio", + "label": "Family planning methods selected by the client", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "tubal_litigation", + "text": "Tubal ligation", + "openmrs_entity": "concept", + "openmrs_entity_id": "tubal_litigation" + }, + { + "key": "intrauterine_device", + "text": "Intrauterine device (IUD)", + "openmrs_entity": "concept", + "openmrs_entity_id": "intrauterine_device" + }, + { + "key": "implants", + "text": "Implants", + "openmrs_entity": "concept", + "openmrs_entity_id": "implants" + }, + { + "key": "progestogen_only_pills", + "text": "Progestogen-only pills (POP)", + "openmrs_entity": "concept", + "openmrs_entity_id": "progestogen_only_pills" + }, + { + "key": "condom", + "text": "Condom", + "openmrs_entity": "concept", + "openmrs_entity_id": "condom" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + }, + { + "key": "none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ] + }, + { + "key": "other_family_planning_methods_selected", + "type": "edit_text", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_family_planning_methods_selected", + "openmrs_entity_parent": "", + "edit_type": "name", + "hint": "Other family planning methods selected", + "v_required": { + "value": "true", + "err": "Please fill the other family planning methods" + }, + "relevance": { + "step1:family_planning_methods_selected": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "family_planning_module_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "family_planning_module_status", + "type": "hidden", + "value": "PENDING" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_stage4_newborn.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_stage4_newborn.json new file mode 100644 index 000000000..b88a56d9c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_stage4_newborn.json @@ -0,0 +1,2599 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "LND Newborn", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "global": {}, + "step1": { + "title": "Immediate Newborn Care", + "fields": [ + { + "key": "mother_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_status", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "delivery_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "delivery_time", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_time", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "newborn_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "newborn_status", + "label": "Status", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "alive", + "text": "Alive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "alive" + }, + { + "key": "still_birth", + "text": "Still birth", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "still_birth" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + } + }, + { + "key": "still_birth_choice", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "still_birth_choice", + "label": "Still Birth", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "fsb", + "text": "FSB", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "fsb" + }, + { + "key": "msb", + "text": "MSB", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "msb" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please select an option" + } + }, + { + "key": "child_delivery_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_delivery_date", + "type": "date_picker", + "hint": "Delivery Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Please the delivery date" + } + }, + { + "key": "child_delivery_time", + "type": "time_picker", + "hint": "Delivery Time", + "openmrs_entity_id": "child_delivery_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Please the delivery time" + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sex", + "type": "spinner", + "hint": "Sex", + "values": [ + "Male", + "Female", + "Ambiguous" + ], + "keys": [ + "Male", + "Female", + "Ambiguous" + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Please select the sex" + } + }, + { + "key": "prompt_for_apgar_at_1_minute", + "type": "toaster_notes", + "text": "APGAR (At 1-minute)", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer1", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_score_activity_label", + "type": "label", + "text": "Activity", + "label_info_title": "Activity", + "label_info_text": "0: Absent \n1: Arm/legs flexed \n2: Active", + "text_size": "7sp", + "text_color": "#000000", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer2", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_activity_score_at_1_minute", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "apgar_activity_score_at_1_minute", + "type": "numbers_selector", + "number_of_selectors": "3", + "start_number": "0", + "max_value": "2", + "text_size": "18px", + "text_color": "#000000", + "selected_text_color": "#ffffff", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer3", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_pulse_score_label", + "type": "label", + "text": "Pulse", + "label_info_title": "Pulse", + "label_info_text": "0: Absent \n1: <100 \n2: > 100", + "text_size": "7sp", + "text_color": "#000000", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer4", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_pulse_score_at_1_minute", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "apgar_pulse_score_at_1_minute", + "type": "numbers_selector", + "number_of_selectors": "3", + "start_number": "0", + "max_value": "2", + "text_size": "18px", + "text_color": "#000000", + "selected_text_color": "#ffffff", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer5", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_grimace_on_stimulation_score_label", + "type": "label", + "text": "Grimace of stimulation", + "label_info_title": "Grimace of stimulation", + "label_info_text": "0: No response \n1: Grimaces \n2: Sneezes coughs/pulls away", + "text_size": "7sp", + "text_color": "#000000", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer6", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_grimace_on_stimulation_score_at_1_minute", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "apgar_grimace_on_stimulation_score_at_1_minute", + "type": "numbers_selector", + "number_of_selectors": "3", + "start_number": "0", + "max_value": "2", + "text_size": "18px", + "text_color": "#000000", + "selected_text_color": "#ffffff", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer7", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_appearance_score_label", + "type": "label", + "text": "Appearance", + "text_size": "7sp", + "text_color": "#000000", + "label_info_title": "Appearance", + "label_info_text": "0: Blue/Pale all over \n1: Blue/Pale extremities \n2: Normal all over", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer8", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_appearance_score_at_1_minute", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "apgar_appearance_score_at_1_minute", + "type": "numbers_selector", + "number_of_selectors": "3", + "start_number": "0", + "max_value": "2", + "text_size": "18px", + "text_color": "#000000", + "selected_text_color": "#ffffff", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer9", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_respiration_score_label", + "type": "label", + "text": "Respiration", + "label_info_title": "Breath", + "label_info_text": "0: Absent \n1: Weak/Slow irregular breathing \n2: Good cry / RR40", + "text_size": "7sp", + "text_color": "#000000", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer10", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_respiration_score_at_1_minute", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "apgar_respiration_score_at_1_minute", + "type": "numbers_selector", + "number_of_selectors": "3", + "start_number": "0", + "max_value": "2", + "text_size": "18px", + "text_color": "#000000", + "selected_text_color": "#ffffff", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_score_at_1_minute", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "openmrs_entity_parent": "", + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "spacer11", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "15dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_normal_apgar_score_at_1_minute", + "type": "toaster_notes", + "text": "APGAR score at 1 min, Normal: {apgar_score}/10", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "positive", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "prompt_for_abnormal_apgar_score_at_1_minute", + "type": "toaster_notes", + "text": "APGAR score at 1 min, Abnormal: {apgar_score}/10. \nGo to emergency", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "prompt_for_apgar_at_5_minute", + "type": "toaster_notes", + "text": "APGAR (At 5-minutes)", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer12", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_score_activity_label_at_5_mins", + "type": "label", + "text": "Activity", + "label_info_title": "Activity", + "label_info_text": "0: Absent \n1: Arm/legs flexed \n2: Active", + "text_size": "7sp", + "text_color": "#000000", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer13", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_activity_score_at_5_minutes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "apgar_activity_score_at_5_minutes", + "type": "numbers_selector", + "number_of_selectors": "3", + "start_number": "0", + "max_value": "2", + "text_size": "18px", + "text_color": "#000000", + "selected_text_color": "#ffffff", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer14", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_pulse_score_label_at_5_mins", + "type": "label", + "text": "Heart", + "label_info_title": "Pulse", + "label_info_text": "0: Absent \n1: <100 \n2: > 100", + "text_size": "7sp", + "text_color": "#000000", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer15", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_pulse_score_at_5_minutes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "apgar_pulse_score_at_5_minutes", + "type": "numbers_selector", + "number_of_selectors": "3", + "start_number": "0", + "max_value": "2", + "text_size": "18px", + "text_color": "#000000", + "selected_text_color": "#ffffff", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer16", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_grimace_on_stimulation_score_label_at_5_mins", + "type": "label", + "text": "Grimace of stimulation", + "label_info_title": "Grimace of stimulation", + "label_info_text": "0: No response \n1: Grimaces \n2: Sneezes coughs/pulls away", + "text_size": "7sp", + "text_color": "#000000", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer17", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_grimace_on_stimulation_score_at_5_minutes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "apgar_grimace_on_stimulation_score_at_5_minutes", + "type": "numbers_selector", + "number_of_selectors": "3", + "start_number": "0", + "max_value": "2", + "text_size": "18px", + "text_color": "#000000", + "selected_text_color": "#ffffff", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer18", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_appearance_score_label_at_5_mins", + "type": "label", + "text": "Appearance", + "text_size": "7sp", + "text_color": "#000000", + "label_info_title": "Appearance", + "label_info_text": "0: Blue/Pale all over \n1: Blue/Pale extremities \n2: Normal all over", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer19", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_appearance_score_at_5_minutes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "apgar_appearance_score_at_5_minutes", + "type": "numbers_selector", + "number_of_selectors": "3", + "start_number": "0", + "max_value": "2", + "text_size": "18px", + "text_color": "#000000", + "selected_text_color": "#ffffff", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer20", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_respiration_score_label_at_5_mins", + "type": "label", + "text": "Respiration", + "label_info_title": "Breath", + "label_info_text": "0: Absent \n1: Weak/Slow irregular breathing \n2: Good cry / RR40", + "text_size": "7sp", + "text_color": "#000000", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "spacer21", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_respiration_score_at_5_minutes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "apgar_respiration_score_at_5_minutes", + "type": "numbers_selector", + "number_of_selectors": "3", + "start_number": "0", + "max_value": "2", + "text_size": "18px", + "text_color": "#000000", + "selected_text_color": "#ffffff", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "apgar_score_at_5_minutes", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "spacer22", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "15dp", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_normal_apgar_score_at_5_minutes", + "type": "toaster_notes", + "text": "APGAR score at 5 mins, Normal: {apgar_score}/10", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "positive", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "prompt_for_abnormal_apgar_score_at_5_minutes", + "type": "toaster_notes", + "text": "APGAR score at 5 mins, Abnormal: {apgar_score}/10. \nGo to emergency", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "resuscitation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "resuscitation", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "resuscitation_question", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "resuscitation_question", + "label": "Resuscitation (Choose the last method done)", + "type": "native_radio", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "no_resuscitation", + "text": "No Resuscitation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_resuscitation" + }, + { + "key": "suction_only", + "text": "Suction Only", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "suction_only" + }, + { + "key": "stimulation", + "text": "Stimulation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "stimulation" + }, + { + "key": "suction_and_bag_mask", + "text": "Suction and Bag Mask", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "suction_and_bag_mask" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "temperature", + "type": "edit_text", + "hint": "Temperature (\u2103)", + "openmrs_entity_id": "temperature", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the temperature" + }, + "v_min": { + "value": "10", + "err": "Temperature must be equal or greater than 10" + }, + "v_max": { + "value": "50", + "err": "Temperature must be equal or less than 50" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "notify_client_has_fever", + "type": "toaster_notes", + "text": "Conduct relevant laboratory tests to elicit the cause of fever and manage according to standard guidelines ", + "openmrs_entity_id": "notify_client_has_fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "notify_client_has_hypothermia", + "type": "toaster_notes", + "text": "Manage the hypothermia according to standard guidelines", + "openmrs_entity_id": "notify_client_has_hypothermia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Weight (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the weight" + }, + "v_min": { + "value": "0", + "err": "The weight must be equal or greater than 0 (KG)" + }, + "v_max": { + "value": "7", + "err": "The weight must be equal or less than 7 (KG)" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_underweight", + "type": "toaster_notes", + "text": "Manage according to SOP and National guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_overweight", + "type": "toaster_notes", + "text": "Manage according to SOP and National guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "heart_rate", + "type": "edit_text", + "hint": "Heart Rate (bpm)", + "openmrs_entity_id": "heart_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the heart rate" + }, + "v_min": { + "value": "0", + "err": "The heart rate must be equal or greater than 0 (bpm)" + }, + "v_max": { + "value": "200", + "err": "The heart rate must be equal or less than 200 (bpm)" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_fetal_distress", + "type": "toaster_notes", + "text": "Manage according to SOP and National guideline", + "openmrs_entity_id": "prompt_for_fetal_distress", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "keep_warm", + "type": "native_radio", + "label": "Keep Warm (skin to skin)", + "openmrs_entity_id": "keep_warm", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_low_apgar_score", + "type": "native_radio", + "label": "Reasons for not Keeping the baby warm (skin to skin)", + "openmrs_entity_id": "reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_low_apgar_score", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "mother_died", + "text": "Mother Died", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_died" + }, + { + "key": "mother_has_complications", + "text": "Mother has complications", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_has_complications" + }, + { + "key": "baby_has_low_apgar_score", + "text": "Baby has low ApGar score", + "openmrs_entity": "concept", + "openmrs_entity_id": "baby_has_low_apgar_score" + }, + { + "key": "baby_has_complications", + "text": "Baby has Complications", + "openmrs_entity": "concept", + "openmrs_entity_id": "baby_has_complications" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_normal_apgar_score", + "type": "native_radio", + "label": "Reasons for not Keeping the baby warm (skin to skin)", + "openmrs_entity_id": "reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_normal_apgar_score", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "mother_died", + "text": "Mother Died", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_died" + }, + { + "key": "mother_has_complications", + "text": "Mother has complications", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_has_complications" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "reasons_for_not_keeping_the_baby_warm_skin_to_skin", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_not_keeping_the_baby_warm_skin_to_skin", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "other_reason_for_not_keeping_the_baby_warm_skin_to_skin", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_keeping_the_baby_warm_skin_to_skin", + "type": "edit_text", + "hint": "Specify other reasons for not keeping the baby warm (skin to skin)", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "respiratory_rate", + "type": "edit_text", + "hint": "Breathing Rate (bpm)", + "openmrs_entity_id": "respiratory_rate", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the breathing rate" + }, + "v_min": { + "value": "0", + "err": "The breathing rate must be equal or greater than 0 (bpm)" + }, + "v_max": { + "value": "80", + "err": "The breathing rate must be equal or less than 80 (bpm)" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_respiratory_rate", + "type": "toaster_notes", + "text": "Manage according to SOP and National guideline", + "openmrs_entity_id": "prompt_for_respiratory_rate", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "cord_bleeding", + "type": "native_radio", + "label": "Cord Bleeding", + "openmrs_entity_id": "cord_bleeding", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_cord_bleeding", + "type": "toaster_notes", + "text": "Manage according to SOP and National guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "early_bf_1hr", + "type": "native_radio", + "label": "Breast Fed within one hour", + "openmrs_entity_id": "early_bf_1hr", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_breast_feeding_within_one_hour", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_breast_feeding_within_one_hour", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Reason why the child was not breast fed within one hour", + "options": [ + { + "key": "mother_died", + "text": "Mother Died", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_died" + }, + { + "key": "baby_unable_to_breast_feed", + "text": "Baby unable to breast feed", + "openmrs_entity": "concept", + "openmrs_entity_id": "baby_unable_to_breast_feed" + }, + { + "key": "replacement_feeding", + "text": "Replacement Feeding", + "openmrs_entity": "concept", + "openmrs_entity_id": "replacement_feeding" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "other_reason_for_not_breast_feeding_within_one_hour", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_breast_feeding_within_one_hour", + "type": "edit_text", + "hint": "Specify other reasons for not breast feeding the child", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "eye_care", + "type": "native_radio", + "label": "Eye Care", + "openmrs_entity_id": "eye_care", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_giving_eye_care", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_eye_care", + "type": "spinner", + "hint": "Reason as to why eye care was not given", + "values": [ + "Out of stock", + "Other (Specify)" + ], + "keys": [ + "out_of_stock", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "other_reason_for_not_giving_eye_care", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_giving_eye_care", + "type": "edit_text", + "hint": "Specify reason(s) for not giving eye care", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "child_bcg_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_bcg_vaccination", + "type": "native_radio", + "label": "Was BCG vaccination administered?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_bcg_vacc_not_provided", + "type": "toaster_notes", + "text": "Provide BCG vaccine to the infant at the first Postnatal care visit or as soon as the BCG vaccine will be available. BCG should not be provided beyond 12-months of infant age", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_providing_bcg_vacc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_bcg_vacc", + "type": "spinner", + "hint": "Reason as to why the BCG vaccine was not administered", + "values": [ + "Out of stock", + "Others (Specify)" + ], + "keys": [ + "out_of_stock_vaccine", + "others" + ], + "openmrs_choice_ids": { + "out_of_stock_vaccine": "out_of_stock_vaccine", + "others": "others" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "other_reason_for_not_providing_bcg_vacc", + "type": "edit_text", + "hint": "Please specify the other reason(s)", + "openmrs_entity_id": "other_reason_for_not_providing_bcg_vacc", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "child_opv0_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_opv0_vaccination", + "type": "native_radio", + "label": "Was OPV 0 vaccination administered?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_opv0_vacc_not_provided", + "type": "toaster_notes", + "text": "Provide OPV 0 vaccination to the infant at the first Postnatal care visit or as soon as the OPV 0 vaccine will be available. OPV 0 should not be provided beyond 14 days", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_providing_opv0_vacc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_opv0_vacc", + "type": "spinner", + "hint": "Reason as to why the OPV 0 vaccine was not administered", + "values": [ + "Out of stock", + "Others (Specify)" + ], + "keys": [ + "out_of_stock_vaccine", + "others" + ], + "openmrs_choice_ids": { + "out_of_stock_vaccine": "out_of_stock_vaccine", + "others": "others" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "other_reason_for_not_providing_opv0_vacc", + "type": "edit_text", + "hint": "Please specify the other reason(s)", + "openmrs_entity_id": "other_reason_for_not_providing_opv0_vacc", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "child_hepatitis_b_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_hepatitis_b_vaccination", + "type": "native_radio", + "label": "Was Hepatitis B vaccination administered?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_hepatitis_b_not_provided", + "type": "toaster_notes", + "text": "Provide Hepatitis B vaccine to the infant at the first Postnatal care visit or as soon as the Hepatitis B vaccine will be available.", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_providing_hepatitis_b_vacc", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_hepatitis_b_vacc", + "type": "spinner", + "hint": "Reason as to why the Hepatitis B vaccine was not administered", + "values": [ + "Out of stock vaccine", + "Others (Specify)" + ], + "keys": [ + "out_of_stock_vaccine", + "others" + ], + "openmrs_choice_ids": { + "out_of_stock_vaccine": "out_of_stock_vaccine", + "others": "others" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "other_reason_for_not_providing_hepatitis_b_injection", + "type": "edit_text", + "hint": "Please specify the other reason(s)", + "openmrs_entity_id": "other_reason_for_not_providing_hepatitis_b_injection", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "child_vitamin_k_injection", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_vitamin_k_injection", + "type": "native_radio", + "label": "Was Vitamin K Injection administered?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_providing_vitamin_k_injection", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_vitamin_k_injection", + "type": "spinner", + "hint": "Reason as to why the Vitamin K Injection was not administered", + "values": [ + "Out of stock", + "Others (Specify)" + ], + "keys": [ + "out_of_stock_vaccine", + "others" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "others": "others" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "other_reason_for_not_providing_vitamin_k_injection", + "type": "edit_text", + "hint": "Please specify the other reason(s)", + "openmrs_entity_id": "other_reason_for_not_providing_vitamin_k_injection", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "risk_category", + "type": "native_radio", + "label": "HEI", + "openmrs_entity_id": "risk_category", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "high", + "text": "High Risk", + "openmrs_entity_id": "high", + "openmrs_entity": "concept" + }, + { + "key": "low", + "text": "Low Risk", + "openmrs_entity_id": "low", + "openmrs_entity": "concept" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_high_risk", + "type": "toaster_notes", + "text": "Please provide AZT + 3TC and NVP Syrup", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_low_risk", + "type": "toaster_notes", + "text": "Please provide NVP Syrup", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "provided_azt_nvp_syrup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_azt_nvp_syrup", + "type": "native_radio", + "label": "Has the infant been provided AZT + 3TC and NVP Syrup?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "provided_other_combinations", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_other_combinations", + "type": "native_radio", + "label": "Has the infant been provided other combinations?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "specify_the_combinations", + "type": "edit_text", + "hint": "Please specify the combinations", + "openmrs_entity_id": "specify_the_combinations", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "number_of_azt_nvp_days_dispensed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_azt_nvp_days_dispensed", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of days dispensed", + "v_numeric_integer": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "1", + "err": "Number of dispensed days should be greater than 0" + }, + "v_max": { + "value": "180", + "err": "Number of dispensed days should be less than or equal to 180" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_providing_other_combination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_other_combination", + "type": "native_radio", + "label": "Please specify the reasons", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_stock", + "text": "Out of stock", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_stock" + }, + { + "key": "medication_expired", + "text": "Medication expired", + "openmrs_entity": "concept", + "openmrs_entity_id": "medication_expired" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "other_reason_for_not_providing_other_combination", + "type": "edit_text", + "hint": "Please specify the other reason(s)", + "openmrs_entity_id": "other_reason_for_not_providing_other_combination", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "collect_dbs", + "type": "native_radio", + "label": "Collect DBS", + "openmrs_entity_id": "collect_dbs", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No (Specify reason)", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "reason_not_collecting_dbs", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_not_collecting_dbs", + "type": "edit_text", + "hint": "Specify reason(s) for not collecting DBS", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "sample_collection_date", + "type": "date_picker", + "hint": "DNA-PCR Sample Collection Date", + "openmrs_entity_id": "sample_collection_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "max_date": "today", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "dna_pcr_collection_time", + "type": "time_picker", + "hint": "DNA-PCR Sample Collection Time", + "openmrs_entity_id": "dna_pcr_collection_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "sample_id", + "type": "edit_text", + "hint": "DNA-PCR Sample ID", + "openmrs_entity_id": "sample_id", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "provided_nvp_syrup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_nvp_syrup", + "type": "native_radio", + "label": "Has the infant been provided NVP Syrup?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "number_of_nvp_days_dispensed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_nvp_days_dispensed", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of days dispensed", + "v_numeric_integer": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "1", + "err": "Number of dispensed days should be greater than 0" + }, + "v_max": { + "value": "180", + "err": "Number of dispensed days should be less than or equal to 180" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_providing_nvp_syrup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_nvp_syrup", + "type": "native_radio", + "label": "Please specify the reasons", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_stock", + "text": "Out of stock", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_stock" + }, + { + "key": "medication_expired", + "text": "Medication expired", + "openmrs_entity": "concept", + "openmrs_entity_id": "medication_expired" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "other_reason_for_not_providing_nvp_syrup", + "type": "edit_text", + "hint": "Please specify the other reason(s)", + "openmrs_entity_id": "other_reason_for_not_providing_nvp_syrup", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_relevance.yml" + } + } + } + }, + { + "key": "type_of_hiv_test", + "type": "hidden", + "openmrs_entity_id": "type_of_hiv_test", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "prophylaxis_arv_for_high_risk_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prophylaxis_arv_for_high_risk_given", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "prophylaxis_arv_for_high_and_low_risk_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prophylaxis_arv_for_high_and_low_risk_given", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "visit_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "next_facility_visit_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "next_facility_visit_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "followup_visit_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "followup_visit_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_stage4_newborn_calculation.yml" + } + } + } + }, + { + "key": "newborn_stage_four_module_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "newborn_stage_four_module_status", + "type": "hidden", + "value": "PENDING" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_syphilis_test.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_syphilis_test.json new file mode 100644 index 000000000..f5c43b123 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_syphilis_test.json @@ -0,0 +1,125 @@ +{ + "count": "1", + "skip_blank_steps": true, + "encounter_type": "Labour and Delivery Syphilis Test", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Syphilis Test", + "fields": [ + { + "key": "syphilis", + "type": "native_radio", + "label": "VDRL (Syphilis)", + "openmrs_entity": "concept", + "openmrs_entity_id": "syphilis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Test Not Conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ] + }, + { + "key": "management_provided_for_syphilis", + "type": "native_radio", + "label": "Was management provided for syphilis?", + "openmrs_entity": "concept", + "openmrs_entity_id": "management_provided_for_syphilis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:syphilis": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "prompt_for_syphilis_management_not_done", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:management_provided_for_syphilis": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_treatment_during_labour.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_treatment_during_labour.json new file mode 100644 index 000000000..cc9798451 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_treatment_during_labour.json @@ -0,0 +1,198 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Treatment during Labour", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Treatment during labour", + "fields": [ + { + "key": "drugs_administered", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "drugs_administered", + "type": "check_box", + "label": "Drugs Administered", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "oxytocin", + "text": "Oxytocin", + "openmrs_entity": "concept", + "openmrs_entity_id": "oxytocin" + }, + { + "key": "drugs", + "text": "Drugs (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "drugs" + }, + { + "key": "iv_fluid", + "text": "IV Fluid (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "iv_fluid" + }, + { + "key": "none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ], + "v_required": { + "value": true, + "err": "Please select at least one option" + } + }, + { + "key": "oxytocin_units_per_liter", + "type": "edit_text", + "edit_type": "number", + "hint": "Oxytocin U/L", + "openmrs_entity": "concept", + "openmrs_entity_id": "oxytocin_units_per_liter", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify the Oxytocin U/L" + }, + "relevance": { + "step1:drugs_administered": { + "type": "string", + "ex-checkbox": [ + { + "or": [ + "oxytocin" + ] + } + ] + } + } + }, + { + "key": "oxytocin_drops_per_minute", + "type": "edit_text", + "edit_type": "number", + "hint": "Oxytocin (drops/min)", + "openmrs_entity": "concept", + "openmrs_entity_id": "oxytocin_drops_per_minute", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify drops/minute" + }, + "relevance": { + "step1:drugs_administered": { + "type": "string", + "ex-checkbox": [ + { + "or": [ + "oxytocin" + ] + } + ] + } + } + }, + { + "key": "drugs_provided", + "type": "edit_text", + "hint": "Drugs (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "drugs_provided", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify the drugs provided" + }, + "relevance": { + "step1:drugs_administered": { + "type": "string", + "ex-checkbox": [ + { + "or": [ + "drugs" + ] + } + ] + } + } + }, + { + "key": "iv_fluid_provided", + "type": "edit_text", + "hint": "IV Fluid (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "iv_fluid_provided", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify the iv fluid provided" + }, + "relevance": { + "step1:drugs_administered": { + "type": "string", + "ex-checkbox": [ + { + "or": [ + "iv_fluid" + ] + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_uterotonic.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_uterotonic.json new file mode 100644 index 000000000..c353f54e7 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_uterotonic.json @@ -0,0 +1,91 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Uterotonic", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Active Management of 3rd Stage Labour (AMSTL)", + "fields": [ + { + "key": "uterotonic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "uterotonic", + "label": "Uterotonic", + "text_color": "#000000", + "label_text_style": "normal", + "type": "check_box", + "combine_checkbox_option_values": "true", + "options": [ + { + "key": "oxytocin", + "text": "Oxytocin (10 IU within 1 minute after delivery)", + "openmrs_entity": "concept", + "openmrs_entity_id": "oxytocin" + }, + { + "key": "misoprostol", + "text": "Misoprostol (400 mcg orally OR 600 mcg sublingual)", + "openmrs_entity": "concept", + "openmrs_entity_id": "misoprostol" + }, + { + "key": "ergometrine", + "text": "Ergometrine (0.5mg)", + "openmrs_entity": "concept", + "openmrs_entity_id": "ergometrine" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_uterus.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_uterus.json new file mode 100644 index 000000000..ac0e3ea1e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_uterus.json @@ -0,0 +1,103 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "Uterus Massage", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Active Management of 3rd Stage Labour (AMSTL)", + "fields": [ + { + "key": "uterus_massage_after_delivery", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "uterus_massage_after_delivery", + "label": "Massage the Uterus after delivery of placenta (Every 15 minutes for the first 1 hour)", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + } + }, + { + "key": "reason_for_not_massaging_uterus_after_delivery", + "type": "edit_text", + "hint": "Please specify the reason(s)", + "openmrs_entity_id": "reason_for_not_massaging_uterus_after_delivery", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify the reason(s)" + }, + "relevance": { + "step1:uterus_massage_after_delivery": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_vaginal_examination.json b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_vaginal_examination.json new file mode 100644 index 000000000..ddbb42187 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/labour_and_delivery_vaginal_examination.json @@ -0,0 +1,754 @@ +{ + "validate_on_submit": true, + "show_errors_on_submit": false, + "count": "1", + "encounter_type": "General Examination", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "global": { + "labour_onset_time": "00:00" + }, + "step1": { + "title": "Vaginal Examination", + "fields": [ + { + "key": "vaginal_exam_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "vaginal_exam_date", + "type": "date_picker", + "hint": "Vaginal examination Date", + "expanded": false, + "min_date": "today-2y", + "max_date": "today", + "v_required": { + "value": true, + "err": "Please select the examination date" + } + }, + { + "key": "labour_onset_time", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "labour_onset_time", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_vaginal_examination_calculation.yml" + } + } + } + }, + { + "key": "vaginal_exam_time", + "type": "time_picker", + "hint": "Vaginal examination Time", + "openmrs_entity_id": "vaginal_exam_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "constraints": [ + { + "type": "time", + "ex": "greaterThan(., step1:labour_onset_time)", + "err": "The vaginal examination time cannot be before labour onset time" + } + ], + "v_required": { + "value": true, + "err": "Please select the examination time" + } + }, + { + "key": "cervix_state", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cervix_state", + "label": "Cervix (State)", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "soft_thin", + "text": "Soft and thin", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "soft_thin" + }, + { + "key": "thick", + "text": "Thick", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "thick" + } + ] + }, + { + "key": "cervix_dilation_label", + "type": "label", + "text": "Cervix (Dilation)", + "text_size": "7sp", + "text_color": "#000000", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "" + }, + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp" + }, + { + "key": "cervix_dilation", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cervix_dilation", + "type": "numbers_selector", + "number_of_selectors": "10", + "start_number": "1", + "max_value": "10", + "text_size": "18px", + "text_color": "#000000", + "selected_text_color": "#ffffff" + }, + { + "key": "prompt_for_cervix_dilation", + "type": "toaster_notes", + "text": "Continue with routine examination for the client", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_vaginal_examination_relevance.yml" + } + } + } + }, + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "8dp" + }, + { + "key": "presenting_part", + "type": "native_radio", + "openmrs_entity_id": "presenting_part", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "label": "Presenting part", + "options": [ + { + "key": "vertex", + "openmrs_entity": "concept", + "openmrs_entity_id": "vertex", + "openmrs_entity_parent": "", + "text": "Vertex" + }, + { + "key": "breech", + "openmrs_entity": "concept", + "openmrs_entity_id": "breech", + "openmrs_entity_parent": "", + "text": "Breech" + }, + { + "key": "brow", + "openmrs_entity": "concept", + "openmrs_entity_id": "brow", + "openmrs_entity_parent": "", + "text": "Brow" + }, + { + "key": "shoulder", + "openmrs_entity": "concept", + "openmrs_entity_id": "shoulder", + "openmrs_entity_parent": "", + "text": "Shoulder" + }, + { + "key": "face", + "openmrs_entity": "concept", + "openmrs_entity_id": "face", + "openmrs_entity_parent": "", + "text": "Face" + }, + { + "key": "cord", + "openmrs_entity": "concept", + "openmrs_entity_id": "cord", + "openmrs_entity_parent": "", + "text": "Cord" + } + ] + }, + { + "key": "occiput_position", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "occiput_position", + "label": "Position of Occiput", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "roa", + "text": "Right occipito anterior(ROA)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "roa" + }, + { + "key": "loa", + "text": "Left Occipito anterior(LOA)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "loa" + }, + { + "key": "rol", + "text": "Right Occipito Lateral(ROL)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rol" + }, + { + "key": "lol", + "text": "Left Occipito Lateral (LOL)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "lol" + }, + { + "key": "rop", + "text": "Right Occipito Posterior (ROP)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rop" + }, + { + "key": "lop", + "text": "Left Occipito Posterior (LOP)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "lop" + }, + { + "key": "doa", + "text": "Direct Occipito Anterior (DOA)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "roa" + }, + { + "key": "dop", + "text": "Direct Occipito Posterior (DOP)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "dop" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_vaginal_examination_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please select the position of Occiput" + } + }, + { + "key": "prompt_for_occiput_position", + "type": "toaster_notes", + "text": "Take action or refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:occiput_position": { + "type": "string", + "ex": "equalTo(., \"opp\")" + } + } + }, + { + "key": "mento_position", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mento_position", + "label": "Position of mento", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "rmp", + "text": "Right mentoposterior(RMP)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rmp" + }, + { + "key": "lmp", + "text": "Left mentoposterior(RMP)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "lmp" + }, + { + "key": "rml", + "text": "Right mentolateral(RML)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rml" + }, + { + "key": "lml", + "text": "Left mentolateral(LML)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "lml" + }, + { + "key": "rma", + "text": "Right mentoanterior(RMA)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rma" + }, + { + "key": "lma", + "text": "Left mentoanterior(RMA)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "lma" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_vaginal_examination_relevance.yml" + } + } + } + }, + { + "key": "sacro_position", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sacro_position", + "label": "Position of sacro", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "rsp", + "text": "Right Sacroposterior(RSP)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rsp" + }, + { + "key": "lsp", + "text": "Left Sacroposterior(LSP)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "lsp" + }, + { + "key": "rsl", + "text": "Right sacrolateral(RSL)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rsl" + }, + { + "key": "lsl", + "text": "Left sacrolateral(LSL)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "lsl" + }, + { + "key": "rsa", + "text": "Right sacroanterior(RSA)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rsa" + }, + { + "key": "lsa", + "text": "Left sacroanterior(LSA)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "lsa" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_vaginal_examination_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please select the correct answer" + } + }, + { + "key": "dorso_position", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "dorso_position", + "label": "Position of dorso", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "dorso_anterior", + "text": "Dorso Anterior", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "dorso_anterior" + }, + { + "key": "dorso_posterior", + "text": "Dorso Posterior", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "dorso_posterior" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_vaginal_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_presenting_part", + "type": "toaster_notes", + "text": "Take action or refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_vaginal_examination_relevance.yml" + } + } + } + }, + { + "key": "moulding", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "moulding", + "label": "Moulding", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_vaginal_examination_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please select an answer" + } + }, + { + "key": "moulding_options", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "moulding_options", + "label": "Moulding", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "sutures_apposed", + "text": "Sutures apposed (+)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sutures_apposed" + }, + { + "key": "sutures_overlapped_reducible", + "text": "Sutures overlapped but reducible (++)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sutures_overlapped_reducible" + }, + { + "key": "sutures_overlapped_not_reducible", + "text": "Sutures overlapped not reducible (+++)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sutures_overlapped_not_reducible" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_vaginal_examination_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please select an option" + } + }, + { + "key": "prompt_for_moulding", + "type": "toaster_notes", + "text": "Provide management according to SOP and Standard Guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_vaginal_examination_relevance.yml" + } + } + } + }, + { + "key": "station", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "station", + "label": "Station", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "minus_three", + "text": "-3", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "minus_three" + }, + { + "key": "minus_two", + "text": "-2", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "minus_two" + }, + { + "key": "minus_one", + "text": "-1", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "minus_one" + }, + { + "key": "zero", + "text": "0", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "zero" + }, + { + "key": "plus_one", + "text": "+1", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "plus_one" + }, + { + "key": "plus_two", + "text": "+2", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "plus_two" + } + ] + }, + { + "key": "amniotic_fluid", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "amniotic_fluid", + "label": "Amniotic fluid", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "membrane_intact", + "text": "Membrane Intact (I)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "membrane_intact" + }, + { + "key": "membrane_ruptured_clear", + "text": "Membrane ruptured liquor clear (C)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "membrane_ruptured_clear" + }, + { + "key": "meconium_stained_liquor", + "text": "Meconium Stained Liquor (M)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "meconium_stained_liquor" + }, + { + "key": "blood_stained_liquor", + "text": "Blood-Stained Liquor (B)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_stained_liquor" + } + ], + "v_required": { + "value": true, + "err": "Please select the correct answer" + } + }, + { + "key": "prompt_for_amniotic_fluid", + "type": "toaster_notes", + "text": "Manage according to standard guideline", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "labour_and_delivery_vaginal_examination_relevance.yml" + } + } + } + }, + { + "key": "decision", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "decision", + "label": "Decision", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "spontaneous_vaginal_delivery", + "text": "Vaginal delivery", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "spontaneous_vaginal_delivery" + }, + { + "key": "emergency", + "text": "Emergency", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "emergency" + } + ] + }, + { + "key": "forecasted_svd_time", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "forecasted_svd_time", + "type": "time_picker", + "hint": "Specify Forecasted SVD Time", + "v_required": { + "value": "true", + "err": "Please specify the forecasted time" + }, + "relevance": { + "step1:decision": { + "type": "string", + "ex": "equalTo(., \"spontaneous_vaginal_delivery\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/ld_child_registration.json b/opensrp-chw-hf/src/main/assets/json.form/ld_child_registration.json new file mode 100644 index 000000000..70d561e97 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/ld_child_registration.json @@ -0,0 +1,314 @@ +{ + "count": "1", + "encounter_type": "LD Child Registration", + "entity_id": "", + "mother_entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "fields": [ + { + "key": "mother_entity_id", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_entity_id", + "type": "hidden" + }, + { + "key": "risk_category", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "risk_category", + "type": "hidden" + }, + { + "key": "entry_point", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "entry_point", + "type": "edit_text", + "value": "PNC" + }, + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "type": "barcode", + "barcode_type": "qrcode", + "hint": "Boresha Afya ID", + "scanButtonText": "Scan QR Code", + "v_numeric": { + "value": "true", + "err": "Please enter a valid ID" + }, + "v_required": { + "value": "true", + "err": "Please enter the UNIQUE ID" + } + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Surname", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\s\\.\\-]*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the surname" + } + }, + { + "key": "same_as_fam_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "openmrs_data_type": "text", + "type": "check_box", + "label": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "same_as_fam_name", + "text": "Surname same as family name", + "text_size": "18px", + "value": "false" + } + ] + }, + { + "key": "last_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "last_name", + "type": "hidden", + "hint": "Surname as Family name" + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "openmrs_data_type": "text", + "type": "edit_text", + "hint": "First name", + "expanded": false, + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please Enter first name" + }, + "v_regex": { + "value": "[A-Za-z\\s\\-]*", + "err": "Please Enter a Valid Name" + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "openmrs_data_type": "text", + "type": "edit_text", + "hint": "Middle name", + "expanded": false, + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please Enter middle name" + }, + "v_regex": { + "value": "[A-Za-z\\s\\.\\-]*", + "err": "Please Enter a Valid Name" + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "date_picker", + "hint": "Date of birth (DOB)", + "expanded": false, + "duration": { + "label": "Age" + }, + "min_date": "today-5y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the date of birth" + } + }, + { + "key": "gender", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "edit_text", + "hint": "Sex" + }, + { + "key": "early_bf_1hr", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "early_bf_1hr", + "type": "spinner", + "hint": "Early initiation of breastfeeding (1 hr)?", + "values": [ + "Yes", + "No" + ], + "keys": [ + "yes", + "no" + ], + "openmrs_choice_ids": { + "yes": "yes", + "no": "no" + }, + "v_required": { + "value": "true", + "err": "Please enter Early initiation of breastfeeding" + } + }, + { + "key": "child_bcg_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_bcg_vaccination", + "type": "native_radio", + "label": "Was BCG vaccination administered?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "child_opv0_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_opv0_vaccination", + "type": "native_radio", + "label": "Was OPV 0 vaccination administered?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Weight (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the weight" + }, + "v_min": { + "value": "0", + "err": "The weight must be equal or greater than 0 (KG)" + }, + "v_max": { + "value": "30", + "err": "The weight must be equal or less than 30 (KG)" + }, + "v_required": { + "value": true, + "err": "Please enter the weight" + } + }, + { + "key": "delivery_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_date", + "type": "hidden" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/ld_hei_first_visit.json b/opensrp-chw-hf/src/main/assets/json.form/ld_hei_first_visit.json new file mode 100644 index 000000000..09b8e1a67 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/ld_hei_first_visit.json @@ -0,0 +1,460 @@ +{ + "count": "1", + "encounter_type": "HEI Followup", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "HEI Followup", + "fields": [ + { + "key": "provided_azt_nvp_syrup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_azt_nvp_syrup", + "type": "native_radio", + "label": "Has the infant been provided AZT + 3TC and NVP Syrup?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + } + }, + { + "key": "provided_other_combinations", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_other_combinations", + "type": "native_radio", + "label": "Has the infant been provided other combinations?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:provided_azt_nvp_syrup": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "specify_the_combinations", + "type": "edit_text", + "hint": "Please specify the combinations", + "openmrs_entity_id": "specify_the_combinations", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify the combinations" + }, + "relevance": { + "step1:provided_other_combinations": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "number_of_azt_nvp_days_dispensed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_azt_nvp_days_dispensed", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of days dispensed", + "v_required": { + "value": "true", + "err": "Please enter number of days dispensed" + }, + "v_numeric_integer": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "1", + "err": "Number of dispensed days should be greater than 0" + }, + "v_max": { + "value": "180", + "err": "Number of dispensed days should be less than or equal to 180" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "hei_arv_prescription_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_providing_other_combination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_other_combination", + "type": "native_radio", + "label": "Please specify the reasons", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_stock", + "text": "Out of stock", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_stock" + }, + { + "key": "medication_expired", + "text": "Medication expired", + "openmrs_entity": "concept", + "openmrs_entity_id": "medication_expired" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:provided_other_combinations": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_for_not_providing_other_combination", + "type": "edit_text", + "hint": "Please specify the other reason(s)", + "openmrs_entity_id": "other_reason_for_not_providing_other_combination", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify the other reason(s)" + }, + "relevance": { + "step1:reason_for_not_providing_other_combination": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "prophylaxis_arv_for_high_risk_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prophylaxis_arv_for_high_risk_given", + "type": "hidden", + "value": "true" + }, + { + "key": "provided_nvp_syrup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "provided_nvp_syrup", + "type": "native_radio", + "label": "Has the infant been provided NVP Syrup?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + } + }, + { + "key": "number_of_nvp_days_dispensed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_nvp_days_dispensed", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of days dispensed", + "v_required": { + "value": "true", + "err": "Please enter number of days dispensed" + }, + "v_numeric_integer": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "1", + "err": "Number of dispensed days should be greater than 0" + }, + "v_max": { + "value": "180", + "err": "Number of dispensed days should be less than or equal to 180" + }, + "relevance": { + "step1:provided_nvp_syrup": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "reason_for_not_providing_nvp_syrup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_nvp_syrup", + "type": "native_radio", + "label": "Please specify the reasons", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_stock", + "text": "Out of stock", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_stock" + }, + { + "key": "medication_expired", + "text": "Medication expired", + "openmrs_entity": "concept", + "openmrs_entity_id": "medication_expired" + }, + { + "key": "home_delivery", + "text": "Home delivery", + "openmrs_entity": "concept", + "openmrs_entity_id": "home_delivery" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:provided_nvp_syrup": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_for_not_providing_nvp_syrup", + "type": "edit_text", + "hint": "Please specify the other reason(s)", + "openmrs_entity_id": "other_reason_for_not_providing_nvp_syrup", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please specify the other reason(s)" + }, + "relevance": { + "step1:reason_for_not_providing_nvp_syrup": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "prophylaxis_arv_for_high_and_low_risk_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prophylaxis_arv_for_high_and_low_risk_given", + "type": "hidden", + "value": "true" + }, + { + "key": "visit_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "type": "hidden" + }, + { + "key": "next_facility_visit_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "next_facility_visit_date", + "type": "hidden" + }, + { + "key": "sample_collection_date", + "type": "date_picker", + "hint": "DNA-PCR Sample Collection Date", + "openmrs_entity_id": "sample_collection_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "min_date": "today-5y", + "max_date": "today", + "v_required": { + "value": true, + "err": "Please enter the collection date" + } + }, + { + "key": "dna_pcr_collection_time", + "type": "time_picker", + "hint": "DNA-PCR Sample Collection Time", + "openmrs_entity_id": "dna_pcr_collection_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please enter the collection time" + } + }, + { + "key": "sample_id", + "type": "edit_text", + "hint": "DNA-PCR Sample ID", + "openmrs_entity_id": "sample_id", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please enter the sample ID" + } + }, + { + "key": "followup_status", + "type": "hidden", + "openmrs_entity_id": "followup_status", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "value": "infant_and_mother" + }, + { + "key": "weight", + "type": "hidden", + "openmrs_entity_id": "weight", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "next_facility_visit_date", + "type": "hidden", + "openmrs_entity_id": "next_facility_visit_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "type_of_hiv_test", + "type": "hidden", + "openmrs_entity_id": "type_of_hiv_test", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "test_at_age", + "type": "hidden", + "openmrs_entity_id": "test_at_age", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "actual_age", + "type": "hidden", + "openmrs_entity_id": "actual_age", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "followup_visit_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "followup_visit_date", + "type": "hidden" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/malaria_confirmation.json b/opensrp-chw-hf/src/main/assets/json.form/malaria_confirmation.json index b701eddb8..96711b537 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/malaria_confirmation.json +++ b/opensrp-chw-hf/src/main/assets/json.form/malaria_confirmation.json @@ -1,6 +1,4 @@ { - "validate_on_submit": true, - "show_errors_on_submit": false, "count": "2", "encounter_type": "Malaria Confirmation", "entity_id": "", @@ -18,11 +16,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/malaria_follow_up_hf.json b/opensrp-chw-hf/src/main/assets/json.form/malaria_follow_up_hf.json index f1c0fc7ce..60268c3e8 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/malaria_follow_up_hf.json +++ b/opensrp-chw-hf/src/main/assets/json.form/malaria_follow_up_hf.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -107,20 +102,17 @@ { "key": "mRDT", "openmrs_choice_id": "", - "text": "mRDT", - "value": false + "text": "mRDT" }, { "key": "mRDT_not_done", "openmrs_choice_id": "", - "text": "mRDT not done", - "value": false + "text": "mRDT not done" }, { "key": "Other_tests", "openmrs_choice_id": "", - "text": "Other tests", - "value": false + "text": "Other tests" } ], "v_required": { @@ -140,14 +132,12 @@ { "key": "stock_out", "openmrs_choice_id": "", - "text": "Stock out", - "value": false + "text": "Stock out" }, { "key": "mRDT_done_within_14_days", "openmrs_choice_id": "", - "text": "mRDT done within 14 days", - "value": false + "text": "mRDT done within 14 days" } ], "relevance": { @@ -193,32 +183,27 @@ { "key": "mRDT_positive", "openmrs_choice_id": "", - "text": "mRDT positive", - "value": false + "text": "mRDT positive" }, { "key": "mRDT_negative", "openmrs_choice_id": "", - "text": "mRDT negative", - "value": false + "text": "mRDT negative" }, { "key": "Malaria_parasite_seen", "openmrs_choice_id": "", - "text": "Malaria parasite seen", - "value": false + "text": "Malaria parasite seen" }, { "key": "No_malaria_parasite_seen", "openmrs_choice_id": "", - "text": "No malaria parasite seen", - "value": false + "text": "No malaria parasite seen" }, { "key": "Other_test_results", "openmrs_choice_id": "", - "text": "Other test results", - "value": false + "text": "Other test results" } ], "v_required": { @@ -258,20 +243,17 @@ { "key": "Uncomplicated_malaria", "openmrs_choice_id": "", - "text": "Uncomplicated malaria", - "value": false + "text": "Uncomplicated malaria" }, { "key": "Severe_malaria", "openmrs_choice_id": "", - "text": "Severe malaria", - "value": false + "text": "Severe malaria" }, { "key": "Other_diagnosis", "openmrs_choice_id": "", - "text": "Other diagnosis", - "value": false + "text": "Other diagnosis" } ], "v_required": { @@ -311,44 +293,37 @@ { "key": "ALU_1_x_6_strips", "openmrs_choice_id": "", - "text": "ALU 1 x 6 strips", - "value": false + "text": "ALU 1 x 6 strips" }, { "key": "ALU_2_x_6_strips", "openmrs_choice_id": "", - "text": "ALU 2 x 6 strips", - "value": false + "text": "ALU 2 x 6 strips" }, { "key": "ALU_3_x_6_strips", "openmrs_choice_id": "", - "text": "ALU 3 x 6 strips", - "value": false + "text": "ALU 3 x 6 strips" }, { "key": "ALU_4_x_6_strips", "openmrs_choice_id": "", - "text": "ALU 4 x 6 strips", - "value": false + "text": "ALU 4 x 6 strips" }, { "key": "Injection_artesunate", "openmrs_choice_id": "", - "text": "Injection artesunate", - "value": false + "text": "Injection artesunate" }, { "key": "Paracetamol", "openmrs_choice_id": "", - "text": "Paracetamol", - "value": false + "text": "Paracetamol" }, { "key": "Other_drugs", "openmrs_choice_id": "NA", - "text": "Other drugs", - "value": false + "text": "Other drugs" } ], "relevance": { diff --git a/opensrp-chw-hf/src/main/assets/json.form/malaria_follow_up_visit.json b/opensrp-chw-hf/src/main/assets/json.form/malaria_follow_up_visit.json index 040fe22d9..9881d92a0 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/malaria_follow_up_visit.json +++ b/opensrp-chw-hf/src/main/assets/json.form/malaria_follow_up_visit.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/male_family_planning_change_method.json b/opensrp-chw-hf/src/main/assets/json.form/male_family_planning_change_method.json index 2bc2f5d75..ea88cc4f0 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/male_family_planning_change_method.json +++ b/opensrp-chw-hf/src/main/assets/json.form/male_family_planning_change_method.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -112,7 +107,6 @@ "openmrs_entity": "concept", "openmrs_entity_id": "163494AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity_parent": "", - "value": false, "text": "Decided to change method" }, { @@ -185,7 +179,7 @@ "Female condom", "Male sterilization" ], - "keys": [ + "keys": [ "Male condom", "Female condom", "Male sterilization" diff --git a/opensrp-chw-hf/src/main/assets/json.form/male_family_planning_registration.json b/opensrp-chw-hf/src/main/assets/json.form/male_family_planning_registration.json index ee367e3a0..ad2856ff0 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/male_family_planning_registration.json +++ b/opensrp-chw-hf/src/main/assets/json.form/male_family_planning_registration.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -57,18 +52,6 @@ "title": "Family planning registration Info", "next": "step2", "fields": [ - { - "key": "sync_location_id", - "openmrs_entity_parent": "", - "openmrs_entity": "person_attribute", - "openmrs_entity_id": "sync_location_id", - "type": "spinner", - "hint": "Select CHW Location", - "v_required": { - "value": "true", - "err": "Please select CHW Location" - } - }, { "key": "fp_reg_date", "openmrs_entity_parent": "", @@ -124,7 +107,7 @@ "openmrs_entity": "concept", "openmrs_entity_id": "couselling_HIV_STI", "openmrs_entity_parent": "", - "label": "Was he counselled on HIV and STI prevention?", + "label": "Was he counselled on HIV and STI/RTI prevention?", "options": [ { "key": "yes", @@ -220,8 +203,7 @@ "openmrs_entity_parent": "190AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "openmrs_entity": "concept", "openmrs_entity_id": "fp_start_condom", - "type": "edit_text", - "hidden": true, + "type": "hidden", "calculation": { "rules-engine": { "ex-rules": { diff --git a/opensrp-chw-hf/src/main/assets/json.form/male_partner_registration_form.json b/opensrp-chw-hf/src/main/assets/json.form/male_partner_registration_form.json new file mode 100644 index 000000000..6a86db84c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/male_partner_registration_form.json @@ -0,0 +1,943 @@ +{ + "count": "2", + "encounter_type": "Family Registration", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Location details", + "next": "step2", + "fields": [ + { + "key": "fam_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "fam_name", + "type": "edit_text", + "hint": "Surname", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the surname" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter the surname" + } + }, + { + "key": "client_first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "First name", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the first name" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + } + }, + { + "key": "client_middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Middle name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the middle name" + } + }, + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "hidden": "true", + "type": "edit_text", + "barcode_type": "qrcode", + "hint": "ID", + "scanButtonText": "Scan QR Code", + "v_numeric": { + "value": "true", + "err": "Please enter a valid ID" + } + }, + { + "key": "fam_village", + "openmrs_entity_parent": "", + "openmrs_entity": "person_address", + "openmrs_entity_id": "cityVillage", + "type": "edit_text", + "edit_type": "name", + "hint": "Area name", + "v_required": { + "value": "true", + "err": "Please enter the name of area or town" + } + }, + { + "key": "landmark", + "openmrs_entity_parent": "", + "openmrs_entity": "person_address", + "openmrs_entity_id": "landmark", + "type": "edit_text", + "hint": "Landmark/Description of house location", + "v_required": { + "value": true, + "err": "Please enter the landmark/description of location." + } + }, + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "15dp" + }, + { + "key": "sync_location_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "sync_location_id", + "type": "spinner", + "hint": "Select CHW Location", + "v_required": { + "value": "true", + "err": "Please select CHW Location" + } + } + ] + }, + "step2": { + "title": "Client details", + "fields": [ + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "type": "edit_text", + "read_only": true, + "hint": "Kituoni ID", + "v_numeric": { + "value": "true", + "err": "Please enter a valid ID" + }, + "v_required": { + "value": "true", + "err": "Please enter the UNIQUE ID" + } + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "last_name", + "type": "edit_text", + "hint": "Surname", + "edit_type": "name", + "read_only": true, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the surname" + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "First name", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the first name" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Middle name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the middle name" + }, + "read_only": true, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "date_picker", + "hint": "Date of birth (DOB)", + "expanded": false, + "duration": { + "label": "Age" + }, + "min_date": "today-120y", + "max_date": "today-15y", + "v_required": { + "value": "true", + "err": "Please enter the date of birth" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + } + }, + { + "key": "age_calculated", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + }, + { + "key": "dob_unknown", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdateApprox", + "type": "check_box", + "label": "", + "options": [ + { + "key": "dob_unknown", + "text": "DOB unknown?", + "text_size": "18px", + "value": "false" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + } + }, + { + "key": "age", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "age", + "type": "edit_text", + "hint": "Age", + "v_numeric_integer": { + "value": "true", + "err": "Must be a rounded number" + }, + "v_max_length": { + "value": "3", + "is_fixed_size": "true", + "err": "Please enter a valid age" + }, + "v_numeric": { + "value": "true", + "err": "Please enter a valid age" + }, + "v_min": { + "value": "15", + "err": "Age must be equal or greater than 15" + }, + "v_max": { + "value": "120", + "err": "Age must be equal or less than 120" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please enter the age" + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + }, + { + "key": "marital_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "marital_status", + "type": "spinner", + "hint": "Client's Marital Status?", + "values": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "keys": [ + "Single", + "Married", + "Divorced", + "Widowed", + "Cohabitation" + ], + "openmrs_choice_ids": { + "Single": "Single", + "Married": "Married", + "Divorced": "Divorced", + "Widowed": "Widowed", + "Cohabitation": "Cohabitation" + }, + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + } + }, + { + "key": "phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "phone_number", + "type": "edit_text", + "hint": "Client phone number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + } + }, + { + "key": "id_avail", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "id_avail", + "type": "check_box", + "label": "Do you have any of the following IDs?", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_national_id", + "text": "National ID", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_national_id" + }, + { + "key": "chk_voters_id", + "text": "Voter's registration ID", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_voters_id" + }, + { + "key": "chk_drivers_license", + "text": "Driver's license", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_drivers_license" + }, + { + "key": "chk_none", + "text": "None", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "chk_none" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + } + }, + { + "key": "national_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "National_ID", + "type": "mask_edit_text", + "mask": "########-#####-#####-##", + "mask_hint": "12345678912345678912", + "allowed_chars": "0123456789", + "hint": "National ID number e.g 12345678-91234-56789-12", + "edit_type": "number", + "v_max_length": { + "value": "23", + "is_fixed_size": "true", + "err": "Please enter a valid national id" + }, + "v_regex": { + "value": "^\\d{8}-\\d{5}-\\d{5}-\\d{2}$", + "err": "National ID number should be of the format (XXXXXXXX-XXXXX-XXXXX-XX)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid national ID" + }, + "relevance": { + "step2:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_national_id" + ] + } + ] + } + } + }, + { + "key": "voter_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Voter_Registration_Number", + "type": "mask_edit_text", + "mask": "T-####-####-###-#", + "mask_hint": "123456789123", + "allowed_chars": "0123456789", + "hint": "Voter's registration number e.g T-1234-5678-912-3", + "edit_type": "number", + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid voters registration" + }, + "v_regex": { + "value": "^T-\\d{4}-\\d{4}-\\d{3}-\\d{1}$", + "err": "Voter's registration number should be of the format (T-XXXX-XXXX-XXX-X)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid voters registration number" + }, + "relevance": { + "step2:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_voters_id" + ] + } + ] + } + } + }, + { + "key": "driver_license", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Driver_License_Number", + "type": "mask_edit_text", + "mask": "##########", + "mask_hint": "1234567891", + "allowed_chars": "0123456789", + "hint": "Driver's license number e.g 1234567891", + "edit_type": "number", + "v_max_length": { + "value": "10", + "is_fixed_size": "true", + "err": "Please enter a valid drivers license number" + }, + "v_regex": { + "value": "^([0-9]{10})", + "err": "Driver's license number should be of the format (XXXXXXXXXX)" + }, + "v_required": { + "value": true, + "err": "Please enter a valid driver's license number" + }, + "relevance": { + "step2:id_avail": { + "ex-checkbox": [ + { + "or": [ + "chk_drivers_license" + ] + } + ] + } + } + }, + { + "key": "insurance_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Health_Insurance_Type", + "type": "spinner", + "hint": "Health insurance provider", + "values": [ + "Community Health Fund (CHF)/(iCHF)", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", + "Tiba Kwa Kadi (TIKA)", + "AAR Healthcare", + "Strategies Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)", + "Britam Insurance Tanzania", + "Jubilee Insurance", + "Resolutions Insurance", + "Reliance Insurance", + "Other", + "None" + ], + "keys": [ + "Community Health Fund (CHF)", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)", + "National Health Insurance Fund (NHIF)", + "Tiba Kwa Kadi (TIKA)", + "AAR Healthcare", + "Strategies Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)", + "Britam Insurance Tanzania", + "Jubilee Insurance", + "Resolutions Insurance", + "Reliance Insurance", + "Other", + "None" + ], + "openmrs_choice_ids": { + "Community Health Fund (CHF)": "Community_Health_Fund", + "National Social Security Fund - Social Health Insurance Benefit (SHIB)": "National_Social_Security_Fund", + "National Health Insurance Fund (NHIF)": "National_Health_Insurance_Fund", + "Tiba Kwa Kadi (TIKA)": "Tiba_kwa_Kadi", + "AAR Healthcare": "AAR_Healthcare", + "AAR Strategies Insurance": "Strategies_Insurance", + "Milvik Tanzania Ltd (BIMA Mkononi)": "BIMA_Mkononi", + "Britam Insurance Tanzania": "Britam_Insurance_Tanzania", + "Jubilee Insurance": "Jubilee_Insurance", + "Resolutions Insurance": "Resolutions_Insurance", + "Reliance Insurance": "Reliance_Insurance", + "Other": "Other_Health_Insurance_Type", + "None": "No_Health_Insurance" + }, + "v_required": { + "value": "true", + "err": "Please enter the insurance provider" + } + }, + { + "key": "insurance_provider_other", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Health_Insurance_Type", + "type": "edit_text", + "hint": "Other health insurance provider", + "v_required": { + "value": "true", + "err": "Please specify the insurance provider" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + } + }, + { + "key": "insurance_provider_number", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Health_Insurance_Number", + "type": "edit_text", + "hint": "Health insurance provider number", + "v_required": { + "value": "true", + "err": "Please add the health insurance provider iD Number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + } + }, + { + "key": "wra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + }, + { + "key": "mra", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + }, + { + "key": "disabilities", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabilities", + "type": "spinner", + "hint": "Physical disabilities", + "values": [ + "Yes", + "No" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "type_of_disability", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "label": "Type of disability", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Mobility and Physical Impairments", + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Spinal Cord Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Head Injuries - Brain Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Vision Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Hearing Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Cognitive or Learning Disabilities", + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Psychological Disorders", + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Invisible Disabilities", + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please select the type of physical disabilities" + } + }, + { + "key": "service_provider", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "service_provider", + "type": "native_radio", + "label": "Occupation of the Client", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "chk_self_employed", + "text": "Self-Employed", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_self_employed" + }, + { + "key": "chk_employed", + "text": "Employed", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_employed" + }, + { + "key": "chk_unemployed", + "text": "Unemployed", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_unemployed" + }, + { + "key": "chk_farmer", + "text": "Farmer", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_farmer" + } + ], + "v_required": { + "value": "true", + "err": "Please pick at least one" + } + }, + { + "key": "leader", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Community_Leader", + "type": "check_box", + "label": "Any leadership role in the community?", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_religious", + "text": "Religious leader", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Religious_Leader" + }, + { + "key": "chk_traditional", + "text": "Traditional leader", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Traditional_leader" + }, + { + "key": "chk_political", + "text": "Political leader", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Political_leader" + }, + { + "key": "chk_influential", + "text": "Influential leader", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Influential_Leader" + }, + { + "key": "chk_other", + "text": "Other", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Community_Leader_Type" + }, + { + "key": "chk_none", + "text": "None", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Not_a_Community_Leader" + } + ], + "v_required": { + "value": "true", + "err": "Please pick at least one" + } + }, + { + "key": "leader_other", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Other_Community_Leader_Type_Name", + "type": "edit_text", + "hint": "Mention other role in the community", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please specify role" + }, + "relevance": { + "step2:leader": { + "ex-checkbox": [ + { + "or": [ + "chk_other" + ] + } + ] + } + } + }, + { + "key": "reasons_for_registration", + "openmrs_entity_parent": "", + "openmrs_entity": "person_attribute", + "openmrs_entity_id": "Registration_Reason", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "male_partner_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/monthly_report.json b/opensrp-chw-hf/src/main/assets/json.form/monthly_report.json index 77b1afe49..591bc5edc 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/monthly_report.json +++ b/opensrp-chw-hf/src/main/assets/json.form/monthly_report.json @@ -16,11 +16,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/next_facility_visit_date_form.json b/opensrp-chw-hf/src/main/assets/json.form/next_facility_visit_date_form.json new file mode 100644 index 000000000..d9c8d8a30 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/next_facility_visit_date_form.json @@ -0,0 +1,78 @@ +{ + "count": "1", + "encounter_type": "Next Facility Visit Date", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Next Followup Visit Date", + "fields": [ + { + "key": "next_facility_visit_date", + "type": "date_picker", + "hint": "Next Facility Visit Date", + "openmrs_entity_id": "next_facility_visit_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "min_date": "today+1d", + "max_date": "today+6m", + "v_required": { + "value": true, + "err": "Please enter a date" + } + }, + { + "key": "visit_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "type": "hidden" + }, + { + "key": "followup_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "followup_status", + "type": "hidden" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/observation_illness.json b/opensrp-chw-hf/src/main/assets/json.form/observation_illness.json index f3607fcf2..9b0fc1b85 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/observation_illness.json +++ b/opensrp-chw-hf/src/main/assets/json.form/observation_illness.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_cd4_sample_collection.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_cd4_sample_collection.json new file mode 100644 index 000000000..9253e3873 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_cd4_sample_collection.json @@ -0,0 +1,158 @@ +{ + "count": "1", + "encounter_type": "PMTCT CD4 Sample Collection", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "CD4 Sample Collection", + "fields": [ + { + "key": "clinician_name", + "type": "edit_text", + "hint": "Healthcare Provider's Name", + "openmrs_entity_id": "clinician_name", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter the healthcare provider's name" + }, + "v_required": { + "value": true, + "err": "Please enter the healthcare provider's name" + } + }, + { + "key": "clinician_position", + "type": "spinner", + "hint": "Healthcare Provider's Title", + "openmrs_entity_id": "clinician_position", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "Medical Officer", + "Assistant Medical Officer", + "Clinical Officer", + "Assistant Clinical Officer", + "Nurse" + ], + "keys": [ + "medical_officer", + "assistant_medical_officer", + "clinical_officer", + "assistant_clinical_officer", + "nurse" + ], + "openmrs_choice_ids": { + "medical_officer": "medical_officer", + "assistant_medical_officer": "assistant_medical_officer", + "clinical_officer": "clinical_officer", + "assistant_clinical_officer": "assistant_clinical_officer", + "nurse": "nurse" + }, + "v_required": { + "value": true, + "err": "Please enter the healthcare provider's title" + } + }, + { + "key": "clinician_phone_number", + "type": "edit_text", + "hint": "Healthcare Provider's Phone Number", + "edit_type": "number", + "openmrs_entity_id": "clinician_phone_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits and must start with 06 au 07." + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + }, + "v_required": { + "value": true, + "err": "Please enter the healthcare provider's phone number" + } + }, + { + "key": "cd4_collection_date", + "type": "date_picker", + "hint": "CD4 Sample Collection Date", + "openmrs_entity_id": "cd4_collection_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "min_date": "today-5y", + "max_date": "today", + "v_required": { + "value": true, + "err": "Please enter the collection date" + } + }, + { + "key": "cd4_collection_time", + "type": "time_picker", + "hint": "CD4 Sample Collection Time", + "openmrs_entity_id": "cd4_collection_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please enter the collection time" + } + }, + { + "key": "cd4_sample_id", + "type": "edit_text", + "hint": "CD4 Sample ID", + "openmrs_entity_id": "cd4_sample_id", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please enter the sample ID" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_cd4_test_results.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_cd4_test_results.json new file mode 100644 index 000000000..1c115994a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_cd4_test_results.json @@ -0,0 +1,181 @@ +{ + "count": "1", + "encounter_type": "PMTCT CD4 Test Results", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "CD4 Test Results", + "fields": [ + { + "key": "cd4_sample_id", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "cd4_sample_id", + "openmrs_entity_parent": "" + }, + { + "key": "cd4_result", + "type": "edit_text", + "hint": "Fill in the CD4 count", + "openmrs_entity": "concept", + "openmrs_entity_id": "cd4_result", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the CD4 count" + }, + "v_required": { + "value": "true", + "err": "Please enter the CD4 count" + } + }, + { + "key": "prompt_to_start_ctx", + "type": "toaster_notes", + "text": "The client should start CTX", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:cd4_result": { + "type": "numeric", + "ex": "lessThan(.,\"350\")" + } + } + }, + { + "key": "started_ctx", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "started_ctx", + "type": "native_radio", + "label": "Has the client started CTX?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:cd4_result": { + "type": "numeric", + "ex": "lessThan(.,\"350\")" + } + } + }, + { + "key": "reason_for_not_starting_ctx", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_starting_ctx", + "type": "native_radio", + "label": "Reason for not starting CTX", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_medicine", + "text": "Stock out of medicine", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_medicine" + }, + { + "key": "client_refused_medication", + "text": "The client refused medication", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_refused_medication" + }, + { + "key": "client_allergic_to_ctx", + "text": "Client allergic to CTX", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_allergic_to_ctx" + }, + { + "key": "drug_interaction", + "text": "Drug interaction", + "openmrs_entity": "concept", + "openmrs_entity_id": "drug_interaction" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:started_ctx": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "cd4_result_date", + "type": "hidden", + "openmrs_entity_id": "cd4_result_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_cd4_test_results_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_clinical_staging_of_disease.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_clinical_staging_of_disease.json new file mode 100644 index 000000000..6b77880de --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_clinical_staging_of_disease.json @@ -0,0 +1,384 @@ +{ + "count": "1", + "encounter_type": "PMTCT clinical staging of disease", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Clinical Staging of Disease", + "fields": [ + { + "key": "clinical_staging_disease", + "type": "spinner", + "hint": "Clinical Staging of the disease", + "openmrs_entity_id": "clinical_staging_disease", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "Stage 1", + "Stage 2", + "Stage 3", + "Stage 4" + ], + "keys": [ + "stage_1", + "stage_2", + "stage_3", + "stage_4" + ], + "openmrs_choice_ids": { + "stage_1": "stage_1", + "stage_2": "stage_2", + "stage_3": "stage_3", + "stage_4": "stage_4" + }, + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "stage_1_symptoms", + "type": "check_box", + "label": "Select the symptoms associated with the patient", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "stage_1_symptoms", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "chk_asymptomatic" + ], + "options": [ + { + "key": "chk_asymptomatic", + "text": "Asymptomatic", + "openmrs_entity_id": "chk_asymptomatic", + "openmrs_entity": "concept" + }, + { + "key": "chk_pgl", + "text": "Persistent generalized lymphadenopathy (PGL) Unexplained, asymptomatic hepatosplenomegaly", + "openmrs_entity_id": "chk_pgl", + "openmrs_entity": "concept" + } + ], + "relevance": { + "step1:clinical_staging_disease": { + "type": "string", + "ex": "equalTo(.,\"stage_1\")" + } + }, + "v_required": { + "value": true, + "err": "Please select a symptom(s)" + } + }, + { + "key": "stage_2_symptoms", + "type": "check_box", + "label": "Select the symptoms associated with the patient", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "stage_2_symptoms", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "chk_ppe", + "text": "Papular pruritic eruptions (PPE)", + "openmrs_entity_id": "chk_ppe", + "openmrs_entity": "concept" + }, + { + "key": "chk_seb_derm", + "text": "Seborrheic dermatitis", + "openmrs_entity_id": "chk_seb_derm", + "openmrs_entity": "concept" + }, + { + "key": "chk_fung_infection", + "text": "Fungal nail infections", + "openmrs_entity_id": "chk_fung_infection", + "openmrs_entity": "concept" + }, + { + "key": "chk_seb_dermatitis", + "text": "Seborrheic dermatitis", + "openmrs_entity_id": "chk_seb_dermatitis", + "openmrs_entity": "concept" + }, + { + "key": "chk_ang_cheilities", + "text": "Angular cheilitis", + "openmrs_entity_id": "chk_ang_cheilities", + "openmrs_entity": "concept" + }, + { + "key": "chk_lin_erythema", + "text": "Linear gingival erythema", + "openmrs_entity_id": "chk_lin_erythema", + "openmrs_entity": "concept" + }, + { + "key": "chk_hpv_infection", + "text": "Extensive HPV or molluscum infection (>5% of body area/face)", + "openmrs_entity_id": "chk_hpv_infection", + "openmrs_entity": "concept" + }, + { + "key": "chk_oral_ulcer", + "text": "Recurrent oral ulcerations (>2 episodes/ in 6 months)", + "openmrs_entity_id": "chk_oral_ulcer", + "openmrs_entity": "concept" + }, + { + "key": "chk_par_enlargement", + "text": "Parotid enlargement", + "openmrs_entity_id": "chk_par_enlargement", + "openmrs_entity": "concept" + }, + { + "key": "chk_herp_zoster", + "text": "Herpes zoster (>1 episode/12 months)", + "openmrs_entity_id": "chk_herp_zoster", + "openmrs_entity": "concept" + }, + { + "key": "chk_rec_uri", + "text": "Recurrent or chronic upper respiratory infection (URI): otitis media, otorrhoea, sinusitis (>2 episodes/6 months)", + "openmrs_entity_id": "chk_rec_uri", + "openmrs_entity": "concept" + } + ], + "relevance": { + "step1:clinical_staging_disease": { + "type": "string", + "ex": "equalTo(.,\"stage_2\")" + } + }, + "v_required": { + "value": true, + "err": "Please select a symptom(s)" + } + }, + { + "key": "stage_3_symptoms", + "type": "check_box", + "label": "Select the symptoms associated with the patient", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "stage_3_symptoms", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "chk_mod_malnutrition", + "text": "Unexplained moderate malnutrition (-2SD or Z score) not responding to standard therapy", + "openmrs_entity_id": "chk_mod_malnutrition", + "openmrs_entity": "concept" + }, + { + "key": "chk_per_diarrhoea", + "text": "Unexplained persistent diarrhoea (>14 days)", + "openmrs_entity_id": "chk_per_diarrhoea", + "openmrs_entity": "concept" + }, + { + "key": "chk_per_fever", + "text": "Unexplained persistent fever (intermittent or constant, > 1 mo.)", + "openmrs_entity_id": "chk_per_fever", + "openmrs_entity": "concept" + }, + { + "key": "chk_oral_candidiasis", + "text": "Oral candidiasis (outside neonatal period)", + "openmrs_entity_id": "chk_oral_candidiasis", + "openmrs_entity": "concept" + }, + { + "key": "chk_oral_leucoplakia", + "text": "Oral hairy Leucoplakia", + "openmrs_entity_id": "chk_oral_leucoplakia", + "openmrs_entity": "concept" + }, + { + "key": "chk_pul_tuberculosis", + "text": "Pulmonary tuberculosis", + "openmrs_entity_id": "chk_pul_tuberculosis", + "openmrs_entity": "concept" + }, + { + "key": "chk_rec_pneumonia", + "text": "Severe recurrent presumed bacterial pneumonia (>2 episodes/12 months)", + "openmrs_entity_id": "chk_rec_pneumonia", + "openmrs_entity": "concept" + }, + { + "key": "chk_acute_gingivitis", + "text": "Acute necrotizing ulcerative gingivitis/periodontitis", + "openmrs_entity_id": "chk_acute_gingivitis", + "openmrs_entity": "concept" + }, + { + "key": "chk_lym_pneumonitis", + "text": "Lymphoid interstitial pneumonitis (LIP)", + "openmrs_entity_id": "chk_lym_pneumonitis", + "openmrs_entity": "concept" + }, + { + "key": "chk_unexp_anaemia", + "text": "Unexplained anaemia (<8g/dL), neutropenia (<1000/mm3), or thrombocytopenia (<30,000/mm3) for >1 mo.", + "openmrs_entity_id": "chk_unexp_anaemia", + "openmrs_entity": "concept" + } + ], + "relevance": { + "step1:clinical_staging_disease": { + "type": "string", + "ex": "equalTo(.,\"stage_3\")" + } + }, + "v_required": { + "value": true, + "err": "Please select a symptom(s)" + } + }, + { + "key": "stage_4_symptoms", + "type": "check_box", + "label": "Select the symptoms associated with the patient", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "stage_4_symptoms", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "chk_sev_wasting", + "text": "Unexplained severe wasting or severe malnutrition (-3 SD or Z score) not responding to standard therapy", + "openmrs_entity_id": "chk_sev_wasting", + "openmrs_entity": "concept" + }, + { + "key": "chk_pneu_penumonia", + "text": "Pneumocystis pneumonia", + "openmrs_entity_id": "chk_pneu_penumonia", + "openmrs_entity": "concept" + }, + { + "key": "chk_recurrent_bacinf", + "text": "Recurrent severe bacterial infections (>2 episodes/12 months, excluding pneumonia)", + "openmrs_entity_id": "chk_recurrent_bacinf", + "openmrs_entity": "concept" + }, + { + "key": "chk_orol_hsv", + "text": "Chronic orolabial or cutaneous HSV (lasting > 1 mo)", + "openmrs_entity_id": "chk_orol_hsv", + "openmrs_entity": "concept" + }, + { + "key": "chk_extra_tuber", + "text": "Extra-pulmonary tuberculosis", + "openmrs_entity_id": "chk_extra_tuber", + "openmrs_entity": "concept" + }, + { + "key": "chk_kap_sarcoma", + "text": "Kaposi’s sarcoma", + "openmrs_entity_id": "chk_kap_sarcoma", + "openmrs_entity": "concept" + }, + { + "key": "chk_oes_candidiasis", + "text": "Oesophageal candidiasis", + "openmrs_entity_id": "chk_oes_candidiasis", + "openmrs_entity": "concept" + }, + { + "key": "chk_cns_toxoplasmosis", + "text": "CNS toxoplasmosis", + "openmrs_entity_id": "chk_cns_toxoplasmosis", + "openmrs_entity": "concept" + }, + { + "key": "chk_crypt_meningitis", + "text": "Cryptococcal meningitis", + "openmrs_entity_id": "chk_crypt_meningitis", + "openmrs_entity": "concept" + }, + { + "key": "chk_ende_mycosis", + "text": "Any disseminated endemic mycosis", + "openmrs_entity_id": "chk_ende_mycosis", + "openmrs_entity": "concept" + }, + { + "key": "chk_cryp_isos", + "text": "Cryptosporidiosis or Isosporiasis (with diarrhoea > 1 month)", + "openmrs_entity_id": "chk_cryp_isos", + "openmrs_entity": "concept" + }, + { + "key": "chk_cmv_organ", + "text": "CMV infection of organ other than liver, spleen, lymph nodes (and onset age >1 month)", + "openmrs_entity_id": "chk_cmv_organ", + "openmrs_entity": "concept" + }, + { + "key": "chk_dis_mycobacterial", + "text": "Disseminated mycobacterial disease other", + "openmrs_entity_id": "chk_dis_mycobacterial", + "openmrs_entity": "concept" + } + ], + "relevance": { + "step1:clinical_staging_disease": { + "type": "string", + "ex": "equalTo(.,\"stage_4\")" + } + }, + "v_required": { + "value": true, + "err": "Please select a symptom(s)" + } + } + ] + } +} + + diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_community_followup_referral.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_community_followup_referral.json new file mode 100644 index 000000000..6daa60480 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_community_followup_referral.json @@ -0,0 +1,125 @@ +{ + "count": "1", + "encounter_type": "PMTCT Community Followup", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Mother Champion Referral", + "fields": [ + { + "key": "last_client_visit_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "last_client_visit_date", + "type": "date_picker", + "hint": "Client's last facility visit date", + "expanded": false, + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please specify the client's last facility visit date" + } + }, + { + "key": "reasons_for_issuing_community_referral", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_issuing_community_referral", + "type": "native_radio", + "label": "Reasons for issuing community followup referral", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "missed_appointment", + "text": "Missed Appointment", + "openmrs_entity": "concept", + "openmrs_entity_id": "missed_appointment" + }, + { + "key": "mother_champion_services", + "text": "Mother Champion Community Services", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_champion_services" + } + ], + "v_required": { + "value": "true", + "err": "Please select reason for issuing the referral" + } + }, + { + "key": "mother_champion_location", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_champion_location", + "type": "spinner", + "hint": "Mother Champion Location", + "v_required": { + "value": true, + "err": "Please enter the Mother Champion Location" + } + }, + { + "key": "comment_pmtct_community_followup", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "comment_pmtct_community_followup", + "type": "edit_text", + "hint": "Remarks/Comments" + }, + { + "key": "pmtct_community_referral_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_community_referral_date", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_community_followup_referral_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_eac_visits.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_eac_visits.json new file mode 100644 index 000000000..54f39fe9e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_eac_visits.json @@ -0,0 +1,634 @@ +{ + "count": "1", + "encounter_type": "PMTCT EAC Visit", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "EAC Visit", + "fields": [ + { + "key": "eac_visit_notification", + "type": "toaster_notes", + "text": "Record EAC Visit Date", + "openmrs_entity_id": "notify_retest", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info" + }, + { + "key": "eac_visit_date", + "type": "date_picker", + "hint": "EAC Visit Date", + "openmrs_entity_id": "eac_visit_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "min_date": "today-3m", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter EAC visit date" + } + }, + { + "key": "summary", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "summary", + "type": "edit_text", + "hint": "Summary", + "v_required": { + "value": "true", + "err": "Please enter the summary" + } + }, + { + "key": "arv_intake_demonstration_done", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "arv_intake_demonstration_done", + "type": "native_radio", + "label": "ARV-intake demonstration by patient/caretaker done?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "pill_count_done", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pill_count_done", + "type": "native_radio", + "label": "Pill count done?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "pill_intake", + "type": "edit_text", + "hint": "Pill intake %", + "openmrs_entity_id": "pill_intake", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the % of pill intake" + }, + "v_min": { + "value": "0", + "err": "The % of the pill intake must be equal or greater than 0" + }, + "v_max": { + "value": "100", + "err": "The % of the pill intake must be equal or less than 100" + } + }, + { + "key": "additional_session", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "additional_session", + "type": "native_radio", + "label": "Does the client require an additional session?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_eac_visits_relevance.yml" + } + } + } + }, + { + "key": "patient_adherence_before_eac", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "patient_adherence_before_eac", + "type": "native_radio", + "label": "Your impression about patient’s adherence before EAC", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "likely_to_be_good", + "text": "Likely to be good", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "likely_to_be_good" + }, + { + "key": "likely_to_be_not_good", + "text": "Likely to be NOT good (relevant barriers identified)", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "likely_to_be_not_good" + }, + { + "key": "clearly_poor", + "text": "Clearly poor (defaulter)", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "clearly_poor" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_eac_visits_relevance.yml" + } + } + } + }, + { + "key": "patient_adherence_during_and_after_eac", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "patient_adherence_during_and_after_eac", + "type": "native_radio", + "label": "Your impression about patient’s adherence during and after EAC", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "likely_to_be_good", + "text": "Likely to be good", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "likely_to_be_good" + }, + { + "key": "likely_to_be_not_good", + "text": "Likely to be NOT good (relevant barriers identified and not cleared)", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "likely_to_be_not_good" + }, + { + "key": "clearly_poor", + "text": "Clearly poor (defaulter)", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "clearly_poor" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "eac_barriers_identified_prompt", + "type": "toaster_notes", + "text": "Major remaining barriers identified after EAC sessions", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:additional_session": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "behavioral_barriers", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "behavioral_barriers", + "type": "native_radio", + "label": "Behavioral", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:additional_session": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "behavioral_barriers_details", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "behavioral_barriers_details", + "type": "edit_text", + "hint": "Behavioral barriers", + "v_required": { + "value": "true", + "err": "Please enter the behavioral barriers" + }, + "relevance": { + "step1:behavioral_barriers": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "cognitive_barriers", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cognitive_barriers", + "type": "native_radio", + "label": "Cognitive", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:additional_session": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "cognitive_barriers_details", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cognitive_barriers_details", + "type": "edit_text", + "hint": "Cognitive barriers", + "v_required": { + "value": "true", + "err": "Please enter the cognitive barriers" + }, + "relevance": { + "step1:cognitive_barriers": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "emotional_barriers", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "emotional_barriers", + "type": "native_radio", + "label": "Emotional", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:additional_session": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "emotional_barriers_details", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "emotional_barriers_details", + "type": "edit_text", + "hint": "Emotional barriers", + "v_required": { + "value": "true", + "err": "Please enter the emotional barriers" + }, + "relevance": { + "step1:emotional_barriers": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "socio_economic_barriers", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "socio_economic_barriers", + "type": "native_radio", + "label": "Socio-economic", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:additional_session": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "socio_economic_barriers_details", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "socio_economic_barriers_details", + "type": "edit_text", + "hint": "Socio-economic barriers", + "v_required": { + "value": "true", + "err": "Please enter the socio-economic barriers" + }, + "relevance": { + "step1:socio_economic_barriers": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "other_barriers", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_barriers", + "type": "native_radio", + "label": "Others (Disclosure, Religion...)", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:additional_session": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_barriers_details", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_barriers_details", + "type": "edit_text", + "hint": "Other barriers", + "v_required": { + "value": "true", + "err": "Please enter other barriers" + }, + "relevance": { + "step1:other_barriers": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "counsellor_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "counsellor_name", + "type": "edit_text", + "hint": "Counsellor's name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the counsellor's name" + } + }, + { + "key": "eac_visit_type", + "type": "hidden", + "openmrs_entity_id": "eac_visit_type", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "eac_visit_session", + "type": "hidden", + "openmrs_entity_id": "eac_visit_session", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "eac_completion_status", + "type": "hidden", + "openmrs_entity_id": "eac_completion_status", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_eac_visits_calculation.yml" + } + } + } + }, + { + "key": "eac", + "type": "hidden", + "openmrs_entity_id": "eac", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + }, + { + "key": "form_submission_timestamp", + "type": "hidden", + "openmrs_entity_id": "form_submission_timestamp", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_eac_visits_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_followup_status.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_followup_status.json new file mode 100644 index 000000000..29f7cf5e2 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_followup_status.json @@ -0,0 +1,103 @@ +{ + "count": "1", + "encounter_type": "PMTCT Followup Status", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Followup Status", + "fields": [ + { + "key": "followup_status", + "type": "native_radio", + "label": "Followup Status", + "openmrs_entity": "concept", + "openmrs_entity_id": "followup_status", + "openmrs_entity_parent": "", + "options": [ + { + "key": "continuing_with_services", + "text": "Continuing with Services (CTN)", + "openmrs_entity": "concept", + "openmrs_entity_id": "continuing_with_services" + }, + { + "key": "transfer_out", + "text": "Transfer Out", + "openmrs_entity": "concept", + "openmrs_entity_id": "transfer_out" + }, + { + "key": "lost_to_followup", + "text": "Lost to Followup", + "openmrs_entity": "concept", + "openmrs_entity_id": "lost_to_followup" + } + ], + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "followup_visit_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "followup_visit_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_followup_calculation.yml" + } + } + } + }, + { + "key": "visit_number", + "type": "hidden", + "openmrs_entity_id": "visit_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_fv_baseline_investigation.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_fv_baseline_investigation.json new file mode 100644 index 000000000..b2abf7cb5 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_fv_baseline_investigation.json @@ -0,0 +1,430 @@ +{ + "count": "1", + "encounter_type": "PMTCT baseline investigation", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Baseline Investigation", + "fields": [ + { + "key": "liver_function_test_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "liver_function_test_conducted", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_fv_baseline_investigation_calculation.yml" + } + } + } + }, + { + "key": "liver_function_test_conducted_question", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "liver_function_test_conducted_question", + "type": "native_radio", + "label": "Is the Liver Function Test conducted?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "test_conducted", + "text": "Liver Function Test conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted" + }, + { + "key": "test_not_conducted", + "text": "Liver Function Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_liver_function_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_liver_function_test", + "type": "spinner", + "hint": "Reason as to why the Liver Function Test was not conducted", + "values": [ + "Test kits out of stock", + "The client was in an emergency situation", + "Client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:liver_function_test_conducted": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_liver_function_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_liver_function_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting Liver Function Test", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_liver_function_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "receive_liver_function_test_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receive_liver_function_test_results", + "type": "native_radio", + "label": "Have you received the Liver Function Test results?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "liver_function_test_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "liver_function_test_results", + "type": "native_radio", + "label": "Select the Liver function test results", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "elevated_liver_enzymes", + "text": "Elevated Liver enzymes", + "openmrs_entity": "concept", + "openmrs_entity_id": "elevated_liver_enzymes" + }, + { + "key": "normal", + "text": "Normal", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:receive_liver_function_test_results": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "prompt_for_liver_function_test", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:liver_function_test_results": { + "type": "string", + "ex": "equalTo(., \"elevated_liver_enzymes\")" + } + } + }, + { + "key": "renal_function_test_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "renal_function_test_conducted", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_fv_baseline_investigation_calculation.yml" + } + } + } + }, + { + "key": "renal_function_test_conducted_question", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "renal_function_test_conducted_question", + "type": "native_radio", + "label": "Is the Renal Function Test conducted?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "test_conducted", + "text": "Renal Function Test conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted" + }, + { + "key": "test_not_conducted", + "text": "Renal Function Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_renal_function_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_renal_function_test", + "type": "spinner", + "hint": "Reason as to why the Renal Function Test was not conducted", + "values": [ + "Test kits out of stock", + "The client was in an emergency situation", + "Client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:renal_function_test_conducted": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_renal_function_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_renal_function_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting Renal Function Test", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_renal_function_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "receive_renal_function_test_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "receive_renal_function_test_results", + "type": "native_radio", + "label": "Have you received the Renal Function Test results?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_fv_baseline_investigation_relevance.yml" + } + } + } + }, + { + "key": "renal_function_test_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "renal_function_test_results", + "type": "native_radio", + "label": "Select the Renal function test results", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "elevated_serum_creatinine", + "text": "Elevated Serum Creatinine", + "openmrs_entity": "concept", + "openmrs_entity_id": "elevated_serum_creatinine" + }, + { + "key": "normal", + "text": "Normal", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:receive_renal_function_test_results": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "prompt_for_renal_function_test_results", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:renal_function_test_results": { + "type": "string", + "ex": "equalTo(., \"elevated_serum_creatinine\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_fv_counselling.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_fv_counselling.json new file mode 100644 index 000000000..7f1cc299a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_fv_counselling.json @@ -0,0 +1,198 @@ +{ + "count": "1", + "encounter_type": "PMTCT counselling", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Continuous Health Education", + "fields": [ + { + "key": "is_client_counselled", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_client_counselled", + "type": "native_radio", + "label": "Has the client been provided continuous health education?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + } + }, + { + "key": "counselling_topics_provided", + "type": "check_box", + "label": "Please select the topics that the client has been educated on", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "counselling_topics_provided", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_hiv_info", + "text": "HIV transmission, presentation, treatment, disease progression & prevention", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_hiv_info" + }, + { + "key": "chk_disclosure", + "text": "Disclosure and identifying treatment supporter", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_disclosure" + }, + { + "key": "chk_promote_testing", + "text": "Promoting Index testing and couple testing", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_promote_testing" + }, + { + "key": "chk_ayf_services", + "text": "Adolescent and youth-friendly services (Adherence, Retention e.t.c)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_ayf_services" + }, + { + "key": "chk_prevention_diseases", + "text": "Prevention of diseases, use of bed nets, environmental and personal hygiene", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_prevention_diseases" + }, + { + "key": "chk_imp_cpt", + "text": "Importance of CPT, CrPET and TPT", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_imp_cpt" + }, + { + "key": "chk_imp_adherence", + "text": "Importance of adherence, how to remind, plan, what to do when travelling, sick, etc. Refer to adherence checklist", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_imp_adherence" + }, + { + "key": "chk_imp_support_group", + "text": "Importance of CBS and HIV support group", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_imp_support_group" + }, + { + "key": "chk_imp_appointment", + "text": "Importance of appointment, dates and time, planning transport", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_imp_appointment" + }, + { + "key": "chk_sti_rti", + "text": "STIs/RTIs Syndromes", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_sti_rti" + }, + { + "key": "chk_imp_insurance", + "text": "Importance of processing and using health insurance to cover treatment costs", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_imp_insurance" + }, + { + "key": "chk_non_communicable_diseases_prevention", + "text": "Non-communicable diseases preventions (Nutrition, Exercise, lifestyle, etc)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_non_communicable_diseases_prevention" + }, + { + "key": "chk_eac_sessions", + "text": "EAC sessions if HVL > 1000 copies/ml", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_eac_sessions" + }, + { + "key": "chk_infant_feeding_options", + "text": "Infant feeding options in the context of HIV", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_infant_feeding_options" + }, + { + "key": "chk_living_with_hiv", + "text": "How to live with HIV", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_living_with_hiv" + }, + { + "key": "chk_none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_none" + } + ], + "v_required": { + "value": "true", + "err": "Please select the topic(s)" + }, + "relevance": { + "step1:is_client_counselled": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_hvl_sample_collection.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_hvl_sample_collection.json new file mode 100644 index 000000000..3054a28f4 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_hvl_sample_collection.json @@ -0,0 +1,158 @@ +{ + "count": "1", + "encounter_type": "PMTCT Follow-up Visit", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "HVL Sample Collection", + "fields": [ + { + "key": "clinician_name", + "type": "edit_text", + "hint": "Healthcare Provider's Name", + "openmrs_entity_id": "clinician_name", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter the healthcare provider's name" + }, + "v_required": { + "value": true, + "err": "Please enter the healthcare provider's name" + } + }, + { + "key": "clinician_position", + "type": "spinner", + "hint": "Healthcare Provider's Title", + "openmrs_entity_id": "clinician_position", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "Medical Officer", + "Assistant Medical Officer", + "Clinical Officer", + "Assistant Clinical Officer", + "Nurse" + ], + "keys": [ + "medical_officer", + "assistant_medical_officer", + "clinical_officer", + "assistant_clinical_officer", + "nurse" + ], + "openmrs_choice_ids": { + "medical_officer": "medical_officer", + "assistant_medical_officer": "assistant_medical_officer", + "clinical_officer": "clinical_officer", + "assistant_clinical_officer": "assistant_clinical_officer", + "nurse": "nurse" + }, + "v_required": { + "value": true, + "err": "Please enter the healthcare provider's title" + } + }, + { + "key": "clinician_phone_number", + "type": "edit_text", + "hint": "Healthcare Provider's Phone Number", + "edit_type": "number", + "openmrs_entity_id": "clinician_phone_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits and must start with 06 au 07." + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + }, + "v_required": { + "value": true, + "err": "Please enter the healthcare provider's phone number" + } + }, + { + "key": "hvl_collection_date", + "type": "date_picker", + "hint": "HVL Sample Collection Date", + "openmrs_entity_id": "hvl_collection_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "min_date": "today-5y", + "max_date": "today", + "v_required": { + "value": true, + "err": "Please enter the collection date" + } + }, + { + "key": "hvl_collection_time", + "type": "time_picker", + "hint": "HVL Sample Collection Time", + "openmrs_entity_id": "hvl_collection_time", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please enter the collection time" + } + }, + { + "key": "hvl_sample_id", + "type": "edit_text", + "hint": "HVL Sample ID", + "openmrs_entity_id": "hvl_sample_id", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_required": { + "value": true, + "err": "Please enter the sample ID" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_hvl_suppression_after_eac_1.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_hvl_suppression_after_eac_1.json new file mode 100644 index 000000000..d52f87085 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_hvl_suppression_after_eac_1.json @@ -0,0 +1,97 @@ +{ + "count": "1", + "encounter_type": "PMTCT Follow-up Visit", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "HVL Suppression", + "fields": [ + { + "key": "hvl_suppression_after_eac_1", + "type": "edit_text", + "hint": "HVL Suppression", + "openmrs_entity_id": "hvl_suppression_after_eac_1", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter a valid value" + }, + "v_required": { + "value": true, + "err": "Please enter the HVL suppression value" + } + }, + { + "key": "notify_continue_regimen", + "type": "toaster_notes", + "text": "Continue current regimen", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_info_text": "Repeat HVL after 6, 12 and 18 months", + "toaster_type": "info", + "relevance": { + "step1:hvl_suppression_after_eac_1": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"1000\")" + } + } + }, + { + "key": "notify_continue_eac_second", + "type": "toaster_notes", + "text": "Client will be enrolled to second EAC", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hvl_suppression_after_eac_1": { + "type": "numeric", + "ex": "greaterThan(.,\"1000\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_hvl_suppression_after_eac_2.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_hvl_suppression_after_eac_2.json new file mode 100644 index 000000000..976a7d43d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_hvl_suppression_after_eac_2.json @@ -0,0 +1,373 @@ +{ + "count": "1", + "encounter_type": "PMTCT Follow-up Visit", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "HVL Suppression", + "fields": [ + { + "key": "hvl_suppression_after_eac_2", + "type": "edit_text", + "hint": "HVL Suppression", + "openmrs_entity_id": "hvl_suppression_after_eac_2", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter a valid value" + }, + "v_required": { + "value": true, + "err": "Please enter the HVL suppression value" + } + }, + { + "key": "notify_continue_regimen", + "type": "toaster_notes", + "text": "Continue current regimen", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_info_text": "Repeat HVL after 6, 12 and 18 months", + "toaster_type": "info", + "relevance": { + "step1:hvl_suppression_after_eac_2": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"1000\")" + } + } + }, + { + "key": "choose_presc_line", + "type": "spinner", + "hint": "Prescribe a new regimen", + "openmrs_entity_id": "choose_presc_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "First Line", + "Second Line", + "Third Line" + ], + "keys": [ + "first_line", + "second_line", + "third_line" + ], + "openmrs_choice_ids": { + "first_line": "first_line", + "second_line": "second_line", + "third_line": "third_line" + }, + "relevance": { + "step1:hvl_suppression_after_eac_2": { + "type": "numeric", + "ex": "greaterThan(.,\"1000\")" + } + }, + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "first_line", + "type": "spinner", + "hint": "Prescription for ARVs \nFirst Line", + "openmrs_entity_id": "first_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "1gA", + "1pA", + "1rA", + "1uA", + "1hA", + "1xA" + ], + "keys": [ + "1_gA", + "1_pA", + "1_rA", + "1_uA", + "1_hA", + "1_xA" + ], + "openmrs_choice_ids": { + "1_gA": "1_gA", + "1_pA": "1_pA", + "1_rA": "1_rA", + "1_uA": "1_uA", + "1_hA": "1_hA", + "1_xA": "1_xA" + }, + "relevance": { + "step1:choose_presc_line": { + "type": "string", + "ex": "equalTo(.,\"first_line\")" + } + }, + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "second_line", + "type": "spinner", + "hint": "Prescription for ARVs \nSecond Line", + "openmrs_entity_id": "second_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "2fA", + "2hA", + "2sA", + "2GA", + "2kA", + "2nA", + "2uA", + "2xA" + ], + "keys": [ + "2_fA", + "2_hA", + "2_sA", + "2_GA", + "2_kA", + "2_nA", + "2_uA", + "2_xA" + ], + "openmrs_choice_ids": { + "2_fA": "2_fA", + "2_hA": "2_hA", + "2_sA": "2_sA", + "2_GA": "2_GA", + "2_kA": "2_kA", + "2_nA": "2_nA", + "2_uA": "2_uA", + "2_xA": "2_xA" + }, + "relevance": { + "step1:choose_presc_line": { + "type": "string", + "ex": "equalTo(.,\"second_line\")" + } + }, + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "third_line", + "type": "spinner", + "hint": "Prescription for ARVs \nThird Line", + "openmrs_entity_id": "third_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "3yA", + "3wA", + "3kA", + "3tA", + "3hA", + "3gA", + "3zA", + "3xA" + ], + "keys": [ + "3_wA", + "3_kA", + "3_tA", + "3_hA", + "3_gA", + "3_zA", + "3_xA", + "3_yA" + ], + "openmrs_choice_ids": { + "3_wA": "3_wA", + "3_kA": "3_kA", + "3_tA": "3_tA", + "3_hA": "3_hA", + "3_gA": "3_gA", + "3_zA": "3_zA", + "3_xA": "3_xA", + "3_yA": "3_yA" + }, + "relevance": { + "step1:choose_presc_line": { + "type": "string", + "ex": "equalTo(.,\"third_line\")" + } + }, + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "type": "hidden", + "key": "eac_day_1", + "openmrs_entity_id": "eac_day_1", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + }, + { + "type": "hidden", + "key": "eac_day_2", + "openmrs_entity_id": "eac_day_2", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + }, + { + "type": "hidden", + "key": "eac_day_3", + "openmrs_entity_id": "eac_day_3", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "step1:hvl_suppression_after_eac_2": { + "type": "numeric", + "ex": "greaterThan(.,\"1000\")" + } + }, + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + }, + { + "type": "hidden", + "key": "eac_month_1", + "openmrs_entity_id": "eac_month_1", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + }, + { + "type": "hidden", + "key": "eac_month_2", + "openmrs_entity_id": "eac_month_2", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + }, + { + "type": "hidden", + "key": "eac_month_3", + "openmrs_entity_id": "eac_month_3", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + }, + { + "type": "hidden", + "key": "hvl_suppression", + "hint": "HVL Suppression", + "openmrs_entity_id": "hvl_suppression", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + }, + { + "type": "hidden", + "key": "hvl_suppression_after_eac_1", + "hint": "HVL Suppression", + "openmrs_entity_id": "hvl_suppression_after_eac_1", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_suppression_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_hvl_test_results.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_hvl_test_results.json new file mode 100644 index 000000000..738abdcec --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_hvl_test_results.json @@ -0,0 +1,586 @@ +{ + "count": "1", + "encounter_type": "PMTCT HVL Results", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": { + "is_after_eac": false + }, + "step1": { + "title": "HVL Suppression", + "fields": [ + { + "key": "hvl_sample_id", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "hvl_sample_id", + "openmrs_entity_parent": "" + }, + { + "key": "notify_tnd_results", + "type": "toaster_notes", + "text": "For HVL results that is TND, fill the results as 11", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning" + }, + { + "key": "hvl_result", + "type": "edit_text", + "hint": "HVL Results", + "openmrs_entity_id": "hvl_result", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter a valid value" + }, + "v_required": { + "value": true, + "err": "Please enter the HVL suppression value" + } + }, + { + "key": "hvl_results_comment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hvl_results_comment", + "type": "edit_text", + "hint": "Remarks/Comments", + "v_required": { + "value": "false", + "err": "Please enter the your remarks/comments" + }, + "relevance": { + "step1:hvl_result": { + "type": "string", + "ex": "equalTo(., \"11\")" + } + } + }, + { + "key": "notify_continue_regimen", + "type": "toaster_notes", + "text": "Continue current regimen", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_info_text": "Repeat HVL after 6, 12 and 18 months", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "notify_continue_eac", + "type": "toaster_notes", + "text": "Client will be enrolled to EAC", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "discuss_plan_prompt", + "type": "toaster_notes", + "text": "Discuss The Plan for this Patient", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "significant_drop_in_viral_load", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "significant_drop_in_viral_load", + "type": "native_radio", + "label": "Was it a significant drop in the Viral Load (fulfilling criteria of good response to EAC)?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "patient_presenting_oi_or_immunosuppression", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "patient_presenting_oi_or_immunosuppression", + "type": "native_radio", + "label": "Is this patient presenting any other OI or signs of immunosuppression?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "describe_patient_presenting_oi_or_immunosuppression", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "describe_patient_presenting_oi_or_immunosuppression", + "type": "edit_text", + "hint": "Describe the presenting OI or signs of immunosuppression", + "v_required": { + "value": "true", + "err": "Please answer the question" + }, + "relevance": { + "step1:patient_presenting_oi_or_immunosuppression": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "history_of_chronic_diarrhea_or_vomiting", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "history_of_chronic_diarrhea_or_vomiting", + "type": "native_radio", + "label": "History of chronic diarrhea or vomiting?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "use_of_traditional_medications", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "use_of_traditional_medications", + "type": "native_radio", + "label": "Use of traditional medications?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "history_of_arv_side_effects", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "history_of_arv_side_effects", + "type": "native_radio", + "label": "History of side-effects with ARV?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "describe_history_of_arv_side_effects", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "describe_history_of_arv_side_effects", + "type": "edit_text", + "hint": "Describe symptom and possible drug", + "v_required": { + "value": "true", + "err": "Please answer the question" + }, + "relevance": { + "step1:history_of_arv_side_effects": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "arv_regimen_plan", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "arv_regimen_plan", + "type": "native_radio", + "label": "Regarding the ARV regimen, what is the plan?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "continue_current_regimen", + "text": "Continue current regimen", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "continue_current_regimen" + }, + { + "key": "refer_to_doctor", + "text": "Refer to doctor for further management", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "refer_to_doctor" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "assessor_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "assessor_name", + "type": "edit_text", + "hint": "Assessor's Name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the assessor's name" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "plan_for_patient", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "plan_for_patient", + "type": "native_radio", + "label": "What is the plan for this patient?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "suitable_for_second_line_regimen", + "text": "Patient is suitable for Second-line Regimen", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "suitable_for_second_line_regimen" + }, + { + "key": "extend_eac_sessions", + "text": "Extend adherence sessions before new Viral Load (in 2-3 months’ time)", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "extend_eac_sessions" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "second_line", + "type": "spinner", + "hint": "New Regimen\nSecond Line", + "openmrs_entity_id": "second_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "2f-A (TDF+FTC+LPV/r)", + "2h-A (TDF+FTC+ATV/r)", + "2s-A (AZT+3TC+ATV/r)", + "2g-A (ABC+3TC+LPV/r)", + "2k-A (ABC+3TC+ATV/r)", + "2n-A (AZT+3TC+LPV/r)", + "2x-A (Other 2nd line)" + ], + "keys": [ + "2_fA", + "2_hA", + "2_sA", + "2_gA", + "2_kA", + "2_nA", + "2_xA" + ], + "openmrs_choice_ids": { + "2_fA": "2_fA", + "2_hA": "2_hA", + "2_sA": "2_sA", + "2_gA": "2_gA", + "2_kA": "2_kA", + "2_nA": "2_nA", + "2_xA": "2_xA" + }, + "v_required": { + "value": true, + "err": "Please answer this question" + }, + "relevance": { + "step1:plan_for_patient": { + "type": "string", + "ex": "equalTo(., \"suitable_for_second_line_regimen\")" + } + } + }, + { + "key": "plan_for_patient_comment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "plan_for_patient_comment", + "type": "edit_text", + "hint": "Comment", + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "review_team_lead_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "review_team_lead_name", + "type": "edit_text", + "hint": "Review Team Lead Name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the review team lead's name" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_relevance.yml" + } + } + } + }, + { + "key": "hvl_result_date", + "type": "hidden", + "openmrs_entity_id": "hvl_result_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_calculation.yml" + } + } + } + }, + { + "key": "enroll_to_eac", + "type": "hidden", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "enroll_to_eac", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_hvl_test_results_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_prescription_line_selection.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_prescription_line_selection.json new file mode 100644 index 000000000..e78141cff --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_prescription_line_selection.json @@ -0,0 +1,346 @@ +{ + "count": "1", + "encounter_type": "PMTCT prescription line selection", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "ARV prescription", + "fields": [ + { + "key": "prescribed_regimes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prescribed_regimes", + "type": "native_radio", + "label": "Has the client been prescribed ARVs regimes?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + } + }, + { + "key": "arv_line", + "type": "spinner", + "hint": "Choose the ARV Line", + "openmrs_entity_id": "arv_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "First Line", + "Second Line", + "Third Line" + ], + "keys": [ + "first_line", + "second_line", + "third_line" + ], + "openmrs_choice_ids": { + "first_line": "first_line", + "second_line": "second_line", + "third_line": "third_line" + }, + "v_required": { + "value": true, + "err": "Please answer this question" + }, + "relevance": { + "step1:prescribed_regimes": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "first_line", + "type": "spinner", + "hint": "Prescription for ARVs \nFirst Line", + "openmrs_entity_id": "first_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "1g-A (TDF+3TC+EFV)", + "1b-A (AZT+3TC+NVP)", + "1c-A (AZT+3TC+EFV)", + "1k-A (ABC+3TC+EFV)", + "1p-A (ABC+3TC+DTG)", + "1r-A (TDF+3TC+DTG)", + "1u-A (AZT+3TC+DTG)", + "1q-A (TDF+FTC+DTG)", + "1x-A (Other 1st line)" + ], + "keys": [ + "1_gA", + "1_bA", + "1_cA", + "1_kA", + "1_pA", + "1_rA", + "1_uA", + "1_qA", + "1_xA" + ], + "openmrs_choice_ids": { + "1_gA": "1_gA", + "1_bA": "1_bA", + "1_cA": "1_cA", + "1_kA": "1_kA", + "1_pA": "1_pA", + "1_rA": "1_rA", + "1_uA": "1_uA", + "1_qA": "1_qA", + "1_xA": "1_xA" + }, + "relevance": { + "step1:arv_line": { + "type": "string", + "ex": "equalTo(.,\"first_line\")" + } + }, + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "second_line", + "type": "spinner", + "hint": "Prescription for ARVs \nSecond Line", + "openmrs_entity_id": "second_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "2f-A (TDF+FTC+LPV/r)", + "2h-A (TDF+FTC+ATV/r)", + "2s-A (AZT+3TC+ATV/r)", + "2g-A (ABC+3TC+LPV/r)", + "2k-A (ABC+3TC+ATV/r)", + "2n-A (AZT+3TC+LPV/r)", + "2x-A (Other 2nd line)" + ], + "keys": [ + "2_fA", + "2_hA", + "2_sA", + "2_gA", + "2_kA", + "2_nA", + "2_xA" + ], + "openmrs_choice_ids": { + "2_fA": "2_fA", + "2_hA": "2_hA", + "2_sA": "2_sA", + "2_gA": "2_gA", + "2_kA": "2_kA", + "2_nA": "2_nA", + "2_xA": "2_xA" + }, + "relevance": { + "step1:arv_line": { + "type": "string", + "ex": "equalTo(.,\"second_line\")" + } + }, + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "third_line", + "type": "spinner", + "hint": "Prescription for ARVs \nThird Line", + "openmrs_entity_id": "third_line", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "values": [ + "3y-A (DTG+DRV/r+AZT+3TC)", + "3w-A (RAL+DRV/r+AZT+3TC)", + "3k-A (DTG+LPV/r+AZT+3TC)", + "3t-A (DTG+LPV/r+TDF+FTC)", + "3h-A (RAL+LPV/r+AZT+3TC)", + "3g-A (RAL+LPV/r+TDF+FTC)", + "3z-A (DTG+ATV/r+AZT+3TC)", + "3x-A (Other 3rd line)" + ], + "keys": [ + "3_yA", + "3_wA", + "3_kA", + "3_tA", + "3_hA", + "3_gA", + "3_zA", + "3_xA" + ], + "openmrs_choice_ids": { + "3_wA": "3_wA", + "3_kA": "3_kA", + "3_tA": "3_tA", + "3_hA": "3_hA", + "3_gA": "3_gA", + "3_zA": "3_zA", + "3_xA": "3_xA", + "3_yA": "3_yA" + }, + "relevance": { + "step1:arv_line": { + "type": "string", + "ex": "equalTo(.,\"third_line\")" + } + }, + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "reason_for_not_prescribing_arv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_prescribing_arv", + "type": "native_radio", + "label": "Reason for not prescribing ARVs", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_medicine", + "text": "Stock out of medicine", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_medicine" + }, + { + "key": "client_refused_medication", + "text": "The client refused medication", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_refused_medication" + }, + { + "key": "other", + "text": "Other(Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:prescribed_regimes": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "other_reason_for_not_prescribing_arv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_prescribing_arv", + "type": "edit_text", + "hint": "Other reason", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please specify other reason(s) for not prescribing ARVs" + }, + "relevance": { + "step1:reason_for_not_prescribing_arv": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "number_of_arv_regimes_days_dispensed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_arv_regimes_days_dispensed", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of days dispensed", + "v_required": { + "value": "true", + "err": "Please enter number of days dispensed" + }, + "v_numeric_integer": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "1", + "err": "Number of dispensed days should be greater than 0" + }, + "v_max": { + "value": "180", + "err": "Number of dispensed days should be less than or equal to 180" + }, + "relevance": { + "step1:prescribed_regimes": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + } +} + + diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_registration.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_registration.json new file mode 100644 index 000000000..783e48272 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_registration.json @@ -0,0 +1,370 @@ +{ + "count": "2", + "encounter_type": "PMTCT Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "ART", + "next": "step2", + "fields": [ + { + "key": "pmtct_register_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "pmtct_register_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_form_calculation.yml" + } + } + } + }, + { + "key": "hiv_registration_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "hiv_registration_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_form_calculation.yml" + } + } + } + }, + { + "key": "known_on_art", + "type": "native_radio", + "label": "Is the client on ART?", + "openmrs_entity_id": "known_on_art", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "is_transfer_in_client", + "type": "native_radio", + "label": "Is the client a Transfer-In (TI) Client?", + "openmrs_entity_id": "is_transfer_in_client", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": true, + "err": "Please answer this question" + }, + "relevance": { + "step1:known_on_art": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "pmtct_register_date_from_originating_facility", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_register_date_from_originating_facility", + "type": "date_picker", + "hint": "Date of PMTCT Registration at the originating health facility", + "expanded": false, + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the date of PMTCT Registration at the originating health facility" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + } + }, + { + "key": "pmtct_register_date_at_this_facility", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_register_date_at_this_facility", + "type": "date_picker", + "hint": "Date of PMTCT Registration", + "expanded": false, + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the date of PMTCT Registration" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + } + } + ] + }, + "step2": { + "title": "End", + "fields": [ + { + "key": "notify_retest", + "type": "toaster_notes", + "text": "Please conduct HIV verification test for the client", + "openmrs_entity_id": "notify_retest", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:known_on_art": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "test_results", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "test_results", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_form_calculation.yml" + } + } + } + }, + { + "key": "hiv_status", + "type": "native_radio", + "label": "HIV status", + "openmrs_entity_id": "hiv_status", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity_id": "positive", + "openmrs_entity": "concept" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity_id": "negative", + "openmrs_entity": "concept" + } + ], + "relevance": { + "step1:known_on_art": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + }, + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "has_the_client_been_provided_with_ctc_number", + "type": "native_radio", + "label": "Has the client been provided with CTC Number?", + "openmrs_entity_id": "has_the_client_been_provided_with_ctc_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "CTC Number", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "CTC number should be of the format (XX-XX-XXXX-XXXXXX)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid CTC Number" + }, + "v_required": { + "value": true, + "err": "Please enter a valid CTC Number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + } + }, + { + "key": "notify_first_visit", + "type": "toaster_notes", + "text": "Perform PMTCT Visit", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "step1:known_on_art": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "notify_continue_with_anc", + "type": "toaster_notes", + "text": "Ask the client to continue with routine ANC Services", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "step2:hiv_status": { + "type": "string", + "ex": "equalTo(.,\"negative\")" + } + } + }, + { + "key": "next_facility_visit_date", + "type": "hidden", + "openmrs_entity_id": "next_facility_visit_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_form_calculation.yml" + } + } + } + }, + { + "key": "followup_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "followup_status", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_form_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_registration_for_clients_known_on_art.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_registration_for_clients_known_on_art.json new file mode 100644 index 000000000..07e79b9fe --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_registration_for_clients_known_on_art.json @@ -0,0 +1,195 @@ +{ + "count": "1", + "encounter_type": "PMTCT Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": { + }, + "step1": { + "title": "On ART", + "fields": [ + { + "key": "pmtct_register_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "pmtct_register_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_form_calculation.yml" + } + } + } + }, + { + "key": "hiv_registration_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "hiv_registration_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_form_calculation.yml" + } + } + } + }, + { + "key": "known_on_art", + "type": "hidden", + "openmrs_entity_id": "known_on_art", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "value": "yes" + }, + { + "key": "is_transfer_in_client", + "type": "native_radio", + "label": "Is the client a Transfer-In (TI) Client?", + "openmrs_entity_id": "is_transfer_in_client", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "pmtct_register_date_from_originating_facility", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_register_date_from_originating_facility", + "type": "date_picker", + "hint": "Date of PMTCT Registration at the originating health facility", + "expanded": false, + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the date of PMTCT Registration at the originating health facility" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + } + }, + { + "key": "pmtct_register_date_at_this_facility", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_register_date_at_this_facility", + "type": "date_picker", + "hint": "Date of PMTCT Registration", + "expanded": false, + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the date of PMTCT Registration" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_relevance.yml" + } + } + } + }, + { + "key": "test_results", + "type": "hidden", + "openmrs_entity_id": "test_results", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "value": "positive" + }, + { + "key": "ctc_number", + "type": "hidden", + "openmrs_entity_id": "ctc_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_calculation.yml" + } + } + } + }, + { + "key": "known_on_art_client", + "type": "toaster_notes", + "text": "The Client with CTC Number {ctc_number} is on ART.\n\nSave the form to register the client in PMTCT and record PMTCT Visit.", + "openmrs_entity_id": "notify_retest", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_registration_for_clients_post_pnc.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_registration_for_clients_post_pnc.json new file mode 100644 index 000000000..7d93e4b1c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_registration_for_clients_post_pnc.json @@ -0,0 +1,700 @@ +{ + "count": "1", + "encounter_type": "PMTCT Post PNC Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "ART", + "fields": [ + { + "key": "relational_id", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "relational_id", + "type": "hidden" + }, + { + "key": "pmtct_register_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "pmtct_register_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registation_for_clients_post_pnc_calculation.yml" + } + } + } + }, + { + "key": "hiv_registration_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "hiv_registration_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registation_for_clients_post_pnc_calculation.yml" + } + } + } + }, + { + "key": "known_on_art", + "type": "native_radio", + "label": "Is the client on ART?", + "openmrs_entity_id": "known_on_art", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "notify_retest", + "type": "toaster_notes", + "text": "Please conduct HIV verification test for the client", + "openmrs_entity_id": "notify_retest", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:known_on_art": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "test_results", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "test_results", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registation_for_clients_post_pnc_calculation.yml" + } + } + } + }, + { + "key": "hiv", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "hiv", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registation_for_clients_post_pnc_calculation.yml" + } + } + } + }, + { + "key": "hiv_status", + "type": "native_radio", + "label": "HIV status", + "openmrs_entity_id": "hiv_status", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity_id": "positive", + "openmrs_entity": "concept" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity_id": "negative", + "openmrs_entity": "concept" + } + ], + "relevance": { + "step1:known_on_art": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + }, + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "has_the_client_been_provided_with_ctc_number", + "type": "native_radio", + "label": "Has the client been provided with CTC Number?", + "openmrs_entity_id": "has_the_client_been_provided_with_ctc_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_for_clients_post_pnc_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "ctc_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "ctc_number", + "type": "mask_edit_text", + "mask": "##-##-####-######", + "mask_hint": "12345678912345", + "allowed_chars": "0123456789", + "hint": "CTC Number", + "edit_type": "number", + "v_regex": { + "value": "(\\d{2}-\\d{2}-\\d{4}-\\d{6})?", + "err": "CTC number should be of the format (XX-XX-XXXX-XXXXXX)" + }, + "v_max_length": { + "value": "17", + "is_fixed_size": "true", + "err": "Please enter a valid CTC Number" + }, + "v_required": { + "value": true, + "err": "Please enter a valid CTC Number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_for_clients_post_pnc_relevance.yml" + } + } + } + }, + { + "key": "is_transfer_in_client", + "type": "native_radio", + "label": "Is the client a Transfer-In (TI) Client?", + "openmrs_entity_id": "is_transfer_in_client", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_id": "yes", + "openmrs_entity": "concept" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_id": "no", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": true, + "err": "Please answer this question" + }, + "relevance": { + "step1:known_on_art": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "pmtct_register_date_from_originating_facility", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_register_date_from_originating_facility", + "type": "date_picker", + "hint": "Date of PMTCT Registration at the originating health facility", + "expanded": false, + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the date of PMTCT Registration at the originating health facility" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_for_clients_post_pnc_relevance.yml" + } + } + } + }, + { + "key": "pmtct_register_date_at_this_facility", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "pmtct_register_date_at_this_facility", + "type": "date_picker", + "hint": "Date of PMTCT Registration", + "expanded": false, + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the date of PMTCT Registration" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_for_clients_post_pnc_relevance.yml" + } + } + } + }, + { + "key": "notify_continue_with_anc", + "type": "toaster_notes", + "text": "Ask the client to continue with routine Services", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "step1:hiv_status": { + "type": "string", + "ex": "equalTo(.,\"negative\")" + } + } + }, + { + "key": "next_facility_visit_date", + "type": "hidden", + "openmrs_entity_id": "next_facility_visit_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registation_for_clients_post_pnc_calculation.yml" + } + } + } + }, + { + "key": "visit_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_number", + "type": "hidden", + "value": "1" + }, + { + "key": "followup_status", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "followup_status", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registation_for_clients_post_pnc_calculation.yml" + } + } + } + }, + { + "key": "delivery_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_date", + "type": "date_picker", + "hint": "Delivery Date", + "expanded": false, + "min_date": "today-17m", + "max_date": "today-42d", + "v_required": { + "value": "true", + "err": "Please enter date the woman delivered" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_for_clients_post_pnc_relevance.yml" + } + } + } + }, + { + "key": "risk_category", + "type": "native_radio", + "label": "HIV exposure risk of the newborn(s)", + "openmrs_entity_id": "risk_category", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "options": [ + { + "key": "high", + "text": "High", + "openmrs_entity_id": "high", + "openmrs_entity": "concept" + }, + { + "key": "low", + "text": "Low", + "openmrs_entity_id": "low", + "openmrs_entity": "concept" + } + ], + "v_required": { + "value": true, + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_for_clients_post_pnc_relevance.yml" + } + } + } + }, + { + "key": "no_immediate_new_born", + "type": "repeating_group", + "reference_edit_text_hint": "Number of children", + "repeating_group_label": "Baby Details #", + "openmrs_entity_parent": "", + "openmrs_entity": "", + "openmrs_entity_id": "", + "repeating_group_max": "4", + "expand_on_text_change": "true", + "value": [ + { + "key": "spacer", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "spacer", + "spacer_height": "15dp" + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Surname", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the surname" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } + } + }, + { + "key": "same_as_fam_name_chk", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "openmrs_data_type": "text", + "type": "check_box", + "options": [ + { + "key": "same_as_fam_name", + "text": "Surname same as family name", + "text_size": "18px", + "value": "false" + } + ] + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "First name", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the first name" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Middle name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the middle name" + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "hidden" + }, + { + "key": "gender", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Sex", + "values": [ + "Male", + "Female", + "Ambiguous" + ], + "keys": [ + "Male", + "Female", + "Ambiguous" + ], + "v_required": { + "value": "true", + "err": "Gender required" + } + }, + { + "key": "disabilities", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabilities", + "type": "spinner", + "hint": "Physical disabilities", + "values": [ + "Yes", + "No" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Required" + } + }, + { + "key": "prompt_for_disabilities", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:disabilities": { + "type": "string", + "ex": "equalTo(.,\"Yes\")" + } + } + }, + { + "key": "type_of_disability", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Type of disability", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Mobility and Physical Impairments", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Spinal Cord Disability", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Head Injuries - Brain Disability", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Vision Disability", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Hearing Disability", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Cognitive or Learning Disabilities", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Psychological Disorders", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Invisible Disabilities", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-dynamic": "anc_pregnancy_outcome_relevance.yml" + } + } + } + } + ], + "v_required": { + "value": "true", + "err": "Please enter the number of children" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_registration_for_clients_post_pnc_relevance.yml" + } + } + } + }, + { + "key": "notify_first_visit", + "type": "toaster_notes", + "text": "Perform PMTCT Visit", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "step1:known_on_art": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pmtct_tb_screening.json b/opensrp-chw-hf/src/main/assets/json.form/pmtct_tb_screening.json new file mode 100644 index 000000000..295e9d02e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pmtct_tb_screening.json @@ -0,0 +1,502 @@ +{ + "count": "1", + "encounter_type": "PMTCT tb screening", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "TB Screening", + "fields": [ + { + "key": "on_tb_treatment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "on_tb_treatment", + "type": "native_radio", + "label": "Is the client on TB treatment?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + } + }, + { + "key": "tb_registration_number", + "type": "edit_text", + "openmrs_entity_id": "tb_registration_number", + "hint": "TB Clinic Number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "step1:on_tb_treatment": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + }, + "v_required": { + "value": "true", + "err": "Please enter the clients TB Clinic Number" + } + }, + { + "key": "tb_symptoms_screening", + "type": "check_box", + "label": "Please select if the client has any of the following TB symptoms", + "combine_checkbox_option_values": "true", + "openmrs_entity_id": "tb_symptoms_screening", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_cough", + "text": "Cough of any duration", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_cough" + }, + { + "key": "chk_sputum", + "text": "Coughing up blood-stained sputum (hemoptysis)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_sputum" + }, + { + "key": "chk_fevers", + "text": "Fevers for two or more weeks", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_fevers" + }, + { + "key": "chk_weight_loss", + "text": "Noticeable weight loss for new patients or 3 kgs", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_weight_loss" + }, + { + "key": "chk_weight_loss_subsequent_visit", + "text": "Weight loss in a month (subsequent visit)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_weight_loss_subsequent_visit" + }, + { + "key": "chk_excessive_sweating", + "text": "Excessive sweating at night for two or more weeks", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_excessive_sweating" + }, + { + "key": "chk_none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_none" + } + ], + "v_required": { + "value": "true", + "err": "Please select the topic(s)" + }, + "relevance": { + "step1:on_tb_treatment": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "investigate_for_tb", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "investigate_for_tb", + "type": "native_radio", + "label": "Investigate for TB", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:tb_symptoms_screening": { + "ex-checkbox": [ + { + "or": [ + "chk_cough", + "chk_sputum", + "chk_fevers", + "chk_weight_loss", + "chk_weight_loss_subsequent_visit", + "chk_excessive_sweating" + ] + } + ] + } + } + }, + { + "key": "reason_for_not_conducting_tb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_tb_test", + "type": "spinner", + "hint": "Reason as to why the TB test was not conducted", + "values": [ + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:investigate_for_tb": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_tb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_tb_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting TB test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_tb_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "prompt_for_tb_treatment", + "type": "toaster_notes", + "text": "Refer the client for TB treatment", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:investigate_for_tb": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "has_been_provided_with_tpt_before", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "has_been_provided_with_tpt_before", + "type": "native_radio", + "label": "Has the client been provided with TPT before?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes (Has completed TPT)", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "partial_complete", + "text": "Yes (But has not completed TPT)", + "openmrs_entity": "concept", + "openmrs_entity_id": "partial_complete" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_tb_screening_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_tpt_eligibility", + "type": "toaster_notes", + "text": "The client is eligible for TPT", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_tb_screening_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_tpt_ineligibility", + "type": "toaster_notes", + "text": "The client is not eligible for TPT", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_tb_screening_relevance.yml" + } + } + } + }, + { + "key": "completed_tpt", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "completed_tpt", + "type": "native_radio", + "label": "Has the client completed TPT?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_tb_screening_relevance.yml" + } + } + } + }, + { + "key": "is_client_provided_with_tpt", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "is_client_provided_with_tpt", + "type": "native_radio", + "label": "Has the client been provided with TPT today?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pmtct_tb_screening_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_providing_tpt", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_providing_tpt", + "type": "native_radio", + "label": "Reason for not providing TPT", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "out_of_medicine", + "text": "Stock out of medicine", + "openmrs_entity": "concept", + "openmrs_entity_id": "out_of_medicine" + }, + { + "key": "client_refused_medication", + "text": "The client refused medication", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_refused_medication" + }, + { + "key": "client_allergic_to_tpt", + "text": "Client is allergic to TPT", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_allergic_to_tpt" + }, + { + "key": "not_eligible", + "text": "Not eligible", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_eligible" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + }, + "relevance": { + "step1:is_client_provided_with_tpt": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "number_of_tpt_days_dispensed", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_tpt_days_dispensed", + "type": "edit_text", + "edit_type": "number", + "hint": "Number of days dispensed", + "v_required": { + "value": "true", + "err": "Please enter number of days dispensed" + }, + "v_numeric_integer": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "1", + "err": "Number of dispensed days should be greater than 0" + }, + "v_max": { + "value": "180", + "err": "Number of dispensed days should be less than or equal to 180" + }, + "relevance": { + "step1:is_client_provided_with_tpt": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_child_enrollment.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_child_enrollment.json new file mode 100644 index 000000000..4a11272b7 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_child_enrollment.json @@ -0,0 +1,401 @@ +{ + "count": "1", + "encounter_type": "PNC Child Registration", + "entity_id": "", + "mother_entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "fields": [ + { + "key": "mother_entity_id", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mother_entity_id", + "type": "hidden" + }, + { + "key": "risk_category", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "risk_category", + "type": "hidden" + }, + { + "key": "entry_point", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "entry_point", + "type": "edit_text", + "value": "PNC" + }, + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "type": "barcode", + "barcode_type": "qrcode", + "hint": "Boresha Afya ID", + "scanButtonText": "Scan QR Code", + "v_numeric": { + "value": "true", + "err": "Please enter a valid ID" + }, + "v_required": { + "value": "true", + "err": "Please enter the UNIQUE ID" + } + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "type": "edit_text", + "hint": "Surname", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\s\\.\\-]*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the surname" + } + }, + { + "key": "same_as_fam_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "", + "openmrs_data_type": "text", + "type": "check_box", + "label": "", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "same_as_fam_name", + "text": "Surname same as family name", + "text_size": "18px", + "value": "false" + } + ] + }, + { + "key": "last_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "last_name", + "type": "hidden", + "hint": "Surname as Family name" + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "openmrs_data_type": "text", + "type": "edit_text", + "hint": "First name", + "expanded": false, + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please Enter first name" + }, + "v_regex": { + "value": "[A-Za-z\\s\\-]*", + "err": "Please Enter a Valid Name" + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "openmrs_data_type": "text", + "type": "edit_text", + "hint": "Middle name", + "expanded": false, + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please Enter middle name" + }, + "v_regex": { + "value": "[A-Za-z\\s\\.\\-]*", + "err": "Please Enter a Valid Name" + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "date_picker", + "hint": "Date of birth (DOB)", + "expanded": false, + "duration": { + "label": "Age" + }, + "min_date": "today-5y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the date of birth" + } + }, + { + "key": "gender", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "edit_text", + "hint": "Sex" + }, + { + "key": "disabilities", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabilities", + "type": "spinner", + "hint": "Physical disabilities", + "values": [ + "Yes", + "No" + ], + "keys": [ + "yes", + "no" + ], + "openmrs_choice_ids": { + "yes": "yes", + "no": "no" + }, + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "early_bf_1hr", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "early_bf_1hr", + "type": "spinner", + "hint": "Early initiation of breastfeeding (1 hr)?", + "values": [ + "Yes", + "No" + ], + "keys": [ + "yes", + "no" + ], + "openmrs_choice_ids": { + "yes": "yes", + "no": "no" + }, + "v_required": { + "value": "true", + "err": "Please enter Early initiation of breastfeeding" + } + }, + { + "key": "lbw", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "lbw", + "type": "spinner", + "hint": "Is the baby low birth weight (weighs less than 2.5 kg)?", + "values": [ + "Yes", + "No" + ], + "keys": [ + "yes", + "no" + ], + "openmrs_choice_ids": { + "yes": "1", + "no": "0" + }, + "v_required": { + "value": "true", + "err": "Please select if baby has low the weight" + } + }, + { + "key": "type_of_disability", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_disability", + "type": "edit_text", + "edit_type": "name", + "hint": "Type of physical disabilities", + "v_required": { + "value": true, + "err": "Please enter type of physical disabilities" + } + }, + { + "key": "essential_newborn_care", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "essential_newborn_care", + "type": "check_box", + "label": "Essential newborn care received at the health facility?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_none", + "text": "None", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_none" + }, + { + "key": "chk_chlorhexidine", + "text": "Chlorhexidine applied to umbilical stump", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_chlorhexidine" + }, + { + "key": "chk_skin_contact", + "text": "Skin to skin contact for at least 2 hours", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_skin_contact" + } + ] + }, + { + "key": "child_bcg_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_bcg_vaccination", + "type": "native_radio", + "label": "Was BCG vaccination administered?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "child_opv0_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_opv0_vaccination", + "type": "native_radio", + "label": "Was OPV 0 vaccination administered?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Weight (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the weight" + }, + "v_min": { + "value": "0", + "err": "The weight must be equal or greater than 0 (KG)" + }, + "v_max": { + "value": "30", + "err": "The weight must be equal or less than 30 (KG)" + }, + "v_required": { + "value": true, + "err": "Please enter the weight" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_child_general_examination.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_child_general_examination.json new file mode 100644 index 000000000..5296612bb --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_child_general_examination.json @@ -0,0 +1,912 @@ +{ + "count": "1", + "encounter_type": "PNC Child Followup", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Child's General Examination", + "fields": [ + { + "key": "child_activeness", + "type": "native_radio", + "label": "Child's activeness", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_activeness", + "openmrs_entity_parent": "", + "options": [ + { + "key": "active", + "text": "Active", + "openmrs_entity": "concept", + "openmrs_entity_id": "active" + }, + { + "key": "not_active", + "text": "Not Active", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_active" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_child_activeness", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:child_activeness": { + "type": "string", + "ex": "equalTo(.,\"not_active\")" + } + } + }, + { + "key": "height", + "type": "edit_text", + "hint": "Length (CM)", + "openmrs_entity": "concept", + "openmrs_entity_id": "height", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the height" + }, + "v_min": { + "value": "10", + "err": "The height must be equal or greater than 10 (CM)" + }, + "v_max": { + "value": "80", + "err": "The height must be equal or less than 80 (CM)" + }, + "v_required": { + "value": true, + "err": "Please enter the height" + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Weight (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the weight" + }, + "v_min": { + "value": "0.5", + "err": "The weight must be equal or greater than 0.5 (KG)" + }, + "v_max": { + "value": "7", + "err": "The weight must be equal or less than 7 (KG)" + }, + "v_required": { + "value": true, + "err": "Please enter the weight" + } + }, + { + "key": "hb_level_test", + "type": "native_radio", + "label": "HB Level Test", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "test_conducted", + "text": "HB Level Test conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted", + "openmrs_entity_parent": "" + }, + { + "key": "test_not_conducted", + "text": "HB Level Test not conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "hb_level", + "type": "edit_text", + "hint": "HB Level (g/dl)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the HB level" + }, + "v_min": { + "value": "0", + "err": "HB level must be equal or greater than 0 (g/dl)" + }, + "v_max": { + "value": "20", + "err": "HB level must be equal or less than 20 (g/dl)" + }, + "v_required": { + "value": true, + "err": "Please provide a value" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_conducted\")" + } + } + }, + { + "key": "prompt_for_severe_anaemia_treatment", + "type": "toaster_notes", + "text": "Manage the severe anaemia according to standard guidelines", + "openmrs_entity_id": "prompt_for_severe_anaemia_treatment", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hb_level": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"8.5\")" + } + } + }, + { + "key": "prompt_for_moderate_anaemia_management", + "type": "toaster_notes", + "text": "Manage the mild anaemia according to standard guidelines", + "openmrs_entity_id": "prompt_for_moderate_anaemia_management", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_mother_general_examination_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hb_test", + "type": "spinner", + "hint": "Reason as to why the HB Level test was not conducted", + "values": [ + "Cuvette Cartridges Out of Stock", + "Haemoque machine out of order", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other" + ], + "keys": [ + "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "stock_out_of_cuvettes_cartridges": "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order": "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_hb_test_not_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_hb_test_not_conducted", + "type": "edit_text", + "hint": "Other reason for why the HB Level test was not conducted", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_hb_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "hiv_antibody_test", + "type": "native_radio", + "label": "HIV Anti-Body Test", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_antibody_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "HIV Antibody Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_mother_general_examination_relevance.yml" + } + } + }, + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "reason_for_not_conducting_hiv_antibody_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hiv_antibody_test", + "type": "spinner", + "hint": "Reason as to why the HIV Antibody test was not conducted", + "values": [ + "Test kits are out of stock", + "The child was in an emergency situation", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:hiv_antibody_test": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_hiv_antibody_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_hiv_antibody_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting HIV Antibody test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_hiv_antibody_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "temperature", + "type": "edit_text", + "hint": "Temperature (\u2103)", + "openmrs_entity_id": "temperature", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the temperature" + }, + "v_min": { + "value": "10", + "err": "Temperature must be equal or greater than 10" + }, + "v_max": { + "value": "50", + "err": "Temperature must be equal or less than 50" + }, + "v_required": { + "value": true, + "err": "Please enter the temperature" + } + }, + { + "key": "notify_client_has_high_temperature", + "type": "toaster_notes", + "text": "The child has a possible bacterial infection, provide antibiotics and antipyretics according to guidelines, provide umbilical care and other essential neonatal care services", + "openmrs_entity_id": "notify_client_has_fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "greaterThan(.,\"38.5\")" + } + } + }, + { + "key": "notify_client_has_low_temperature", + "type": "toaster_notes", + "text": "Provide warmth to the child and other essential newborn care services as per guidelines", + "openmrs_entity_id": "notify_client_has_hypothermia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "lessThan(.,\"36.5\")" + } + } + }, + { + "key": "head_circumference", + "type": "edit_text", + "hint": "Head Circumference (CM)", + "openmrs_entity": "concept", + "openmrs_entity_id": "head_circumference", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the head circumference (CM)" + }, + "v_min": {}, + "v_required": { + "value": true, + "err": "Please enter the head circumference (CM)" + } + }, + { + "key": "prompt_for_large_head_circumference", + "type": "toaster_notes", + "text": "Assess features of hydrocephalus and refer for neurosurgical intervention", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:head_circumference": { + "type": "numeric", + "ex": "greaterThan(.,\"50\")" + } + } + }, + { + "key": "prompt_for_small_head_circumference", + "type": "toaster_notes", + "text": "Check for signs of Down's Syndrome or other neurological malformations leading to microcephaly, refer for advanced management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:head_circumference": { + "type": "numeric", + "ex": "lessThan(.,\"30\")" + } + } + }, + { + "key": "upper_arm_circumference", + "type": "edit_text", + "hint": "Upper Arm Circumference (CM)", + "openmrs_entity": "concept", + "openmrs_entity_id": "upper_arm_circumference", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the upper arm circumference (CM)" + }, + "v_required": { + "value": true, + "err": "Please enter the upper arm circumference (CM)" + }, + "v_min": { + "value": "7.5", + "err": "Upper arm circumference can not be less than 7.5 CM" + }, + "v_max": { + "value": "13", + "err": "Upper arm circumference can not be greater than than 13 CM" + } + }, + { + "key": "feeding_options", + "type": "native_radio", + "label": "Feeding options", + "openmrs_entity": "concept", + "openmrs_entity_id": "feeding_options", + "openmrs_entity_parent": "", + "options": [ + { + "key": "ebf", + "text": "Exclusive Breastfeeding (EBF)", + "openmrs_entity": "concept", + "openmrs_entity_id": "ebf" + }, + { + "key": "rf", + "text": "Replacement Feeding (RF)", + "openmrs_entity": "concept", + "openmrs_entity_id": "rf" + }, + { + "key": "mf", + "text": "Mixed Feeding (MF)", + "openmrs_entity": "concept", + "openmrs_entity_id": "mf" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "septicaemia", + "type": "native_radio", + "label": "Child has high risk of infection (Septicaemia)", + "openmrs_entity": "concept", + "openmrs_entity_id": "septicaemia", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "no", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_septicaemia", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "prompt_for_septicaemia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:septicaemia": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "umbilical_cord", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "umbilical_cord", + "type": "check_box", + "label": "Umbilical Cord Assessment", + "combine_checkbox_option_values": "true", + "exclusive": [ + "chk_no_abnormalities" + ], + "options": [ + { + "key": "chk_smell_bad", + "text": "Smell bad", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_smell_bad", + "value": "false" + }, + { + "key": "chk_infection", + "text": "Infection", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_infection", + "value": "false" + }, + { + "key": "chk_descended", + "text": "Destended", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_descended", + "value": "false" + }, + { + "key": "chk_delayed_off", + "text": "Delayed off", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_delayed_off", + "value": "false" + }, + { + "key": "chk_no_abnormalities", + "text": "No Abnormalities", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_no_abnormalities", + "value": "false" + }, + { + "key": "chk_other", + "text": "Others (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_other", + "value": "false" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_umbilical_cord_smelling_bad", + "type": "toaster_notes", + "text": "Manage according to standard guideline/Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:umbilical_cord": { + "ex-checkbox": [ + { + "or": [ + "chk_smell_bad", + "chk_infection" + ] + } + ] + } + } + }, + { + "key": "umbilical_cord_other_assessment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "umbilical_cord_other_assessment", + "type": "edit_text", + "hint": "Other Assessment for Umbilical Cord", + "v_required": { + "value": "true", + "err": "Please specify the other assessment for umbilical cord" + }, + "relevance": { + "step1:umbilical_cord": { + "ex-checkbox": [ + { + "or": [ + "chk_other" + ] + } + ] + } + } + }, + { + "key": "jaundice", + "type": "native_radio", + "label": "Does the child have jaundice?", + "openmrs_entity": "concept", + "openmrs_entity_id": "jaundice", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "no", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_jaundice", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:jaundice": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "skin_infection", + "type": "native_radio", + "label": "Does the child have skin infection?", + "openmrs_entity": "concept", + "openmrs_entity_id": "skin_infection", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "no", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_skin_infection", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:skin_infection": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "kangaroo_enrollment", + "type": "native_radio", + "label": "Was the child enrolled to Kangaroo Care (KMC)?", + "openmrs_entity": "concept", + "openmrs_entity_id": "kangaroo_enrollment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "no", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_child_examination_relevance.yml" + } + } + } + }, + { + "key": "child_bcg_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_bcg_vaccination", + "type": "native_radio", + "label": "Was BCG vaccination administered?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_child_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_bcg_vaccination", + "type": "toaster_notes", + "text": "The client should be given BCG vaccine", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:child_bcg_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "child_opv0_vaccination", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "child_opv0_vaccination", + "type": "native_radio", + "label": "Was OPV0 vaccination administered?", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_child_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_opv0_vaccination", + "type": "toaster_notes", + "text": "The client should be given OPV0 vaccine before the age of 14 days", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:child_opv0_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "followup_visit_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "followup_visit_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_followup_calculation.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_counselling.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_counselling.json index 5e08075ff..a04c7407e 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/pnc_counselling.json +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_counselling.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -64,141 +59,121 @@ "options": [ { "key": "chk_maternal_nutrition", - "text": "3. Maternal nutrition during breastfeeding", - "value": false, + "text": "Maternal nutrition during breastfeeding", "openmrs_entity": "concept", "openmrs_entity_id": "1380AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_hiv_aids", - "text": "5. HIV/AIDS general information", - "value": false, + "text": "HIV/AIDS general information", "openmrs_entity": "concept", "openmrs_entity_id": "1914AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_pmtct", - "text": "6. PMTCT for the mother", - "value": false, + "text": "PMTCT for the mother", "openmrs_entity": "concept", "openmrs_entity_id": "160538AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_malaria_prevention", - "text": "7. Malaria prevention", - "value": false, + "text": "Malaria prevention", "openmrs_entity": "concept", "openmrs_entity_id": "164884AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_pnc_care_for_mother", - "text": "9. PNC care for mother", - "value": false, + "text": "PNC care for mother", "openmrs_entity": "concept", "openmrs_entity_id": "1623AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_hiv_exposed_infant", - "text": "9. Follow-up for the HIV-exposed Infant", - "value": false, + "text": "Follow-up for the HIV-exposed Infant", "openmrs_entity": "concept", "openmrs_entity_id": "164818AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_pnc_danger_signs", - "text": "10. PNC danger signs", - "value": false, + "text": "PNC danger signs", "openmrs_entity": "concept", "openmrs_entity_id": "161541AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_care_of_infant_after_birth", - "text": "11. Care of infant after birth", - "value": false, + "text": "Care of infant after birth", "openmrs_entity": "concept", "openmrs_entity_id": "159839AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_care_of_premature_baby", - "text": "12. Care of a premature baby", - "value": false, + "text": "Care of a premature baby", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_care_of_new_born", - "text": "13. Care of a newborn", - "value": false, + "text": "Care of a newborn", "openmrs_entity": "concept", "openmrs_entity_id": "160413AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_new_born_danger_signs", - "text": "14. Newborn danger signs", - "value": false, + "text": "Newborn danger signs", "openmrs_entity": "concept", "openmrs_entity_id": "161071AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_hiv_exposed_infant", - "text": "15. Follow-up for the HIV-exposed infant", - "value": false, + "text": "Follow-up for the HIV-exposed infant", "openmrs_entity": "concept", "openmrs_entity_id": "164818AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_breastfeeding", - "text": "16. Breastfeeding", - "value": false, + "text": "Breastfeeding", "openmrs_entity": "concept", "openmrs_entity_id": "1910AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_lam", - "text": "17. LAM as a natural FP method, which includes exclusive breastfeeding six months after delivery", - "value": false, + "text": "LAM as a natural FP method, which includes exclusive breastfeeding six months after delivery", "openmrs_entity": "concept", "openmrs_entity_id": "161096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_family_planning", - "text": "18. Family planning", - "value": false, + "text": "Family planning", "openmrs_entity": "concept", "openmrs_entity_id": "1382AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_birth_registration", - "text": "19. Birth registration", - "value": false, + "text": "Birth registration", "openmrs_entity": "concept", "openmrs_entity_id": "165406AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_immunisation", - "text": "22. Immunisation", - "value": false, + "text": "Immunisation", "openmrs_entity": "concept", "openmrs_entity_id": "1914AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_infection_prevention", - "text": "24. Infection prevention and control", - "value": false, + "text": "Infection prevention and control", "openmrs_entity": "concept", "openmrs_entity_id": "1906AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_gender_issues", - "text": "26. Gender issues", - "value": false, + "text": "Gender issues", "openmrs_entity": "", "openmrs_entity_id": "" }, { "key": "chk_none", "text": "Hakushauriwa", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_danger_signs_baby.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_danger_signs_baby.json index 539646a6c..9b6b1366e 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/pnc_danger_signs_baby.json +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_danger_signs_baby.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -65,98 +60,84 @@ { "key": "chk_fever", "text": "Fever", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "140238AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_excessive_crying", "text": "Excessive crying", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "110540AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_fast_breathing", "text": "Fast breathing", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "125061AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_difficult_breathing", "text": "Difficulty breathing", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "142373AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_unable_to_suck", "text": "Unable to suck", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "159861AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_umbilical_discharge", "text": "Umbilical blood / pus discharge", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "123843AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_no_movement", "text": "No movement", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164455AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_convulsions", "text": "Convulsions", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164483AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_skin_rashes", "text": "Skin rashes", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "512AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_pale", "text": "Pale or jaundiced", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "136443AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_eye_discharge", "text": "Eye discharge", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "142246AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_severe_abdominal_pain", "text": "Severe abdominal pain", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "165271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_lethargy", "text": "Lethargy", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "116334AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_none", "text": "None", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_danger_signs_mother.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_danger_signs_mother.json index ad9312928..5a1a549e2 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/pnc_danger_signs_mother.json +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_danger_signs_mother.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -65,98 +60,84 @@ { "key": "chk_fever", "text": "Fever", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "140238AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_bleeding_vaginally", "text": "Bleeding vaginally", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "150802AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_server_headache", "text": "Severe headache", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "139081AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_convulsions", "text": "Convulsions", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164483AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_difficulty_breathing", "text": "Difficulty breathing", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "142373AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_severe_leg_pain", "text": "Severe leg pain", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "114395AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_unusual_behaviour", "text": "Unusual behaviour (stress, confusion)", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "152376AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_swelling of breast", "text": "Swelling of the breast and nipple", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "125212AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_severe_abdominal_pain", "text": "Severe abdominal pain", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "165271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_vaginal_discharge", "text": "Discoloured or watery, liquid vaginal discharge with a bad smell", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "123395AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_blurred_vision", "text": "Blurred vision", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "147104AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_loss_conscioueness", "text": "Loss of consciousness", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "135592AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_urination", "text": "Urinate a little or urine leakage", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "118982AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_none", "text": "None", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_danger_signs_outcome.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_danger_signs_outcome.json index 3c8ad3d8c..dc51b2166 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/pnc_danger_signs_outcome.json +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_danger_signs_outcome.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -82,104 +77,87 @@ { "key": "Fever", "openmrs_choice_id": "", - "text": "Fever", - "value": false + "text": "Fever" }, { "key": "Bleeding_vaginally", "openmrs_choice_id": "", - "text": "Bleeding vaginally", - "value": false + "text": "Bleeding vaginally" }, { "key": "Severe_headache", "openmrs_choice_id": "", - "text": "Severe headache", - "value": false + "text": "Severe headache" }, { "key": "Convulsions", "openmrs_choice_id": "", - "text": "Convulsions", - "value": false + "text": "Convulsions" }, { "key": "Difficulty_breathing", "openmrs_choice_id": "", - "text": "Difficulty breathing", - "value": false + "text": "Difficulty breathing" }, { "key": "Severe_abdominal_pain", "openmrs_choice_id": "", - "text": "Severe abdominal pain", - "value": false + "text": "Severe abdominal pain" }, { "key": "Vaginal_discharge_with_a_bad_smell", "openmrs_choice_id": "", - "text": "Vaginal discharge with a bad smell", - "value": false + "text": "Vaginal discharge with a bad smell" }, { "key": "Redness_around_the_umbilical_cord_foul_smelling_discharge_from_the_umbilical_cord", "openmrs_choice_id": "", - "text": "Redness around the umbilical cord, foul-smelling discharge from the umbilical cord", - "value": false + "text": "Redness around the umbilical cord, foul-smelling discharge from the umbilical cord" }, { "key": "Excessive_crying", "openmrs_choice_id": "", - "text": "Excessive crying", - "value": false + "text": "Excessive crying" }, { "key": "Fast_breathing", "openmrs_choice_id": "", - "text": "Fast breathing", - "value": false + "text": "Fast breathing" }, { "key": "Chest_indrawing", "openmrs_choice_id": "", - "text": "Chest indrawing", - "value": false + "text": "Chest indrawing" }, { "key": "Unable_to_suck", "openmrs_choice_id": "", - "text": "Unable to suck", - "value": false + "text": "Unable to suck" }, { "key": "No_movement", "openmrs_choice_id": "", - "text": "No movement", - "value": false + "text": "No movement" }, { "key": "Pale_or_jaundiced", "openmrs_choice_id": "", - "text": "Pale or jaundiced", - "value": false + "text": "Pale or jaundiced" }, { "key": "Lethargy", "openmrs_choice_id": "", - "text": "Lethargy", - "value": false + "text": "Lethargy" }, { "key": "Other", "openmrs_choice_id": "", - "text": "Other", - "value": false + "text": "Other" }, { "key": "None", "openmrs_choice_id": "", - "text": "None", - "value": false + "text": "None" } ], "exclusive": [ diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_exclusive_breastfeeding.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_exclusive_breastfeeding.json index dc0b8e344..e08e53f1c 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/pnc_exclusive_breastfeeding.json +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_exclusive_breastfeeding.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_family_planning.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_family_planning.json index 3475dfb89..edc531913 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/pnc_family_planning.json +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_family_planning.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -87,21 +82,18 @@ { "key": "chk_during_anc", "text": "During ANC", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "chk_during_anc" }, { "key": "chk_during_labour_and_delivery", "text": "During labour and delivery", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "chk_during_labour_and_delivery" }, { "key": "chk_during_pnc", "text": "During PNC", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "chk_during_pnc" } diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_family_planning_services.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_family_planning_services.json new file mode 100644 index 000000000..4ac5b3d41 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_family_planning_services.json @@ -0,0 +1,260 @@ +{ + "count": "1", + "encounter_type": "PNC Family Planning Services", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Family Planning Services", + "fields": [ + { + "key": "education_counselling_given", + "type": "native_radio", + "label": "Was Education/counselling given?", + "openmrs_entity": "concept", + "openmrs_entity_id": "education_counselling_given", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_provide_education_counselling", + "type": "toaster_notes", + "text": "Please provide education/counselling", + "openmrs_entity_id": "prompt_provide_education_counselling", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:education_counselling_given": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "iec_given", + "type": "native_radio", + "label": "Were IEC materials given?", + "openmrs_entity": "concept", + "openmrs_entity_id": "iec_given", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "using_family_planning_method", + "type": "native_radio", + "label": "Is the client already using any Family Planning Method?", + "openmrs_entity": "concept", + "openmrs_entity_id": "using_family_planning_method", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "has_the_client_been_provided_fp_method", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "has_the_client_been_provided_fp_method", + "type": "native_radio", + "label": "Has the client been provided any family planning method?", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:using_family_planning_method": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "method_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "method_provided", + "type": "native_radio", + "label": "Family Planning Method Provided", + "options": [ + { + "key": "chk_condom", + "text": "Condom", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_condom" + }, + { + "key": "chk_pills", + "text": "Pills (Progestogen-only pill)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_pills" + }, + { + "key": "chk_injectable", + "text": "Injectable (After 42 days)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_injectable" + }, + { + "key": "chk_jadelle", + "text": "Jadelle", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_jadelle" + }, + { + "key": "chk_implants", + "text": "Implanon/NXT", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_implants" + }, + { + "key": "chk_iucd", + "text": "PPIUCD (Within 48 hours after delivery or after 42 days of PNC)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_iucd" + }, + { + "key": "chk_tubal_ligation", + "text": "Bilateral Tubal Ligation (BTL)", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_tubal_ligation" + }, + { + "key": "chk_referred_fp_services", + "text": "Referred for other FP services", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_referred_fp_services" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:has_the_client_been_provided_fp_method": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "reason_for_not_providing_fp_method", + "type": "edit_text", + "hint": "Specify reason for not providing FP method", + "openmrs_entity_id": "reason_for_not_providing_fp_method", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "relevance": { + "step1:method_provided": { + "type": "string", + "ex": "equalTo(.,\"chk_none\")" + } + }, + "v_required": { + "value": "true", + "err": "Please specify" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_health_facility_visit.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_health_facility_visit.json index d1f59f1e4..662886227 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/pnc_health_facility_visit.json +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_health_facility_visit.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_health_facility_visit_two.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_health_facility_visit_two.json index b801a611e..5ac476ed7 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/pnc_health_facility_visit_two.json +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_health_facility_visit_two.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_hiv_test_results.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_hiv_test_results.json new file mode 100644 index 000000000..ba90afa6f --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_hiv_test_results.json @@ -0,0 +1,193 @@ +{ + "count": "1", + "encounter_type": "PNC HIV Test Results", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "HIV Test Results", + "fields": [ + { + "key": "hiv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv", + "type": "native_radio", + "label": "Select the HIV test result", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "test_not_conducted", + "text": "HIV Test not conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": "true", + "err": "Please select an option" + } + }, + { + "key": "reason_for_not_conducting_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hiv_test", + "type": "spinner", + "hint": "Reason as to why the HIV test was not conducted", + "values": [ + "Test kits out of stock", + "The client was in an emergency situation", + "Client refused to be tested", + "We are still counselling the client", + "Other (Specify)" + ], + "keys": [ + "test_kits_out_of_stock", + "client_was_in_an_emergency_situation", + "client_refused_to_be_tested", + "still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "test_kits_out_of_stock": "test_kits_out_of_stock", + "client_was_in_an_emergency_situation": "client_was_in_an_emergency_situation", + "client_refused_to_be_tested": "client_refused_to_be_tested", + "still_counselling_the_client": "still_counselling_the_client", + "Other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:hiv": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_for_not_conducting_hiv_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_conducting_hiv_test", + "type": "edit_text", + "hint": "Specify other reasons for not conducting HIV test", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_hiv_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "hiv_test_result_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_test_result_date", + "type": "date_picker", + "hint": "Date of receiving results", + "expanded": false, + "min_date": "today-3y", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please select the date of receiving the results" + }, + "relevance": { + "step1:hiv": { + "type": "string", + "ex": "notEqualTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "register_pmtct", + "type": "toaster_notes", + "text": "Register the client for PMTCT care and follow up", + "openmrs_entity_id": "register_pmtct", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hiv_test_result": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + }, + { + "key": "prescribe_arv", + "type": "toaster_notes", + "text": "Prescribe ARVs to the client according to standard guidelines", + "openmrs_entity_id": "prescribe_arv", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hiv_test_result": { + "type": "string", + "ex": "equalTo(.,\"positive\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_hv_danger_signs.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_hv_danger_signs.json index 487997b34..5c0a1be20 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/pnc_hv_danger_signs.json +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_hv_danger_signs.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -65,70 +60,60 @@ { "key": "chk_fever", "text": "Fever", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "140238AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_bleeding_vaginally", "text": "Bleeding vaginally", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "150802AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_server_headache", "text": "Severe headache", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "139081AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_convulsions", "text": "Convulsions", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "164483AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_difficulty_breathing", "text": "Difficulty breathing", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "142373AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_severe_abdominal_pain", "text": "Severe abdominal pain", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "165271AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_swelling", "text": "Swelling of the face and/or hands", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "460AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_vaginal_discharge", "text": "Discoloured or watery, liquid vaginal discharge with a bad smell", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "123395AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_unusual_movement", "text": "No movement / unusual movement for a child in the womb", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "113377AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_none", "text": "None", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_hv_observations_infant.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_hv_observations_infant.json index d6bfc7dc8..35bb49df2 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/pnc_hv_observations_infant.json +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_hv_observations_infant.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -92,42 +87,36 @@ { "key": "chk_ors", "text": "ORS 5", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "351AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_zinc", "text": "Zinc 10", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "86672AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_paracetamol", "text": "Panadol", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "70116AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_referred", "text": "Referred", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "163762AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_other_treatment", "text": "Other treatment", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_none", "text": "No treatment given", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_hv_observations_mother.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_hv_observations_mother.json index fc45b38dc..a28659ad2 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/pnc_hv_observations_mother.json +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_hv_observations_mother.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -92,42 +87,36 @@ { "key": "chk_ors", "text": "ORS 5", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "351AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_zinc", "text": "Zinc 10", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "86672AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_paracetamol", "text": "Panadol", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "70116AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_referred", "text": "Referred", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "163762AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_other_treatment", "text": "Other treatment", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, { "key": "chk_none", "text": "No treatment given", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" } diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_immunization.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_immunization.json new file mode 100644 index 000000000..66332eaeb --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_immunization.json @@ -0,0 +1,146 @@ +{ + "count": "1", + "encounter_type": "PNC Immunization", + "entity_id": "", + "global": {}, + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Immunization", + "fields": [ + { + "key": "tetanus_vaccination", + "type": "native_radio", + "label": "Was Diphtheria/Tetanus vaccination administered?", + "openmrs_entity": "concept", + "openmrs_entity_id": "tetanus_vaccination", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_immunization_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_tetanus_vaccination", + "type": "toaster_notes", + "text": "Give according to schedule", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:tetanus_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + }, + { + "key": "hepatitis_b_vaccination", + "type": "native_radio", + "label": "Was Hepatitis B vaccination administered?", + "openmrs_entity": "concept", + "openmrs_entity_id": "hepatitis_b_vaccination", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_immunization_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_hepatitis_b_vaccination", + "type": "toaster_notes", + "text": "The client should be given Hepatitis B vaccination", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hepatitis_b_vaccination": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_malaria_prevention.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_malaria_prevention.json index fe30139b0..f3420ee88 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/pnc_malaria_prevention.json +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_malaria_prevention.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_mother_general_examination.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_mother_general_examination.json new file mode 100644 index 000000000..c253e77d9 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_mother_general_examination.json @@ -0,0 +1,880 @@ +{ + "count": "1", + "encounter_type": "PNC Mother General Examination", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "step1": { + "title": "Mother's General Examination", + "fields": [ + { + "key": "followup_visit_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "followup_visit_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_followup_calculation.yml" + } + } + } + }, + { + "key": "systolic", + "type": "edit_text", + "hint": "Systolic (Blood Pressure)", + "openmrs_entity_id": "systolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the systolic value" + }, + "v_min": { + "value": "0", + "err": "Systolic value must be equal or greater than 0" + }, + "v_max": { + "value": "320", + "err": "Systolic value must be equal or less than 320" + }, + "v_required": { + "value": true, + "err": "Please enter the systolic value" + } + }, + { + "key": "diastolic", + "type": "edit_text", + "hint": "Diastolic (Blood Pressure)", + "openmrs_entity_id": "diastolic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the diastolic value" + }, + "v_min": { + "value": "0", + "err": "Diastolic value must be equal or greater than 0" + }, + "v_max": { + "value": "200", + "err": "Diastolic value must be equal or less than 200" + }, + "v_required": { + "value": true, + "err": "Please enter the diastolic value" + }, + "constraints": [ + { + "type": "numeric", + "ex": "lessThan(., step1:systolic)", + "err": "The diastolic value must be less than the systolic value" + } + ] + }, + { + "key": "prompt_for_management_of_hypertension", + "type": "toaster_notes", + "text": "Manage the hypertension according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypertension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_mother_general_examination_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_management_of_hypotension", + "type": "toaster_notes", + "text": "Give IV fluids, identify the cause of hypotension and manage according to standard guidelines", + "openmrs_entity_id": "prompt_for_management_of_hypotension", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_mother_general_examination_relevance.yml" + } + } + } + }, + { + "key": "hb_level_test", + "type": "native_radio", + "label": "HB Level Test", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level_test", + "openmrs_entity_parent": "", + "options": [ + { + "key": "test_conducted", + "text": "HB Level Test conducted", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_conducted", + "openmrs_entity_parent": "" + }, + { + "key": "test_not_conducted", + "text": "HB Level Test not conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "test_not_conducted" + } + ], + "v_required": { + "value": true, + "err": "Please answer this question" + } + }, + { + "key": "hb_level", + "type": "edit_text", + "hint": "HB Level (g/dl)", + "openmrs_entity": "concept", + "openmrs_entity_id": "hb_level", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the HB level" + }, + "v_min": { + "value": "0", + "err": "HB level must be equal or greater than 0 (g/dl)" + }, + "v_max": { + "value": "20", + "err": "HB level must be equal or less than 20 (g/dl)" + }, + "v_required": { + "value": true, + "err": "Please provide a value" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_conducted\")" + } + } + }, + { + "key": "prompt_for_severe_anaemia_treatment", + "type": "toaster_notes", + "text": "Manage the severe anaemia according to standard guidelines", + "openmrs_entity_id": "prompt_for_severe_anaemia_treatment", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:hb_level": { + "type": "numeric", + "ex": "lessThanEqualTo(.,\"8.5\")" + } + } + }, + { + "key": "prompt_for_moderate_anaemia_management", + "type": "toaster_notes", + "text": "Manage the mild anaemia according to standard guidelines", + "openmrs_entity_id": "prompt_for_moderate_anaemia_management", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_mother_general_examination_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_conducting_hb_test", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_conducting_hb_test", + "type": "spinner", + "hint": "Reason as to why the HB Level test was not conducted", + "values": [ + "Cuvette Cartridges Out of Stock", + "Haemoque machine out of order", + "The client was in an emergency situation", + "The client refused to be tested", + "We are still counselling the client", + "Other" + ], + "keys": [ + "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client", + "other" + ], + "openmrs_choice_ids": { + "stock_out_of_cuvettes_cartridges": "stock_out_of_cuvettes_cartridges", + "haemoque_machine_out_of_order": "haemoque_machine_out_of_order", + "the_client_was_in_an_emergency_situation": "the_client_was_in_an_emergency_situation", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "we_are_still_counselling_the_client": "we_are_still_counselling_the_client", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:hb_level_test": { + "type": "string", + "ex": "equalTo(., \"test_not_conducted\")" + } + } + }, + { + "key": "other_reason_hb_test_not_conducted", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_hb_test_not_conducted", + "type": "edit_text", + "hint": "Other reason for why the HB Level test was not conducted", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_conducting_hb_test": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "temperature", + "type": "edit_text", + "hint": "Temperature (\u2103)", + "openmrs_entity_id": "temperature", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "v_numeric": { + "value": "true", + "err": "Please enter the temperature" + }, + "v_min": { + "value": "10", + "err": "Temperature must be equal or greater than 10" + }, + "v_max": { + "value": "50", + "err": "Temperature must be equal or less than 50" + }, + "v_required": { + "value": true, + "err": "Please enter the temperature" + } + }, + { + "key": "notify_client_has_fever", + "type": "toaster_notes", + "text": "Conduct relevant laboratory tests to elicit the cause of fever and manage according to standard guidelines ", + "openmrs_entity_id": "notify_client_has_fever", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "greaterThan(.,\"37.8\")" + } + } + }, + { + "key": "notify_client_has_hypothermia", + "type": "toaster_notes", + "text": "Manage the hypothermia according to standard guidelines", + "openmrs_entity_id": "notify_client_has_hypothermia", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "step1:temperature": { + "type": "numeric", + "ex": "lessThan(.,\"36.5\")" + } + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Weight (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the weight" + }, + "v_min": { + "value": "20", + "err": "The weight must be equal or greater than 20 (KG)" + }, + "v_max": { + "value": "300", + "err": "The weight must be equal or less than 300 (KG)" + }, + "v_required": { + "value": true, + "err": "Please enter the weight" + } + }, + { + "key": "prompt_for_breast_exam", + "type": "toaster_notes", + "text": "Breast Examination", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info" + }, + { + "key": "breast_milk_flow", + "type": "native_radio", + "label": "Does the Mother have Breast Milk Flow?", + "openmrs_entity": "concept", + "openmrs_entity_id": "breast_milk_flow", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_no_breast_milk_flow", + "type": "toaster_notes", + "text": "Counsel and support the mother on attachment of the newborn to the nipple and positioning of the newborn during breastfeeding. Milk flow will begin as the newborn continues to suck", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:breast_milk_flow": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "bruised_nipples", + "type": "native_radio", + "label": "Does the Mother have Bruised Nipples?", + "openmrs_entity": "concept", + "openmrs_entity_id": "bruised_nipples", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_bruised_nipples", + "type": "toaster_notes", + "text": "Refer for further Management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:bruised_nipples": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "engorgement_mastitis", + "type": "native_radio", + "label": "Does the Mother have Engorgement or Mastitis?", + "openmrs_entity": "concept", + "openmrs_entity_id": "engorgement_mastitis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_engorgement_mastitis", + "type": "toaster_notes", + "text": "Provide antibiotics and analgesics to the mother, breastfeed the newborn on the other breast", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:engorgement_mastitis": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "abscess", + "type": "native_radio", + "label": "Does the Mother have Abscess?", + "openmrs_entity": "concept", + "openmrs_entity_id": "abscess", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_abscess", + "type": "toaster_notes", + "text": "Incise and Drain the abscess, Provide antibiotics and analgesics to the mother", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:abscess": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "perineum_infection", + "type": "native_radio", + "label": "Does the Mother have Perineum Infection?", + "openmrs_entity": "concept", + "openmrs_entity_id": "perineum_infection", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_perineum_infection", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:perineum_infection": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "uterus_assessment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "uterus_assessment", + "type": "native_radio", + "label": "Uterus Assessment", + "options": [ + { + "key": "chk_normal_involution", + "text": "Normal/involution has taken place", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_normal_involution" + }, + { + "key": "chk_pain", + "text": "Pain", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_pain" + }, + { + "key": "chk_distended", + "text": "Distended", + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_distended" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_uterus_pain", + "type": "toaster_notes", + "text": "Conduct a thorough vaginal examination for any signs of puerperial sepsis or retained products of conception, manage the client based on standard guidelines, provide antibiotics and analgesics according to standard guidelines", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:uterus_assessment": { + "type": "string", + "ex": "equalTo(.,\"chk_pain\")" + } + } + }, + { + "key": "prompt_for_uterus_distended", + "type": "toaster_notes", + "text": "Assess abdominal tenderness and uterine involution, manage the client according to standard guidelines", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:uterus_assessment": { + "type": "string", + "ex": "equalTo(.,\"chk_distended\")" + } + } + }, + { + "key": "lochia_assessment", + "type": "native_radio", + "label": "Lochia assessment", + "openmrs_entity": "concept", + "openmrs_entity_id": "lochia_assessment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "lochia_rubra", + "text": "Lochia Rubra", + "openmrs_entity": "concept", + "openmrs_entity_id": "lochia_rubra" + }, + { + "key": "lochia_serosa", + "text": "Lochia Serosa", + "openmrs_entity": "concept", + "openmrs_entity_id": "lochia_serosa" + }, + { + "key": "lochia_alba", + "text": "Lochia Alba", + "openmrs_entity": "concept", + "openmrs_entity_id": "lochia_alba" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "vaginal_assessment", + "type": "native_radio", + "label": "Vaginal Assessment", + "openmrs_entity": "concept", + "openmrs_entity_id": "vaginal_assessment", + "openmrs_entity_parent": "", + "options": [ + { + "key": "tear", + "text": "Tear", + "openmrs_entity": "concept", + "openmrs_entity_id": "tear" + }, + { + "key": "episiotomy", + "text": "Episiotomy", + "openmrs_entity": "concept", + "openmrs_entity_id": "episiotomy" + }, + { + "key": "intact", + "text": "Intact", + "openmrs_entity": "concept", + "openmrs_entity_id": "intact" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_tear_vaginal_assessment", + "type": "toaster_notes", + "text": "If the client is actively bleeding provide emergency care of the postpartum haemorrhage, repair the tear, and provide antibiotics and analgesics", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:vaginal_assessment": { + "type": "string", + "ex": "equalTo(.,\"tear\")" + } + } + }, + { + "key": "prompt_for_episiotomy_vaginal_assessment", + "type": "toaster_notes", + "text": "Check the wound for any active bleeding and infection, manage according to standard guidelines", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:vaginal_assessment": { + "type": "string", + "ex": "equalTo(.,\"episiotomy\")" + } + } + }, + { + "key": "fistula", + "type": "native_radio", + "label": "Does the Mother have Fistula?", + "openmrs_entity": "concept", + "openmrs_entity_id": "fistula", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "prompt_for_fistula", + "type": "toaster_notes", + "text": "Refer for surgical repair of the fistula", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:fistula": { + "type": "string", + "ex": "equalTo(.,\"yes\")" + } + } + }, + { + "key": "prompt_for_mental_health_examination", + "type": "toaster_notes", + "text": "Mental Health Examination", + "openmrs_entity_id": "", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "toaster_type": "info" + }, + { + "key": "puerperal_psychosis", + "type": "native_radio", + "label": "Does the Mother have Puerperal Psychosis?", + "openmrs_entity": "concept", + "openmrs_entity_id": "puerperal_psychosis", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "mental_illness_symptom", + "type": "native_radio", + "label": "Any other symptom of Mental Illness?", + "openmrs_entity": "concept", + "openmrs_entity_id": "mental_illness_symptom", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "step1:puerperal_psychosis": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "prompt_for_mental_illness", + "type": "toaster_notes", + "text": "Refer to psychiatrist", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_mother_general_examination_relevance.yml" + } + } + } + }, + { + "key": "visit_number", + "type": "hidden", + "openmrs_entity_id": "visit_number", + "openmrs_entity": "concept", + "openmrs_entity_parent": "" + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_no_mother_registration.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_no_mother_registration.json new file mode 100644 index 000000000..4610d58a2 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_no_mother_registration.json @@ -0,0 +1,482 @@ +{ + "count": "2", + "encounter_type": "No Mother PNC Registration", + "entity_id": "", + "relational_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "step1": { + "title": "Child Registration", + "next": "step2", + "fields": [ + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "hidden": "true", + "type": "edit_text", + "barcode_type": "qrcode", + "hint": "ID", + "scanButtonText": "Scan QR Code", + "v_numeric": { + "value": "true", + "err": "Please enter a valid ID" + } + }, + { + "key": "fam_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "fam_name", + "type": "edit_text", + "hint": "Child's Surname", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the surname" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter the surname" + } + }, + { + "key": "client_first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "edit_text", + "hint": "Child's First name", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the first name" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + } + }, + { + "key": "client_middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "edit_text", + "hint": "Child's Middle name", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + }, + "v_required": { + "value": "true", + "err": "Please enter the middle name" + } + }, + { + "key": "fam_village", + "openmrs_entity_parent": "", + "openmrs_entity": "person_address", + "openmrs_entity_id": "cityVillage", + "type": "edit_text", + "edit_type": "name", + "hint": "Area name", + "v_required": { + "value": "true", + "err": "Please enter the name of area or town" + } + }, + { + "key": "weight", + "type": "edit_text", + "hint": "Weight (KG)", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight", + "openmrs_entity_parent": "", + "v_numeric": { + "value": "true", + "err": "Please enter the weight" + }, + "v_min": { + "value": "0", + "err": "The weight must be equal or greater than 0 (KG)" + }, + "v_max": { + "value": "6", + "err": "The weight must be equal or less than 6 (KG)" + }, + "v_required": { + "value": true, + "err": "Please enter the weight" + } + }, + { + "key": "prompt_for_underweight", + "type": "toaster_notes", + "text": "Refer for Further Management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_no_mother_registration_relevance.yml" + } + } + } + }, + { + "key": "disabilities", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "disabilities", + "type": "spinner", + "hint": "Physical disabilities", + "values": [ + "Yes", + "No" + ], + "keys": [ + "Yes", + "No" + ], + "openmrs_choice_ids": { + "Yes": "Yes", + "No": "No" + }, + "v_required": { + "value": "true", + "err": "Required" + } + }, + { + "key": "prompt_for_disabilities", + "type": "toaster_notes", + "text": "Refer for further management", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "problem", + "relevance": { + "step1:disabilities": { + "type": "string", + "ex": "equalTo(.,\"Yes\")" + } + } + }, + { + "key": "type_of_disability", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_disability", + "type": "check_box", + "label": "Type of disability", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "physical_impairments", + "text": "Mobility and Physical Impairments", + "openmrs_entity": "concept", + "openmrs_entity_id": "physical_impairments" + }, + { + "key": "spinal_cord_disability", + "text": "Spinal Cord Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "spinal_cord_disability" + }, + { + "key": "brain_disability", + "text": "Head Injuries - Brain Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "brain_disability" + }, + { + "key": "vision_disability", + "text": "Vision Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "vision_disability" + }, + { + "key": "hearing_disability", + "text": "Hearing Disability", + "openmrs_entity": "concept", + "openmrs_entity_id": "hearing_disability" + }, + { + "key": "learning_disabilities", + "text": "Cognitive or Learning Disabilities", + "openmrs_entity": "concept", + "openmrs_entity_id": "learning_disabilities" + }, + { + "key": "psychological_disorders", + "text": "Psychological Disorders", + "openmrs_entity": "concept", + "openmrs_entity_id": "psychological_disorders" + }, + { + "key": "invisible_disabilities", + "text": "Invisible Disabilities", + "openmrs_entity": "concept", + "openmrs_entity_id": "invisible_disabilities" + } + ], + "relevance": { + "step1:disabilities": { + "type": "string", + "ex": "equalTo(.,\"Yes\")" + } + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "date_picker", + "hint": "Date of birth (DOB)", + "expanded": false, + "duration": { + "label": "Age" + }, + "min_date": "today-6w", + "max_date": "today", + "v_required": { + "value": "true", + "err": "Please enter the date of birth" + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "spinner", + "hint": "Sex", + "values": [ + "Male", + "Female", + "Ambiguous" + ], + "keys": [ + "Male", + "Female", + "Ambiguous" + ], + "v_required": { + "value": "true", + "err": "Please enter the sex" + } + }, + { + "key": "entry_point", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "entry_point", + "type": "hidden", + "value": "PNC" + } + ] + }, + "step2": { + "title": "Caregiver details", + "fields": [ + { + "key": "unique_id", + "openmrs_entity_parent": "", + "openmrs_entity": "person_identifier", + "openmrs_entity_id": "opensrp_id", + "type": "hidden" + }, + { + "key": "surname", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "last_name", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_no_mother_registration_calculation.yml" + } + } + } + }, + { + "key": "first_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "first_name", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_no_mother_registration_calculation.yml" + } + } + } + }, + { + "key": "middle_name", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "middle_name", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_no_mother_registration_calculation.yml" + } + } + } + }, + { + "key": "dob", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "birthdate", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_no_mother_registration_calculation.yml" + } + } + } + }, + { + "key": "sex", + "openmrs_entity_parent": "", + "openmrs_entity": "person", + "openmrs_entity_id": "gender", + "type": "hidden", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_no_mother_registration_calculation.yml" + } + } + } + }, + { + "key": "risk_category", + "type": "hidden", + "openmrs_entity_id": "risk_category", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "value": "high" + }, + { + "key": "delivery_date", + "type": "hidden", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "delivery_date", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_no_mother_registration_calculation.yml" + } + } + } + }, + { + "key": "caregiver_name", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "caregiver_name", + "type": "edit_text", + "edit_type": "name", + "hint": "Caregiver Name", + "v_required": { + "value": "true", + "err": "Please enter caregiver's name" + }, + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter the caregiver's name" + } + }, + { + "key": "caregiver_phone_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "caregiver_phone_number", + "type": "edit_text", + "hint": "Client phone number", + "v_numeric": { + "value": "true", + "err": "Number must be a total of 10 digits in length" + }, + "v_regex": { + "value": "(0[6-7][1-9][0-9][0-9]{6})|\\s*", + "err": "Number must be 10 digits and must start with 06 or 07." + }, + "v_required": { + "value": "true", + "err": "Please enter the phone number" + } + }, + { + "key": "caregiver_location", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "caregiver_location", + "type": "edit_text", + "edit_type": "name", + "hint": "Caregiver Location", + "v_required": { + "value": "true", + "err": "Please enter caregiver's Location" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_nutrition_status_infant.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_nutrition_status_infant.json index c4e56647d..9dd71b325 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/pnc_nutrition_status_infant.json +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_nutrition_status_infant.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_nutrition_status_mother.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_nutrition_status_mother.json index e5ce028db..b6e0a1367 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/pnc_nutrition_status_mother.json +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_nutrition_status_mother.json @@ -15,11 +15,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", diff --git a/opensrp-chw-hf/src/main/assets/json.form/pnc_nutritional_supplement.json b/opensrp-chw-hf/src/main/assets/json.form/pnc_nutritional_supplement.json new file mode 100644 index 000000000..5f5ec1f12 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/pnc_nutritional_supplement.json @@ -0,0 +1,221 @@ +{ + "count": "1", + "encounter_type": "PNC Nutritional Supplement", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "Nutritional Supplements", + "fields": [ + { + "key": "iron_and_folic_acid", + "type": "native_radio", + "label": "Was Iron and Folic acid given?", + "openmrs_entity": "concept", + "openmrs_entity_id": "iron_and_folic_acid", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + } + }, + { + "key": "reason_for_not_giving_iron_and_folic_acid", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_iron_and_folic_acid", + "type": "spinner", + "hint": "Reason as to why Iron and Folic acid was not given", + "values": [ + "Out of stock", + "The client did not agree to take the medication", + "The client is allergic to medication", + "Other (Specify)" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:iron_and_folic_acid": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "other_reason_for_not_giving_iron_and_folic_acid", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_giving_iron_and_folic_acid", + "type": "edit_text", + "hint": "Specify other reasons for not giving Iron and Folic acid", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_giving_iron_and_folic_acid": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + }, + { + "key": "vitamin_a", + "type": "native_radio", + "label": "Was Vitamin A given?", + "openmrs_entity": "concept", + "openmrs_entity_id": "vitamin_a", + "openmrs_entity_parent": "", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please answer this question" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "pnc_nutritional_supplement_relevance.yml" + } + } + } + }, + { + "key": "reason_for_not_giving_vitamin_a", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_not_giving_vitamin_a", + "type": "spinner", + "hint": "Reason as to why Vitamin A was not given", + "values": [ + "Out of stock", + "The client did not agree to take the medication", + "The client is allergic to medication", + "Other (Specify)" + ], + "keys": [ + "out_of_stock", + "client_did_not_agree_medication", + "client_is_allergic_to_medication", + "other" + ], + "openmrs_choice_ids": { + "out_of_stock": "out_of_stock", + "client_did_not_agree_medication": "client_did_not_agree_medication", + "the_client_refused_to_be_tested": "the_client_refused_to_be_tested", + "client_is_allergic_to_medication": "client_is_allergic_to_medication", + "other": "other" + }, + "v_required": { + "value": "true", + "err": "Please select a reason" + }, + "relevance": { + "step1:vitamin_a": { + "type": "string", + "ex": "equalTo(.,\"no\")" + } + } + }, + { + "key": "other_reason_for_not_giving_vitamin_a", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_for_not_giving_vitamin_a", + "type": "edit_text", + "hint": "Specify other reasons for not giving Vitamin A", + "edit_type": "name", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reason_for_not_giving_vitamin_a": { + "type": "string", + "ex": "equalTo(., \"other\")" + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/prep_initiation.json b/opensrp-chw-hf/src/main/assets/json.form/prep_initiation.json new file mode 100644 index 000000000..151269f40 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/prep_initiation.json @@ -0,0 +1,585 @@ +{ + "count": "1", + "encounter_type": "PrEP Initiation", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "PrEP Initiation", + "fields": [ + { + "key": "prep_status", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_status", + "label": "PrEP status in this visit", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "initiated", + "text": "Initiated", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "initiated" + }, + { + "key": "continuing", + "text": "Continuing", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "continuing" + }, + { + "key": "re_start", + "text": "Re-start", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "re_start" + }, + { + "key": "not_initiated", + "text": "Not initiated", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_initiated" + }, + { + "key": "discontinued_quit", + "text": "Discontinued/Quit", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "discontinued_quit" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "prep_drug_offered", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_drug_offered", + "label": "Type of PrEP drug offered", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "tdf_ftc", + "text": "TDF/FTC", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tdf_ftc" + }, + { + "key": "other_drugs", + "text": "Other Drugs", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_drugs" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_relevance.yml" + } + } + } + }, + { + "key": "other_prep_drug_offered", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_prep_drug_offered", + "type": "edit_text", + "hint": "Other PrEP Drug Offered", + "v_required": { + "value": "true", + "err": "Please enter the other PrEP drug Offered" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_relevance.yml" + } + } + } + }, + { + "key": "prep_pills_number", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_pills_number", + "type": "edit_text", + "hint": "Number of PrEP pills dispensed", + "v_required": { + "value": "true", + "err": "Please enter the number" + }, + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_relevance.yml" + } + } + }, + "v_max": { + "value": "30", + "err": "Number of pills must be equal to or less than 30" + } + }, + { + "key": "prep_adherence", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_adherence", + "label": "PrEP adherence", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "good", + "text": "Good", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "good" + }, + { + "key": "poor", + "text": "Poor", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "poor" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_relevance.yml" + } + } + } + }, + { + "key": "poor_prep_adherence_reason", + "type": "check_box", + "label": "Reasons for poor PrEP adherence", + "combine_checkbox_option_values": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "poor_prep_adherence_reason", + "openmrs_entity_parent": "", + "exclusive": [ + "not_applicable" + ], + "options": [ + { + "key": "forgotten", + "text": "Forgotten", + "openmrs_entity": "concept", + "openmrs_entity_id": "forgotten" + }, + { + "key": "lost_out_of_drugs", + "text": "Lost/run out of drugs", + "openmrs_entity": "concept", + "openmrs_entity_id": "lost_out_of_drugs" + }, + { + "key": "pill_burden", + "text": "Pill burden", + "openmrs_entity": "concept", + "openmrs_entity_id": "pill_burden" + }, + { + "key": "side_effects", + "text": "Side effects", + "openmrs_entity": "concept", + "openmrs_entity_id": "side_effects" + }, + { + "key": "stigma", + "text": "Stigma", + "openmrs_entity": "concept", + "openmrs_entity_id": "stigma" + }, + { + "key": "not_at_risk", + "text": "Not at risk", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_at_risk" + }, + { + "key": "others", + "text": "Others", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select at least one" + }, + "relevance": { + "step1:prep_adherence": { + "type": "string", + "ex": "equalTo(., \"poor\")" + } + } + }, + { + "key": "other_poor_prep_adherence_reason", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_poor_prep_adherence_reason", + "type": "edit_text", + "hint": "Other(Specify)", + "v_required": { + "value": "true", + "err": "Please specify" + }, + "relevance": { + "step1:poor_prep_adherence_reason": { + "type": "string", + "ex": "equalTo(., \"others\")" + } + } + }, + { + "key": "prep_side_effects", + "type": "check_box", + "label": "PrEP side effects", + "combine_checkbox_option_values": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "prep_side_effects", + "openmrs_entity_parent": "", + "exclusive": [ + "not_applicable", + "no_side_effects" + ], + "options": [ + { + "key": "nausea", + "text": "Nausea", + "openmrs_entity": "concept", + "openmrs_entity_id": "nausea" + }, + { + "key": "abdominal_pain", + "text": "Abdominal pain", + "openmrs_entity": "concept", + "openmrs_entity_id": "abdominal_pain" + }, + { + "key": "headache", + "text": "Headache", + "openmrs_entity": "concept", + "openmrs_entity_id": "headache" + }, + { + "key": "diarrhea", + "text": "Diarrhea", + "openmrs_entity": "concept", + "openmrs_entity_id": "diarrhea" + }, + { + "key": "loss_of_appetite", + "text": "Loss of appetite", + "openmrs_entity": "concept", + "openmrs_entity_id": "loss_of_appetite" + }, + { + "key": "dizziness", + "text": "Dizziness", + "openmrs_entity": "concept", + "openmrs_entity_id": "dizziness" + }, + { + "key": "others", + "text": "Others", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + }, + { + "key": "no_side_effects", + "text": "No side effects", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_side_effects" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select at least one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_relevance.yml" + } + } + } + }, + { + "key": "other_prep_side_effects", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_prep_side_effects", + "type": "edit_text", + "hint": "Other(Specify)", + "v_required": { + "value": "true", + "err": "Please specify" + }, + "relevance": { + "step1:prep_side_effects": { + "ex-checkbox": [ + { + "or": [ + "others" + ] + } + ] + } + } + }, + { + "key": "reasons_stopping_prep", + "type": "check_box", + "label": "Reason(s) for stopping PrEP medication", + "combine_checkbox_option_values": "true", + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_stopping_prep", + "openmrs_entity_parent": "", + "exclusive": [ + "not_applicable" + ], + "options": [ + { + "key": "hiv_positive", + "text": "HIV positive", + "openmrs_entity": "concept", + "openmrs_entity_id": "hiv_positive" + }, + { + "key": "side_effect_or_allergy", + "text": "Drugs side effect or allergy", + "openmrs_entity": "concept", + "openmrs_entity_id": "side_effect_or_allergy" + }, + { + "key": "poor_adherence", + "text": "Poor adherence", + "openmrs_entity": "concept", + "openmrs_entity_id": "poor_adherence" + }, + { + "key": "client_decision", + "text": "Client's decision", + "openmrs_entity": "concept", + "openmrs_entity_id": "client_decision" + }, + { + "key": "not_at_risk", + "text": "Client has stopped, not at risk", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_at_risk" + }, + { + "key": "others", + "text": "Others (Specify)", + "openmrs_entity": "concept", + "openmrs_entity_id": "others" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select at least one" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_relevance.yml" + } + } + } + }, + { + "key": "other_reason_stopping_prep", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_reason_stopping_prep", + "type": "edit_text", + "hint": "Other reason", + "v_required": { + "value": "true", + "err": "Please enter the reason" + }, + "relevance": { + "step1:reasons_stopping_prep": { + "ex-checkbox": [ + { + "or": [ + "others" + ] + } + ] + } + } + }, + { + "key": "prep_initiation_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "prep_initiation_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_calculation.yml" + } + } + } + }, + { + "key": "maximum_date_for_next_visit", + "type": "hidden", + "openmrs_entity_id": "maximum_date_for_next_visit", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_calculation.yml" + } + } + } + }, + { + "key": "minimum_date_for_next_visit", + "type": "hidden", + "openmrs_entity_id": "minimum_date_for_next_visit", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_calculation.yml" + } + } + } + }, + { + "key": "next_visit_date", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "next_visit_date", + "type": "date_picker", + "hint": "Next visit date", + "expanded": false, + "min_date": "today", + "max_date": "today+1y", + "v_required": { + "value": "true", + "err": "Please enter the next visit date" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_initiation_relevance.yml" + } + } + }, + "constraints": [ + { + "type": "date", + "ex": "greaterThanEqualTo(., step1:minimum_date_for_next_visit)", + "err": "Date should be within 3 days of the medication provided" + }, + { + "type": "date", + "ex": "lessThanEqualTo(., step1:maximum_date_for_next_visit)", + "err": "Date should be within 3 days of the medication provided" + } + ] + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/prep_other_services.json b/opensrp-chw-hf/src/main/assets/json.form/prep_other_services.json new file mode 100644 index 000000000..d52cb04ec --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/prep_other_services.json @@ -0,0 +1,380 @@ +{ + "count": "1", + "encounter_type": "PrEP Other Services", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "PrEP Other Services", + "fields": [ + { + "key": "health_edu_sti_provided", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "health_edu_sti_provided", + "label": "Health education on sexually transmitted infection provided?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "sti_rti_screening", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sti_rti_screening", + "label": "Screened for STI/RTI", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "sti_rti_treatment", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sti_rti_treatment", + "label": "STI/RTI treatment", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "treated", + "text": "Treated", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "treated" + }, + { + "key": "referred", + "text": "Referred", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "referred" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:sti_rti_screening": { + "type": "string", + "ex": "equalTo(., \"positive\")" + } + } + }, + { + "key": "condoms_given", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "condoms_given", + "label": "Was the client given condoms?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "type_of_issued_condoms", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "type_of_issued_condoms", + "type": "check_box", + "combine_checkbox_option_values": "true", + "label": "Select the type of condoms issued", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "options": [ + { + "key": "male_condoms", + "text": "Male Condoms", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "male_condoms" + }, + { + "key": "female_condoms", + "text": "Female Condoms", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "female_condoms" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:condoms_given": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "number_of_male_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_male_condoms_issued", + "type": "edit_text", + "hint": "Number of Male condoms issued (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "0", + "err": "The number must be equal or greater than 0" + }, + "v_required": { + "value": true, + "err": "Please enter the number" + }, + "relevance": { + "step1:type_of_issued_condoms": { + "ex-checkbox": [ + { + "or": [ + "male_condoms" + ] + } + ] + } + } + }, + { + "key": "number_of_female_condoms_issued", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "number_of_female_condoms_issued", + "type": "edit_text", + "hint": "Number of Female condoms issued (Pieces)", + "v_numeric": { + "value": "true", + "err": "Please enter a valid number" + }, + "v_min": { + "value": "0", + "err": "The number must be equal or greater than 0" + }, + "v_required": { + "value": true, + "err": "Please enter the number" + }, + "relevance": { + "step1:type_of_issued_condoms": { + "ex-checkbox": [ + { + "or": [ + "female_condoms" + ] + } + ] + } + } + }, + { + "key": "iec_sbcc_materials", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "iec_sbcc_materials", + "type": "edit_text", + "hint": "Number of IEC/SBCC materials provided to the client", + "v_numeric": { + "value": "true", + "err": "Please enter the number" + }, + "v_required": { + "value": "true", + "err": "Please enter the number" + } + }, + { + "key": "services_and_referral", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "services_and_referral", + "label": "Other services and referral", + "text_color": "#000000", + "type": "check_box", + "exclusive": [ + "none" + ], + "options": [ + { + "key": "rch", + "text": "RCH", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "rch" + }, + { + "key": "mental_health", + "text": "Mental health", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "mental_health" + }, + { + "key": "covid_vaccine", + "text": "Covid-19 vaccine", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "covid_vaccine" + }, + { + "key": "legal_services", + "text": "Legal services", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "legal_services" + }, + { + "key": "iga", + "text": "IGA", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "iga" + }, + { + "key": "other", + "text": "Other (Specify)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other" + }, + { + "key": "none", + "text": "None", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "none" + } + ] + }, + { + "key": "services_and_referral_other", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "services_and_referral_other", + "type": "edit_text", + "hint": "Other", + "v_required": { + "value": "true", + "err": "Please specify" + }, + "relevance": { + "step1:services_and_referral": { + "ex-checkbox": [ + { + "or": [ + "other" + ] + } + ] + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/prep_registration.json b/opensrp-chw-hf/src/main/assets/json.form/prep_registration.json new file mode 100644 index 000000000..af0d9b326 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/prep_registration.json @@ -0,0 +1,121 @@ +{ + "count": "1", + "encounter_type": "PrEP Registration", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "PrEP Registration", + "fields": [ + { + "key": "nickname", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "nickname", + "type": "edit_text", + "hint": "Add Nickname (A.K.A)", + "edit_type": "name", + "v_regex": { + "value": "[A-Za-z\\u00C0-\\u017F\\s\\u00C0-\\u017F\\.\\-\\']*", + "err": "Please enter a valid name" + } + }, + { + "key": "agreed_to_use_prep", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "agreed_to_use_prep", + "label": "Has the client agreed to use PrEP?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "sms_notification_service", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "sms_notification_service", + "label": "Has the client opted for sms notification service?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/prep_screening.json b/opensrp-chw-hf/src/main/assets/json.form/prep_screening.json new file mode 100644 index 000000000..0eb2f66d5 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/prep_screening.json @@ -0,0 +1,636 @@ +{ + "count": "1", + "encounter_type": "PrEP Screening", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "PrEP Screening", + "fields": [ + { + "key": "diabetes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "diabetes", + "label": "Diabetes", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "treated", + "text": "Treated/is doing well", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "treated" + }, + { + "key": "not_treated", + "text": "Not treated/not doing well", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_treated" + }, + { + "key": "not_diabetic", + "text": "Not diabetic", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_diabetic" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "blood_pressure", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "blood_pressure", + "label": "Blood pressure", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "treated", + "text": "Treated/is doing well", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "treated" + }, + { + "key": "not_treated", + "text": "Not treated/not doing well", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_treated" + }, + { + "key": "normal", + "text": "Has normal blood pressure", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "normal" + } + ], + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + }, + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "kidney_disease", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "kidney_disease", + "label": "Kidney disease", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "treated", + "text": "Treated/is doing well", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "treated" + }, + { + "key": "not_treated", + "text": "Not treated/not doing well", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_treated" + }, + { + "key": "no_disease", + "text": "Has no kidney disease", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_disease" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "nephrotoxic_drugs", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "nephrotoxic_drugs", + "label": "Is the client using medicine/drugs which affect kidney (Nephrotoxic drugs)", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "tested_hbv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tested_hbv", + "label": "Tested for HBV", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "hbv_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hbv_results", + "label": "HBV results", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:tested_hbv": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "hbv_test_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "hbv_test_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_calculation.yml" + } + } + } + }, + { + "key": "tested_hcv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tested_hcv", + "label": "Tested for HCV", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "hcv_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "hcv_results", + "label": "HCV results", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "positive", + "text": "Positive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "positive" + }, + { + "key": "negative", + "text": "Negative", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "negative" + }, + { + "key": "not_applicable", + "text": "Not applicable", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "not_applicable" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "hcv_test_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "hcv_test_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_calculation.yml" + } + } + } + }, + { + "key": "tested_crcl", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "tested_crcl", + "label": "Tested for Serum Creatinine (CrCL)", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "should_test_for_crcl", + "type": "toaster_notes", + "text": "Client should be tested for Serum Createnine", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "crcl_results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "crcl_results", + "label": "Creatinine Clearance (CrCL) results", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "greater_than_60", + "text": "> 60 ml/min", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "greater_than_60" + }, + { + "key": "less_than_60", + "text": "< 60 ml/min", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "less_than_60" + }, + { + "key": "no_results", + "text": "No results", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no_results" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "step1:tested_crcl": { + "type": "string", + "ex": "equalTo(., \"yes\")" + } + } + }, + { + "key": "crcl_test_date", + "type": "edit_text", + "hidden": "true", + "openmrs_entity_id": "crcl_test_date", + "openmrs_entity": "concept", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_calculation.yml" + } + } + } + }, + { + "key": "weight_35_or_above", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "weight_35_or_above", + "label": "Does the client weigh 35 KG or above", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "acute_hiv", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "acute_hiv", + "label": "Symptoms of acute HIV infection", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + }, + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "should_initiate", + "type": "hidden", + "openmrs_entity": "concept", + "openmrs_entity_id": "should_initiate", + "openmrs_entity_parent": "", + "calculation": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_calculation.yml" + } + } + } + }, + { + "key": "prompt_for_prep_eligibility", + "type": "toaster_notes", + "text": "This client is eligible for PrEP", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "info", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + }, + { + "key": "prompt_for_prep_ineligibility", + "type": "toaster_notes", + "text": "This client is ineligible for PrEP", + "openmrs_entity_id": "", + "openmrs_entity": "", + "openmrs_entity_parent": "", + "toaster_type": "warning", + "relevance": { + "rules-engine": { + "ex-rules": { + "rules-file": "prep_screening_relevance.yml" + } + } + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/prep_visit_type.json b/opensrp-chw-hf/src/main/assets/json.form/prep_visit_type.json new file mode 100644 index 000000000..21b331415 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/prep_visit_type.json @@ -0,0 +1,122 @@ +{ + "count": "1", + "encounter_type": "PrEP Visit Type", + "entity_id": "", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "" + }, + "global": {}, + "step1": { + "title": "PrEP Visit Type", + "fields": [ + { + "key": "place", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "place", + "label": "Place", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "facility", + "text": "Health Facility", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "facility" + }, + { + "key": "community_outreach", + "text": "Community/Outreach", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "community_outreach" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + }, + { + "key": "visit_type", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visit_type", + "label": "Visit type", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "new_client", + "text": "New client", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "new_client" + }, + { + "key": "returning_client", + "text": "Return", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "returning_client" + }, + { + "key": "transfer_in", + "text": "Transfer in", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "transfer_in" + }, + { + "key": "visited_another_facility", + "text": "Visited another facility (refill/outreach/transit)", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "visited_another_facility" + } + ], + "v_required": { + "value": "true", + "err": "Please select an answer" + } + } + ] + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/referrals/labour_and_delivery_child_emergency_referral.json b/opensrp-chw-hf/src/main/assets/json.form/referrals/labour_and_delivery_child_emergency_referral.json new file mode 100644 index 000000000..68e02af32 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/referrals/labour_and_delivery_child_emergency_referral.json @@ -0,0 +1,162 @@ +{ + "form": "Referral form", + "encounter_type": "Referral Registration", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/labour_and_delivery_emergency_neat_referral_form_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "L&D Child Emergency Referral Form", + "fields": [ + { + "name": "chw_referral_hf", + "type": "spinner", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "chw_referral_hf", + "openmrs_entity_parent": "" + }, + "properties": { + "text": "Choose referral facility", + "searchable": "Choose referral facility" + }, + "options": [], + "required_status": "yes:Please specify" + }, + { + "name": "problem", + "type": "multi_choice_checkbox", + "properties": { + "text": "Problems/Complications" + }, + "meta_data": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "problem" + }, + "options": [ + { + "name": "birth_asphyxia", + "text": "Birth Asphyxia", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "birth_asphyxia", + "openmrs_entity_parent": "" + } + }, + { + "name": "neo_respiratory_distress", + "text": "Neonatal Respiratory Distress", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "neo_respiratory_distress", + "openmrs_entity_parent": "" + } + }, + { + "name": "early_neonatal_sepsis", + "text": "Early Neonatal Sepsis", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "early_neonatal_sepsis", + "openmrs_entity_parent": "" + } + }, + { + "name": "congenital_anomalies", + "text": "Congenital Anomalies", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "congenital_anomalies", + "openmrs_entity_parent": "" + } + }, + { + "name": "prematurity", + "text": "Prematurity", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "prematurity", + "openmrs_entity_parent": "" + } + }, + { + "name": "other_reasons", + "text": "Other reasons", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "other_reasons", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please specify", + "dependent_calculations": [ + "referral_date", + "referral_time", + "referral_type", + "referral_status" + ] + }, + { + "name": "problem_other", + "type": "text_input_edit_text", + "properties": { + "hint": "Other reasons", + "type": "name" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "problem_other", + "openmrs_entity_parent": "problem" + }, + "required_status": "true:Please specify other reasons", + "subjects": "problem:map" + } + ] + } + ] +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/referrals/labour_and_delivery_emergency_referral.json b/opensrp-chw-hf/src/main/assets/json.form/referrals/labour_and_delivery_emergency_referral.json new file mode 100644 index 000000000..2314ef34b --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/referrals/labour_and_delivery_emergency_referral.json @@ -0,0 +1,180 @@ +{ + "form": "Referral form", + "encounter_type": "Referral Registration", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/labour_and_delivery_emergency_neat_referral_form_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "L&D Emergency Referral Form", + "fields": [ + { + "name": "chw_referral_hf", + "type": "spinner", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "chw_referral_hf", + "openmrs_entity_parent": "" + }, + "properties": { + "text": "Choose referral facility", + "searchable": "Choose referral facility" + }, + "options": [], + "required_status": "yes:Please specify" + }, + { + "name": "problem", + "type": "multi_choice_checkbox", + "properties": { + "text": "Problems/Complications" + }, + "meta_data": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "problem" + }, + "options": [ + { + "name": "aph", + "text": "APH", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "aph", + "openmrs_entity_parent": "" + } + }, + { + "name": "prom", + "text": "Pre-mature Rupture of Membrane (PROM)", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "prom", + "openmrs_entity_parent": "" + } + }, + { + "name": "eclampsia", + "text": "Eclampsia", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "eclampsia", + "openmrs_entity_parent": "" + } + }, + { + "name": "pph", + "text": "PPH", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "pph", + "openmrs_entity_parent": "" + } + }, + { + "name": "obstructed_labour", + "text": "Obstructed labour", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "obstructed_labour", + "openmrs_entity_parent": "" + } + }, + { + "name": "retained_placenta", + "text": "Retained placenta", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "retained_placenta", + "openmrs_entity_parent": "" + } + }, + { + "name": "sepsis", + "text": "Sepsis", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "sepsis", + "openmrs_entity_parent": "" + } + }, + { + "name": "other_reasons", + "text": "Other reasons", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "other_reasons", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please specify", + "dependent_calculations": [ + "referral_date", + "referral_time", + "referral_type", + "referral_status" + ] + }, + { + "name": "problem_other", + "type": "text_input_edit_text", + "properties": { + "hint": "Other reasons", + "type": "name" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "problem_other", + "openmrs_entity_parent": "problem" + }, + "required_status": "true:Please specify other reasons", + "subjects": "problem:map" + } + ] + } + ] +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/referrals/ltfu_referral_form.json b/opensrp-chw-hf/src/main/assets/json.form/referrals/ltfu_referral_form.json new file mode 100644 index 000000000..e993ba366 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/referrals/ltfu_referral_form.json @@ -0,0 +1,227 @@ +{ + "form": "Referral form", + "encounter_type": "Referral Registration", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/ltfu_referral_form_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "Lost To FollowUp Referral Form", + "fields": [ + { + "name": "on_art", + "type": "radio_group", + "properties": { + "text": "Was the client on ARV?" + }, + "options": [ + { + "name": "yes", + "text": "Yes", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "No", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "meta_data": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "on_art" + }, + "required_status": "yes:Please specify", + "dependent_calculations": [ + "referral_date", + "referral_time", + "referral_type", + "referral_status" + ] + }, + { + "name": "problem_for_on_art", + "type": "radio_group", + "properties": { + "text": "Lost to Followup Clinic" + }, + "meta_data": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "problem" + }, + "options": [ + { + "name": "CTC", + "text": "CTC", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "CTC", + "openmrs_entity_parent": "" + } + }, + { + "name": "PMTCT", + "text": "PMTCT", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "PMTCT", + "openmrs_entity_parent": "" + } + }, + { + "name": "TB", + "text": "TB", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "TB", + "openmrs_entity_parent": "" + } + }, + { + "name": "PWID", + "text": "PWID", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "PWID", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please specify", + "dependent_calculations": [ + "problem" + ], + "subjects": "on_art:map" + }, + { + "name": "problem_for_not_on_art", + "type": "radio_group", + "properties": { + "text": "Lost to Followup Clinic" + }, + "meta_data": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "problem" + }, + "options": [ + { + "name": "Prep", + "text": "Prep", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "Prep", + "openmrs_entity_parent": "" + } + }, + { + "name": "TB", + "text": "TB", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "TB", + "openmrs_entity_parent": "" + } + }, + { + "name": "PWID", + "text": "PWID", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "PWID", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please specify", + "dependent_calculations": [ + "problem" + ], + "subjects": "on_art:map" + }, + { + "name": "chw_referral_hf", + "type": "spinner", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "chw_referral_hf", + "openmrs_entity_parent": "" + }, + "properties": { + "text": "CHW Location" + }, + "options": [], + "required_status": "yes:Please specify" + }, + { + "name": "last_appointment_date", + "type": "datetime_picker", + "properties": { + "hint": "Please select the Last appointment date", + "type": "date_picker", + "display_format": "dd/MM/yyyy", + "max_date": "today" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "last_appointment_date", + "openmrs_entity_parent": "" + }, + "required_status": "true:Please specify the Last appointment date" + } + ] + } + ] +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/routine_home_visit.json b/opensrp-chw-hf/src/main/assets/json.form/routine_home_visit.json index 7b7c7a435..e8d767904 100644 --- a/opensrp-chw-hf/src/main/assets/json.form/routine_home_visit.json +++ b/opensrp-chw-hf/src/main/assets/json.form/routine_home_visit.json @@ -18,11 +18,6 @@ "openmrs_data_type": "end", "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" }, - "today": { - "openmrs_entity_parent": "", - "openmrs_entity": "encounter", - "openmrs_entity_id": "encounter_date" - }, "deviceid": { "openmrs_entity_parent": "", "openmrs_entity": "concept", @@ -71,106 +66,91 @@ "options": [ { "key": "chk_maternal_nutrition", - "text": "3. Maternal nutrition during breastfeeding", - "value": false, + "text": "Maternal nutrition during breastfeeding", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_hiv_aids", - "text": "5. HIV/AIDS general information", - "value": false, + "text": "HIV/AIDS general information", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_pmtc_for_mother", - "text": "6. PMTCT for the mother", - "value": false, + "text": "PMTCT for the mother", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_malaria_prevention", - "text": "7. Malaria prevention", - "value": false, + "text": "Malaria prevention", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_hiv_exposed_infant", - "text": "15. Follow-up for the HIV-exposed infant", - "value": false, + "text": "Follow-up for the HIV-exposed infant", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_breast_feeding", - "text": "16. Breastfeeding", - "value": false, + "text": "Breastfeeding", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_birth_registration", - "text": "19. Birth registration", - "value": false, + "text": "Birth registration", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_complementary_feeding", - "text": "20. Complementary feeding", - "value": false, + "text": "Complementary feeding", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_growth_and_dev", - "text": "21. Growth and development", - "value": false, + "text": "Growth and development", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_immunization", - "text": "22. Immunisation", - "value": false, + "text": "Immunisation", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_newborn_danger", - "text": "23. Newborn danger signs", - "value": false, + "text": "Newborn danger signs", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_infection", - "text": "24. Infection prevention and control", - "value": false, + "text": "Infection prevention and control", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_prevention_of_accidents", - "text": "25. Prevention of accidents", - "value": false, + "text": "Prevention of accidents", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_gender_issues", - "text": "26. Gender issues", - "value": false, + "text": "Gender issues", "openmrs_entity": "concept", "openmrs_entity_id": "" }, { "key": "chk_none", "text": "None", - "value": false, "openmrs_entity": "concept", "openmrs_entity_id": "" } diff --git a/opensrp-chw-hf/src/main/assets/json.form/sub_form/labour_and_delivery_registration_past_obstetric_history_sub_form.json b/opensrp-chw-hf/src/main/assets/json.form/sub_form/labour_and_delivery_registration_past_obstetric_history_sub_form.json new file mode 100644 index 000000000..5e7669ed2 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/sub_form/labour_and_delivery_registration_past_obstetric_history_sub_form.json @@ -0,0 +1,278 @@ +{ + "content_form": [ + { + "key": "year", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "year", + "type": "edit_text", + "edit_type": "number", + "hint": "Year", + "v_regex": { + "value": "(19[789]\\d|20[012]\\d)", + "err": "Please enter a valid Year" + }, + "v_required": { + "value": true, + "err": "Please enter the year" + } + }, + { + "key": "maternal_complications_during_labour", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "maternal_complications_during_labour", + "type": "check_box", + "label": "Complications", + "combine_checkbox_option_values": "true", + "label_text_style": "normal", + "text_color": "#C0C0C0", + "exclusive": [ + "chk_none" + ], + "options": [ + { + "key": "chk_aph", + "text": "APH", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_aph" + }, + { + "key": "chk_prom", + "text": "Pre-mature Rupture of Membrane (PROM)", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_prom" + }, + { + "key": "chk_high_bp", + "text": "High BP", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_high_bp" + }, + { + "key": "chk_pre_eclampsia", + "text": "Pre-eclampsia", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_pre_eclampsia" + }, + { + "key": "chk_eclampsia", + "text": "Eclampsia", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_eclampsia" + }, + { + "key": "chk_anaemia", + "text": "Anaemia", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_anaemia" + }, + { + "key": "chk_malaria", + "text": "Malaria", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_malaria" + }, + { + "key": "chk_hiv_stage_3_or_4", + "text": "HIV + Stage III or IV", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_hiv_stage_3_or_4" + }, + { + "key": "chk_fgm", + "text": "FGM", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_fgm" + }, + { + "key": "chk_iufd", + "text": "IUFD", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_iufd" + }, + { + "key": "chk_pph", + "text": "PPH", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_pph" + }, + { + "key": "chk_obstructed_labour", + "text": "Obstructed labour", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_obstructed_labour" + }, + { + "key": "chk_retained_placenta", + "text": "Retained placenta", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_retained_placenta" + }, + { + "key": "chk_3_degree_tear", + "text": "Third degree tear", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_3_degree_tear" + }, + { + "key": "chk_ruptured_uterus", + "text": "Ruptured uterus", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_ruptured_uterus" + }, + { + "key": "chk_sepsis", + "text": "Sepsis", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_sepsis" + }, + { + "key": "chk_others", + "text": "Other (Specify)", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_others" + }, + { + "key": "chk_none", + "text": "None", + "value": false, + "openmrs_entity": "concept", + "openmrs_entity_id": "chk_none" + } + ], + "v_required": { + "value": "true", + "err": "Please pick at least one" + } + }, + { + "key": "other_maternal_complications_during_labour", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "other_maternal_complications_during_labour", + "type": "edit_text", + "hint": "Other complications", + "v_required": { + "value": true, + "err": "Please specify other complications" + }, + "relevance": { + "step1:maternal_complications_during_labour": { + "ex-checkbox": [ + { + "or": [ + "chk_others" + ] + } + ] + } + } + }, + { + "key": "historic_mode_of_delivery", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "historic_mode_of_delivery", + "label": "Method of delivery", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "spontaneous_vaginal_delivery", + "text": "Spontaneous vertex delivery", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "spontaneous_vaginal_delivery" + }, + { + "key": "cesarean", + "text": "Cesarean", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "cesarean" + }, + { + "key": "vacuum_extraction", + "text": "Vacuum Extraction", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "vacuum_extraction" + }, + { + "key": "breech_delivery", + "text": "Breech Delivery", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "breech_delivery" + } + ], + "v_required": { + "value": true, + "err": "Please select an option" + } + }, + { + "key": "alive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "alive", + "label": "Was the child born alive?", + "text_color": "#000000", + "type": "native_radio", + "options": [ + { + "key": "yes", + "text": "Yes", + "openmrs_entity": "concept", + "openmrs_entity_id": "yes" + }, + { + "key": "no", + "text": "No", + "openmrs_entity": "concept", + "openmrs_entity_id": "no" + } + ], + "v_required": { + "value": "true", + "err": "Please select if the child was born alive" + } + }, + { + "key": "reason_for_child_not_born_alive", + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_child_not_born_alive", + "type": "edit_text", + "hint": "Reason as to why the child was not born alive", + "v_required": { + "value": true, + "err": "Please specify the reason" + }, + "relevance": { + "step1:alive": { + "type": "string", + "ex": "equalTo(., \"no\")" + } + } + } + ] +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/json.form/tb_community_followup_referral.json b/opensrp-chw-hf/src/main/assets/json.form/tb_community_followup_referral.json new file mode 100644 index 000000000..9efbbe98e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/tb_community_followup_referral.json @@ -0,0 +1,151 @@ +{ + "form": "TB Community Followup", + "count": "1", + "encounter_type": "TB Community Followup", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/tb_community_followup_referral_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "TB Community Followup Referral", + "fields": [ + { + "name": "reasons_for_issuing_community_referral", + "type": "radio_group", + "properties": { + "text": "Reasons for issuing community followup referral" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reasons_for_issuing_community_referral", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "missed_appointment", + "text": "Missed Appointment", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "missed_appointment", + "openmrs_entity_parent": "" + } + }, + { + "name": "lost_to_followup", + "text": "Lost to followup client", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "lost_to_followup", + "openmrs_entity_parent": "" + } + }, + { + "name": "Other", + "text": "Other", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "Other", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select reason for issuing the referral", + "dependent_calculations": [ + "tb_community_referral_date" + ] + }, + { + "name": "reason_for_issuing_community_referral_other", + "type": "text_input_edit_text", + "properties": { + "hint": "Other Reasons", + "type": "name" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "reason_for_issuing_community_referral_other", + "openmrs_entity_parent": "reasons_for_issuing_community_referral" + }, + "required_status": "true:Please specify other reasons", + "subjects": "reasons_for_issuing_community_referral:map" + }, + { + "name": "last_client_visit_date", + "type": "datetime_picker", + "properties": { + "hint": "Client's last facility visit date", + "type": "date_picker", + "display_format": "dd/MM/yyyy", + "max_date": "today" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "last_client_visit_date", + "openmrs_entity_parent": "" + }, + "required_status": "true:Please specify the client's last facility visit date", + "subjects": "reasons_for_issuing_community_referral:map" + }, + { + "name": "comment_tb_community_followup", + "type": "text_input_edit_text", + "properties": { + "hint": "Remarks/Comments" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment_tb_community_followup", + "openmrs_entity_parent": "" + }, + "required_status": "false" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form/tb_outcome.json b/opensrp-chw-hf/src/main/assets/json.form/tb_outcome.json new file mode 100644 index 000000000..5959f3c6d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/tb_outcome.json @@ -0,0 +1,314 @@ +{ + "form": "TB Outcome", + "count": "1", + "encounter_type": "TB Outcome", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/tb_outcome_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "TB Problems Outcome", + "fields": [ + { + "name": "problem", + "type": "multi_choice_checkbox", + "properties": { + "text": "Pick problem/condition associated with the client." + }, + "meta_data": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_entity_id": "problem" + }, + "options": [ + { + "name": "coughing_blood", + "text": "Coughing up blood or sputum", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "coughing_blood", + "openmrs_entity_parent": "" + } + }, + { + "name": "pain_in_the_chest", + "text": "Pain in the chest", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "cough_lasting_3_weeks_or_more", + "openmrs_entity_parent": "" + } + }, + { + "name": "cough_lasting_3_weeks_or_more", + "text": "A bad cough that lasts 3 weeks or longer", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "cough_lasting_3_weeks_or_more", + "openmrs_entity_parent": "" + } + }, + { + "name": "fever", + "text": "Fever", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "fever", + "openmrs_entity_parent": "" + } + }, + { + "name": "weight_loss", + "text": "Weight loss", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "weight_loss", + "openmrs_entity_parent": "" + } + }, + { + "name": "lack_of_appetite", + "text": "Lack of appetite", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "lack_of_appetite", + "openmrs_entity_parent": "" + } + }, + { + "name": "night_sweats", + "text": "Night Sweats", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "night_sweats", + "openmrs_entity_parent": "" + } + }, + { + "name": "Other", + "text": "Other", + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "Other", + "openmrs_entity_parent": "" + } + }, + { + "name": "None", + "text": "None", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "", + "openmrs_entity_id": "None", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please specify client's problems", + "dependent_calculations": [ + "tb_facility_visit_date" + ] + }, + { + "name": "problem_other", + "type": "text_input_edit_text", + "properties": { + "hint": "Other Problems", + "type": "name" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "problem_other", + "openmrs_entity_parent": "problem" + }, + "required_status": "true:Please specify other symptoms", + "subjects": "problem:map" + }, + { + "name": "action_taken_tb_problems", + "type": "radio_group", + "properties": { + "text": "Action taken by health facility." + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "action_taken_tb_problems", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "no_action_taken", + "text": "No action taken", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no_action_taken", + "openmrs_entity_parent": "" + } + }, + { + "name": "tested", + "text": "Tested", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "tested", + "openmrs_entity_parent": "" + } + }, + { + "name": "referred", + "text": "Referred", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "referred", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select action taken" + }, + { + "name": "test_results", + "type": "radio_group", + "properties": { + "text": "Select client’s TB test results." + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "test_results", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "positive", + "text": "Positive", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "positive", + "openmrs_entity_parent": "" + } + }, + { + "name": "negative", + "text": "Negative", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "negative", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the test results", + "subjects": "action_taken_tb_problems:map" + }, + { + "name": "enrolled_to_clinic", + "type": "radio_group", + "properties": { + "text": "Is the client enrolled to TB clinic?" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "enrolled_to_clinic", + "openmrs_entity_parent": "" + }, + "options": [ + { + "name": "yes", + "text": "Yes", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "yes", + "openmrs_entity_parent": "" + } + }, + { + "name": "no", + "text": "No", + "is_exclusive": true, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "no", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please select the answer", + "subjects": "test_results:map" + }, + { + "name": "tb_clinic_number", + "type": "text_input_edit_text", + "properties": { + "hint": "Please fill client's TB Clinic number", + "type": "name" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "tb_clinic_number", + "openmrs_entity_parent": "" + }, + "required_status": "true:Please fill client's CTC number", + "subjects": "enrolled_to_clinic:map" + }, + { + "name": "comment_tb_problems", + "type": "text_input_edit_text", + "properties": { + "hint": "Remarks/Comments" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "comment_tb_problems", + "openmrs_entity_parent": "" + }, + "required_status": "false" + } + ] + } + ] +} + diff --git a/opensrp-chw-hf/src/main/assets/json.form/tb_registration.json b/opensrp-chw-hf/src/main/assets/json.form/tb_registration.json new file mode 100644 index 000000000..e9ffd03bf --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/json.form/tb_registration.json @@ -0,0 +1,294 @@ +{ + "form": "TB Registration form", + "count": "1", + "encounter_type": "TB Registration", + "entity_id": "", + "relational_id": "", + "rules_file": "rule/tb_registration_form_rules.yml", + "metadata": { + "start": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "start", + "openmrs_entity_id": "163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "end": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "end", + "openmrs_entity_id": "163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "deviceid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "deviceid", + "openmrs_entity_id": "163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "subscriberid": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "subscriberid", + "openmrs_entity_id": "163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "simserial": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "simserial", + "openmrs_entity_id": "163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "phonenumber": { + "openmrs_entity_parent": "", + "openmrs_entity": "concept", + "openmrs_data_type": "phonenumber", + "openmrs_entity_id": "163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + }, + "encounter_location": "", + "look_up": { + "entity_id": "", + "value": "" + } + }, + "steps": [ + { + "title": "TB Clients Registration form", + "fields": [ + { + "name": "community_client_tb_registration_number", + "type": "text_input_edit_text", + "properties": { + "hint": "Client TB Clinic Registration Number" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "community_client_tb_registration_number", + "openmrs_entity_parent": "" + }, + "required_status": "yes: Please fill the clients TB clinic registration number", + "dependent_calculations": [ + "tb_registration_date", + "client_tb_status_during_registration", + "test_results" + ] + }, + { + "name": "place_of_domicile", + "type": "spinner", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "place_of_domicile", + "openmrs_entity_parent": "" + }, + "properties": { + "text": "Place of Domicile" + }, + "options": [ + { + "name": "a_family_with_tb_patient", + "text": "A family with TB patient", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "a_family_with_tb_patient", + "openmrs_entity_parent": "" + } + }, + { + "name": "a_family_without_tb_patient", + "text": "A family without TB patient", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "a_family_without_tb_patient", + "openmrs_entity_parent": "" + } + }, + { + "name": "community_gathering", + "text": "Community Gathering", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "community_gathering", + "openmrs_entity_parent": "" + } + }, + { + "name": "pharmacy", + "text": "Pharmacy", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "pharmacy", + "openmrs_entity_parent": "" + } + }, + { + "name": "traditional_doctors", + "text": "Traditional doctors", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "traditional_doctors", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please specify place of domicile" + }, + { + "name": "district_council_number_of_current_tb_client", + "type": "text_input_edit_text", + "properties": { + "hint": "District council number of the TB client in the family" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "district_council_number_of_current_tb_client", + "openmrs_entity_parent": "" + }, + "required_status": "yes:Fill in the district council number of the TB client in the family", + "subjects": "place_of_domicile:text" + }, + { + "name": "community_gathering", + "type": "spinner", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "community_gathering", + "openmrs_entity_parent": "" + }, + "properties": { + "text": "Type of community gathering" + }, + "options": [ + { + "name": "school", + "text": "School", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "school", + "openmrs_entity_parent": "" + } + }, + { + "name": "worship_houses", + "text": "Worship houses", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "worship_houses", + "openmrs_entity_parent": "" + } + }, + { + "name": "mining", + "text": "Mining", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "mining", + "openmrs_entity_parent": "" + } + }, + { + "name": "public_meetings", + "text": "Public meetings", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "public_meetings", + "openmrs_entity_parent": "" + } + }, + { + "name": "prison", + "text": "Prison", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "prison", + "openmrs_entity_parent": "" + } + }, + { + "name": "others", + "text": "Others", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "others", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please specify the type of community gathering", + "subjects": "place_of_domicile:text" + }, + { + "name": "other_community_gathering", + "type": "text_input_edit_text", + "properties": { + "hint": "Specify other community gathering" + }, + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "other_community_gathering", + "openmrs_entity_parent": "" + }, + "required_status": "yes:Please specify other community gathering", + "subjects": "community_gathering:text" + }, + { + "name": "client_tb_screening_results", + "type": "spinner", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "client_tb_screening_results", + "openmrs_entity_parent": "" + }, + "properties": { + "text": "Client's screening results" + }, + "options": [ + { + "name": "coughing", + "text": "Coughing", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "coughing", + "openmrs_entity_parent": "" + } + }, + { + "name": "hemoptysis", + "text": "Sputum with blood (hemoptysis) ", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "hemoptysis", + "openmrs_entity_parent": "" + } + }, + { + "name": "fever", + "text": "Fever", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "fever", + "openmrs_entity_parent": "" + } + }, + { + "name": "weight_lose", + "text": "Weight lose", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "weight_lose", + "openmrs_entity_parent": "" + } + }, + { + "name": "history_of_night_sweats", + "text": "History of night sweats", + "meta_data": { + "openmrs_entity": "concept", + "openmrs_entity_id": "history_of_night_sweats", + "openmrs_entity_parent": "" + } + } + ], + "required_status": "yes:Please specify clients screening results" + } + ] + } + ] +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/reports/anc-taarifa-ya-mwezi.html b/opensrp-chw-hf/src/main/assets/reports/anc-taarifa-ya-mwezi.html new file mode 100644 index 000000000..511a7619e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/anc-taarifa-ya-mwezi.html @@ -0,0 +1,775 @@ + + + + + + + + Taarifa ya mwezi ANC + + + + + +
+

Taarifa ya Mwezi Toka Kliniki (ANC)

+

TAARIFA YA [MWEZI/MWAKA]:

+

KITUO:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Na.MaelezoUmri Miaka 10 -14Umri Miaka 15 - 19Umri Miaka 20 - 24Umri Miaka 25 - 29Umri Miaka 30 - 34 Umri Miaka 35 na zaidiJumla
1Idadi ya Wajawazito Waliotegemewa
2Hudhurio la kwanza
2aUmri wa mimba chini ya wiki 12 (⩽12weeks)
2bUmri wa mimba wiki 12 au zaidi (12+ weeks)
Jumla ya hudhurio la Kwanza (2a + 2b)
2cWateja wote wa marudio
2dHudhurio la nne au zaidi wajawazito wote
Jumla ya mahudhurio yote (2a+2b+2c)
2eIdadi ya wajawazito waliopima wingi wa damu hudhurio la kwanza
3Wajawazito waliopewa Chanjo ya TT2+
4Vidokezo vya Hatari
4aMimba 4 au zaidi
4bUmri chini ya miaka 20
4cUmri zaidi ya miaka 35 kwa mimba ya kwanza
4dUpungufu mkubwa wa damu ⩽8.5g/dl - Anaemia hudhurio la kwanza +
4eShinikizo la damu (BP => 140/90mm/hg)
4fKifua kikuu
4gSukari kwenye mkojo
4hProtein kwenye mkojo
4iWajawazito waliopima Kaswende
4jWaliogundulika na maambukizi ya Kaswende
4kWaliopata matibabu ya Kaswende
4lWenza/Waume waliopima Kaswende
4mWenza/Waume Waliogundulika na maambukizi ya Kaswende
4nWenza/Waume waliopata matibabu ya Kaswende
4oWaliopatikana na magonjwa ya maambukizo ya ngono yasiyo kaswende
4pWaliopata tiba sahihi ya magonjwa ya maambukizo ya ngono yasiyo + kaswende +
4qWenza/waume waliopatikana na magonjwa ya maambukizo ya ngono yasiyo + kaswende +
4rWenza/waume waliopata tiba sahihi ya magonjwa ya maambukizo ya ngono + yasiyo + kaswende +
5PMTCT
5aTayari wana maambukizi ya VVU kabla ya kuanza kliniki
5bWajawazito wote waliopata ushauri nasaha kabla ya kupima VVU + kliniki +
5cWajawazito Waliopima VVU kipimo cha kwanza kliniki
5dWajawazito Waliokutwa na VVU (positive) kipimo cha kwanza
5eWajawazito Waliokutwa na VVU (positive) kipimo cha kwanza walio chini + ya umri wa + miaka 25 +
5fWajawazito waliopata ushauri baada ya kupima
5gWajawazito waliopimwa VVU na mwenza wao (Couple) kwa pamoja katika + kliniki ya + wajawazito +
5hWajawazito waliopima VVU kipimo cha pili
5iWajawazito waliokutwa na maambukizi ya VVU kipimo cha pili
5jWenza waliopima VVU kipimo cha kwanza Kliniki ya wajawazito
5kWenza Waliogundulika kuwa na maambukizi ya VVU kipimo cha kwanza + katika kliniki + wa wajawazito +
5lWenza waliopima VVU kipimo cha pili Kliniki ya wajawazito
5mWenza waliogundulika kuwa na maambukizi ya VVU kipimo cha pili katika + kliniki ya + wajawazito +
5nWajawazito na wenza waliopata majibu tofauti (discordant) baada ya + kupima VVU + kliniki ya wajawazito +
5oWaliopata ushauri juu ya ulishaji wa mtoto
5pWajawazito waliopima VVU kipimo cha kwanza walio chini ya umri wa + miaka 25 +
6Malaria
6aWaliopewa LLIN
6bWaliopima Malaria kutumia mRDT/BS
6cWaliopima Malaria positive
6dWaliopewa IPT2
6eWaliopewa IPT3
6fWaliopewa IPT4
Huduma Nyingine
7Waliopewa Iron/Folic Acid (I,F,IFA) vidonge vya kutosha mpaka + hudhurio + linalofuata +
8Waliopewa Dawa za minyoo (Albendazole / Mebendazole)
9Waliopewa ushauri wa uzazi wa mpango
10Waliopewa rufaa wakati wa ujauzito
11Waliopewa rufaa kwenda CTC
+ + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/reports/cbhs-taarifa-ya-mwezi.html b/opensrp-chw-hf/src/main/assets/reports/cbhs-taarifa-ya-mwezi.html new file mode 100644 index 000000000..61dbd598f --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/cbhs-taarifa-ya-mwezi.html @@ -0,0 +1,415 @@ + + + + + + + Taarifa ya mwezi CBHS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Na.ViashiriaJUMLACHINI YA MWAKA MMOJAMIAKA 1-5MIAKA 6-9MIAKA 10-14MIAKA 15-19MIAKA 20-24MIAKA 25-49MIAKA 50-59MIAKA 60+
MEKEMEKEMEKEMEKEMEKEMEKEMEKEMEKEMEKEMEKE
1a + Idadi ya wateja waliowahi kuandikishwa kwenye huduma za VVU na + UKIMWI katika jamii hadi kufikia mwisho wa mwezi uliopita (Wakiwemo + waliohamia). +
1b + Wateja wanao endelea na huduma mwezi huu +
2a + Idadi ya wateja wapya walio andikishwa mwezi huu +
2bSababu za Usajili
1. Maambukizo ya VVU
2. Kifua Kikuu
+ 3. Mwanaume anayefanya ngono na mwanaume mwenzake +
4. Mwanamke anayefanya biashara ya ngono
5. Mtoto aliyezaliwa na mama mwenye VVU
6. Mtoto ambaye hajapimwa VVU
7. Mtoto anayefanyiwa ukatili
8. Mtu aliyenyanyaswa kijinsia
9. Mtu anayejidunga
10. Mama mjamzito
11. Mama anayenyonyesha
2cHali ya maambukizo ya VVU
1. Walioambukizwa
2. Hawajaambukizwa
3. Haijulikani
2dHuduma iliyotolewa
+ 1. Huduma ya ushauri nasaha na upimaji wa VVU katika jamii +
+ 2. Huduma za dawa za kupunguza makali ya VVU katika jamii +
+ 3. Huduma za kuzuia maambukizi kutoka kwa mama kwenda kwa mtoto + katika jamii +
+ 4.Huduma shirikishi za kifua kikuu na VVU katika jamii +
+ 5. Huduma za kuzuia kuenea magonjwa ya ngono katika jamii +
6. Huduma kwa makundi maalumu
+ 7. Huduma za kuzuia ukatili wa kijinsia na ukatili dhidi ya watoto + katika jamii +
8. Huduma za kisaikolojia katika jamii
9. Elimu ya tohara katika jamii
+ 10. Huduma za uzazi wa mpango na ugawaji kondomu +
+ 11. Huduma ya ugawaji wa vitendanishi vya JIPIME +
3 + Idadi ya wateja waliowahi kuandikishwa kwenye huduma za VVU na + UKIMWI katika jamii (1a + 2a) +
4 + Idadi ya wateja wapya na wanao endelea kupata huduma mwezi huu ( 1b + + 2a) +
5 + Idadi ya wateja ambao hawapatiwi tena huduma mwezi huu + JumlaWamefariki + Wamehamishiwa kwenye kituo kingine cha huduma za tiba na matunzo + WamehamaWamejitoaAmefuzu huduma
Msaada wa kisheriaVikundi vya kusaidianaRufaa kwenda huduma zingine
6 + Idadi ya wateja waliopewa rufaa kwenda kwenye huduma nyingine +
7 + Idadi ya rufaa za wateja zilizofanikiwa +
+ + Jumlawaliopata mafunzo kulingana na miongozo ya kitaifa + Hawakupata mafunzo kulingana na miongozo ya kitaifa +
8 + Idadi ya watoa Huduma za VVU na UKIMWI ngazi ya jamii wanaotoa huduma mwezi huu
+
+ + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/reports/cdp_reports/condom-distribution-issuing-report-at-the-facility.html b/opensrp-chw-hf/src/main/assets/reports/cdp_reports/condom-distribution-issuing-report-at-the-facility.html new file mode 100644 index 000000000..50eb1e4c2 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/cdp_reports/condom-distribution-issuing-report-at-the-facility.html @@ -0,0 +1,33 @@ + + + + + + + + Issuing Report + + + + + +
+

Report for male and female issued at the facility

+

Condom Issued [MWEZI/MWAKA]:

+

KITUO:

+
+ + + + + + + + + + + +
ID Male CondomsFemale Condoms
+ + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/reports/cdp_reports/condom-distribution-issuing-report-from-the-facility.html b/opensrp-chw-hf/src/main/assets/reports/cdp_reports/condom-distribution-issuing-report-from-the-facility.html new file mode 100644 index 000000000..ce1a29f51 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/cdp_reports/condom-distribution-issuing-report-from-the-facility.html @@ -0,0 +1,33 @@ + + + + + + + + Issuing Report + + + + + +
+

Report for male and female issued from the facility

+

Condom Issued [MWEZI/MWAKA]:

+

KITUO:

+
+ + + + + + + + + + + +
ID Male CondomsFemale Condoms
+ + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/reports/cdp_reports/condom-distribution-receiving-report.html b/opensrp-chw-hf/src/main/assets/reports/cdp_reports/condom-distribution-receiving-report.html new file mode 100644 index 000000000..58689d008 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/cdp_reports/condom-distribution-receiving-report.html @@ -0,0 +1,35 @@ + + + + + + + + Report of male and female condoms Received at health facility + + + + + +
+

Report of male and female condoms Received at health facility

+

Condom Receiving Report [MWEZI/MWAKA]:

+

KITUO:

+
+ + + + + + + + + + + + + +
IDSourceMale Condom BrandFemale Condom BrandNumber of Male CondomNumber of Female Condom
+ + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/reports/kvp-report.html b/opensrp-chw-hf/src/main/assets/reports/kvp-report.html new file mode 100644 index 000000000..7d90eefa5 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/kvp-report.html @@ -0,0 +1,4943 @@ + + + + + + + + + + + + + +
+

MAKUNDI MAALUM YA WALIOPO KWENYE HATARI YA KUPATA MAAMBUKIZI YA VVU

+

TAARIFA YA [MWEZI/MWAKA]:

+

KITUO:

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SEHEMU E: VIASHIRIAWajidungaWajidunga
WanaumeWanawake
Jumla<1010-1415-1920-2425-2930-3435-3940-4445-49>=50<1010-1415-1920-2425-2930-3435-3940-4445-49>=50
E1.USAJILI WA WATEJA
1.Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti +
E2.KINGA
2.Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini + kinachotakiwa (minimum standards) katika kipindi cha ripoti
3.Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti
4.Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti
5.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti
6.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti
7.Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga
8.Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti
9.Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti
10.Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti
11.Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya)
12.Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa
13.Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu + mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6
14.Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti
15.Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) + wakati wa mahudhurio katika kipindi cha ripoti
16.Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti
E3.HIV CASCADE
17Idadi ya wateja wapya waliofikiwa na huduma za upimaji na walioanzishiwa dawa za ARV katika kipindi cha ripoti
17a.Wapya waliopimwa na kupokea majibu
17b.Wapya wenye majibu ya VVU chanya
17c.Wapya waliosajiliwa huduma ya Tiba na Matunzo
17d.Wapya walioanzishiwa ART
E4.UCHUNGUZI WA KIFUA KIKUU
18Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti
E5.KONDOMU NA VIPEPERUSHI VYA ELIMU YA AFYA
19Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti
20Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti
21Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa
E6.DAWA YA USAIDIZI YA METHADONE
22Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SEHEMU E: VIASHIRIAWatumiaji wa njia nyingine za dawa za kulevyaWatumiaji wa njia nyingine za dawa za kulevya
WanaumeWanawake
Jumla<1010-1415-1920-2425-2930-3435-3940-4445-49>=50<1010-1415-1920-2425-2930-3435-3940-4445-49>=50
E1.USAJILI WA WATEJA
1.Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti +
E2.KINGA
2.Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini + kinachotakiwa (minimum standards) katika kipindi cha ripoti
3.Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti
4.Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti
5.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti
6.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti
7.Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga
8.Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti
9.Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti
10.Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti
11.Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya)
12.Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa
13.Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu + mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6
14.Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti
15.Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) + wakati wa mahudhurio katika kipindi cha ripoti
16.Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti
E3.HIV CASCADE
17Idadi ya wateja wapya waliofikiwa na huduma za upimaji na walioanzishiwa dawa za ARV katika kipindi cha ripoti
17a.Wapya waliopimwa na kupokea majibu
17b.Wapya wenye majibu ya VVU chanya
17c.Wapya waliosajiliwa huduma ya Tiba na Matunzo
17d.Wapya walioanzishiwa ART
E4.UCHUNGUZI WA KIFUA KIKUU
18Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti
E5.KONDOMU NA VIPEPERUSHI VYA ELIMU YA AFYA
19Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti
20Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti
21Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa
E6.DAWA YA USAIDIZI YA METHADONE
22Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SEHEMU E: VIASHIRIAWanawake wanaofanya biashara ya ngono
Wanawake
Jumla<1010-1415-1920-2425-2930-3435-3940-4445-49>=50
E1.USAJILI WA WATEJA
1.Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti +
E2.KINGA
2.Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini + kinachotakiwa (minimum standards) katika kipindi cha ripoti
3.Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti
4.Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti
5.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti
6.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti
7.Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga
8.Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti
9.Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti
10.Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti
11.Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya)
12.Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa
13.Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu + mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6
14.Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti
15.Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) + wakati wa mahudhurio katika kipindi cha ripoti
16.Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti
E3.HIV CASCADE
17Idadi ya wateja wapya waliofikiwa na huduma za upimaji na walioanzishiwa dawa za ARV katika kipindi cha ripoti
17a.Wapya waliopimwa na kupokea majibu
17b.Wapya wenye majibu ya VVU chanya
17c.Wapya waliosajiliwa huduma ya Tiba na Matunzo
17d.Wapya walioanzishiwa ART
E4.UCHUNGUZI WA KIFUA KIKUU
18Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti
E5.KONDOMU NA VIPEPERUSHI VYA ELIMU YA AFYA
19Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti
20Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti
21Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa
E6.DAWA YA USAIDIZI YA METHADONE
22Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SEHEMU E: VIASHIRIAWasichana rika balehe wanawake vijana
Wanawake
Jumla15-1920-24
E1.USAJILI WA WATEJA
1.Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti +
E2.KINGA
2.Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini + kinachotakiwa (minimum standards) katika kipindi cha ripoti
3.Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti
4.Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti
5.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti
6.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti
7.Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga
8.Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti
9.Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti
10.Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti
11.Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya)
12.Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa
13.Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu + mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6
14.Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti
15.Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) + wakati wa mahudhurio katika kipindi cha ripoti
16.Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti
E3.HIV CASCADE
17Idadi ya wateja wapya waliofikiwa na huduma za upimaji na walioanzishiwa dawa za ARV katika kipindi cha ripoti
17a.Wapya waliopimwa na kupokea majibu
17b.Wapya wenye majibu ya VVU chanya
17c.Wapya waliosajiliwa huduma ya Tiba na Matunzo
17d.Wapya walioanzishiwa ART
E4.UCHUNGUZI WA KIFUA KIKUU
18Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti
E5.KONDOMU NA VIPEPERUSHI VYA ELIMU YA AFYA
19Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti
20Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti
21Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa
E6.DAWA YA USAIDIZI YA METHADONE
22Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SEHEMU E: VIASHIRIAWanaume wanaofanya ngono na wanaume wenzao
Wanaume
Jumla<1010-1415-1920-2425-2930-3435-3940-4445-49>=50
E1.USAJILI WA WATEJA
1.Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti +
E2.KINGA
2.Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini + kinachotakiwa (minimum standards) katika kipindi cha ripoti
3.Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti
4.Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti
5.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti
6.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti
7.Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga
8.Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti
9.Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti
10.Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti
11.Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya)
12.Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa
13.Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu + mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6
14.Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti
15.Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) + wakati wa mahudhurio katika kipindi cha ripoti
16.Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti
E3.HIV CASCADE
17Idadi ya wateja wapya waliofikiwa na huduma za upimaji na walioanzishiwa dawa za ARV katika kipindi cha ripoti
17a.Wapya waliopimwa na kupokea majibu
17b.Wapya wenye majibu ya VVU chanya
17c.Wapya waliosajiliwa huduma ya Tiba na Matunzo
17d.Wapya walioanzishiwa ART
E4.UCHUNGUZI WA KIFUA KIKUU
18Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti
E5.KONDOMU NA VIPEPERUSHI VYA ELIMU YA AFYA
19Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti
20Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti
21Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa
E6.DAWA YA USAIDIZI YA METHADONE
22Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SEHEMU E: VIASHIRIAMakundi ya watu wanaohamahamaMakundi ya watu wanaohamahama
WanaumeWanawake
Jumla<1010-1415-1920-2425-2930-3435-3940-4445-49>=50<1010-1415-1920-2425-2930-3435-3940-4445-49>=50
E1.USAJILI WA WATEJA
1.Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti +
E2.KINGA
2.Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini + kinachotakiwa (minimum standards) katika kipindi cha ripoti
3.Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti
4.Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti
5.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti
6.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti
7.Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga
8.Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti
9.Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti
10.Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti
11.Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya)
12.Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa
13.Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu + mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6
14.Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti
15.Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) + wakati wa mahudhurio katika kipindi cha ripoti
16.Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti
E3.HIV CASCADE
17Idadi ya wateja wapya waliofikiwa na huduma za upimaji na walioanzishiwa dawa za ARV katika kipindi cha ripoti
17a.Wapya waliopimwa na kupokea majibu
17b.Wapya wenye majibu ya VVU chanya
17c.Wapya waliosajiliwa huduma ya Tiba na Matunzo
17d.Wapya walioanzishiwa ART
E4.UCHUNGUZI WA KIFUA KIKUU
18Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti
E5.KONDOMU NA VIPEPERUSHI VYA ELIMU YA AFYA
19Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti
20Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti
21Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa
E6.DAWA YA USAIDIZI YA METHADONE
22Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SEHEMU E: VIASHIRIAWenza wenye majibu kinzaniWenza wenye majibu kinzani
WanaumeWanawake
Jumla<1010-1415-1920-2425-2930-3435-3940-4445-49>=50<1010-1415-1920-2425-2930-3435-3940-4445-49>=50
E1.USAJILI WA WATEJA
1.Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti +
E2.KINGA
2.Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini + kinachotakiwa (minimum standards) katika kipindi cha ripoti
3.Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti
4.Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti
5.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti
6.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti
7.Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga
8.Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti
9.Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti
10.Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti
11.Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya)
12.Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa
13.Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu + mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6
14.Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti
15.Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) + wakati wa mahudhurio katika kipindi cha ripoti
16.Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti
E3.HIV CASCADE
17Idadi ya wateja wapya waliofikiwa na huduma za upimaji na walioanzishiwa dawa za ARV katika kipindi cha ripoti
17a.Wapya waliopimwa na kupokea majibu
17b.Wapya wenye majibu ya VVU chanya
17c.Wapya waliosajiliwa huduma ya Tiba na Matunzo
17d.Wapya walioanzishiwa ART
E4.UCHUNGUZI WA KIFUA KIKUU
18Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti
E5.KONDOMU NA VIPEPERUSHI VYA ELIMU YA AFYA
19Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti
20Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti
21Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa
E6.DAWA YA USAIDIZI YA METHADONE
22Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SEHEMU E: VIASHIRIAMakundi maalumu mengineMakundi maalumu mengine
WanaumeWanawake
Jumla<1010-1415-1920-2425-2930-3435-3940-4445-49>=50<1010-1415-1920-2425-2930-3435-3940-4445-49>=50
E1.USAJILI WA WATEJA
1.Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti +
E2.KINGA
2.Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini + kinachotakiwa (minimum standards) katika kipindi cha ripoti
3.Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti
4.Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti
5.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti
6.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti
7.Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga
8.Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti
9.Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti
10.Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti
11.Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya)
12.Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa
13.Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu + mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6
14.Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti
15.Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) + wakati wa mahudhurio katika kipindi cha ripoti
16.Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti
E3.HIV CASCADE
17Idadi ya wateja wapya waliofikiwa na huduma za upimaji na walioanzishiwa dawa za ARV katika kipindi cha ripoti
17a.Wapya waliopimwa na kupokea majibu
17b.Wapya wenye majibu ya VVU chanya
17c.Wapya waliosajiliwa huduma ya Tiba na Matunzo
17d.Wapya walioanzishiwa ART
E4.UCHUNGUZI WA KIFUA KIKUU
18Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti
E5.KONDOMU NA VIPEPERUSHI VYA ELIMU YA AFYA
19Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti
20Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti
21Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa
E6.DAWA YA USAIDIZI YA METHADONE
22Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SEHEMU E: VIASHIRIAJumla kuu makundi yote
Jumla Kuu
E1.USAJILI WA WATEJA
1.Idadi wa wateja wapya waliosajiliwa katika kipindi cha ripoti +
E2.KINGA
2.Idadi ya wateja wa makundi maalum waliofikiwa na huduma za kinga kufuatana na kiwango cha chini + kinachotakiwa (minimum standards) katika kipindi cha ripoti
3.Idadi ya wateja waliopata huduma za ukatili wa kijinsia katika kipindi cha ripoti
4.Idadi ya wateja waliochunguzwa maambukizi ya magonjwa ya ngono katika kipindi cha ripoti
5.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis B) katika kipindi cha ripoti
6.Idadi ya wateja waliochunguzwa maambukizi ya homa ya ini (Hepatitis C) katika kipindi cha ripoti
7.Idadi ya wateja waliotathiminiwa kutumia huduma za dawa kinga
8.Idadi ya wateja wanaostahili kuanza dawa kinga katika kipindi cha ripoti
9.Idadi ya wateja wapya ambao wameanza kutumia dawa kinga katika kipindi cha ripoti
10.Idadi ya wateja waliopata dawa kinga katika kipindi cha ripoti
11.Idadi ya wateja wanaoendelea kutumia dawa kinga katika kipindi cha ripoti (Isipokuwa wateja Wapya)
12.Idadi ya wateja waliokuja kuchukua dawa kinga mwezi mmoja baada ya kuanzishiwa
13.Idadi ya wateja waliondelea kutumia dawa kinga miezi mitatu + mfululizo baada ya kuanzishiwa katika kipindi cha miezi 6
14.Idadi ya wateja walioacha dawa kinga kwa sababu yoyote ile katika kipindi cha ripoti
15.Idadi ya wateja waliokuwa wakitumia dawa kinga na wamegundulika na VVU (New seroconversion) + wakati wa mahudhurio katika kipindi cha ripoti
16.Idadi ya wateja waliopata huduma za uzazi wa mpango katika kipindi cha ripoti
E3.HIV CASCADE
17Idadi ya wateja wapya waliofikiwa na huduma za upimaji na walioanzishiwa dawa za ARV katika kipindi cha ripoti
17a.Wapya waliopimwa na kupokea majibu
17b.Wapya wenye majibu ya VVU chanya
17c.Wapya waliosajiliwa huduma ya Tiba na Matunzo
17d.Wapya walioanzishiwa ART
E4.UCHUNGUZI WA KIFUA KIKUU
18Idadi ya wateja waliochunguzwa kifua kikuu katika kipindi cha ripoti
E5.KONDOMU NA VIPEPERUSHI VYA ELIMU YA AFYA
19Idadi ya kondomu za kike(pcs) zilizogawiwa katika kipindi cha ripoti
20Idadi ya kondomu za kiume(pcs) zilizogawiwa katika kipindi cha ripoti
21Idadi ya vipeperushi vya Elimu ya Afya vilivyotolewa
E6.DAWA YA USAIDIZI YA METHADONE
22Idadi ya wateja waliopata huduma za MAT katika kipindi cha ripoti
+ + +
+ + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/reports/labour-delivery-taarifa-ya-mwezi.html b/opensrp-chw-hf/src/main/assets/reports/labour-delivery-taarifa-ya-mwezi.html new file mode 100644 index 000000000..7e6ff672d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/labour-delivery-taarifa-ya-mwezi.html @@ -0,0 +1,1190 @@ + + + + + + + Taarifa ya mwezi Wodi ya wazazi + + + + + +
+

Taarifa ya Mwezi Kutoka wodi ya wazazi

+

TAARIFA YA [MWEZI/MWAKA]:

+

KITUO:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Na.MaelezoMiaka 10 -14Miaka 15 - 19Miaka 20 - 24Miaka 25 - 29Miaka 30 - 34Miaka 35 na zaidiJumla
1 + Waliotarajiwa kujifungua katika eneo la huduma +
2Taarifa ya Wanaojifungua
2a + Waliojifungua katika kituo cha kutolea huduma za afya +
2bWaliojifungua kabla ya kufika kituoni(BBA)
2cWaliozalishwa na wakunga wa jadi(TBA)
2d + Waliojifungua nyumbani (H) bila msaada wa TBA +
Jumla ya waliojifungua(2a+2b+2c+2d)
2eWaliozalishwa na watoa huduma wenye ujuzi
+ Asilimia ya waliojifungulia katika vituo vya kutolea huduma za afya + (2a/1)x100 +
3Taarifa kuhusu uchungu
3a + Waliojifungua baada ya saa 12 toka uchungu kuanza +
4Taarifa ya njia za kujifungua
4aKawaida (SVD)
4bVacuum (VM)
4cBreech delivery (BR)
4dCaesarian Section (CS)
Jumla (4a+4b+4c+4d)
5Matatizo kabla ya kujifungua
5aAPH
5bPre-mature Rupture of Membrane (PROM)
5cHigh BP
5dPre-eclampsia
5eEclampsia
5fAnaemia
5gMalaria
5hHIV + Stage III au IV
+ Jumla wenye matatizo kabla ya kujifungua (5a+5b+5c+5d+5e+5f+5g+5h) +
5iWaliokekektwa (FGM)
6 + Matatizo wakati na baada ya kujifungua +
6aPPH
6bPre eclampsia
6cEclampsia
6dObstructed Labour
6eRetained Placenta
6fThird degree tear
6gRuptured uterus
6hUambukizo/Sepsis
+ Jumla wenye matatizo baada ya kujifungua (6a+6b+6c+6d+6e+6f+6g+6h) +
7EmOC
7aAmepewa Antibiotic
7bAmepewa Uterotonic
7cAmepewa Magnesium Sulphate
7dAmeondolewa kwa mkono kondo la nyuma
7eAmefanyiwa MVA/D&C
7fAmeongezewa damu
8AMSTL
8a + Wanawake waliosaidiwa kutolewa kondo la nyuma kwa kuvutwa kitovu + pole pole +
8b + Wanawake waliosaidiwa kwa kukandwa kandwa nyumba ya uzazi. +
8c + Wanawake waliopata Oxytocin baada ya kujifungua (10 IU) +
8d + Wanawake waliopata Egometrine baada ya kujifungua (0.5mg) +
8e + Wanawake waliopata Misoprostol baada ya kujifungua +
9PMTCT
9aJumla waliopimwa VVU ANC
9bWaliogundulika Positive kutoka ANC
9c + Jumla waliopimwa VVU wakati na baada ya kujifungua +
9d + Waliogundulika Positive wakati na baada ya kujifungua +
Jumla walio na VVU (9b+9d)
9e + Waliochagua kunyonyesha maziwa ya mama pekee (EBF) +
9f + Waliochagua ulishaji wa maziwa mbadala (RF) +
9g + Waliopewa ARV Prophylaxis (tail) wakati wa kuruhusiwa +
9h + Waliopata rufaa kwenda kliniki ya huduma na matibabu +
10Watoto Waliozaliwa mmoja
10aJumla ya watoto waliozaliwa hai
10bWaliozaliwa hai Uzito < 2.5kg
10cWaliozaliwa hai Uzito =>2.5kg
10dWaliozaliwa wafu Macerated (MSB)
10eWaliozaliwa wafu Fresh (FSB)
10fWaliozaliwa na mama wenye VVU
10gWaliopewa dawa za ARV
+ Jumla ya watoto waliozaliwa (hai na wafu) (10a+10d+10e) +
10h + Watoto wenye APGAR Score chini ya 7 katika dakika 5 +
11Watoto Waliozaliwa mapacha
11aJumla ya watoto waliozaliwa hai
11bWaliozaliwa hai Uzito < 2.5kg
11cWaliozaliwa hai Uzito =>2.5kg
11dWaliozaliwa wafu Macerated (MSB)
11eWaliozaliwa wafu Fresh (FSB)
11fWaliozaliwa na mama wenye VVU
11gWaliopewa dawa za ARV
+ Jumla ya watoto waliozaliwa (hai na wafu) (11a+11d+11e) +
11h + Watoto wenye APGAR Score chini ya 7 katika dakika 5 +
12Watoto waliosaidiwa kupumua
12a + Idadi ya watoto Waliosaidiwa kupumua - Suction +
12b + Idadi ya watoto waliosaidiwa kupumua- stimulation +
12c + Idadi ya watoto waliosaidiwa kupumua- bag and mask +
13Huduma nyinginezo
13a + Idadi ya watoto walionyonyeshwa ndani ya saa moja baada ya kuzaliwa +
13bIdadi ya Wamama waliopewa rufaa
13cIdadi ya Watoto waliopewa rufaa
14Vifo vya Wazazi
14aWazazi waliofariki
15Uzazi wa MpangoWateja Wapya
15aWaliopewa ushauri wa uzazi wa mpango
15bWateja waliofunga kizazi
15cWateja waliowekewa kitanzi
15dWateja waliowekewa vipandikizi
15eWateja waliopewa vidonge (POP)
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Na.MaelezoMiaka 10 -14Miaka 15 - 19Miaka 20 - 24Miaka 25 - 29Miaka 30 - 34Miaka 35 na zaidiJumla
16Vifo vya Watoto Wachanga
MEKEMEKEMEKEMEKEMEKEMEKEMEKE
16aWatoto Wachanga waliofariki
+ + diff --git a/opensrp-chw-hf/src/main/assets/reports/ltfu-summary-report.html b/opensrp-chw-hf/src/main/assets/reports/ltfu-summary-report.html new file mode 100644 index 000000000..d4922a0d7 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/ltfu-summary-report.html @@ -0,0 +1,617 @@ + + + + + + + + LTFU Summary + + + + +
+
+

Muhtasari wa mwezi ngazi ya jamii kwa wateja wasiofika kliniki ya tiba na matunzo kama + ilivyopangwa

+
+

Jina la kituo :

+

Mwezi :

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Kitengo anachohudumiwa mtejaUmri/JinsiJumla
Chini ya Miaka 2Miaka 2 - 14Miaka 15 - 24Miaka 25 - 49Miaka 50+
MEKEMEKEMEKEMEKEMEKE
CTC
PrEP
PMTCT
TB
Kliniki Ya Wajidunga
Mteja Anatumia ARVs
N = Ndio
H = Hapana
Jumla ya wateja waliofuatiliwa (CTC+PMTCT+TB+KLINIKI YA WAJIDUNGA)
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Matokeo ya ufuatiliajiUmri/JinsiJumla
Chini ya Miaka 2Miaka 2 - 14Miaka 15 - 24Miaka 25 - 49Miaka 50+
MEKEMEKEMEKEMEKEMEKE
A) Mteja anahudhuria kliniki
B) Amepatikana na yuko tayari kurudi kliniki
C) Amepatikana na amerudi kliniki kuendelea na huduma
D) Amehamia kituo kingine bila taarifa
E) Amehama makazi
F) Amepatikana laknini hayuko tayari kurudi kliniki
G) Amefariki
H) Hajapatikana
Jumla ya wateja waliopatikana (A + B + D + E + F + G)
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Sababu za kutokufika KlinikiUmri/JinsiJumla
Chini ya Miaka 2Miaka 2 - 14Miaka 15 - 24Miaka 25 - 49Miaka 50+
MEKEMEKEMEKEMEKEMEKE
Alisahau
Alikuwa mgonjwa sana
Ameshindwa kujiweka wazi
Amekosa nauli
Umbali/Usafiri Mgumu
Amepata Nafuu
Hakupata Ruhusa Kazini
Alisafiri
Anatumia Tiba Mbadala
Huduma haziridhisha
Nyinginezo
+ + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/reports/mother-champion-report.html b/opensrp-chw-hf/src/main/assets/reports/mother-champion-report.html new file mode 100644 index 000000000..a2db8cfec --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/mother-champion-report.html @@ -0,0 +1,169 @@ + + + + + + + Mother Champion Report + + + + +
+
+

Majumuisho (Summary Findings) Ya Ripoti za Mwezi za Mama Vinara

+
+

Jina la kituo :

+

Mwezi :

+
+

A. Majina ya mama vinara waliofanya kazi ndani ya mwezi husika

+ + + + + + + + + + +
NoMajina ya Mama VinaraJina lililosajiliwa
+

+

B. Majumuisho ya kazi walizofanya

+
    +
  1. + Idadi ya wateja wa PMTCT waliounganishwa kwenye kikundi/vikundi vya IGA and Ushauri Nasaha + +
  2. +
  3. + Idadi ya wateja wapya wa PMTCT waliofuatiliwa na mama vinara na kuanza kutumia dawa +
  4. +
  5. + Idadi ya wateja wa PMTCT waliopotea kwenye matumizi ya dawa (LTF) na kurudishwa/kufuatiliwa + na mama vinara +
  6. +
  7. + Idadi ya vipindi alivyofundisha mama kinara/vinara kwa wateja wa PMTCT +
  8. +
  9. + Idadi ya wateja wa PMTCT walioelimishwa na mama kinara/vinara +
  10. +
  11. + Idadi ya wenza waliofuatiliwa/kuletwa kituoni kupima na kujua hali za afya zao kwa mara ya + kwanza +
  12. + +
+ + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/reports/pmtct-reports/taarifa-cross-sectional.html b/opensrp-chw-hf/src/main/assets/reports/pmtct-reports/taarifa-cross-sectional.html new file mode 100644 index 000000000..827a90991 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/pmtct-reports/taarifa-cross-sectional.html @@ -0,0 +1,213 @@ + + + + + + + + PMTCT EID CROSS-SECTIONAL MONTHLY REPORT + + + + + +
+

PMTCT EID CROSS-SECTIONAL MONTHLY REPORT

+

TAARIFA YA [MWEZI/MWAKA]:

+

KITUO:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Kipimo cha kwanza cha VVU kwa Watoto +
AIdadi ya waliopima VVU mara baada ya kuzaliwa
BIdadi ya waliopima VVU ndani ya umri wa miezi ⩽ 2 + katika hudhurio + la kwanza RCH +
CIdadi ya waliopima VVU wakiwa na umri zaidi ya miezi 2, + na pungufu au + sawa na miezi 12 +
DIdadi ya waliopima VVU wakiwa na umri zaidi ya miezi 12 +
EJumla ya watoto waliopima kipimo cha VVU wakiwa na umri + wa wiki sita + na kuendelea (B+C+D). +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Watoto waliogundulika kuwa na VVU (Kipimo cha Kwanza) na matumizi ya dawa kinga +
A1Idadi ya waliogundulika kuwa na VVU mara baada ya + kuzaliwa +
B1Idadi ya waliogundulika kuwa na VVU wakiwa na umri wa miezi + ⩽ 2 +
C1Idadi waliogundulika kuwa na VVU wakiwa na umri zaidi ya + miezi > 2, na + ⩽ 12 +
D1Idadi waliogundulika kuwa na VVU wakiwa na umri zaidi ya + miezi > 12 +
E1Idadi ya watoto waliokutwa na maambukizo ya VVU kwa + kipimo cha kwanza + waliopewa rufaa kwenda CTC + (Waliopata namba ya CTC) +
FIdadi ya Watoto waliopewa dawa kinga za ARVs
GIdadi ya Watoto waliopewa dawa kinga ya ‘Cotrimoxazole’ + (CTX) +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Kipimo cha marudio cha VVU kwa Watoto +
+ H + + Idadi ya watoto waliopima kipimo cha marudio cha VVU wakiwa na umri wa miezi 9 hadi 12 +
+ I + + Idadi ya watoto waliopima kipimo cha marudio cha VVU wiki 12 baada ya kuacha kunyonya +
+ J + + Idadi ya watoto waliopima kipimo cha uthibitisho cha VVU wakiwa na umri wa miezi 18 +
+ Watoto waliogundulika kuwa na VVU (Kipimo cha Marudio) +
+ H1 + + Idadi ya watoto waliogundulika kuwa na VVU kwa kipimo cha marudio wakiwa na umri wa miezi + 9 hadi 12 +
+ I1 + + Idadi ya watoto waliogundulika kuwa na VVU kwa kipimo cha marudio cha VVU wiki 12 baada + ya kuacha + kunyonya +
+ J1 + + Idadi ya watoto waliogundulika kuwa na VVU kwa kipimo cha uthibitisho cha VVU wakiwa na + umri wa miezi + 18 +
+ K + + Idadi ya watoto waliokutwa na maambukizo ya VVU kwa kipimo cha marudio au uthibitisho + waliopewa + rufaa kwenda CTC (Waliopata namba ya CTC) +
+ + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/reports/pmtct-reports/taarifa-ya-miezi-12.html b/opensrp-chw-hf/src/main/assets/reports/pmtct-reports/taarifa-ya-miezi-12.html new file mode 100644 index 000000000..1c666bc8f --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/pmtct-reports/taarifa-ya-miezi-12.html @@ -0,0 +1,214 @@ + + + + + + + + Taarifa ya miezi 12 + + + + + +
+

TAARIFA YA KUNDI MIEZI 12

+

COHORT YA MAMA [MWEZI/MWAKA]:

+

KITUO:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Tafuta jumla ya kundi (MAMA) +
+ A12 + + Idadi ya wajawazito na wanaonyonyesha walioandikishwa katika kundi katika mwezi husika + (Month 0) +
+ B12 + + Jumla waliohamia kliniki hi ya PMTCT (TI) tangu Month 0 +
+ C12 + + Jumla waliohama kutoka kliniki/kundi (TO+TP) tangu Month 0 +
+ D12 + + Jumla ya kundi= Net current cohort (A12+B12-C12) +
+ Matokeo ya ufuatiliaji wa mama +
+ E12 + + Idadi ya kina mama wanaoendelea na huduma (CTN katika M10 au M11 au M12) +
+ F12 + + Idadi ya kina mama waliopima kiwango cha VVU katika damu ndani ya miezi 6 ya mwisho + katika ufuatiliaji wa miezi 12 +
+ G12 + + Kina mama walio na kiwango cha VVU katika damu chini ya nakala 50/ul miezi 6 ya mwisho + katika ufuatiliaji wa miezi 12 +
+ H12 + + Wateja waliopotea (LTF) +
+ I12 + + Waliofariki (DIED) +
+ J12 + + Waliomaliza ufuatiliaji na kwonda CTC (EXIT) +
+ K12 + + % walio hai na wanatumia huduma za PMTCT [E12/(D12-J12) * 100]% +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Tafuta jumla ya kundi (Watoto) +
+ L12 + + Idadi ya watoto waliozaliwa na kina mama katika kundi la mwezi husika +
+ Matokeo ya ufuatiliaji wa mtoto +
+ M12 + + Idadi ya watoto waliopotea +
+ N12 + + Idadi ya watoto waliofariki +
+ O12 + + Idadi ya watoto walioanza kinga ya ARV (Prophylaxis) +
+ P12 + + Idadi ya watoto walioanzishiwa tiba kinga ya Cotrimoxazole ndani ya umri wa miezi 2 +
+ Q12a + + Idadi ya watoto waliopata kipimo cha kwanza cha VVU ndani ya umri wa miezi 2 +
+ Q12b + + Waliogundulika na maambukizo ya VVU ndani ya umri wa miezi 2 +
+ + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/reports/pmtct-reports/taarifa-ya-miezi-24.html b/opensrp-chw-hf/src/main/assets/reports/pmtct-reports/taarifa-ya-miezi-24.html new file mode 100644 index 000000000..3cf32b19e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/pmtct-reports/taarifa-ya-miezi-24.html @@ -0,0 +1,212 @@ + + + + + + + + Taarifa ya miezi 24 + + + + + +
+

TAARIFA YA KUNDI MIEZI 12

+

COHORT YA MAMA [MWEZI/MWAKA]:

+

KITUO:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Tafuta jumla ya kundi (MAMA) +
+ A24 + + Idadi ya wajawazito na wanaonyonyesha walioandikishwa katika kundi katika mwezi husika + (Month 0) +
+ B24 + + Jumla waliohamia kliniki hi ya PMTCT (TI) tangu Month 0 +
+ C24 + + Jumla waliohama kutoka kliniki/kundi (TO+TP) tangu Month 0 +
+ D24 + + Jumla ya kundi= Net current cohort (A12+B12-C12) +
+ Matokeo ya ufuatiliaji wa mama +
+ E24 + + Idadi ya kina mama wanaoendelea na huduma (CTN katika M24) +
+ F24 + + Wateja waliopotea (LTF) +
+ G24 + + Waliofariki (DIED) +
+ H24 + + Waliomaliza ufuatiliaji na kwenda CTC (EXIT) +
+ I24 + + % ya mama waliomaliza ufuatiliaji [H24/D24 * 100%) +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Tafuta jumla ya kundi (Watoto) +
+ J24 + + Idadi ya watoto waliozaliwa na kina mama katika kundi la mwezi husika +
+ K24 + + Watoto waliohama kliniki (TO) +
+ L24 + + Jumla ya Kundi la watoto (J24-K24) +
+ Matokeo ya ufuatiliaji wa mtoto +
+ M24 + + Watoto wasio na uambukizo, na wamemaliza ufuatiliaji +
+ N24 + + Watoto wasio na uambukizo, lakini bado wananyonya +
+ O24 + + Watoto wote wenye uambukizo wa VVU +
+ P24 + + Waliofariki +
+ Q24 + + Waliopotea +
+ R24 + + % ya watoto hai wasio na uambukizo wa VVU baada ya ufuatiliaji [(M24+N24)/ L24 * 100]% +
+ + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/reports/pmtct-reports/taarifa-ya-miezi-3.html b/opensrp-chw-hf/src/main/assets/reports/pmtct-reports/taarifa-ya-miezi-3.html new file mode 100644 index 000000000..afd251afd --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/pmtct-reports/taarifa-ya-miezi-3.html @@ -0,0 +1,179 @@ + + + + + + + + Taarifa ya miezi mitatu + + + + + +
+

TAARIFA YA KUNDI MIEZI MITATU

+

COHORT YA MAMA [MWEZI/MWAKA]:

+

KITUO:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Taarifa za mama alipoandikishwa (Month 0) +
A3Idadi ya wajawazito na wanaonyonyesha walioandikishwa katika kundi katika mwezi husika (Month 0)
+ + B3a + + Idadi umri wa miaka 10-14 +
+ + B3b + + Idadi umri wa miaka 15-19 +
+ + B3c + + Idadi umri wa miaka 20-24 +
+ + B3d + + Idadi umri wa miaka 25+ +
+ + C3a + + Idadi walioanza tiba ART(initiates) +
+ + C3b + + Idadi waliyotayari kwenye tiba ya ART +
+ Tafuta jumla ya kundi +
+ D3 + + Jumla waliohamia kliniki hii ya PMTCT(TI) tangu month 0 +
+ E3 + + Jumla waliohama kutoka kliniki hii ya PMTCT (TO) tangu month 0 +
+ F3 + + Jumla ya kundi = (A3+D3-E3) +
+ Matokeo ya ufuatiliaji wa mama +
+ G3 + + Idadi ya kina mama wanaoendelea na huduma (CTN katika M1 au M2 au M3) +
+ H3 + + Idadi waliokosa mahudhurio matatu mfululizo (M1, M2 na M3) +
+ I3 + + Waliofariki +
+ J3 + + Waliomaliza ufuatiliaji na kwenda CTC (Exit) +
+ K3 + + (Early retention)% walio hai na wanatumia huduma ya PMTCT [G3/(F3-J3)*100]% +
+ + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/reports/pnc-taarifa-ya-mwezi.html b/opensrp-chw-hf/src/main/assets/reports/pnc-taarifa-ya-mwezi.html new file mode 100644 index 000000000..0dff97a7a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/pnc-taarifa-ya-mwezi.html @@ -0,0 +1,526 @@ + + + + + + + + Taarifa ya mwezi PNC + + + + + +
+

TAARIFA YA MWEZI BAADA YA KUJIFUNGUA (POSTNATAL)

+

TAARIFA YA [MWEZI/MWAKA]:

+

KITUO:

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Na.MaelezoUmri Miaka 10 -14Umri Miaka 15 - 19Umri Miaka 20 - 24Umri Miaka 25 - 29Umri Miaka 30 - 34 Umri Miaka 35 na zaidiJumla
1aWaliohudhuria Ndani ya saa 48
1bWaliohudhuria kati ya siku ya 3-7
Jumla Waliohudhuria ndani ya siku 7 (1a+1b)
2aWaliomaliza mahudhurio yote ( saa 48, siku 3-7, siku 8-28, siku + 29-42) +
3Wenye upungufu mkubwa wa damu (Hb ⟨ 8.5 g/dl)
4Waliopata matatizo ya akili baada ya kujifungua
5Waliopata Vit. A
6Wenye msamba ulioambukizwa/Ulioachia
7Wenye fistula
8Waliojifungulia Nje ya kituo cha kutolea huduma za Afya +
8aWaliojifungua kabla ya kufika kituo cha kutolea huduma za afya + (BBA) +
8bWaliojifungulia kwa wakunga wa jadi (TBA)
8cIdadi ya waliojifungulia nyumbani)
9Uzazi wa Mpango
9aWaliopata ushauri wa uzazi wa mpango
9bWaliopata kondomu
9cWaliopata vidonge (POP)
9d1Waliopata vipandikizi (Implanon)
9d2Waliopata vipandikizi (Jadelle)
9eWaliopata kitanzi
9fKufunga uzazi (BTL)
9gWaliopata rufaa kupata njia ya uzazi wa mpango
10PMTCT
10aWaliokuja postnatal wakiwa positive
10bWaliopima VVU wakati wa postnatal (ndani ya siku 42 tangu ya + kujifungua) +
10cWaliogundulika wana VVU wakati wa postnatal (ndani ya siku 42 tangu + ya + kujifungua) +
10dWenye VVU waliochagua kunyonyesha maziwa ya mama pekee (EBF)
10eWenye VVU waliochagua kunywesha maziwa mbadala (RF)
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
11MTOTOMEKEJumla
11aWaliohudhuria Ndani ya saa 48
11bWaliohudhuria kati ya siku ya 3-7
Jumla Waliohudhuria ndani ya siku 7 (11a+11b)
11cWaliomaliza mahudhurio yote ( saa 48, siku 3- 7, siku 8-28, siku + 29-42) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
12HUDUMA KWA MTOTOMEKEJumla
12aIdadi ya watoto waliopewa BCG
12bIdadi ya watoto waliopewa OPV 0
12cIdadi ya watoto waliozaliwa na uzito wa ⟨ 2.5kg + wakapatiwa + KMC +
12dIdadi ya watoto waliozaliwa nyumbani chini ya 2.5kg
12eIdadi ya watoto waliozaliwa nyumbani walioanzishiwa huduma ya + kangaroo (KMC) +
12fWenye upungufu mkubwa wa damu (Hb ⟨ 10 g/dl au + viganja + vyeupe + sana) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
13UAMBUKIZO WA MTOTOMEKEJumla
13aWatoto wenye uambukizo mkali (septicaemia)
13bWatoto wenye uambukizo kwenye kitovu
13cWatoto wenye uambukizo kwenye ngozi
13dIdadi ya watoto wenye jaundice
14Vifo vya watoto wachanga waliozaliwa nyumbani (perinatal); neonatal +
15Waliopewa dawa ya ARV
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
16ULISHAJI WA MTOTOMEKEJumla
16aWatoto wachanga wanaonyonya maziwa ya mama pekee (EBF)
16bWatoto wachanga wanaonyweshwa maziwa mbadala (RF)
16cWatoto wachanga wanaonyweshwa maziwa ya mama na kupatiwa chakula + kingine (MF) +
+ + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/reports/report-script.js b/opensrp-chw-hf/src/main/assets/reports/report-script.js new file mode 100644 index 000000000..253c1d888 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/report-script.js @@ -0,0 +1,36 @@ +function loadData(reportKey, reportType) { + const data = JSON.parse(Android.getData(reportKey)); + const tableBody = document.getElementById("table-body"); + const keys = Object.keys(data.nameValuePairs); + const reportPeriod = document.getElementById("report_period"); + const reportingFacility = document.getElementById("reporting_facility"); + keys.forEach((key) => { + let element; + if(reportType!== null && reportType === "pnc"){ + element = document.getElementById(key.replace("pnc-","")); + }else{ + element = document.getElementById(key); + } + if (element !== null && typeof element !== "undefined") { + element.innerHTML = data.nameValuePairs[key]; + } + }); + if(typeof data!== undefined && data !== ""){ + const reportData = data.nameValuePairs.reportData.values; + + reportData.forEach((dataPoint) => { + //append to the table body a row with data + const row = document.createElement("tr"); + const dataPointKeys = Object.keys(dataPoint.nameValuePairs); + dataPointKeys.forEach((key) => { + const cell = document.createElement("td"); + cell.innerHTML = dataPoint.nameValuePairs[key]; + row.appendChild(cell); + } + ); + tableBody.appendChild(row); + }); + } + reportPeriod.innerHTML = Android.getDataPeriod(reportKey); + reportingFacility.innerHTML = Android.getReportingFacility(); +} diff --git a/opensrp-chw-hf/src/main/assets/reports/report-styles.css b/opensrp-chw-hf/src/main/assets/reports/report-styles.css new file mode 100644 index 000000000..2de1d6c9c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/report-styles.css @@ -0,0 +1,130 @@ +.show-on-print { + display: none; +} + +body, +h1, +h2, +td, +th { + font-family: "Times New Roman", serif; +} + +h1, +h2 { + font-size: 0.8rem; + text-align: center; + font-weight: 200; +} + +table { + background-color: #fff; + border: none; + width: 100%; + border-collapse: collapse; +} + +#report_period { + font-weight: 700; +} + +#reporting_facility { + font-weight: 700; +} + +th { + padding: 10px; + background: #ccc; + font-size: 0.8rem; + font-weight: 500; + text-transform: uppercase; +} + +.pnc-anc-table th { + padding: 4px; + font-size: 0.74rem; + text-transform: initial; +} + +.pnc-anc-table td { + font-size: 0.71rem; + padding: 5px; +} + +td { + text-align: initial; + padding: 10px 0; + padding-left: 10px; + font-size: 0.8rem; +} + +.pnc-anc-table td:nth-child(1) { + width: 5%; + min-width: initial; + text-align: center; +} + +td:nth-child(3) { + text-align: center; + width: 15%; +} + +.pnc-anc-table td:nth-child(3) { + width: initial; +} + +.pnc-table .list-title { + width: 30%; +} + +tbody tr > td:nth-child(2), +tbody tr > td:nth-child(4) { + text-align: center; + min-width: 50px; +} + +tbody tr > td:nth-child(1) { + min-width: 40px; + text-align: center; +} + +.pnc-anc-table td:nth-child(9) { + width: 10%; +} + +tbody .four-cols > td:nth-child(3) { + width: 50%; + text-align: initial !important; +} + +tbody .three-cols > td:nth-child(3) { + text-align: center; + min-width: 50px; +} + +.pnc-anc-table tr > td:nth-child(n + 3) { + text-align: center; +} + +.list-title { + text-align: initial !important; + font-size: 0.8rem; +} + +.pnc-anc-table .child-table { + width: 50%; +} + +.no-data { + background: #ccc; +} + +@media print { + .show-on-print { + display: block; + } + + .child-table { + width: 50%; + } +} diff --git a/opensrp-chw-hf/src/main/assets/reports/self-testing-report.html b/opensrp-chw-hf/src/main/assets/reports/self-testing-report.html new file mode 100644 index 000000000..9f719e7d7 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/reports/self-testing-report.html @@ -0,0 +1,1869 @@ + + + + + + + + + + +
+

FOMU YA RIPOTI YA UHAMASISHAJI, UFUATILIAJI WASHIRIKA NA HUDUMA ZA JIPIME + VVU NGAZI YA JAMII

+

TAARIFA YA [MWEZI/MWAKA]:

+

KITUO:

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BVIASHIRIA VYA TAKWIMUJUMLA KUUWANAUME(ME)
<11-45-910-1718-1920-2425-2930-3435-3940-4445-49>50JUMLA KUU(ME)
B1UHAMASISHAJI WA UPIMAJI VVU
1Jumla ya wateja waliohamasishwa kwa ajili ya huduma ya upimaji wa maambukizi ya + VVU. +
2Jumla ya wateja waliogawiwa kondom katika kipindi cha ripoti.
i) Wajidunga dawa za kulevya
ii) Wafungwa/Mahabusu
iii)Wanawake wanaofanya biashara ya ngono
iv)Wanaume wanaofanya ngono na wanaume wenzao
v)Vijana rika balehe
vi)Makundi Mengine
B2HUDUMA YA JIPIME VVU
3JUMLA YA VITENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BINAFSI)0
i) Wajidunga dawa za kulevya0
ii) Wafungwa/Mahabusu0
iii) Wanawake wanaofanya biashara ya ngono0
iv) Wanaume wanaofanya ngono na wanaume wenzao0
v) Vijana rika balehe
vi) Makundi Mengine0
4 Jumla ya vitendanishi vya kujipima VVU vilivyosambazwa (Washirika wa Ngono, Rafiki + Rika) +
5 Jumla ya vitendanishi vya kujipima VVU vilivyosambazwa (Binafsi, Washrika wa Ngono, + Rafiki rika); 3+4 +
6Jumla ya wateja (Washrika wa ngono, Rafiki rika) waliotumia vitendanishi vya + kujipima VVU na kurudisha majibu +
7Jumla ya wateja (Binafsi) waliotumia vitendanishi vya kujipima VVU na kurudisha + majibu +
i)Wajidunga dawa za kulevya
ii)Wafungwa/Mahabusu
iii)Wanawake wanaofanya biashara ya ngono
iv)Wanaume wanaofanya ngono na wanaume wenzao
v)Vijana rika balehe
vi)Makundi Mengine
8Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya + kujipima VVU + 0
i) Wajidunga dawa za kulevya
ii)Wafungwa/Mahabusu
iii) Wanawake wanaofanya biashara ya ngono
iv) Wanaume wanaofanya ngono na wanaume wenzao
v) Vijana rika balehe
vi) Makundi Mengine
9Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la + upimaji wa maambukizi ya VVU +
i) Wajidunga dawa za kulevya
ii) Wafungwa/Mahabusu
iii) Wanawake wanaofanya biashara ya ngono
iv) Wanaume wanaofanya ngono na wanaume wenzao
v) Vijana rika balehe
vi) Makundi Mengine
B3UFUATILIAJI WA WASHIRIKA WA INDEX
10Jumla ya washirika wa ngono,watoto wa kuzaa na wajidunga Walioorodheshwa kwa + ufuatiliaji kwenye jamii mwezi huu +
11Jumla ya washirika wa ngono,watoto wa kuzaa na wajidunga Walioorodheshwa na kufikiwa + Mwezi huu +
12Jumla ya washirika wa ngono,watoto wa kuzaa na wajidunga Wasioorodheshwa na + wamefikiwa Mwezi huu +
13Jumla ya washirika wa Ngono, watoto wa kuzaa na wajidunga Waliowahi kuorodheshwa + bila kufikiwa kwa miezi yote iliyopita (Jumla Endelevu) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BVIASHIRIA VYA TAKWIMUJUMLA KUUWANAWAKE(KE)
<11-45-910-1718-1920-2425-2930-3435-3940-4445-49>50JUMLA KUU(KE)
B1UHAMASISHAJI WA UPIMAJI VVU
1Jumla ya wateja waliohamasishwa kwa ajili ya huduma ya upimaji wa maambukizi ya + VVU. +
2Jumla ya wateja waliogawiwa kondom katika kipindi cha ripoti.
i) Wajidunga dawa za kulevya
ii) Wafungwa/Mahabusu
iii) Wanawake wanaofanya biashara ya ngono
iv) Wanaume wanaofanya ngono na wanaume wenzao
v) Vijana rika balehe
vi) Makundi Mengine
B2HUDUMA YA JIPIME VVU
3JUMLA YA VITENDANISHI VYA JIPIME VVU VILIVYOSAMBAZWA(BINAFSI)
i) Wajidunga dawa za kulevya
ii) Wafungwa/Mahabusu
iii) Wanawake wanaofanya biashara ya ngono
iv) Wanaume wanaofanya ngono na wanaume wenzao
v) Vijana rika balehe
vi) Makundi Mengine
4 Jumla ya vitendanishi vya kujipima VVU vilivyosambazwa (Washirika wa Ngono, Rafiki + Rika) +
5 Jumla ya vitendanishi vya kujipima VVU vilivyosambazwa (Binafsi, Washrika wa Ngono, + Rafiki rika); 3+4 +
6Jumla ya wateja (Washrika wa ngono, Rafiki rika) waliotumia vitendanishi vya + kujipima VVU na kurudisha majibu +
7Jumla ya wateja (Binafsi) waliotumia vitendanishi vya kujipima VVU na kurudisha + majibu +
i) Wajidunga dawa za kulevya
ii) Wafungwa/Mahabusu
iii) Wanawake wanaofanya biashara ya ngono
iv) Wanaume wanaofanya ngono na wanaume wenzao
v) Vijana rika balehe
vi) Makundi Mengine
8Jumla ya wateja (Binafsi) waliopata majibu chanya (Reactive) baada ya kujipima VVU +
i) Wajidunga dawa za kulevya
ii) Wafungwa/Mahabusu
iii) Wanawake wanaofanya biashara ya ngono
iv) Wanaume wanaofanya ngono na wanaume wenzao
v) Vijana rika balehe
vi) Makundi Mengine
9Jumla ya wateja (Binafsi) waliopewa rufaa kwenda kituo/Eneo la upimaji wa maambukizi + ya VVU +
i) Wajidunga dawa za kulevya
ii) Wafungwa/Mahabusu
iii) Wanawake wanaofanya biashara ya ngono
iv) Wanaume wanaofanya ngono na wanaume wenzao
v) Vijana rika balehe
vi) Makundi Mengine
B3UFUATILIAJI WA WASHIRIKA WA INDEX
10Jumla ya washirika wa ngono,watoto wa kuzaa na wajidunga Walioorodheshwa kwa + ufuatiliaji kwenye jamii mwezi huu +
11Jumla ya washirika wa ngono,watoto wa kuzaa na wajidunga Walioorodheshwa na kufikiwa + Mwezi huu +
12Jumla ya washirika wa ngono,watoto wa kuzaa na wajidunga Wasioorodheshwa na + wamefikiwa Mwezi huu +
13Jumla ya washirika wa Ngono, watoto wa kuzaa na wajidunga Waliowahi kuorodheshwa + bila kufikiwa kwa miezi yote iliyopita (Jumla Endelevu) +
+
+ + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/all_clients_member_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/all_clients_member_calculation.yml new file mode 100644 index 000000000..6880fc89b --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/all_clients_member_calculation.yml @@ -0,0 +1,35 @@ +--- +name: step2_age_calculated +description: Age calculated +priority: 1 +condition: "true" +actions: + - "calculation = (!step2_dob_unknown.equals('') && step2_dob_unknown.contains('dob_unknown')) ? step2_age : helper.getDifferenceDays(step2_dob) / 365.25" +--- +name: step2_wra +description: wra calculation +priority: 1 +condition: "step2_sex == 'Female' && (step2_age_calculated >= 10 && step2_age_calculated <= 49)" +actions: + - "calculation = 1" +--- +name: step2_surname +description: set surname as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_fam_name" +--- +name: step2_first_name +description: set surname as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_client_first_name" +--- +name: step2_middle_name +description: set surname as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_client_middle_name" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/all_clients_member_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/all_clients_member_relevance.yml new file mode 100644 index 000000000..19e5d95d1 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/all_clients_member_relevance.yml @@ -0,0 +1,98 @@ +--- +name: step2_dob +description: dob relevance +priority: 1 +condition: "!step2_dob_unknown.contains('dob_unknown')" +actions: + - "isRelevant = true" +--- +name: step2_age +description: age relevance +priority: 1 +condition: "step2_dob_unknown.contains('dob_unknown')" +actions: + - "isRelevant = true" +--- +name: step2_phone_number +description: phone number relevance +priority: 1 +condition: "step2_is_primary_caregiver == 'Yes'" +actions: + - "isRelevant = true" +--- +name: step2_id_avail +description: identity relevance +priority: 1 +condition: "(step2_dob != '' && helper.formatDate(step2_dob,'y') >= 18) || (step2_age != '' && step2_age >= 18)" +actions: + - "isRelevant = true" +--- +name: step2_marital_status +description: marital_status relevance +priority: 1 +condition: "(step2_dob != '' && helper.formatDate(step2_dob,'y') > 10) || (step2_age != '' && step2_age > 10)" +actions: + - "isRelevant = true" +--- +name: step2_service_provider +description: service provider relevance +priority: 1 +condition: "(step2_dob != '' && helper.formatDate(step2_dob,'y') >= 10) || (step2_age != '' && step2_age >= 10)" +actions: + - "isRelevant = true" +--- +name: step2_leader +description: leadership role relevance +priority: 1 +condition: "(step2_dob != '' && helper.formatDate(step2_dob,'y') >= 10) || (step2_age != '' && step2_age >= 10)" +actions: + - "isRelevant = true" +--- +name: step2_preg_1yr +description: pregnance 1yr relevance +priority: 1 +condition: "step2_wra == 1" +actions: + - "isRelevant = true" +--- +name: step2_insurance_provider_other +description: insurance_provider_other relevance +priority: 1 +condition: "!step2_insurance_provider.equals('') && step2_insurance_provider.equals('Other')" +actions: + - "isRelevant = true" +--- +name: step2_insurance_provider_number +descripltion: insurance number relevance +priority: 1 +condition: "!step2_insurance_provider.equals('') && !step2_insurance_provider.contains('None')" +actions: + - "isRelevant = true" +--- +name: step2_type_of_disability +description: type_of_disability relevance +priority: 1 +condition: "step2_disabilities.equals('Yes')" +actions: + - "isRelevant = true" +--- +name: step2_preg_1yr +description: pregnance 1yr relevance +priority: 1 +condition: "step2_wra == 1" +actions: + - "isRelevant = true" +--- +name: step2_primary_caregiver_name +description: ask primary caregiver name +priority: 1 +condition: "step2_has_primary_caregiver == 'Yes'" +actions: + - "isRelevant = true" +--- +name: step2_other_phone_number +description: as primary caregiver phone number +priority: 1 +condition: "step2_has_primary_caregiver == 'Yes'" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/all_clients_member_update_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/all_clients_member_update_calculation.yml new file mode 100644 index 000000000..127d9ea57 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/all_clients_member_update_calculation.yml @@ -0,0 +1,14 @@ +--- +name: step1_age_calculated +description: Age calculated +priority: 1 +condition: "true" +actions: + - "calculation = (!step1_dob_unknown.equals('') && step1_dob_unknown.contains('dob_unknown')) ? step1_age : helper.getDifferenceDays(step1_dob) / 365.25" +--- +name: step1_wra +description: wra calculation +priority: 1 +condition: "step1_sex == 'Female' && (step1_age_calculated >= 10 && step1_age_calculated <= 49)" +actions: + - "calculation = 1" diff --git a/opensrp-chw-hf/src/main/assets/rule/all_clients_member_update_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/all_clients_member_update_relevance.yml new file mode 100644 index 000000000..5a9c6fbf5 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/all_clients_member_update_relevance.yml @@ -0,0 +1,99 @@ +--- +name: step1_dob +description: dob relevance +priority: 1 +condition: "!step1_dob_unknown.contains('dob_unknown')" +actions: + - "isRelevant = true" +--- +name: step1_age +description: age relevance +priority: 1 +condition: "step1_dob_unknown.contains('dob_unknown')" +actions: + - "isRelevant = true" +--- +name: step1_phone_number +description: phone number relevance +priority: 1 +condition: "step1_is_primary_caregiver == 'Yes'" +actions: + - "isRelevant = true" +--- +name: step1_id_avail +description: identity relevance +priority: 1 +condition: "(step1_dob != '' && helper.formatDate(step1_dob,'y') >= 18) || (step1_age != '' && step1_age >= 18)" +actions: + - "isRelevant = true" +--- +name: step1_service_provider +description: service provider relevance +priority: 1 +condition: "(step1_dob != '' && helper.formatDate(step1_dob,'y') >= 10) || (step1_age != '' && step1_age >= 10)" +actions: + - "isRelevant = true" +--- +name: step1_leader +description: leadership role relevance +priority: 1 +condition: "(step1_dob != '' && helper.formatDate(step1_dob,'y') >= 10) || (step1_age != '' && step1_age >= 10)" +actions: + - "isRelevant = true" +--- +name: step1_preg_1yr +description: pregnance 1yr relevance +priority: 1 +condition: "step1_wra == 1" +actions: + - "isRelevant = true" +--- +name: step1_insurance_provider_other +description: insurance_provider_other relevance +priority: 1 +condition: "!step1_insurance_provider.equals('') && step1_insurance_provider.equals('Other')" +actions: + - "isRelevant = true" +--- +name: step1_insurance_provider_number +descripltion: insurance number relevance +priority: 1 +condition: "!step1_insurance_provider.equals('') && !step1_insurance_provider.contains('None')" +actions: + - "isRelevant = true" +--- +name: step1_type_of_disability +description: type_of_disability relevance +priority: 1 +condition: "step1_disabilities.equals('Yes')" +actions: + - "isRelevant = true" +--- +name: step1_preg_1yr +description: pregnance 1yr relevance +priority: 1 +condition: "step1_wra == 1" +actions: + - "isRelevant = true" +--- +name: step1_primary_caregiver_name +description: ask primary caregiver name +priority: 1 +condition: "step1_has_primary_caregiver == 'Yes'" +actions: + - "isRelevant = true" +--- +name: step1_other_phone_number +description: as primary caregiver phone number +priority: 1 +condition: "step1_has_primary_caregiver == 'Yes'" +actions: + - "isRelevant = true" +--- +name: step1_marital_status +description: marital_status relevance +priority: 1 +condition: "(step1_dob != '' && helper.formatDate(step1_dob,'y') > 10) || (step1_age != '' && step1_age > 10)" +actions: + - "isRelevant = true" + diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_danger_signs_outcome_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_danger_signs_outcome_calculation.yml index 68edcbbb0..eff262649 100644 --- a/opensrp-chw-hf/src/main/assets/rule/anc_danger_signs_outcome_calculation.yml +++ b/opensrp-chw-hf/src/main/assets/rule/anc_danger_signs_outcome_calculation.yml @@ -11,4 +11,11 @@ description: ANC key info priority: 1 condition: "true" actions: - - "calculation = 'Key information for health facility:\nLast menstrual period: ' + step1_lmp + '\nGestational age: ' + step1_gest_age + '\nEDD: ' + step1_edd" \ No newline at end of file + - "calculation = ['gest_age':step1_gest_age, 'edd':step1_edd]" +--- +name: step1_anc_key_info_swahili +description: ANC key info for swahili +priority: 1 +condition: "true" +actions: + - "calculation = 'Taarifa muhimu kwa kituo cha afya:\nKipindi cha mwisho cha kawaida cha hedhi: ' + step1_lmp + '\nUmri wa ujauzito: ' + step1_gest_age + '\nEDD: ' + step1_edd" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_emergency_plan_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/anc_emergency_plan_relevance.yml new file mode 100644 index 000000000..0c528a347 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_emergency_plan_relevance.yml @@ -0,0 +1,42 @@ +--- +name: step1_delivery_place +description: if filled once no need to fill again +priority: 1 +condition: "!global_delivery_place_identified" +actions: + - "isRelevant = true" +--- +name: step1_transport +description: if filled once no need to fill again +priority: 1 +condition: "!global_transport_identified" +actions: + - "isRelevant = true" +--- +name: step1_birth_companion +description: if filled once no need to fill again +priority: 1 +condition: "!global_birth_companion_identified" +actions: + - "isRelevant = true" +--- +name: step1_emergency_funds +description: if filled once no need to fill again +priority: 1 +condition: "!global_emergency_funds_identified" +actions: + - "isRelevant = true" +--- +name: step1_household_support +description: if filled once no need to fill again +priority: 1 +condition: "!global_household_support_identified" +actions: + - "isRelevant = true" +--- +name: step1_blood_donor +description: if filled once no need to fill again +priority: 1 +condition: "!global_blood_donor_identified" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_fv_baseline_investigation_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_fv_baseline_investigation_calculation.yml new file mode 100644 index 000000000..ba5135cd8 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_fv_baseline_investigation_calculation.yml @@ -0,0 +1,21 @@ +--- +name: step1_date_anc_hiv_test +description: date of hiv test calculation +priority: 1 +condition: "true" +actions: + - "calculation = !step1_hiv.equals('test_not_conducted')?helper.getDateToday() : ''" +--- +name: step1_hiv_test_at_32 +description: Record true if test was conducted at gestational age of 32 or more +priority: 1 +condition: "true" +actions: + - "calculation = global_gestational_age >= 32 ? 'true' : 'false'" +--- +name: step1_hiv +description: Calculated field for hiv status +priority: 1 +condition: "!global_known_positive.equals('')" +actions: + - "calculation = global_known_positive ? 'positive' : step1_hiv_qn" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_fv_baseline_investigation_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/anc_fv_baseline_investigation_relevance.yml new file mode 100644 index 000000000..ae0c0644a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_fv_baseline_investigation_relevance.yml @@ -0,0 +1,71 @@ + +--- +name: step1_prompt_for_moderate_anaemia_management +description: prompt for moderate anaemia management +priority: 1 +condition: "!step1_hb_level.equals('') && Float.parseFloat(step1_hb_level) > 8.5 && Float.parseFloat(step1_hb_level) <= 11.4" +actions: + - "isRelevant = true" +--- +name: step1_blood_for_glucose +description: blood for glucose +priority: 1 +condition: "!step1_type_of_blood_for_glucose_test.equals('')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_gestational_diabetes_mellitus +description: prompt for gestational diabetes mellitus +priority: 1 +condition: " (step1_type_of_blood_for_glucose_test.equals('rbg') && step1_blood_for_glucose > 11.1) || (step1_type_of_blood_for_glucose_test.equals('gtt') && step1_blood_for_glucose > 7.8) || (step1_type_of_blood_for_glucose_test.equals('fbg') && step1_blood_for_glucose > 7.8) " +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_hypoglycaemia +description: prompt for hypoglycaemia +priority: 1 +condition: "(step1_type_of_blood_for_glucose_test.equals('rbg') && !step1_blood_for_glucose.equals('') && step1_blood_for_glucose < 3.9) || (step1_type_of_blood_for_glucose_test.equals('gtt') && !step1_blood_for_glucose.equals('') && step1_blood_for_glucose < 3.5) || (step1_type_of_blood_for_glucose_test.equals('fbg') && !step1_blood_for_glucose.equals('') && step1_blood_for_glucose < 3.9) " +actions: + - "isRelevant = true" +--- +name: step1_prescribe_arv_hepb_at_above_twenty_eight +description: prompt for hepatitis B when GA is at or above 28 weeks +priority: 1 +condition: "(step1_hepatitis.contains('positive') && global_gestational_age >= 28)" +actions: + - "isRelevant = true" +--- +name: step1_counsel_arv_hepb_below_twenty_eight +description: prompt for hepatitis B when GA is less than 28 weeks +priority: 1 +condition: "(step1_hepatitis.contains('positive') && global_gestational_age < 28)" +actions: + - "isRelevant = true" +--- +name: step1_hiv_qn +description: show the hiv question if the person isn't known positive +priority: 1 +condition: "!global_known_positive" +actions: + - "isRelevant = true" +--- +name: step1_rh_factor +description: rh factor to only appear when blood group is relevant +priority: 1 +condition: "!step1_blood_group.contains('test_not_conducted')" +actions: + - "isRelevant = true" +--- +name: step1_hiv_counselling_before_testing +description: show the hiv counselling question if the person isn't known positive +priority: 1 +condition: "!global_known_positive && (step1_hiv_qn.contains('positive') || step1_hiv_qn.contains('negative'))" +actions: + - "isRelevant = true" +--- +name: step1_hiv_counselling_after_testing +description: show the hiv counselling question after getting the test results +priority: 1 +condition: "step1_hiv_qn.contains('positive') || step1_hiv_qn.contains('negative')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_fv_malaria_investigation_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_fv_malaria_investigation_calculation.yml new file mode 100644 index 000000000..3890aad5f --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_fv_malaria_investigation_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_malaria_preventive_therapy +description: malaria preventive therapy calculation +priority: 1 +condition: "step1_client_on_malaria_medication.equals('no')" +actions: + - "calculation = !step1_malaria_preventive_therapy_ipt1.equals('') ? step1_malaria_preventive_therapy_ipt1 : (!step1_malaria_preventive_therapy_ipt2.equals('') ? step1_malaria_preventive_therapy_ipt2 : (!step1_malaria_preventive_therapy_ipt3.equals('') ? step1_malaria_preventive_therapy_ipt3 : step1_malaria_preventive_therapy_ipt4)) " diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_fv_malaria_investigation_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/anc_fv_malaria_investigation_relevance.yml new file mode 100644 index 000000000..e2d83c8bd --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_fv_malaria_investigation_relevance.yml @@ -0,0 +1,42 @@ +--- +name: step1_malaria_preventive_therapy_ipt1 +description: malaria preventive therapy should be recorded if gestational age is greater than 13 +priority: 1 +condition: "global_gestational_age >= 13 && !global_malaria_preventive_therapy_ipt1.equals('ipt1') && (!step1_client_on_malaria_medication.equals('') && step1_client_on_malaria_medication.equals('no')) && ((!step1_mRDT_for_malaria.equals('') && !step1_mRDT_for_malaria.equals('positive')) || (step1_malaria_symptoms_screening!= null && step1_malaria_symptoms_screening.contains('none')))" +actions: + - "isRelevant = true" +--- +name: step1_malaria_preventive_therapy_ipt2 +description: malaria preventive therapy ipt2 if ipt1 is given +priority: 1 +condition: "global_malaria_preventive_therapy_ipt1.equals('ipt1') && !global_malaria_preventive_therapy_ipt2.equals('ipt2') && (!step1_client_on_malaria_medication.equals('') && step1_client_on_malaria_medication.equals('no')) && ((!step1_mRDT_for_malaria.equals('') && !step1_mRDT_for_malaria.equals('positive')) || (step1_malaria_symptoms_screening!= null && step1_malaria_symptoms_screening.contains('none')))" +actions: + - "isRelevant = true" +--- +name: step1_malaria_preventive_therapy_ipt3 +description: malaria preventive therapy ipt3 if ipt2 is given +priority: 1 +condition: "global_malaria_preventive_therapy_ipt2.equals('ipt2') && !global_malaria_preventive_therapy_ipt3.equals('ipt3') && (!step1_client_on_malaria_medication.equals('') && step1_client_on_malaria_medication.equals('no')) && ((!step1_mRDT_for_malaria.equals('') && !step1_mRDT_for_malaria.equals('positive')) || (step1_malaria_symptoms_screening!= null && step1_malaria_symptoms_screening.contains('none')))" +actions: + - "isRelevant = true" +--- +name: step1_malaria_preventive_therapy_ipt4 +description: malaria preventive therapy ipt4 if ipt3 is given +priority: 1 +condition: "global_malaria_preventive_therapy_ipt3.equals('ipt3') && !global_malaria_preventive_therapy_ipt4.equals('ipt4') && (!step1_client_on_malaria_medication.equals('') && step1_client_on_malaria_medication.equals('no')) && ((!step1_mRDT_for_malaria.equals('') && !step1_mRDT_for_malaria.equals('positive')) || (step1_malaria_symptoms_screening!= null && step1_malaria_symptoms_screening.contains('none')))" +actions: + - "isRelevant = true" +--- +name: step1_reason_for_not_giving_malaria_medication +description: reasons for not giving malaria medication relevance +priority: 1 +condition: "step1_malaria_preventive_therapy_ipt1.contains('medication_not_given') || step1_malaria_preventive_therapy_ipt2.contains('medication_not_given') || step1_malaria_preventive_therapy_ipt3.contains('medication_not_given') || step1_malaria_preventive_therapy_ipt4.contains('medication_not_given')" +actions: + - "isRelevant = true" +--- +name: step1_llin_provision +description: llin provision relevance +priority: 1 +condition: "!global_llin_provided" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_fv_medical_and_surgical_history_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_fv_medical_and_surgical_history_calculation.yml new file mode 100644 index 000000000..f853033a0 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_fv_medical_and_surgical_history_calculation.yml @@ -0,0 +1,49 @@ +--- +name: step1_known_on_art +description: known on art calculation +priority: 1 +condition: "step1_medical_surgical_history.contains('known_on_art')" +actions: + - "calculation = true" +--- +name: step1_gravida +description: gravida +priority: 1 +condition: "true" +actions: + - "calculation = step1_medical_surgical_history.contains('first_pregnancy_at_or_above_thirty_five') ? step1_gravida_read_only : step1_gravida_text == '' ? '' : step1_gravida_text" +--- +name: step1_parity +description: parity +priority: 1 +condition: "true" +actions: + - "calculation = step1_medical_surgical_history.contains('first_pregnancy_at_or_above_thirty_five') ? step1_parity_read_only : step1_parity_text == '' ? '' : step1_parity_text" +--- +name: step1_no_surv_children +description: no_surv_children +priority: 1 +condition: "true" +actions: + - "calculation = step1_medical_surgical_history.contains('first_pregnancy_at_or_above_thirty_five') ? step1_no_surv_children_read_only : step1_no_surv_children_text == '' ? '' : step1_no_surv_children_text" +--- +name: step1_gravida_read_only +description: gravida_read_only +priority: 1 +condition: "step1_medical_surgical_history.contains('first_pregnancy_at_or_above_thirty_five')" +actions: + - "calculation = 1" +--- +name: step1_parity_read_only +description: parity_read_only +priority: 1 +condition: "step1_medical_surgical_history.contains('first_pregnancy_at_or_above_thirty_five')" +actions: + - "calculation = 0" +--- +name: step1_no_surv_children_read_only +description: no_surv_children_read_only +priority: 1 +condition: "step1_medical_surgical_history.contains('first_pregnancy_at_or_above_thirty_five')" +actions: + - "calculation = 0" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_fv_medical_and_surgical_history_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/anc_fv_medical_and_surgical_history_relevance.yml new file mode 100644 index 000000000..ccea7bd32 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_fv_medical_and_surgical_history_relevance.yml @@ -0,0 +1,49 @@ +--- +name: step1_prompt_for_grand_multiparity +description: prompt_for_grand_multiparity relevance +priority: 1 +condition: "!step1_gravida.equals('') && !step1_parity.equals('') && step1_gravida >= 5 && step1_parity >= 4" +actions: + - "isRelevant = true" +--- +name: step1_gravida_read_only +description: gravida_read_only relevant if is first pregnancy +priority: 1 +condition: "step1_medical_surgical_history.contains('first_pregnancy_at_or_above_thirty_five')" +actions: + - "isRelevant = true" +--- +name: step1_parity_read_only +description: parity_read_only relevant if is first pregnancy +priority: 1 +condition: "step1_medical_surgical_history.contains('first_pregnancy_at_or_above_thirty_five')" +actions: + - "isRelevant = true" +--- +name: step1_no_surv_children_read_only +description: no_surv_children_read_only relevant if is first pregnancy +priority: 1 +condition: "step1_medical_surgical_history.contains('first_pregnancy_at_or_above_thirty_five')" +actions: + - "isRelevant = true" +--- +name: step1_gravida_text +description: gravida_text relevant if is first pregnancy +priority: 1 +condition: "!step1_medical_surgical_history.contains('first_pregnancy_at_or_above_thirty_five')" +actions: + - "isRelevant = true" +--- +name: step1_parity_text +description: parity_read_only relevant if is first pregnancy +priority: 1 +condition: "!step1_medical_surgical_history.contains('first_pregnancy_at_or_above_thirty_five')" +actions: + - "isRelevant = true" +--- +name: step1_no_surv_children_text +description: no_surv_children_read_only relevant if is first pregnancy +priority: 1 +condition: "!step1_medical_surgical_history.contains('first_pregnancy_at_or_above_thirty_five') && !step1_parity.equals('') && step1_parity > 0" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_fv_obstetric_examination_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_fv_obstetric_examination_calculation.yml new file mode 100644 index 000000000..f95497a4b --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_fv_obstetric_examination_calculation.yml @@ -0,0 +1,15 @@ +--- +name: step1_gest_age +description: Gestational age calculated +priority: 1 +condition: "true" +actions: + - "calculation = (helper.getDifferenceDays(global_last_menstrual_period)-helper.getDifferenceDays(helper.getDateToday())) /7" +--- +name: step1_bmi +description: BMI calculated +priority: 1 +condition: "!step1_weight.equals('') && !step1_height.equals('')" +actions: + - "calculation = Float.parseFloat(step1_weight) / (Float.parseFloat(step1_height) * Float.parseFloat(step1_height) / 10000)" + diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_fv_obstetric_examination_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/anc_fv_obstetric_examination_relevance.yml new file mode 100644 index 000000000..c120d3344 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_fv_obstetric_examination_relevance.yml @@ -0,0 +1,71 @@ +--- +name: step1_fundal_height +description: fundal height should be recorded if gestational age is greater than 20 +priority: 1 +condition: "step1_gest_age >= 20" +actions: + - "isRelevant = true" +--- +name: step1_fetal_heart_rate +description: fetal heart rate should be recorded if gestational age is greater than 20 +priority: 1 +condition: "step1_gest_age >= 20" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_fetal_distress +description: prompt for fetal distress +priority: 1 +condition: "!step1_fetal_heart_rate.equals('') && (step1_fetal_heart_rate > 160 || step1_fetal_heart_rate < 120)" +actions: + - "isRelevant = true" +--- +name: step1_lie +description: lie should be recorded if gestational age is greater than 36 +priority: 1 +condition: "step1_gest_age >= 36" +actions: + - "isRelevant = true" +--- +name: step1_presentation +description: presentation should be recorded if gestational age is greater than 36 +priority: 1 +condition: "step1_gest_age >= 36 && step1_lie.contains('longitudinal')" +actions: + - "isRelevant = true" +--- +name: step1_bmi +description: BMI should be visible once height and weight are filled +priority: 1 +condition: "!step1_weight.equals('') && !step1_height.equals('')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_management_of_hypertension +description: prompt_for_management_of_hypertension +priority: 1 +condition: "(!step1_systolic.equals('') && step1_systolic >= 140) || (!step1_diastolic.equals('') && step1_diastolic >= 90)" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_management_of_hypotension +description: prompt_for_management_of_hypotension +priority: 1 +condition: "(!step1_systolic.equals('') && step1_systolic < 90) || (!step1_diastolic.equals('') && step1_diastolic < 60)" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_lie +description: prompt_for_lie +priority: 1 +condition: "step1_lie.contains('transverse') || step1_lie.contains('oblique')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_presentation +description: prompt_for_presentation +priority: 1 +condition: "step1_presentation.contains('breech')" +actions: + - "isRelevant = true" + diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_fv_tb_screening_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_fv_tb_screening_calculation.yml new file mode 100644 index 000000000..663fcef60 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_fv_tb_screening_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_tb_status +description: tb_status calculated +priority: 1 +condition: "true" +actions: + - "calculation = step1_on_tb_treatment.contains('yes') ? 'positive': (step1_tb_symptoms_screening.contains('chk_none') ? 'negative' : step1_investigate_for_tb )" diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_fv_tt_vaccination_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_fv_tt_vaccination_calculation.yml new file mode 100644 index 000000000..478be32c2 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_fv_tt_vaccination_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_tt_vaccination_type +description: tt_vaccination_type calculated +priority: 1 +condition: "true" +actions: + - "calculation = step1_tt_vaccination_type_qn != '' && step1_tt_vaccination == 'yes' ? step1_tt_vaccination_type_qn :'none' " diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_member_transfer_in_registration_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_member_transfer_in_registration_calculation.yml new file mode 100644 index 000000000..f2b1531e1 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_member_transfer_in_registration_calculation.yml @@ -0,0 +1,78 @@ +--- +name: step2_last_menstrual_period +description: Last Menstrual Period +priority: 1 +condition: "true" +actions: + - "calculation = step2_known_last_menstrual_period" + +--- +name: step2_gest_age +description: Gestational age calculated +priority: 1 +condition: "true" +actions: + - "calculation = (helper.getDifferenceDays(step2_last_menstrual_period)-helper.getDifferenceDays(helper.getDateToday())) /7" + +--- +name: step2_edd +description: Edd calculated +priority: 1 +condition: "!step2_last_menstrual_period.equals('')" +actions: + - "calculation = helper.addDuration(step2_last_menstrual_period,'280d')" + +--- +name: step2_gest_age_note +description: Gestational age calculated +priority: 1 +condition: "true" +actions: + - "calculation = step2_gest_age" + +--- +name: step2_last_menstrual_period +description: last_menstrual_period calculated +priority: 1 +condition: "true" +actions: + - "calculation = helper.subtractDuration(step2_edd, '280d')" + +--- +name: step2_hiv_test_at_32 +description: hiv_test_at_32 calculated +priority: 1 +condition: "true" +actions: + - "calculation = step2_is_test_at_32.contains('yes')? true : false" + +--- +name: step2_hiv_test_number +description: hiv_test_number calculated +priority: 1 +condition: "true" +actions: + - "calculation = step2_hiv_test_at_32.equals('true')? 2 : 1" +--- +name: step1_pregnancy_confirmation_date +description: pregnancy_confirmation_date calculated +priority: 1 +condition: "true" +actions: + - "calculation = helper.getDateToday()" +--- +name: step1_hiv +description: hiv calculated +priority: 1 +condition: "step1_medical_surgical_history.contains('known_on_art')" +actions: + - "calculation = step1_medical_surgical_history.contains('known_on_art')? 'positive'" +--- +name: step1_known_on_art +description: known_on_art calculated +priority: 1 +condition: "true" +actions: + - "calculation = step1_medical_surgical_history.contains('known_on_art')? 'yes':''" + + diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_member_transfer_in_registration_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/anc_member_transfer_in_registration_relevance.yml new file mode 100644 index 000000000..febf48537 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_member_transfer_in_registration_relevance.yml @@ -0,0 +1,14 @@ +--- +name: step1_prompt_for_grand_multiparity +description: prompt_for_grand_multiparity relevance +priority: 1 +condition: "!step1_gravida.equals('') && !step1_parity.equals('') && step1_gravida >= 5 && step1_parity >= 4" +actions: + - "isRelevant = true" +--- +name: step1_no_surv_children +description: no_surv_children relevance +priority: 1 +condition: "!step1_para.equals('') && step1_para > 0" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_partner_community_followup_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_partner_community_followup_calculation.yml new file mode 100644 index 000000000..2dc9d2963 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_partner_community_followup_calculation.yml @@ -0,0 +1,12 @@ +--- +name: step1_anc_partner_community_referral_date +description: Date ANC Partner community referral was submitted +priority: 1 +condition: "true" +actions: + - "def getDate(dateFormat) { + import java.util.*; + import java.text.SimpleDateFormat; + return new SimpleDateFormat(dateFormat).format(System.currentTimeMillis()); + }" + - "calculation = getDate('yyyy-MM-dd')" diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_partner_registration_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_partner_registration_calculation.yml new file mode 100644 index 000000000..87e8e4470 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_partner_registration_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_partner_registered +description: db check for partner registered +priority: 1 +condition: "true" +actions: + - "calculation = step1_partner_surname.equals('') ? 0 : 1" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_partner_testing_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_partner_testing_calculation.yml new file mode 100644 index 000000000..fbf5e3cd5 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_partner_testing_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_partner_hiv_test_at_32 +description: Record true if test was conducted at gestational age of 32 or more +priority: 1 +condition: "true" +actions: + - "calculation = global_gestational_age >= 32 ? 'true' : 'false'" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_partner_testing_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/anc_partner_testing_relevance.yml new file mode 100644 index 000000000..631ab7dba --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_partner_testing_relevance.yml @@ -0,0 +1,49 @@ +--- +name: step1_partner_hiv +description: Hiv testing for partner if it was not conducted in first visit +priority: 1 +condition: "!global_hiv_testing_done || ((global_gestational_age >= 32 && global_partner_hiv_status.contains('negative')) && !global_partner_hiv_test_at_32_done)" +actions: + - "isRelevant = true" +--- +name: step1_partner_syphilis +description: Syphilis testing for partner if it was not conducted in first visit +priority: 1 +condition: "!global_syphilis_testing_done" +actions: + - "isRelevant = true" +--- +name: step1_partner_hepatitis +description: Syphilis testing for partner if it was not conducted in first visit +priority: 1 +condition: "!global_hepatitis_testing_done" +actions: + - "isRelevant = true" +--- +name: step1_partner_hiv_test_at_32 +description: Check to mark if test was conducted at week 32 if client was marked negative +priority: 1 +condition: "((global_gestational_age >= 32 && global_partner_hiv_status.contains('negative')) && !global_partner_hiv_test_at_32_done)" +actions: + - "isRelevant = true" +--- +name: step1_partner_other_stds +description: To only show up once +priority: 1 +condition: "global_partner_other_stds == 'null'" +actions: + - "isRelevant = true" +--- +name: step1_couple_testing +description: couple_testing relevance +priority: 1 +condition: "!step1_partner_hiv.equals('') && !step1_partner_hiv.contains('test_not_conducted')" +actions: + - "isRelevant = true" +--- +name: step1_partner_ctc_number +description: partner_ctc_number relevance +priority: 1 +condition: "step1_partner_hiv.contains('positive') || step1_reason_for_not_conducting_partner_hiv_test.contains('known_on_art') " +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_pregnancy_confirmation_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_pregnancy_confirmation_calculation.yml new file mode 100644 index 000000000..b1c4d720c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_pregnancy_confirmation_calculation.yml @@ -0,0 +1,49 @@ +--- +name: step3_gest_age +description: Gestational age calculated +priority: 1 +condition: "step2_fundal_palpation.contains('fetal_parts_detected') || (step2_uss.contains('present_gestation_sac') && !step2_upt.contains('negative')) || (step2_upt.contains('positive'))" +actions: + - "calculation = step3_fundal_height == '' ? ((helper.getDifferenceDays(step3_last_menstrual_period)-helper.getDifferenceDays(helper.getDateToday())) /7) : step3_fundal_height" +--- +name: step3_gest_age_note +description: Gestational age calculated +priority: 1 +condition: "step2_fundal_palpation.contains('fetal_parts_detected') || (step2_uss.contains('present_gestation_sac') && !step2_upt.contains('negative')) || (step2_upt.contains('positive'))" +actions: + - "calculation = step3_gest_age" +--- +name: step3_estimated_last_menstrual_period +description: estimated_last_menstrual_period calculation +priority: 1 +condition: "true" +actions: + - "calculation = step3_fundal_height == '' ? '' : helper.subtractDuration(helper.getDateToday(), step3_gest_age+'w') " +--- +name: step3_edd +description: Edd calculated +priority: 1 +condition: "true" +actions: + - "calculation = step3_estimated_last_menstrual_period == '' ? helper.addDuration(step3_last_menstrual_period,'280d') : helper.addDuration(step3_estimated_last_menstrual_period,'280d')" +--- +name: step3_last_menstrual_period +description: Last Menstrual Period +priority: 1 +condition: "true" +actions: + - "calculation = step3_estimated_last_menstrual_period == '' ? step3_known_last_menstrual_period : step3_estimated_last_menstrual_period" +--- +name: step3_pregnancy_confirmation_status +description: Pregnancy Confirmation Status +priority: 1 +condition: "true" +actions: + - "calculation = step2_fundal_palpation.contains('fetal_parts_detected') || (step2_uss.contains('present_gestation_sac') && !step2_upt.contains('negative')) || (step2_upt.contains('positive')) ? 'Confirmed' : 'Unconfirmed'" +--- +name: step3_pregnancy_confirmation_date +description: Pregnancy Confirmation Date +priority: 1 +condition: "true" +actions: + - "calculation = helper.getDateToday()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_pregnancy_confirmation_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/anc_pregnancy_confirmation_relevance.yml new file mode 100644 index 000000000..5e6103313 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_pregnancy_confirmation_relevance.yml @@ -0,0 +1,77 @@ +--- +name: step2_upt +description: upt relevance +priority: 1 +condition: "step2_type_of_pregnancy_test.contains('upt')" +actions: + - "isRelevant = true" +--- +name: step2_fundal_palpation +description: fundal_palpation relevance +priority: 1 +condition: "step2_type_of_pregnancy_test.contains('fundal_palpation')" +actions: + - "isRelevant = true" +--- +name: step2_uss +description: uss relevance +priority: 1 +condition: "step2_type_of_pregnancy_test.contains('uss')" +actions: + - "isRelevant = true" +--- +name: step3_known_last_menstrual_period +description: lmp_entered relevance +priority: 1 +condition: "(step2_fundal_palpation.contains('fetal_parts_detected') || (step2_uss.contains('present_gestation_sac') && !step2_upt.contains('negative')) || (step2_upt.contains('positive'))) && !step3_last_menstrual_period_unknown.contains('lmp_unknown')" +actions: + - "isRelevant = true" +--- +name: step3_last_menstrual_period_unknown +description: last_menstrual_period_unknown relevance +priority: 1 +condition: "step2_fundal_palpation.contains('fetal_parts_detected') || (step2_uss.contains('present_gestation_sac') && !step2_upt.contains('negative')) || (step2_upt.contains('positive'))" +actions: + - "isRelevant = true" +--- +name: step3_fundal_height +description: fundal_height relevance +priority: 1 +condition: "(step2_fundal_palpation.contains('fetal_parts_detected') || (step2_uss.contains('present_gestation_sac') && !step2_upt.contains('negative')) || (step2_upt.contains('positive'))) && step3_last_menstrual_period_unknown.contains('lmp_unknown')" +actions: + - "isRelevant = true" +--- +name: step3_estimated_last_menstrual_period +description: estimated_last_menstrual_period relevance +priority: 1 +condition: " (step2_fundal_palpation.contains('fetal_parts_detected') || (step2_uss.contains('present_gestation_sac') && !step2_upt.contains('negative')) || (step2_upt.contains('positive'))) && step3_last_menstrual_period_unknown.contains('lmp_unknown')" +actions: + - "isRelevant = true" +--- +name: step3_gest_age_note +description: gest_age_note relevance +priority: 1 +condition: "step2_fundal_palpation.contains('fetal_parts_detected') || (step2_uss.contains('present_gestation_sac') && !step2_upt.contains('negative')) || (step2_upt.contains('positive'))" +actions: + - "isRelevant = true" +--- +name: step3_edd +description: edd_note relevance +priority: 1 +condition: "step2_fundal_palpation.contains('fetal_parts_detected') || (step2_uss.contains('present_gestation_sac') && !step2_upt.contains('negative')) || (step2_upt.contains('positive'))" +actions: + - "isRelevant = true" +--- +name: step3_not_pregnant +description: not_pregnant relevance +priority: 1 +condition: "(!step2_uss.contains('present_gestation_sac') && !step2_upt.contains('positive') && !step2_fundal_palpation.contains('fetal_parts_detected'))" +actions: + - "isRelevant = true" +--- +name: step3_see_a_doctor +description: see a doctor toaster note relevance +priority: 1 +condition: "(step2_uss.contains('present_gestation_sac') && step2_upt.contains('negative'))" +actions: + - "isRelevant = true" diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_pregnancy_outcome_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_pregnancy_outcome_calculation.yml index 04f6238ce..2dfd8b704 100644 --- a/opensrp-chw-hf/src/main/assets/rule/anc_pregnancy_outcome_calculation.yml +++ b/opensrp-chw-hf/src/main/assets/rule/anc_pregnancy_outcome_calculation.yml @@ -29,4 +29,11 @@ priority: 1 condition: "step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem'" actions: - "calculation = step1_temp_unique_id" +--- +name: step1_hiv +description: hiv calculation +priority: 1 +condition: "true" +actions: + - "calculation = !step1_hiv_status_question.equals('') ? step1_hiv_status_question : global_hiv_status_mother ? 'positive' : 'negative'" diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_pregnancy_outcome_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/anc_pregnancy_outcome_relevance.yml index d36ee85ce..bc0b60d97 100644 --- a/opensrp-chw-hf/src/main/assets/rule/anc_pregnancy_outcome_relevance.yml +++ b/opensrp-chw-hf/src/main/assets/rule/anc_pregnancy_outcome_relevance.yml @@ -47,97 +47,82 @@ actions: - "isRelevant = true" --- -name: step1_type_of_disability -description: type_of_disability relevance +name: step1_no_children_no +description: no_children_no relevance priority: 1 -condition: "step1_disabilities == 'Yes' && (step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem')" +condition: "(step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem') && !(step1_delivery_date == helper.getDateToday() && (step1_delivery_place == 'At a health facility' || step1_delivery_place == 'Birth before Arrival (BBA)'))" actions: - "isRelevant = true" - --- -name: step1_baby_label -description: delivery_place relevance +name: step1_no_immediate_new_born +description: no_immediate_new_born relevance priority: 1 -condition: "step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem'" +condition: "(step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem') && (step1_delivery_date == helper.getDateToday() && (step1_delivery_place == 'At a health facility' || step1_delivery_place == 'Birth before Arrival (BBA)'))" actions: - "isRelevant = true" --- -name: step1_unique_id -description: unique_id relevance +name: step1_baby_label +description: delivery_place relevance priority: 1 condition: "step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem'" actions: - "isRelevant = true" --- -name: step1_surname -description: surname relevance -priority: 1 -condition: "!step1_same_as_fam_name_chk.contains('same_as_fam_name') && (step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem')" -actions: - - "isRelevant = true" - ---- -name: step1_same_as_fam_name_chk -description: same_as_fam_name relevance +name: step1_type_of_disability +description: type_of_disability relevance priority: 1 -condition: "step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem'" +condition: "step1_disabilities == 'Yes'" actions: - "isRelevant = true" --- -name: step1_fam_name -description: fam_name relevance +name: step1_surname +description: surname relevance priority: 1 -condition: "step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem'" +condition: "!step1_same_as_fam_name_chk.contains('same_as_fam_name')" actions: - "isRelevant = true" - --- -name: step1_first_name -description: first_name relevance +name: step1_hiv_status_question +description: hiv question relevance priority: 1 -condition: "step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem'" +condition: "(step1_mothers_condition == 'alive' && !global_hiv_status_mother)" actions: - "isRelevant = true" - --- -name: step1_middle_name -description: middle_name relevance +name: step1_risk_category +description: risk_category question relevance priority: 1 -condition: "step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem'" +condition: "((step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem') && (step1_hiv_status_question.contains('positive') || global_hiv_status_mother))" actions: - "isRelevant = true" - --- -name: step1_gender -description: gender relevance +name: step1_hiv_status +description: hiv status relevance priority: 1 condition: "step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem'" actions: - "isRelevant = true" - --- -name: step1_disabilities -description: disabilities relevance +name: step1_prompt_for_normal_apgar_score +description: prompt_for_normal_apgar_score info priority: 1 -condition: "step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem'" +condition: "step1_apgar_score != ''" actions: - - "isRelevant = true" - + - "calculation = ['apgar_score':step1_apgar_score]" --- -name: step1_early_bf_1hr -description: early_bf_1hr relevance +name: step1_apgar_score_calculated +description: apgar_score_calculated info priority: 1 -condition: "step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem'" +condition: "step1_apgar_score != ''" actions: - - "isRelevant = true" - + - "calculation = step1_apgar_score" --- -name: step1_vacc_birth -description: vacc_birth relevance +name: step1_prompt_for_abnormal_apgar_score +description: prompt_for_abnormal_apgar_score info priority: 1 -condition: "step1_preg_outcome == 'born_alive' || step1_preg_outcome == 'alive_with_problem'" +condition: "step1_apgar_score != ''" actions: - - "isRelevant = true" \ No newline at end of file + - "calculation = ['apgar_score':step1_apgar_score]" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_rv_consultation_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_rv_consultation_calculation.yml new file mode 100644 index 000000000..e56c480eb --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_rv_consultation_calculation.yml @@ -0,0 +1,21 @@ +--- +name: step1_gest_age_consultation +description: Gestational age calculated +priority: 1 +condition: "true" +actions: + - "calculation = (helper.getDifferenceDays(global_last_menstrual_period)-helper.getDifferenceDays(helper.getDateToday())) /7" +--- +name: step1_height_calculated +description: height calculated +priority: 1 +condition: "true" +actions: + - "calculation = global_client_age < 25 ? step1_height : global_client_height" +--- +name: step1_bmi +description: BMI calculated +priority: 1 +condition: "!step1_weight.equals('') && !step1_height_calculated.equals('')" +actions: + - "calculation = Float.parseFloat(step1_weight) / (Float.parseFloat(step1_height_calculated) * Float.parseFloat(step1_height_calculated) / 10000)" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_rv_consultation_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/anc_rv_consultation_relevance.yml new file mode 100644 index 000000000..81a725a19 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_rv_consultation_relevance.yml @@ -0,0 +1,70 @@ +--- +name: step1_fundal_height +description: fundal height should be recorded if gestational age is greater than 20 +priority: 1 +condition: "step1_gest_age_consultation >= 20" +actions: + - "isRelevant = true" +--- +name: step1_lie +description: lie should be recorded if gestational age is greater than 36 +priority: 1 +condition: "step1_gest_age_consultation >= 36" +actions: + - "isRelevant = true" +--- +name: step1_presentation +description: presentation should be recorded if gestational age is greater than 36 +priority: 1 +condition: "step1_gest_age_consultation >= 36 && step1_lie.contains('longitudinal')" +actions: + - "isRelevant = true" +--- +name: step1_height +description: height should be recorded if client's age is less than 25 +priority: 1 +condition: "global_client_age < 25" +actions: + - "isRelevant = true" +--- +name: step1_fetal_heart_rate +description: fetal heart rate should be recorded if gestational age is greater than 20 +priority: 1 +condition: "step1_gest_age_consultation >= 20" +actions: + - "isRelevant = true" +--- +name: step1_bmi +description: BMI should be visible once height and weight are filled +priority: 1 +condition: "!step1_weight.equals('') && !step1_height_calculated.equals('')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_management_of_hypertension +description: prompt_for_management_of_hypertension +priority: 1 +condition: "(!step1_systolic.equals('') && step1_systolic >= 140) || (!step1_diastolic.equals('') && step1_diastolic >= 90)" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_management_of_hypotension +description: prompt_for_management_of_hypotension +priority: 1 +condition: "(!step1_systolic.equals('') && step1_systolic < 90) || (!step1_diastolic.equals('') && step1_diastolic < 60)" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_lie +description: prompt_for_lie +priority: 1 +condition: "step1_lie.contains('transverse') || step1_lie.contains('oblique')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_fetal_distress +description: prompt for fetal distress +priority: 1 +condition: "!step1_fetal_heart_rate.equals('') && (step1_fetal_heart_rate > 160 || step1_fetal_heart_rate < 120)" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_rv_lab_test_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_rv_lab_test_calculation.yml new file mode 100644 index 000000000..a3e666e81 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_rv_lab_test_calculation.yml @@ -0,0 +1,21 @@ +--- +name: step1_date_anc_hiv_test +description: date of hiv test calculation +priority: 1 +condition: "(!global_hiv_test_complete || (global_gestational_age >= 32 && !global_hiv_test_at_32_complete)) && !step1_hiv.equals('test_not_conducted')" +actions: + - "calculation = helper.getDateToday()" +--- +name: step1_hiv_test_at_32 +description: Record true if test was conducted at gestational age of 32 or more +priority: 1 +condition: "true" +actions: + - "calculation = global_gestational_age >= 32 ? 'true' : 'false'" +--- +name: step1_hiv +description: Calculated field for hiv status +priority: 1 +condition: "!global_known_positive.equals('') && !step1_hiv_qn.equals('')" +actions: + - "calculation = global_known_positive ? 'positive' : step1_hiv_qn" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_rv_lab_test_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/anc_rv_lab_test_relevance.yml new file mode 100644 index 000000000..0d77d9439 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_rv_lab_test_relevance.yml @@ -0,0 +1,119 @@ +--- +name: step1_blood_group +description: Blood group test should be conducted if it wasn't conducted in the prior visit +priority: 1 +condition: "!global_blood_group_complete" +actions: + - "isRelevant = true" +--- +name: step1_rh_factor +description: Rh factor test should be conducted if it wasn't conducted in the prior visit +priority: 1 +condition: "!global_blood_group_complete && !step1_blood_group.contains('test_not_conducted')" +actions: + - "isRelevant = true" +--- +name: step1_hiv +description: HIV Test Results should be recorded when gest_age is greater than 32 +priority: 1 +condition: "!global_hiv_test_complete || ((global_gestational_age >= 32 && global_hiv_status.contains('negative')) && !global_hiv_test_at_32_complete)" +actions: + - "isRelevant = true" +--- +name: step1_date_anc_hiv_test +description: HIV Test Results should be recorded when gest_age is greater than 32 +priority: 1 +condition: "(!global_hiv_test_complete || (global_gestational_age >= 32 && !global_hiv_test_at_32_complete)) && !step1_hiv.equals('test_not_conducted')" +actions: + - "isRelevant = true" +--- +name: step1_hiv_test_at_32 +description: Check to mark if test was conducted at week 32 if client was marked negative +priority: 1 +condition: "((global_gestational_age >= 32 && global_hiv_status.contains('negative')) && !global_hiv_test_at_32_complete)" +actions: + - "isRelevant = true" +--- +name: step1_hepatitis +description: Hepatitis test should show up if wasn't conducted in first visit +priority: 1 +condition: "!global_hepatitis_test_complete" +actions: + - "isRelevant = true" +--- +name: step1_mRDT_for_malaria +description: mRDT_for_malaria test should show up if wasn't conducted in first visit +priority: 1 +condition: "!global_malaria_test_complete" +actions: + - "isRelevant = true" +--- +name: step1_syphilis +description: syphilis test should show up if wasn't conducted in first visit +priority: 1 +condition: "!global_syphilis_test_complete" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_moderate_anaemia_management +description: prompt for moderate anaemia management +priority: 1 +condition: "!step1_hb_level.equals('') && Float.parseFloat(step1_hb_level) > 8.5 && Float.parseFloat(step1_hb_level) <= 11.4" +actions: + - "isRelevant = true" +--- +name: step1_blood_for_glucose +description: blood for glucose +priority: 1 +condition: "!step1_type_of_blood_for_glucose_test.equals('')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_gestational_diabetes_mellitus +description: prompt for gestational diabetes mellitus +priority: 1 +condition: " (step1_type_of_blood_for_glucose_test.equals('rbg') && !step1_blood_for_glucose.equals('') && Float.parseFloat(step1_blood_for_glucose) > 11.1) || (step1_type_of_blood_for_glucose_test.equals('gtt') && !step1_blood_for_glucose.equals('') && Float.parseFloat(step1_blood_for_glucose) > 7.8) || (step1_type_of_blood_for_glucose_test.equals('fbg') && !step1_blood_for_glucose.equals('') && Float.parseFloat(step1_blood_for_glucose) > 7.8) " +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_hypoglycaemia +description: prompt for hypoglycaemia +priority: 1 +condition: "(step1_type_of_blood_for_glucose_test.equals('rbg') && !step1_blood_for_glucose.equals('') && Float.parseFloat(step1_blood_for_glucose) < 3.9) || (step1_type_of_blood_for_glucose_test.equals('fbg') && !step1_blood_for_glucose.equals('') && Float.parseFloat(step1_blood_for_glucose) < 3.9) || (step1_type_of_blood_for_glucose_test.equals('gtt') && !step1_blood_for_glucose.equals('') && Float.parseFloat(step1_blood_for_glucose) < 3.5) " +actions: + - "isRelevant = true" +--- +name: step1_prescribe_arv_hepb_at_above_twenty_eight +description: prompt for hepatitis B when GA is at or above 28 weeks +priority: 1 +condition: "(step1_hepatitis.contains('positive') && global_gestational_age >= 28)" +actions: + - "isRelevant = true" +--- +name: step1_counsel_arv_hepb_below_twenty_eight +description: prompt for hepatitis B when GA is less than 28 weeks +priority: 1 +condition: "(step1_hepatitis.contains('positive') && global_gestational_age < 28)" +actions: + - "isRelevant = true" +--- +name: step1_hiv_counselling_before_testing +description: Showing of HIV counselling question +priority: 1 +condition: "!global_hiv_test_complete && (step1_hiv.contains('positive') || step1_hiv.contains('negative')) || ((global_gestational_age >= 32 && global_hiv_status.contains('negative')) && !global_hiv_test_at_32_complete && (step1_hiv.contains('positive') || step1_hiv.contains('negative')))" +actions: + - "isRelevant = true" +--- +name: step1_hiv_counselling_after_testing +description: show the hiv counselling question after getting the test results +priority: 1 +condition: "step1_hiv.contains('positive') || step1_hiv.contains('negative')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_severe_anaemia_treatment +description: show the hiv counselling question after getting the test results +priority: 1 +condition: "!step1_hb_level.equals('') && Float.parseFloat(step1_hb_level) <= 8.5" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_rv_malaria_investigation_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/anc_rv_malaria_investigation_relevance.yml new file mode 100644 index 000000000..8b355b535 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_rv_malaria_investigation_relevance.yml @@ -0,0 +1,42 @@ +--- +name: step1_malaria_preventive_therapy_ipt1 +description: malaria preventive therapy should be recorded if gestational age is greater than 13 +priority: 1 +condition: "global_gestational_age >= 13 && !global_malaria_preventive_therapy.equals('ipt1') && !global_malaria_preventive_therapy.equals('ipt2') && !global_malaria_preventive_therapy.equals('ipt3') && !global_malaria_preventive_therapy.equals('ipt4') && (!step1_client_on_malaria_medication.equals('') && step1_client_on_malaria_medication.equals('no')) && ((!step1_mRDT_for_malaria.equals('') && !step1_mRDT_for_malaria.equals('positive')) || (step1_malaria_symptoms_screening!= null && step1_malaria_symptoms_screening.contains('none')))" +actions: + - "isRelevant = true" +--- +name: step1_malaria_preventive_therapy_ipt2 +description: malaria preventive therapy ipt2 if ipt1 is given +priority: 1 +condition: "global_malaria_preventive_therapy.equals('ipt1') && (!step1_client_on_malaria_medication.equals('') && step1_client_on_malaria_medication.equals('no')) && ((!step1_mRDT_for_malaria.equals('') && !step1_mRDT_for_malaria.equals('positive')) || (step1_malaria_symptoms_screening!= null && step1_malaria_symptoms_screening.contains('none')))" +actions: + - "isRelevant = true" +--- +name: step1_malaria_preventive_therapy_ipt3 +description: malaria preventive therapy ipt3 if ipt2 is given +priority: 1 +condition: "global_malaria_preventive_therapy.equals('ipt2') && (!step1_client_on_malaria_medication.equals('') && step1_client_on_malaria_medication.equals('no')) && ((!step1_mRDT_for_malaria.equals('') && !step1_mRDT_for_malaria.equals('positive')) || (step1_malaria_symptoms_screening!= null && step1_malaria_symptoms_screening.contains('none')))" +actions: + - "isRelevant = true" +--- +name: step1_malaria_preventive_therapy_ipt4 +description: malaria preventive therapy ipt4 if ipt3 is given +priority: 1 +condition: "global_malaria_preventive_therapy.equals('ipt3') && (!step1_client_on_malaria_medication.equals('') && step1_client_on_malaria_medication.equals('no')) && ((!step1_mRDT_for_malaria.equals('') && !step1_mRDT_for_malaria.equals('positive')) || (step1_malaria_symptoms_screening!= null && step1_malaria_symptoms_screening.contains('none')))" +actions: + - "isRelevant = true" +--- +name: step1_reason_for_not_giving_malaria_medication +description: reasons for not giving malaria medication relevance +priority: 1 +condition: "step1_malaria_preventive_therapy_ipt1.contains('medication_not_given') || step1_malaria_preventive_therapy_ipt2.contains('medication_not_given') || step1_malaria_preventive_therapy_ipt3.contains('medication_not_given') || step1_malaria_preventive_therapy_ipt4.contains('medication_not_given')" +actions: + - "isRelevant = true" +--- +name: step1_llin_provision +description: llin provision relevance +priority: 1 +condition: "!global_llin_provided" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_rv_pharmacy_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/anc_rv_pharmacy_relevance.yml new file mode 100644 index 000000000..144384d0a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_rv_pharmacy_relevance.yml @@ -0,0 +1,7 @@ +--- +name: step1_deworming +description: deworming relevance +priority: 1 +condition: "global_gestational_age >= 13 && !global_deworming_given" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_rv_pregnancy_status_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_rv_pregnancy_status_calculation.yml new file mode 100644 index 000000000..81e7cdad9 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_rv_pregnancy_status_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_preg_outcome +description: Gestational age calculated +priority: 1 +condition: "true" +actions: + - "calculation = step1_pregnancy_status.contains('intrauterine_fetal_death') ? 'still_born' : '' " diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_rv_triage_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/anc_rv_triage_calculation.yml new file mode 100644 index 000000000..de7e5e2f3 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_rv_triage_calculation.yml @@ -0,0 +1,37 @@ +--- +name: step1_gest_age +description: Gestational age calculated +priority: 1 +condition: "true" +actions: + - "calculation = (helper.getDifferenceDays(global_last_menstrual_period)-helper.getDifferenceDays(helper.getDateToday())) /7" + +--- +name: step1_gest_age_note +description: Gestational age calculated +priority: 1 +condition: "true" +actions: + - "calculation = step1_gest_age + ' weeks'" +--- +name: step1_visit_number +description: Visit Number +priority: 1 +condition: "true" +actions: + - "calculation = global_current_visit_number + 1" +--- +name: step1_edd +description: Estimated Delivery Date Calculated +priority: 1 +condition: "true" +actions: + - "calculation = step1_last_menstrual_period != '' ? helper.addDuration(step1_last_menstrual_period,'280d') : '' " + +--- +name: step1_last_menstrual_period +description: last_menstrual_period calculation +priority: 1 +condition: "true" +actions: + - "calculation = step1_gest_age == '' ? '' : helper.subtractDuration(helper.getDateToday(), step1_gest_age+'w')" diff --git a/opensrp-chw-hf/src/main/assets/rule/anc_rv_triage_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/anc_rv_triage_relevance.yml new file mode 100644 index 000000000..9fdd4ab8d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/anc_rv_triage_relevance.yml @@ -0,0 +1,7 @@ +--- +name: step1_client_concern +description: client_concern relevance +priority: 1 +condition: "step1_reasons_to_clinic.contains('sick_concerned')" +actions: + - "isRelevant = true" diff --git a/opensrp-chw-hf/src/main/assets/rule/cdp_condom_distribution_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/cdp_condom_distribution_calculation.yml new file mode 100644 index 000000000..05376e2ca --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/cdp_condom_distribution_calculation.yml @@ -0,0 +1,136 @@ +--- +name: step1_male_condom_brand +description: male_condom_brand +priority: 1 +condition: "true" +actions: + - "calculation = step1_condom_brand" +--- +name: step1_female_condom_brand +description: female_condom_brand +priority: 1 +condition: "true" +actions: + - "calculation = step1_condom_brand" +--- +name: step1_stock_event_type +description: stock_event_type for distribution is decrement +priority: 1 +condition: "true" +actions: + - "calculation = 'decrement' " +--- +name: step1_condom_restock_date +description: condom_restock_date +priority: 1 +condition: "true" +actions: + - "calculation = helper.getTimeInMillis() " +--- +name: step1_condom_type +description: condom_type +priority: 1 +condition: "true" +actions: + - "calculation = global_condom_type" +--- +name: step1_quantity_response +description: quantity response is the number of condoms provided +priority: 1 +condition: "true" +actions: + - "calculation = global_condom_type == 'male_condom' ? step1_provided_male_condoms : step1_provided_female_condoms" +--- +name: step1_male_condoms +description: stock on hand of male condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_male_condom_count" +--- +name: step1_female_condoms +description: stock on hand of female condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_female_condom_count" +--- +name: step1_male_condoms_public_sc +description: stock on hand of male condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_male_condom_public_sc_count" +--- +name: step1_female_condoms_public_sc +description: stock on hand of female condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_female_condom_public_sc_count" +--- +name: step1_male_condoms_dume +description: stock on hand of male condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_male_condom_dume_count" +--- +name: step1_female_condoms_dume +description: stock on hand of female condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_female_condom_dume_count" +--- +name: step1_male_condoms_salama +description: stock on hand of male condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_male_condom_salama_count" +--- +name: step1_female_condoms_salama +description: stock on hand of female condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_female_condom_salama_count" +--- +name: step1_male_condoms_familia +description: stock on hand of male condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_male_condom_familia_count" +--- +name: step1_female_condoms_familia +description: stock on hand of female condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_female_condom_familia_count" +--- +name: step1_provided_male_condoms +description: provided_male_condoms +priority: 1 +condition: "global_condom_type == 'male_condom'" +actions: + - "calculation = step1_condom_brand == 'public_sc'? step1_provided_male_condoms_public_sc : + step1_condom_brand == 'dume'? step1_provided_male_condoms_dume : + step1_condom_brand == 'salama'? step1_provided_male_condoms_salama : + step1_condom_brand == 'familia'? step1_provided_male_condoms_familia : + step1_condom_brand == 'others'? step1_provided_male_condoms_other : 0 + " +--- +name: step1_provided_female_condoms +description: provided_female_condoms +priority: 1 +condition: "global_condom_type == 'female_condom'" +actions: + - "calculation = step1_condom_brand == 'public_sc'? step1_provided_female_condoms_public_sc : + step1_condom_brand == 'dume'? step1_provided_female_condoms_dume : + step1_condom_brand == 'salama'? step1_provided_female_condoms_salama : + step1_condom_brand == 'familia'? step1_provided_female_condoms_familia : + step1_condom_brand == 'others'? step1_provided_female_condoms_other : 0 + " \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/cdp_condom_distribution_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/cdp_condom_distribution_relevance.yml new file mode 100644 index 000000000..8a8715789 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/cdp_condom_distribution_relevance.yml @@ -0,0 +1,72 @@ +--- +name: step1_provided_male_condoms_public_sc +description: provided_male_condoms_public_sc +priority: 1 +condition: "global_condom_type == 'male_condom' && step1_condom_brand == 'public_sc'" +actions: + - "isRelevant = true" +--- +name: step1_provided_female_condoms_public_sc +description: provided_female_condoms_public_sc +priority: 1 +condition: "global_condom_type == 'female_condom' && step1_condom_brand == 'public_sc'" +actions: + - "isRelevant = true" +--- +name: step1_provided_male_condoms_dume +description: provided_male_condoms_dume +priority: 1 +condition: "global_condom_type == 'male_condom' && step1_condom_brand == 'dume'" +actions: + - "isRelevant = true" +--- +name: step1_provided_female_condoms_dume +description: provided_female_condoms_dume +priority: 1 +condition: "global_condom_type == 'female_condom' && step1_condom_brand == 'dume'" +actions: + - "isRelevant = true" + +--- +name: step1_provided_male_condoms_salama +description: provided_male_condoms_salama +priority: 1 +condition: "global_condom_type == 'male_condom' && step1_condom_brand == 'salama'" +actions: + - "isRelevant = true" +--- +name: step1_provided_female_condoms_salama +description: provided_female_condoms_salama +priority: 1 +condition: "global_condom_type == 'female_condom' && step1_condom_brand == 'salama'" +actions: + - "isRelevant = true" + +--- +name: step1_provided_male_condoms_familia +description: provided_male_condoms_familia +priority: 1 +condition: "global_condom_type == 'male_condom' && step1_condom_brand == 'familia'" +actions: + - "isRelevant = true" +--- +name: step1_provided_female_condoms_familia +description: provided_female_condoms_familia +priority: 1 +condition: "global_condom_type == 'female_condom' && step1_condom_brand == 'familia'" +actions: + - "isRelevant = true" +--- +name: step1_provided_male_condoms_other +description: provided_male_condoms_other +priority: 1 +condition: "global_condom_type == 'male_condom' && step1_condom_brand == 'others'" +actions: + - "isRelevant = true" +--- +name: step1_provided_female_condoms_other +description: provided_female_condoms_other +priority: 1 +condition: "global_condom_type == 'female_condom' && step1_condom_brand == 'others'" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/cdp_condom_distribution_within_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/cdp_condom_distribution_within_calculation.yml new file mode 100644 index 000000000..7e3df1a58 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/cdp_condom_distribution_within_calculation.yml @@ -0,0 +1,129 @@ +--- +name: step1_male_condom_brand +description: male_condom_brand +priority: 1 +condition: "true" +actions: + - "calculation = step1_condom_brand" +--- +name: step1_female_condom_brand +description: female_condom_brand +priority: 1 +condition: "true" +actions: + - "calculation = step1_condom_brand" +--- +name: step1_stock_event_type +description: stock_event_type for distribution is decrement +priority: 1 +condition: "true" +actions: + - "calculation = 'decrement' " +--- +name: step1_condom_restock_date +description: condom_restock_date +priority: 1 +condition: "true" +actions: + - "calculation = helper.getTimeInMillis() " +--- +name: step1_quantity_response +description: quantity response is the number of condoms provided +priority: 1 +condition: "true" +actions: + - "calculation = step1_condom_type == 'male_condom' ? step1_provided_male_condoms : step1_provided_female_condoms" +--- +name: step1_male_condoms +description: stock on hand of male condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_male_condom_count" +--- +name: step1_female_condoms +description: stock on hand of female condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_female_condom_count" +--- +name: step1_male_condoms_public_sc +description: stock on hand of male condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_male_condom_public_sc_count" +--- +name: step1_female_condoms_public_sc +description: stock on hand of female condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_female_condom_public_sc_count" +--- +name: step1_male_condoms_dume +description: stock on hand of male condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_male_condom_dume_count" +--- +name: step1_female_condoms_dume +description: stock on hand of female condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_female_condom_dume_count" +--- +name: step1_male_condoms_salama +description: stock on hand of male condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_male_condom_salama_count" +--- +name: step1_female_condoms_salama +description: stock on hand of female condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_female_condom_salama_count" +--- +name: step1_male_condoms_familia +description: stock on hand of male condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_male_condom_familia_count" +--- +name: step1_female_condoms_familia +description: stock on hand of female condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_female_condom_familia_count" +--- +name: step1_provided_male_condoms +description: provided_male_condoms +priority: 1 +condition: "step1_condom_type == 'male_condom'" +actions: + - "calculation = step1_condom_brand == 'public_sc'? step1_provided_male_condoms_public_sc : + step1_condom_brand == 'dume'? step1_provided_male_condoms_dume : + step1_condom_brand == 'salama'? step1_provided_male_condoms_salama : + step1_condom_brand == 'familia'? step1_provided_male_condoms_familia : + step1_condom_brand == 'others'? step1_provided_male_condoms_other : 0 + " +--- +name: step1_provided_female_condoms +description: provided_female_condoms +priority: 1 +condition: "step1_condom_type == 'female_condom'" +actions: + - "calculation = step1_condom_brand == 'public_sc'? step1_provided_female_condoms_public_sc : + step1_condom_brand == 'dume'? step1_provided_female_condoms_dume : + step1_condom_brand == 'salama'? step1_provided_female_condoms_salama : + step1_condom_brand == 'familia'? step1_provided_female_condoms_familia : + step1_condom_brand == 'others'? step1_provided_female_condoms_other : 0 + " \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/cdp_condom_distribution_within_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/cdp_condom_distribution_within_relevance.yml new file mode 100644 index 000000000..ae9de3877 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/cdp_condom_distribution_within_relevance.yml @@ -0,0 +1,72 @@ +--- +name: step1_provided_male_condoms_public_sc +description: provided_male_condoms_public_sc +priority: 1 +condition: "step1_condom_type == 'male_condom' && step1_condom_brand == 'public_sc'" +actions: + - "isRelevant = true" +--- +name: step1_provided_female_condoms_public_sc +description: provided_female_condoms_public_sc +priority: 1 +condition: "step1_condom_type == 'female_condom' && step1_condom_brand == 'public_sc'" +actions: + - "isRelevant = true" +--- +name: step1_provided_male_condoms_dume +description: provided_male_condoms_dume +priority: 1 +condition: "step1_condom_type == 'male_condom' && step1_condom_brand == 'dume'" +actions: + - "isRelevant = true" +--- +name: step1_provided_female_condoms_dume +description: provided_female_condoms_dume +priority: 1 +condition: "step1_condom_type == 'female_condom' && step1_condom_brand == 'dume'" +actions: + - "isRelevant = true" + +--- +name: step1_provided_male_condoms_salama +description: provided_male_condoms_salama +priority: 1 +condition: "step1_condom_type == 'male_condom' && step1_condom_brand == 'salama'" +actions: + - "isRelevant = true" +--- +name: step1_provided_female_condoms_salama +description: provided_female_condoms_salama +priority: 1 +condition: "step1_condom_type == 'female_condom' && step1_condom_brand == 'salama'" +actions: + - "isRelevant = true" + +--- +name: step1_provided_male_condoms_familia +description: provided_male_condoms_familia +priority: 1 +condition: "step1_condom_type == 'male_condom' && step1_condom_brand == 'familia'" +actions: + - "isRelevant = true" +--- +name: step1_provided_female_condoms_familia +description: provided_female_condoms_familia +priority: 1 +condition: "step1_condom_type == 'female_condom' && step1_condom_brand == 'familia'" +actions: + - "isRelevant = true" +--- +name: step1_provided_male_condoms_other +description: provided_male_condoms_other +priority: 1 +condition: "step1_condom_type == 'male_condom' && step1_condom_brand == 'others'" +actions: + - "isRelevant = true" +--- +name: step1_provided_female_condoms_other +description: provided_female_condoms_other +priority: 1 +condition: "step1_condom_type == 'female_condom' && step1_condom_brand == 'others'" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/cdp_condom_order_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/cdp_condom_order_calculation.yml new file mode 100644 index 000000000..396b984df --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/cdp_condom_order_calculation.yml @@ -0,0 +1,14 @@ +--- +name: step1_request_type +description: request_type for facility is facility_to_facility +priority: 1 +condition: "true" +actions: + - "calculation = 'facility_to_facility' " +--- +name: step1_condom_order_date +description: condom_order_date +priority: 1 +condition: "true" +actions: + - "calculation = helper.getTimeInMillis() " diff --git a/opensrp-chw-hf/src/main/assets/rule/cdp_receive_condom_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/cdp_receive_condom_calculation.yml new file mode 100644 index 000000000..562412d1a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/cdp_receive_condom_calculation.yml @@ -0,0 +1,42 @@ +--- +name: step1_stock_event_type +description: stock_event_type for distribution is decrement +priority: 1 +condition: "true" +actions: + - "calculation = 'increment' " +--- +name: step1_condom_restock_date +description: condom_restock_date +priority: 1 +condition: "step1_condom_receive_date != ''" +actions: + - "def getDate(date) { + import java.util.*; + import java.text.*; + + SimpleDateFormat dateFormat = new SimpleDateFormat('dd-MM-yyyy', Locale.getDefault()); + return dateFormat.parse(date).getTime(); + }" + - "calculation = getDate(step1_condom_receive_date) " +--- +name: step1_condom_type +description: condom_type +priority: 1 +condition: "true" +actions: + - "calculation = global_condom_type" +--- +name: step1_provided_male_condoms +description: provided_male_condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_condom_type == 'male_condom' ? global_condom_quantity : 0" +--- +name: step1_provided_female_condoms +description: provided_female_condoms +priority: 1 +condition: "true" +actions: + - "calculation = global_condom_type == 'female_condom' ? global_condom_quantity : 0" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/cdp_receive_condom_msd_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/cdp_receive_condom_msd_calculation.yml new file mode 100644 index 000000000..299dc4769 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/cdp_receive_condom_msd_calculation.yml @@ -0,0 +1,21 @@ +--- +name: step1_stock_event_type +description: stock_event_type for restocking in community is decrement +priority: 1 +condition: "true" +actions: + - "calculation = 'increment' " +--- +name: step1_condom_restock_date +description: condom_restock_date +priority: 1 +condition: "step1_condom_receive_date != ''" +actions: + - "def getDate(date) { + import java.util.*; + import java.text.*; + + SimpleDateFormat dateFormat = new SimpleDateFormat('dd-MM-yyyy', Locale.getDefault()); + return dateFormat.parse(date).getTime(); + }" + - "calculation = getDate(step1_condom_receive_date) " \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/family-child-relevance.yml b/opensrp-chw-hf/src/main/assets/rule/family-child-relevance.yml index 0ed45d8c2..17a467000 100644 --- a/opensrp-chw-hf/src/main/assets/rule/family-child-relevance.yml +++ b/opensrp-chw-hf/src/main/assets/rule/family-child-relevance.yml @@ -13,6 +13,13 @@ condition: "!step1_dob_unknown.contains('dob_unknown')" actions: - "isRelevant = true" --- +name: step1_dob_unknown +description: dob unknown relevance +priority: 1 +condition: "step1_dob.equals('')" +actions: + - "isRelevant = true" +--- name: step1_age description: age relevance priority: 1 @@ -41,6 +48,13 @@ condition: "step1_disabilities.contains('Yes')" actions: - "isRelevant = true" --- +name: step1_birth_cert_available +description: birth certificate availability relevance +priority: 1 +condition: "!step1_dob_unknown.contains('dob_unknown')" +actions: + - "isRelevant = true" +--- name: step1_birth_regist_number descripltion: birth registration number priority: 1 diff --git a/opensrp-chw-hf/src/main/assets/rule/family_member_register_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/family_member_register_calculation.yml index 4f29f9584..6fb1b38ee 100644 --- a/opensrp-chw-hf/src/main/assets/rule/family_member_register_calculation.yml +++ b/opensrp-chw-hf/src/main/assets/rule/family_member_register_calculation.yml @@ -4,7 +4,7 @@ description: Age calculated priority: 1 condition: "true" actions: - - "calculation = (!step1_dob_unknown.isEmpty() && step1_dob_unknown.contains('dob_unknown')) ? step1_age : helper.getDifferenceDays(step1_dob) / 365.25" + - "calculation = (!step1_dob_unknown.equals('') && step1_dob_unknown.contains('dob_unknown')) ? step1_age : helper.getDifferenceDays(step1_dob) / 365.25" --- name: step1_wra description: wra calculation diff --git a/opensrp-chw-hf/src/main/assets/rule/family_member_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/family_member_relevance.yml index f5c933ed4..b3329d9f4 100644 --- a/opensrp-chw-hf/src/main/assets/rule/family_member_relevance.yml +++ b/opensrp-chw-hf/src/main/assets/rule/family_member_relevance.yml @@ -13,6 +13,13 @@ condition: "!step1_dob_unknown.contains('dob_unknown')" actions: - "isRelevant = true" --- +name: step1_dob_unknown +description: dob unknown relevance +priority: 1 +condition: "step1_dob.equals('')" +actions: + - "isRelevant = true" +--- name: step1_age description: age relevance priority: 1 @@ -29,6 +36,13 @@ actions: - "isRelevant = true" --- +name: step1_marital_status +description: marital_status relevance +priority: 1 +condition: "(step1_dob != '' && helper.formatDate(step1_dob,'y') > 10) || (step1_age != '' && step1_age > 10)" +actions: + - "isRelevant = true" +--- name: step1_preg_1yr description: pregnance 1yr relevance priority: 1 diff --git a/opensrp-chw-hf/src/main/assets/rule/family_register_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/family_register_calculation.yml index d756714a4..4a1c22da4 100644 --- a/opensrp-chw-hf/src/main/assets/rule/family_register_calculation.yml +++ b/opensrp-chw-hf/src/main/assets/rule/family_register_calculation.yml @@ -11,11 +11,25 @@ description: Age calculated priority: 1 condition: "true" actions: - - "calculation = (!step2_dob_unknown.isEmpty() && step2_dob_unknown.contains('dob_unknown')) ? step2_age : helper.getDifferenceDays(step2_dob) / 365.25" + - "calculation = (!step2_dob_unknown.equals('') && step2_dob_unknown.contains('dob_unknown')) ? step2_age : helper.getDifferenceDays(step2_dob) / 365.25" --- name: step2_wra description: wra calculation priority: 1 condition: "step2_sex == 'Female' && (step2_age_calculated >= 10 && step2_age_calculated <= 49)" actions: - - "calculation = 1" \ No newline at end of file + - "calculation = 1" +--- +name: step2_first_name +description: set surname as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_client_first_name" +--- +name: step2_middle_name +description: set surname as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_client_middle_name" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/family_register_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/family_register_relevance.yml index 9bcf1d69b..c0e227f85 100644 --- a/opensrp-chw-hf/src/main/assets/rule/family_register_relevance.yml +++ b/opensrp-chw-hf/src/main/assets/rule/family_register_relevance.yml @@ -12,7 +12,34 @@ priority: 1 condition: "!step2_dob_unknown.contains('dob_unknown')" actions: - "isRelevant = true" - +--- +name: step2_dob_unknown +description: dob unknown relevance +priority: 1 +condition: "step2_dob.equals('')" +actions: + - "isRelevant = true" +--- +name: step2_service_provider +description: service_provider relevance +priority: 1 +condition: "(step2_dob != '' && helper.formatDate(step2_dob,'y') >= 18) || (step2_age != '' && step2_age >= 18)" +actions: + - "isRelevant = true" +--- +name: step2_leader +description: leader relevance +priority: 1 +condition: "(step2_dob != '' && helper.formatDate(step2_dob,'y') >= 18) || (step2_age != '' && step2_age >= 18)" +actions: + - "isRelevant = true" +--- +name: step2_marital_status +description: marital_status relevance +priority: 1 +condition: "(step2_dob != '' && helper.formatDate(step2_dob,'y') >= 14) || (step2_age != '' && step2_age >= 14)" +actions: + - "isRelevant = true" --- name: step2_dob_entered description: dob_entered relevance @@ -53,14 +80,6 @@ condition: "step2_id_avail.equals('Driver\\'s license')" actions: - "isRelevant = true" ---- -name: step2_passport -description: passport relevance -priority: 1 -condition: "step2_id_avail.equals('Passport')" -actions: - - "isRelevant = true" - --- name: step2_insurance_provider_other description: insurance_provider_other relevance @@ -126,5 +145,12 @@ name: step2_preg_1yr description: pregnance 1yr relevance priority: 1 condition: "step2_wra == 1" +actions: + - "isRelevant = true" +--- +name: step2_id_avail +description: identity relevance +priority: 1 +condition: "(step2_dob != '' && helper.formatDate(step2_dob,'y') >= 18) || (step2_age != '' && step2_age >= 18)" actions: - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/general_neat_referral_form_rules.yml b/opensrp-chw-hf/src/main/assets/rule/general_neat_referral_form_rules.yml new file mode 100644 index 000000000..35685938f --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/general_neat_referral_form_rules.yml @@ -0,0 +1,54 @@ +--- +name: "problem_other_visibility" +description: "Specify other symptoms" +priority: 1 +condition: "problem['other_reasons'] != null" +actions: + - "problem_other_visibility = true" +--- +name: "service_before_referral_other_visibility" +description: "Specify Other pre-referral managements given" +priority: 1 +condition: "service_before_referral['Other_treatment'] != null" +actions: + - "service_before_referral_other_visibility = true" +--- +name: "referral_date_calculation" +description: "Referral date calculation" +priority: 1 +condition: "true" +actions: + - "referral_date_calculation = System.currentTimeMillis()" +--- +name: "referral_time_calculation" +description: "Referral time calculation" +priority: 1 +condition: "true" +actions: + - "def getDate(dateFormat) { + import java.util.*; + import java.text.SimpleDateFormat; + return new SimpleDateFormat(dateFormat).format(System.currentTimeMillis()); + }" + - "referral_time_calculation = getDate('HH:mm:ss.SSS')" +--- +name: "referral_type_calculation" +description: "Referral type calculation" +priority: 1 +condition: "true" +actions: + - "referral_type_calculation = 'facility_to_community_referral'" +--- +name: "referral_status_calculation" +description: "Referral type calculation" +priority: 1 +condition: "true" +actions: + - "referral_status_calculation = 'PENDING'" +--- +name: "service_before_referral_calculation" +description: "Service Before Referral" +condition: "true" +priority: 1 +actions: + - "service_before_referral_calculation = 'None'" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hei-followup-rule.yml b/opensrp-chw-hf/src/main/assets/rule/hei-followup-rule.yml new file mode 100644 index 000000000..6eb1d803f --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hei-followup-rule.yml @@ -0,0 +1,7 @@ +--- +name: schedule_every_month +description: gets hei visit status +priority: 1 +condition: "true" +actions: + - "heiFollowupRule.updateDueDates()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hei_arv_prescription_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/hei_arv_prescription_relevance.yml new file mode 100644 index 000000000..3bfa368e4 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hei_arv_prescription_relevance.yml @@ -0,0 +1,7 @@ +--- +name: step1_number_of_azt_nvp_days_dispensed +description: number_of_azt_nvp_days_dispensed +priority: 1 +condition: "step1_provided_azt_nvp_syrup.equals('yes') || step1_provided_other_combinations.equals('yes')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hei_baseline_investigation_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/hei_baseline_investigation_relevance.yml new file mode 100644 index 000000000..07e688814 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hei_baseline_investigation_relevance.yml @@ -0,0 +1,35 @@ +--- +name: step1_health_status +description: health_status +priority: 1 +condition: "step1_followup_status != '' && !step1_followup_status.equals('transfer_out') && !step1_followup_status.equals('lost_to_followup')" +actions: + - "isRelevant = true" +--- +name: step1_infant_feeding_practice +description: infant_feeding_practice +priority: 1 +condition: "step1_followup_status != '' && !step1_followup_status.equals('transfer_out') && !step1_followup_status.equals('lost_to_followup')" +actions: + - "isRelevant = true" +--- +name: step1_weight +description: weight +priority: 1 +condition: "step1_followup_status != '' && !step1_followup_status.equals('transfer_out') && !step1_followup_status.equals('lost_to_followup')" +actions: + - "isRelevant = true" +--- +name: step1_name_of_hf +description: name_of_hf +priority: 1 +condition: "step1_followup_status != '' && step1_followup_status.equals('transfer_out') && !step1_followup_status.equals('lost_to_followup')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_health_status +description: prompt_for_health_status relevance +priority: 1 +condition: "step1_health_status.equals('diarrhoea') || step1_health_status.equals('draining_ears') || step1_health_status.equals('fever') || step1_health_status.equals('kaposi_sarcoma') || step1_health_status.equals('malnutrition') || step1_health_status.equals('oesophageal_candidiasis') || step1_health_status.equals('pneumonia') || step1_health_status.equals('skin_disease') || step1_health_status.equals('thrush') || step1_health_status.equals('tuberculosis') || step1_health_status.equals('lymphadenopathy')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hei_followup_visit_date_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/hei_followup_visit_date_calculation.yml new file mode 100644 index 000000000..d0021d873 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hei_followup_visit_date_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_followup_visit_date +description: hei follow-up visit date +priority: 1 +condition: "true" +actions: + - "calculation = helper.getDateToday()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hei_hiv_test_results_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/hei_hiv_test_results_relevance.yml new file mode 100644 index 000000000..5944b091d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hei_hiv_test_results_relevance.yml @@ -0,0 +1,7 @@ +--- +name: step1_results_provided_to_parents +description: results_provided_to_parents +priority: 1 +condition: "step1_hiv_test_result != ''" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hiv_community_followup_referral_rules.yml b/opensrp-chw-hf/src/main/assets/rule/hiv_community_followup_referral_rules.yml new file mode 100644 index 000000000..4caaf4a36 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hiv_community_followup_referral_rules.yml @@ -0,0 +1,21 @@ +--- +name: "reason_for_issuing_community_referral_other_visibility" +description: "reason_for_issuing_community_referral_other symptoms" +priority: 1 +condition: "reasons_for_issuing_community_referral['Other'] != null" +actions: + - "reason_for_issuing_community_referral_other_visibility = true" +--- +name: "last_client_visit_date_visibility" +description: "last_client_visit_date visibility" +priority: 1 +condition: "reasons_for_issuing_community_referral['Other'] == null" +actions: + - "last_client_visit_date_visibility = true" +--- +name: "hiv_community_referral_date_calculation" +description: "hiv_community_referral_date calculation" +priority: 1 +condition: "true" +actions: + - "hiv_community_referral_date_calculation = System.currentTimeMillis()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hiv_index_client_contacts_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/hiv_index_client_contacts_calculation.yml new file mode 100644 index 000000000..bf6476f6d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hiv_index_client_contacts_calculation.yml @@ -0,0 +1,46 @@ +--- +name: step2_age_calculated +description: Age calculated +priority: 1 +condition: "true" +actions: + - "calculation = step2_age" +--- +name: step2_wra +description: wra calculation +priority: 1 +condition: "step2_sex == 'Female' && (step2_age_calculated >= 10 && step2_age_calculated <= 49)" +actions: + - "calculation = 1" +--- +name: step2_surname +description: set surname as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_fam_name" +--- +name: step2_relationship +description: set relationship +priority: 1 +condition: "true" +actions: + - "calculation = step2_age_calculated < 15 ? (step2_age_calculated < (global_index_client_age - 15) && global_index_client_age > 15) ? step2_relationship_under_15_for_possible_children : step2_relationship_under_15 + : (step2_age_calculated >= 15 && step2_age_calculated < 19) ? (step2_age_calculated < (global_index_client_age - 15)) ? step2_relationship_above_15_to_18_possible_children : step2_relationship_above_15_to_18 + : (step2_age_calculated >= 19 && step2_sex.equals('Female') && (step2_age_calculated > (global_index_client_age + 15) && global_index_client_age < 19)) ? step2_relationship_above_18_possible_parents_female + : (step2_age_calculated >= 19 && step2_sex.equals('Male') && (step2_age_calculated > (global_index_client_age + 15) && global_index_client_age < 19)) ? step2_relationship_above_18_possible_parents_male + : step2_relationship_above_18;" +--- +name: step2_first_name +description: set first name as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_client_first_name" +--- +name: step2_middle_name +description: set middle name as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_client_middle_name" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hiv_index_contact_community_followup_referral_rules.yml b/opensrp-chw-hf/src/main/assets/rule/hiv_index_contact_community_followup_referral_rules.yml new file mode 100644 index 000000000..af96ecfc1 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hiv_index_contact_community_followup_referral_rules.yml @@ -0,0 +1,19 @@ +--- +name: "refer_to_chw_calculation" +description: "refer_to_chw calculation" +priority: 1 +condition: "true" +actions: + - "refer_to_chw_calculation = 'yes'" +--- +name: "hiv_index_contact_community_followup_referral_date_calculation" +description: "hiv_index_contact_community_followup_referral_date calculation" +priority: 1 +condition: "true" +actions: + - "def getDate(dateFormat) { + import java.util.*; + import java.text.SimpleDateFormat; + return new SimpleDateFormat(dateFormat).format(Calendar.getInstance().getTime()); + }" + - "hiv_index_contact_community_followup_referral_date_calculation = getDate('yyyy-MM-dd hh:mm:ss') " \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hiv_index_contact_ctc_enrollment_rules.yml b/opensrp-chw-hf/src/main/assets/rule/hiv_index_contact_ctc_enrollment_rules.yml new file mode 100644 index 000000000..60d5dec67 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hiv_index_contact_ctc_enrollment_rules.yml @@ -0,0 +1,14 @@ +--- +name: "test_results_visibility" +description: "test_results visibility" +priority: 1 +condition: "true" +actions: + - "test_results_visibility = false" +--- +name: "place_where_test_was_conducted_visibility" +description: "place_where_test_was_conducted visibility" +priority: 1 +condition: "true" +actions: + - "place_where_test_was_conducted_visibility = false" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hiv_index_contact_followup_for_non_sex_partner_rules.yml b/opensrp-chw-hf/src/main/assets/rule/hiv_index_contact_followup_for_non_sex_partner_rules.yml new file mode 100644 index 000000000..e3a54029b --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hiv_index_contact_followup_for_non_sex_partner_rules.yml @@ -0,0 +1,115 @@ +--- +name: "relationship_calculation" +description: "relationship visibility" +priority: 1 +condition: "true" +actions: + - "relationship = 'non_sex_partner'" +--- +name: "eligibility_for_testing_visibility" +description: "eligibility_for_testing visibility" +priority: 1 +condition: "has_the_client_been_reached['yes'] != null" +actions: + - "eligibility_for_testing_visibility = true" +--- +name: "has_the_contact_client_been_tested_visibility" +description: "has_the_contact_client_been_tested visibility" +priority: 1 +condition: "has_the_client_been_reached['yes'] != null && eligibility_for_testing['yes'] != null" +actions: + - "has_the_contact_client_been_tested_visibility = true" +--- +name: "reasons_conducting_testing_for_index_contact_visibility" +description: "Show reasons to why the client was not tested" +priority: 1 +condition: "has_the_contact_client_been_tested['no'] != null && eligibility_for_testing['yes'] != null && has_the_client_been_reached['yes'] != null" +actions: + - "reasons_conducting_testing_for_index_contact_visibility = true" +--- +name: "other_reason_for_not_testing_visibility" +description: "Specify other reasons to why the client was not tested" +priority: 1 +condition: "(reasons_conducting_testing_for_index_contact.value == 'Other' || reasons_conducting_testing_for_index_contact.value == 'Nyingine') && has_the_contact_client_been_tested['no'] != null && eligibility_for_testing['yes'] != null && has_the_client_been_reached['yes'] != null" +actions: + - "other_reason_for_not_testing_visibility = true" +--- +name: "test_results_visibility" +description: "test_results visibility" +priority: 1 +condition: "has_the_client_been_reached['yes'] != null && eligibility_for_testing['yes'] != null && has_the_contact_client_been_tested['yes'] != null" +actions: + - "test_results_visibility = true" +--- +name: "place_where_test_was_conducted_visibility" +description: "place_where_test_was_conducted visibility" +priority: 1 +condition: "(test_results['positive'] != null || test_results['negative'] != null) && has_the_contact_client_been_tested['yes'] != null && eligibility_for_testing['yes'] != null && has_the_client_been_reached['yes'] != null" +actions: + - "place_where_test_was_conducted_visibility = true" +--- +name: "client_test_date_visibility" +description: "client_test_date visibility" +priority: 1 +condition: "(test_results['positive'] != null || test_results['negative'] != null) && has_the_contact_client_been_tested['yes'] != null && eligibility_for_testing['yes'] != null && has_the_client_been_reached['yes'] != null" +actions: + - "client_test_date_visibility = true" +--- +name: "toast_enroll_the_client_to_prep_visibility" +description: "toast_enroll_the_client_to_prep visibility" +priority: 2 +condition: "relationship == 'sex_partner' && test_results['negative'] != null && has_the_contact_client_been_tested['yes'] != null && eligibility_for_testing['yes'] != null && has_the_client_been_reached['yes'] != null" +actions: + - "toast_enroll_the_client_to_prep_visibility = true" +--- +name: "enrolled_to_clinic_visibility" +description: "enrolled_to_clinic visibility" +priority: 1 +condition: "test_results['positive'] != null && has_the_contact_client_been_tested['yes'] != null && eligibility_for_testing['yes'] != null && has_the_client_been_reached['yes'] != null" +actions: + - "enrolled_to_clinic_visibility = true" +--- +name: "ctc_number_visibility" +description: "ctc_number visibility" +priority: 1 +condition: "(test_results['positive'] != null && enrolled_to_clinic['yes'] != null && has_the_contact_client_been_tested['yes'] != null && eligibility_for_testing['yes'] != null && has_the_client_been_reached['yes'] != null) || ( (reasons_for_ineligibility_for_testing.value == 'The contact is known HIV positive' || reasons_for_ineligibility_for_testing.value == 'Mteja tayari amekwisha pima na ana HIV') && eligibility_for_testing['no'] != null && has_the_client_been_reached['yes'] != null )" +actions: + - "ctc_number_visibility = true" +--- +name: "hiv_facility_visit_date_calculation" +description: "hiv_facility_visit_date calculation" +priority: 1 +condition: "true" +actions: + - "def getDate(dateFormat) { + import java.util.*; + import java.text.SimpleDateFormat; + return new SimpleDateFormat(dateFormat).format(Calendar.getInstance().getTime()); + }" + - "hiv_facility_visit_date_calculation = getDate('yyyy-MM-dd hh:mm:ss') " +--- +name: "hiv_facility_visit_date_calculation" +description: "hiv_facility_visit_date calculation" +priority: 1 +condition: "true" +actions: + - "def getDate(dateFormat) { + import java.util.*; + import java.text.SimpleDateFormat; + return new SimpleDateFormat(dateFormat).format(Calendar.getInstance().getTime()); + }" + - "hiv_facility_visit_date_calculation = getDate('yyyy-MM-dd hh:mm:ss') " +--- +name: "reasons_for_ineligibility_for_testing_visibility" +description: "reasons_for_ineligibility_for_testing visibility" +priority: 1 +condition: "eligibility_for_testing['no'] != null && has_the_client_been_reached['yes'] != null" +actions: + - "reasons_for_ineligibility_for_testing_visibility = true" +--- +name: "other_reason_for_ineligibility_visibility" +description: "other_reason_for_ineligibility visibility" +priority: 1 +condition: "eligibility_for_testing['no'] != null && has_the_client_been_reached['yes'] != null && (reasons_for_ineligibility_for_testing.value == 'Other' || reasons_for_ineligibility_for_testing.value == 'Nyingine')" +actions: + - "other_reason_for_ineligibility_visibility = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hiv_index_contact_followup_for_sex_partner_rules.yml b/opensrp-chw-hf/src/main/assets/rule/hiv_index_contact_followup_for_sex_partner_rules.yml new file mode 100644 index 000000000..cfc01794d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hiv_index_contact_followup_for_sex_partner_rules.yml @@ -0,0 +1,115 @@ +--- +name: "relationship_calculation" +description: "relationship visibility" +priority: 1 +condition: "true" +actions: + - "relationship = 'sex_partner'" +--- +name: "eligibility_for_testing_visibility" +description: "eligibility_for_testing visibility" +priority: 1 +condition: "has_the_client_been_reached['yes'] != null" +actions: + - "eligibility_for_testing_visibility = true" +--- +name: "has_the_contact_client_been_tested_visibility" +description: "has_the_contact_client_been_tested visibility" +priority: 1 +condition: "has_the_client_been_reached['yes'] != null && eligibility_for_testing['yes'] != null" +actions: + - "has_the_contact_client_been_tested_visibility = true" +--- +name: "reasons_conducting_testing_for_index_contact_visibility" +description: "Show reasons to why the client was not tested" +priority: 1 +condition: "has_the_contact_client_been_tested['no'] != null && eligibility_for_testing['yes'] != null && has_the_client_been_reached['yes'] != null" +actions: + - "reasons_conducting_testing_for_index_contact_visibility = true" +--- +name: "other_reason_for_not_testing_visibility" +description: "Specify other reasons to why the client was not tested" +priority: 1 +condition: "(reasons_conducting_testing_for_index_contact.value == 'Other' || reasons_conducting_testing_for_index_contact.value == 'Nyingine') && has_the_contact_client_been_tested['no'] != null && eligibility_for_testing['yes'] != null && has_the_client_been_reached['yes'] != null" +actions: + - "other_reason_for_not_testing_visibility = true" +--- +name: "test_results_visibility" +description: "test_results visibility" +priority: 1 +condition: "has_the_client_been_reached['yes'] != null && eligibility_for_testing['yes'] != null && has_the_contact_client_been_tested['yes'] != null" +actions: + - "test_results_visibility = true" +--- +name: "place_where_test_was_conducted_visibility" +description: "place_where_test_was_conducted visibility" +priority: 1 +condition: "(test_results['positive'] != null || test_results['negative'] != null) && has_the_contact_client_been_tested['yes'] != null && eligibility_for_testing['yes'] != null && has_the_client_been_reached['yes'] != null" +actions: + - "place_where_test_was_conducted_visibility = true" +--- +name: "client_test_date_visibility" +description: "client_test_date visibility" +priority: 1 +condition: "(test_results['positive'] != null || test_results['negative'] != null) && has_the_contact_client_been_tested['yes'] != null && eligibility_for_testing['yes'] != null && has_the_client_been_reached['yes'] != null" +actions: + - "client_test_date_visibility = true" +--- +name: "toast_enroll_the_client_to_prep_visibility" +description: "toast_enroll_the_client_to_prep visibility" +priority: 2 +condition: "relationship == 'sex_partner' && test_results['negative'] != null && has_the_contact_client_been_tested['yes'] != null && eligibility_for_testing['yes'] != null && has_the_client_been_reached['yes'] != null" +actions: + - "toast_enroll_the_client_to_prep_visibility = true" +--- +name: "enrolled_to_clinic_visibility" +description: "enrolled_to_clinic visibility" +priority: 1 +condition: "test_results['positive'] != null && has_the_contact_client_been_tested['yes'] != null && eligibility_for_testing['yes'] != null && has_the_client_been_reached['yes'] != null" +actions: + - "enrolled_to_clinic_visibility = true" +--- +name: "ctc_number_visibility" +description: "ctc_number visibility" +priority: 1 +condition: "(test_results['positive'] != null && enrolled_to_clinic['yes'] != null && has_the_contact_client_been_tested['yes'] != null && eligibility_for_testing['yes'] != null && has_the_client_been_reached['yes'] != null) || ( (reasons_for_ineligibility_for_testing.value == 'The contact is known HIV positive' || reasons_for_ineligibility_for_testing.value == 'Mteja tayari amekwisha pima na ana HIV') && eligibility_for_testing['no'] != null && has_the_client_been_reached['yes'] != null )" +actions: + - "ctc_number_visibility = true" +--- +name: "hiv_facility_visit_date_calculation" +description: "hiv_facility_visit_date calculation" +priority: 1 +condition: "true" +actions: + - "def getDate(dateFormat) { + import java.util.*; + import java.text.SimpleDateFormat; + return new SimpleDateFormat(dateFormat).format(Calendar.getInstance().getTime()); + }" + - "hiv_facility_visit_date_calculation = getDate('yyyy-MM-dd hh:mm:ss') " +--- +name: "hiv_facility_visit_date_calculation" +description: "hiv_facility_visit_date calculation" +priority: 1 +condition: "true" +actions: + - "def getDate(dateFormat) { + import java.util.*; + import java.text.SimpleDateFormat; + return new SimpleDateFormat(dateFormat).format(Calendar.getInstance().getTime()); + }" + - "hiv_facility_visit_date_calculation = getDate('yyyy-MM-dd hh:mm:ss') " +--- +name: "reasons_for_ineligibility_for_testing_visibility" +description: "reasons_for_ineligibility_for_testing visibility" +priority: 1 +condition: "eligibility_for_testing['no'] != null && has_the_client_been_reached['yes'] != null" +actions: + - "reasons_for_ineligibility_for_testing_visibility = true" +--- +name: "other_reason_for_ineligibility_visibility" +description: "other_reason_for_ineligibility visibility" +priority: 1 +condition: "eligibility_for_testing['no'] != null && has_the_client_been_reached['yes'] != null && (reasons_for_ineligibility_for_testing.value == 'Other' || reasons_for_ineligibility_for_testing.value == 'Nyingine')" +actions: + - "other_reason_for_ineligibility_visibility = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hiv_index_contacts_registration_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/hiv_index_contacts_registration_relevance.yml new file mode 100644 index 000000000..6846cbb07 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hiv_index_contacts_registration_relevance.yml @@ -0,0 +1,106 @@ +--- +name: step2_relationship_under_15_for_possible_children +description: relationship_under_15_for_possible_children relevance +priority: 1 +condition: "step2_age_calculated < 15 && (step2_age_calculated < (global_index_client_age - 15) && global_index_client_age > 15 )" +actions: + - "isRelevant = true" +--- +name: step2_relationship_under_15 +description: relationship_under_15 relevance +priority: 1 +condition: "step2_age_calculated < 15 && !(step2_age_calculated < (global_index_client_age - 15) && global_index_client_age > 15 )" +actions: + - "isRelevant = true" + + +--- +name: step2_relationship_above_15_to_18_possible_children +description: relationship_above_15_to_18_possible_children relevance +priority: 1 +condition: "step2_age_calculated >= 15 && step2_age_calculated < 19 && (step2_age_calculated < (global_index_client_age - 15))" +actions: + - "isRelevant = true" +--- +name: step2_relationship_above_15_to_18 +description: relationship_above_15_to_18 relevance +priority: 1 +condition: "step2_age_calculated >= 15 && step2_age_calculated < 19 && !(step2_age_calculated < (global_index_client_age - 15))" +actions: + - "isRelevant = true" + + + +--- +name: step2_relationship_above_18_possible_parents_female +description: relationship_above_18_possible_parents_female relevance +priority: 1 +condition: "step2_age_calculated >= 19 && step2_sex == 'Female' && (step2_age_calculated > (global_index_client_age + 15) && global_index_client_age < 19 )" +actions: + - "isRelevant = true" +--- +name: step2_relationship_above_18_possible_parents_male +description: relationship_above_18_possible_parents_male relevance +priority: 1 +condition: "step2_age_calculated >= 19 && step2_sex == 'Male' && (step2_age_calculated > (global_index_client_age + 15) && global_index_client_age < 19 )" +actions: + - "isRelevant = true" + + +--- +name: step2_relationship_above_18 +description: relationship_above_18 relevance +priority: 1 +condition: "step2_age_calculated >= 19 && !(step2_age_calculated > (global_index_client_age + 15) && global_index_client_age < 19 )" +actions: + - "isRelevant = true" + +--- +name: step2_gbv_analysis +description: gbv_analysis relevance +priority: 1 +condition: "!step2_relationship.equals('biological_child') && !step2_relationship.equals('siblings') " +actions: + - "isRelevant = true" +--- +name: step2_physical_abuse +description: physical_abuse relevance +priority: 1 +condition: "!step2_relationship.equals('biological_child') && !step2_relationship.equals('siblings')" +actions: + - "isRelevant = true" +--- +name: step2_threatened_to_be_hurt +description: threatened_to_be_hurt relevance +priority: 1 +condition: "!step2_relationship.equals('biological_child') && !step2_relationship.equals('siblings')" +actions: + - "isRelevant = true" +--- +name: step2_sexual_assault +description: sexual_assault relevance +priority: 1 +condition: "!step2_relationship.equals('biological_child') && !step2_relationship.equals('siblings')" +actions: + - "isRelevant = true" +--- +name: step2_fearful_of_contact_client +description: sexual_assault relevance +priority: 1 +condition: "!step2_relationship.equals('biological_child') && !step2_relationship.equals('siblings')" +actions: + - "isRelevant = true" +--- +name: step2_additional_details +description: additional_details relevance +priority: 1 +condition: "!step2_relationship.equals('biological_child') && !step2_relationship.equals('siblings')" +actions: + - "isRelevant = true" +--- +name: step2_prompt_for_ipv_service +description: prompt_for_ipv_service relevance +priority: 1 +condition: "step2_physical_abuse.equals('yes') || step2_threatened_to_be_hurt.equals('yes') || step2_sexual_assault.equals('yes') || step2_fearful_of_contact_client.equals('yes')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hiv_outcome_rules.yml b/opensrp-chw-hf/src/main/assets/rule/hiv_outcome_rules.yml new file mode 100644 index 000000000..7139a0b54 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hiv_outcome_rules.yml @@ -0,0 +1,82 @@ +--- +name: "test_results_visibility" +description: "test_results visibility" +priority: 1 +condition: "action_taken_hiv_problems.containsKey('tested')" +actions: + - "test_results_visibility = true" +--- +name: "where_was_test_conducted_visibility" +description: "where_was_test_conducted visibility" +priority: 1 +condition: "action_taken_hiv_problems.containsKey('tested')" +actions: + - "where_was_test_conducted_visibility = true" +--- +name: "reason_no_action_was_taken_visibility" +description: "reason_no_action_was_taken visibility" +priority: 1 +condition: "action_taken_hiv_problems.containsKey('no_action_taken')" +actions: + - "reason_no_action_was_taken_visibility = true" +--- +name: "other_reason_no_action_was_taken_visibility" +description: "other_reason_no_action_was_taken visibility" +priority: 1 +condition: "reason_no_action_was_taken.containsKey('other') && action_taken_hiv_problems.containsKey('no_action_taken')" +actions: + - "other_reason_no_action_was_taken_visibility = true" +--- +name: "other_where_was_test_conducted_visibility" +description: "other_where_was_test_conducted visibility" +priority: 1 +condition: "where_was_test_conducted.containsKey('other')" +actions: + - "other_where_was_test_conducted_visibility = true" +--- +name: "enrolled_to_clinic_visibility" +description: "enrolled_to_clinic visibility" +priority: 1 +condition: "test_results.containsKey('positive') && action_taken_hiv_problems.containsKey('tested') " +actions: + - "enrolled_to_clinic_visibility = true" +--- +name: "ctc_number_visibility" +description: "ctc_number visibility" +priority: 1 +condition: "reason_no_action_was_taken.containsKey('known_positive') || (test_results.containsKey('positive') && enrolled_to_clinic.containsKey('yes') && action_taken_hiv_problems.containsKey('tested'))" +actions: + - "ctc_number_visibility = true" +--- +name: "prompt_for_ctc_enrollment_visibility" +description: "prompt_for_ctc_enrollment visibility" +priority: 1 +condition: "test_results.containsKey('positive') && enrolled_to_clinic.containsKey('no') && action_taken_hiv_problems.containsKey('tested')" +actions: + - "prompt_for_ctc_enrollment_visibility = true" +--- +name: "prompt_for_hiv_inconclusive_visibility" +description: "prompt_for_inconclusive visibility" +priority: 1 +condition: "test_results.containsKey('inconclusive') && action_taken_hiv_problems.containsKey('tested')" +actions: + - "prompt_for_hiv_inconclusive_visibility = true" +--- +name: "test_results_calculation" +description: "test_results calculation" +priority: 1 +condition: "reason_no_action_was_taken.containsKey('known_positive')" +actions: + - "test_results_calculation = 'positive'" +--- +name: "hiv_facility_visit_date_calculation" +description: "hiv_facility_visit_date calculation" +priority: 1 +condition: "true" +actions: + - "def getDate(dateFormat) { + import java.util.*; + import java.text.SimpleDateFormat; + return new SimpleDateFormat(dateFormat).format(Calendar.getInstance().getTime()); + }" + - "hiv_facility_visit_date_calculation = getDate('yyyy-MM-dd hh:mm:ss') " \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hiv_registration_form_rules.yml b/opensrp-chw-hf/src/main/assets/rule/hiv_registration_form_rules.yml new file mode 100644 index 000000000..72edb9d1a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hiv_registration_form_rules.yml @@ -0,0 +1,28 @@ +--- +name: "hiv_registration_date_calculation" +description: "calculating the hiv registration date" +priority: 1 +condition: "true" +actions: + - "hiv_registration_date_calculation = System.currentTimeMillis()" +--- +name: "client_hiv_status_during_registration_calculation" +description: "calculating client_hiv_status_during_registration" +priority: 1 +condition: "true" +actions: + - "client_hiv_status_during_registration_calculation = 'Positive'" +--- +name: "test_results_calculation" +description: "calculating test_results" +priority: 1 +condition: "true" +actions: + - "test_results_calculation = 'Positive'" +--- +name: "place_where_test_was_conducted_other_visibility" +description: "Specify other place where the test was conducted" +priority: 1 +condition: "place_where_test_was_conducted['other'] != null" +actions: + - "place_where_test_was_conducted_other_visibility = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hivst_issue_kits_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/hivst_issue_kits_calculation.yml new file mode 100644 index 000000000..81831a256 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hivst_issue_kits_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_collection_date +description: collection_date calculation +priority: 1 +condition: "true" +actions: + - "calculation = helper.getDateTimeToday()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hivst_issue_kits_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/hivst_issue_kits_relevance.yml new file mode 100644 index 000000000..248295207 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hivst_issue_kits_relevance.yml @@ -0,0 +1,42 @@ +--- +name: step1_kit_code +description: kit_code relevance +priority: 1 +condition: "step1_self_test_kit_given.contains('yes')" +actions: + - "isRelevant = true" +--- +name: step1_client_testing_approach +description: client_testing_approach is not relevant if client is known positive +priority: 1 +condition: "!global_known_positive && step1_self_test_kit_given.contains('yes')" +actions: + - "isRelevant = true" +--- +name: step1_self_test_kit_given +description: self_test_kit_given is not relevant if client is known positive +priority: 1 +condition: "!global_known_positive" +actions: + - "isRelevant = true" +--- +name: step1_pre_test_counselling_and_instructions +description: pre_test_counselling_and_instructions is not relevant if client is known positive +priority: 1 +condition: "!global_known_positive" +actions: + - "isRelevant = true" +--- +name: step1_kits_batch_number +description: kits_batch_number relevance +priority: 1 +condition: "step1_self_test_kit_given.contains('yes') || step1_extra_kits_required.contains('yes')" +actions: + - "isRelevant = true" +--- +name: step1_kits_expiry_date +description: kits_expiry_date relevance +priority: 1 +condition: "step1_self_test_kit_given.contains('yes') || step1_extra_kits_required.contains('yes')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hivst_registration_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/hivst_registration_calculation.yml new file mode 100644 index 000000000..b00cab569 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hivst_registration_calculation.yml @@ -0,0 +1,14 @@ +--- +name: step1_known_positive_during_reg +description: if selected known positive, then yes else no +priority: 1 +condition: "true" +actions: + - "calculation = step1_client_testing_history.contains('known_positive') ? 'yes' : 'no'" +--- +name: step1_client_group +description: if client is male take client_group_male else if client's age is female with 15-24 show agyw opt else show female +priority: 1 +condition: "true" +actions: + - "calculation = global_gender.equalsIgnoreCase('male') ? step1_client_group_male : (global_age >= 15 && global_age <= 24) ? step1_client_group_female_15_24 : step1_client_group_female" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hivst_registration_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/hivst_registration_relevance.yml new file mode 100644 index 000000000..e768e488a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hivst_registration_relevance.yml @@ -0,0 +1,21 @@ +--- +name: step1_client_group_male +description: if client is male is relevannt +priority: 1 +condition: "global_gender.equalsIgnoreCase('male')" +actions: + - "isRelevant = true " +--- +name: step1_client_group_female_15_24 +description: if client is female with age between 15 to 24 is relevannt +priority: 1 +condition: "global_gender.equalsIgnoreCase('female') && (global_age >= 15 && global_age <= 24)" +actions: + - "isRelevant = true " +--- +name: step1_client_group_female +description: if client is female and age is not between 15 and 24 is relevannt +priority: 1 +condition: "global_gender.equalsIgnoreCase('female') && (global_age < 15 || global_age > 24)" +actions: + - "isRelevant = true " \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hivst_results_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/hivst_results_calculation.yml new file mode 100644 index 000000000..abbebf3be --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hivst_results_calculation.yml @@ -0,0 +1,27 @@ +--- +name: step1_hivst_result +description: hivst_result calculation +priority: 1 +condition: "true" +actions: + - "calculation = (step1_has_the_client_been_found != '' && step1_has_the_client_been_found == 'no') ? 'client_not_found' : + (step1_disclose_result != '' && step1_disclose_result == 'no') ? 'client_did_not_disclose' : + step1_client_test_result != '' ? step1_client_test_result : + step1_peer_test_result != '' ? step1_peer_test_result : + step1_sexual_partner_test_result != '' ? step1_sexual_partner_test_result : '' " + +--- +name: step1_register_to_hts +description: register to hts is yes if client results are reactive or non-reactive +priority: 1 +condition: "true" +actions: + - "calculation = step1_client_test_result != '' && (step1_client_test_result == 'reactive' || step1_client_test_result == 'non_reactive') ? 'yes' : 'no'" + +--- +name: step1_result_date +description: result_date calculation +priority: 1 +condition: "true" +actions: + - "calculation = helper.getDateToday()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/hivst_results_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/hivst_results_relevance.yml new file mode 100644 index 000000000..f7558ff1b --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/hivst_results_relevance.yml @@ -0,0 +1,63 @@ +--- +name: step1_has_the_client_been_found +description: relevant if the client has been found +priority: 1 +condition: "global_kit_for == 'client' && (global_client_testing_approach == 'assisted_testing_off_site' || global_client_testing_approach == 'unassisted_testing_off_site')" +actions: + - "isRelevant = true" +--- +name: step1_disclose_result +description: relevant if global kit for is client +priority: 1 +condition: "global_kit_for == 'client' && ((global_client_testing_approach == 'assisted_testing_on_site' || global_client_testing_approach == 'unassisted_testing_on_site') || step1_has_the_client_been_found == 'yes')" +actions: + - "isRelevant = true" +--- +name: step1_peer_test_result +description: relevant if global kit for is peer_friend +priority: 1 +condition: "global_kit_for == 'peer_friend'" +actions: + - "isRelevant = true" +--- +name: step1_sexual_partner_test_result +description: relevant if global kit for is sexual_partner +priority: 1 +condition: "global_kit_for == 'sexual_partner'" +actions: + - "isRelevant = true" +--- +name: step1_client_test_result +description: client_test_result relevance +priority: 1 +condition: "step1_disclose_result == 'yes'" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_referral +description: prompt_for_referral relevance +priority: 1 +condition: "step1_client_test_result == 'reactive' || step1_client_test_result == 'non_reactive'" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_referral_for_peer_or_sexual_partner +description: prompt_for_referral_for_peer_or_sexual_partner relevance +priority: 1 +condition: "step1_peer_test_result == 'reactive' || step1_peer_test_result == 'non_reactive' || step1_sexual_partner_test_result == 'reactive' || step1_sexual_partner_test_result == 'non_reactive' " +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_invalid_or_wastage_for_client +description: prompt_for_invalid_or_wastage_for_client relevance +priority: 1 +condition: "step1_client_test_result == 'invalid' || step1_client_test_result == 'wastage'" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_invalid_or_wastage_for_peer_or_sexual_partner +description: prompt_for_invalid_or_wastage_for_peer_or_sexual_partner relevance +priority: 1 +condition: "step1_peer_test_result == 'invalid' || step1_peer_test_result == 'wastage' || step1_sexual_partner_test_result == 'invalid' || step1_sexual_partner_test_result == 'wastage' " +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/kvp_hts_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/kvp_hts_relevance.yml new file mode 100644 index 000000000..080ff86ee --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/kvp_hts_relevance.yml @@ -0,0 +1,35 @@ +--- +name: step1_testing_site +description: testing_site relevance +priority: 1 +condition: "!step1_previous_hiv_testing_method.isEmpty() && !step1_previous_hiv_testing_method.equals('not_tested')" +actions: + - "isRelevant = true" +--- +name: step1_testing_approach +description: testing_approach relevance +priority: 1 +condition: "!step1_tested_hiv.isEmpty() && step1_tested_hiv.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_hiv_status +description: hiv_status relevance +priority: 1 +condition: "step1_tested_hiv.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_ctc_services +description: ctc_services relevance +priority: 1 +condition: "step1_hiv_status.equals('positive') || step1_hiv_status.equals('known_positive')" +actions: + - "isRelevant = true" +--- +name: step1_ctc_number +description: ctc_number relevance +priority: 1 +condition: "step1_ctc_services.equals('enrolled_but_not_on_arv') || step1_ctc_services.equals('enrolled_and_on_arv')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/kvp_screening_female_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/kvp_screening_female_calculation.yml new file mode 100644 index 000000000..04a340cfd --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/kvp_screening_female_calculation.yml @@ -0,0 +1,51 @@ +--- +name: step1_is_pwud +description: check if client falls in pwud +priority: 1 +condition: "true" +actions: + - "calculation = step1_drug_use.equals('yes') ? 'yes' : 'no'" +--- +name: step2_is_pwid +description: check if client falls in pwid +priority: 1 +condition: "true" +actions: + - "calculation = step2_drug_injection.equals('yes') ? 'yes' : 'no'" +--- +name: step4_is_sdc +description: check if client falls in sdc +priority: 1 +condition: "true" +actions: + - "calculation = (step4_hiv_status_on_screening.equals('negative') && step4_hiv_positive_partner.equals('yes')) ? 'yes' : 'no' " +--- +name: step5_is_fsw +description: check if client falls in msm +priority: 1 +condition: "true" +actions: + - "calculation = (global_age >= 18 && step5_sex_for_money.equals('yes') && step5_main_income_source_is_sex.equals('yes')) ? 'yes' : 'no'" +--- +name: step6_is_agyw +description: check if client falls in msm +priority: 1 +condition: "true" +actions: + - "calculation = (!step6_harsh_condition_impact.isEmpty() && !step6_harsh_condition_impact.contains('not_applicable')) ? 'yes' : 'no'" +--- +name: step7_is_ovp_kvp +description: check if client falls in other vunerable population +priority: 1 +condition: "true" +actions: + - "calculation = !(step7_prisoner_or_rumandee.equals('not_applicable') && step7_mobile_population.equals('not_applicable') && step7_other_groups_at_risk.equals('not_applicable')) ? 'yes' : 'no' " +--- +name: step8_should_enroll +description: check if should enroll client if they belong to any kvp group +priority: 1 +condition: "true" +actions: + - "calculation = (step1_is_pwud.equals('yes') || step2_is_pwid.equals('yes') || step5_is_fsw.equals('yes') || step6_is_agyw.equals('yes') || step4_is_sdc.equals('yes') || step7_is_ovp_kvp.equals('yes')) ? 'yes' : 'no' " + + diff --git a/opensrp-chw-hf/src/main/assets/rule/kvp_screening_female_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/kvp_screening_female_relevance.yml new file mode 100644 index 000000000..3623b17a0 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/kvp_screening_female_relevance.yml @@ -0,0 +1,112 @@ +--- +name: step2_drug_injection +description: drug_injection relevance +priority: 1 +condition: "step1_drug_use.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step3_risk_of_having_sexual_intercourse +description: risk_of_having_sexual_intercourse relevance +priority: 1 +condition: "step3_sexual_intercourse.equals('no') && (global_age >= 10 && global_age <= 24)" +actions: + - "isRelevant = true" +--- +name: step4_hiv_status_on_screening +description: hiv_status_on_screening relevance +priority: 1 +condition: "step3_sexual_intercourse.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step4_hiv_positive_partner +description: hiv_positive_partner relevance +priority: 1 +condition: "step4_hiv_status_on_screening.equals('negative')" +actions: + - "isRelevant = true" +--- +name: step5_sex_for_money +description: sex_for_money relevance +priority: 1 +condition: "!step4_hiv_status_on_screening.isEmpty()" +actions: + - "isRelevant = true" +--- +name: step6_client_in_school +description: client_in_school relevance +priority: 1 +condition: "(step5_is_fsw.equals('no') && global_age >= 10 && global_age <= 24)" +actions: + - "isRelevant = true" +--- +name: step9_prompt_for_sdc_kvp +description: prompt_for_sdc_kvp relevance +priority: 1 +condition: "step4_is_sdc.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step9_prompt_for_fsw_kvp +description: prompt_for_fsw_kvp relevance +priority: 1 +condition: "step5_is_fsw.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step9_prompt_for_ovp_kvp +description: prompt_for_ovp_kvp relevance +priority: 1 +condition: "step7_is_ovp_kvp.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step9_prompt_for_agyw_kvp +description: prompt_for_agyw_kvp relevance +priority: 1 +condition: "step6_is_agyw.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step9_prompt_for_pwud_kvp +description: prompt_for_pwud_kvp relevance +priority: 1 +condition: "step1_is_pwud.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step9_prompt_for_pwid_kvp +description: prompt_for_pwid_kvp relevance +priority: 1 +condition: "step2_is_pwid.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step9_prompt_no_group +description: prompt_no_group +priority: 1 +condition: "step8_should_enroll.equals('no')" +actions: + - "isRelevant = true" +--- +name: step9_birth_region +description: prompt_no_group +priority: 1 +condition: "step8_should_enroll.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step9_enrollment_date +description: prompt_no_group +priority: 1 +condition: "step8_should_enroll.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step9_client_group +description: client_group +priority: 1 +condition: "step8_should_enroll.equals('yes')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/kvp_screening_male_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/kvp_screening_male_calculation.yml new file mode 100644 index 000000000..0e74cf967 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/kvp_screening_male_calculation.yml @@ -0,0 +1,44 @@ +--- +name: step1_is_pwud +description: check if client falls in pwud +priority: 1 +condition: "true" +actions: + - "calculation = step1_drug_use.equals('yes') ? 'yes' : 'no'" +--- +name: step2_is_pwid +description: check if client falls in pwid +priority: 1 +condition: "true" +actions: + - "calculation = step2_drug_injection.equals('yes') ? 'yes' : 'no'" +--- +name: step4_is_msm +description: check if client falls in msm +priority: 1 +condition: "true" +actions: + - "calculation = (step4_sexual_intercourse_with.equals('man') || step4_sexual_intercourse_with.equals('both')) ? 'yes' : 'no' " +--- +name: step5_is_sdc +description: check if client falls in sdc +priority: 1 +condition: "true" +actions: + - "calculation = (step5_hiv_status_on_screening.equals('negative') && step5_hiv_positive_partner.equals('yes')) ? 'yes' : 'no' " +--- +name: step6_is_ovp_kvp +description: check if client falls in other vunerable population +priority: 1 +condition: "true" +actions: + - "calculation = !(step6_prisoner_or_rumandee.equals('not_applicable') && step6_mobile_population.equals('not_applicable') && step6_other_groups_at_risk.equals('not_applicable')) ? 'yes' : 'no' " +--- +name: step7_should_enroll +description: check if should enroll client if they belong to any kvp group +priority: 1 +condition: "true" +actions: + - "calculation = (step1_is_pwud.equals('yes') || step2_is_pwid.equals('yes') || step4_is_msm.equals('yes') || step5_is_sdc.equals('yes') || step6_is_ovp_kvp.equals('yes')) ? 'yes' : 'no' " + + diff --git a/opensrp-chw-hf/src/main/assets/rule/kvp_screening_male_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/kvp_screening_male_relevance.yml new file mode 100644 index 000000000..c7145e4b7 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/kvp_screening_male_relevance.yml @@ -0,0 +1,91 @@ +--- +name: step2_drug_injection +description: drug_injection relevance +priority: 1 +condition: "step1_drug_use.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step4_sexual_intercourse_with +description: sexual_intercourse_with relevance +priority: 1 +condition: "step3_sexual_intercourse.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step5_hiv_status_on_screening +description: hiv_status relevance +priority: 1 +condition: "step3_sexual_intercourse.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step5_hiv_positive_partner +description: hiv_positive_partner relevance +priority: 1 +condition: "step5_hiv_status_on_screening.equals('negative')" +actions: + - "isRelevant = true" +--- +name: step8_prompt_for_sdc_kvp +description: prompt_for_sdc_kvp relevance +priority: 1 +condition: "step5_is_sdc.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step8_prompt_for_msm_kvp +description: prompt_for_msm_kvp relevance +priority: 1 +condition: "step4_is_msm.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step8_prompt_for_pwud_kvp +description: prompt_for_pwud_kvp relevance +priority: 1 +condition: "step1_is_pwud.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step8_prompt_for_pwid_kvp +description: prompt_for_pwid_kvp relevance +priority: 1 +condition: "step2_is_pwid.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step8_prompt_for_ovp_kvp +description: prompt_for_ovp_kvp relevance +priority: 1 +condition: "step6_is_ovp_kvp.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step8_prompt_no_group +description: prompt_no_group +priority: 1 +condition: "step7_should_enroll.equals('no')" +actions: + - "isRelevant = true" +--- +name: step8_birth_region +description: prompt_no_group +priority: 1 +condition: "step7_should_enroll.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step8_enrollment_date +description: prompt_no_group +priority: 1 +condition: "step7_should_enroll.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step8_client_group +description: prompt_no_group +priority: 1 +condition: "step7_should_enroll.equals('yes')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labor_and_delivery_registration_current_labor_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labor_and_delivery_registration_current_labor_relevance.yml new file mode 100644 index 000000000..c780815f6 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labor_and_delivery_registration_current_labor_relevance.yml @@ -0,0 +1,21 @@ +--- +name: step1_prompt_for_true_labor +description: prompt for true labor relevance +priority: 1 +condition: "step1_true_labour.size > 1" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_false_labor +description: prompt for false labor relevance +priority: 1 +condition: "step1_true_labour.size == 1 && !step1_true_labour.contains('none')" +actions: + - "isRelevant = true" +--- +name: step1_admit_client +description: Admit the client +priority: 1 +condition: "step1_true_labour.size == 1" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_anc_clinic_findings_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_anc_clinic_findings_calculation.yml new file mode 100644 index 000000000..d8211eae4 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_anc_clinic_findings_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_hiv +description: hiv status calculated +priority: 1 +condition: "true" +actions: + - "calculation = step1_anc_hiv_status.equals('known_on_art_before_this_pregnancy') ? 'positive' : step1_anc_hiv_status " \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_anc_clinic_findings_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_anc_clinic_findings_relevance.yml new file mode 100644 index 000000000..75e01f95f --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_anc_clinic_findings_relevance.yml @@ -0,0 +1,7 @@ +--- +name: step1_prompt_for_art_management +description: prompt_for_art_management relevance +priority: 1 +condition: "step1_management_provided_for_pmtct.contains('no') || step1_art_prescription.contains('no') " +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_cervix_dilation_monitoring_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_cervix_dilation_monitoring_calculation.yml new file mode 100644 index 000000000..0f533d85f --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_cervix_dilation_monitoring_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_last_vaginal_exam_time +description: last_vaginal_exam_time calculated +priority: 1 +condition: "true" +actions: + - "calculation = step1_vaginal_exam_date == global_last_vaginal_exam_date? global_last_vaginal_exam_time : '00:00'" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_eclampsia_management_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_eclampsia_management_relevance.yml new file mode 100644 index 000000000..76bf1e3cd --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_eclampsia_management_relevance.yml @@ -0,0 +1,7 @@ +--- +name: step1_prompt_for_not_administering_magnesium_sulphate +description: prompt_for_not_administering_magnesium_sulphate relevance +priority: 1 +condition: "step1_administered_magnesium_sulphate.contains('no') && (step1_reason_for_not_administering_magnesium_sulphate.contains('lack_of_skills') || step1_reason_for_not_administering_magnesium_sulphate.contains('out_of_stock'))" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_emergency_neat_referral_form_rules.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_emergency_neat_referral_form_rules.yml new file mode 100644 index 000000000..ab72d654b --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_emergency_neat_referral_form_rules.yml @@ -0,0 +1,54 @@ +--- +name: "problem_other_visibility" +description: "Specify other symptoms" +priority: 1 +condition: "problem['other_reasons'] != null" +actions: + - "problem_other_visibility = true" +--- +name: "service_before_referral_other_visibility" +description: "Specify Other pre-referral managements given" +priority: 1 +condition: "service_before_referral['Other_treatment'] != null" +actions: + - "service_before_referral_other_visibility = true" +--- +name: "referral_date_calculation" +description: "Referral date calculation" +priority: 1 +condition: "true" +actions: + - "referral_date_calculation = System.currentTimeMillis()" +--- +name: "referral_time_calculation" +description: "Referral time calculation" +priority: 1 +condition: "true" +actions: + - "def getDate(dateFormat) { + import java.util.*; + import java.text.SimpleDateFormat; + return new SimpleDateFormat(dateFormat).format(System.currentTimeMillis()); + }" + - "referral_time_calculation = getDate('HH:mm:ss.SSS')" +--- +name: "referral_type_calculation" +description: "Referral type calculation" +priority: 1 +condition: "true" +actions: + - "referral_type_calculation = 'facility_to_facility_referral'" +--- +name: "referral_status_calculation" +description: "Referral type calculation" +priority: 1 +condition: "true" +actions: + - "referral_status_calculation = 'PENDING'" +--- +name: "service_before_referral_calculation" +description: "Service Before Referral" +condition: "true" +priority: 1 +actions: + - "service_before_referral_calculation = 'None'" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_fetal_wellbeing_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_fetal_wellbeing_relevance.yml new file mode 100644 index 000000000..ceb581aa5 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_fetal_wellbeing_relevance.yml @@ -0,0 +1,28 @@ +--- +name: step1_prompt_for_fetal_distress +description: prompt for fetal distress +priority: 1 +condition: "!step1_fetal_heart_rate.equals('') && (step1_fetal_heart_rate > 160 || step1_fetal_heart_rate < 120)" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_amniotic_fluid +description: prompt_for_amniotic_fluid +priority: 1 +condition: "!step1_amniotic_fluid.equals('') && (step1_amniotic_fluid != 'membrane_intact') && (step1_amniotic_fluid != 'membrane_ruptured_liquor_clear')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_moulding +description: prompt for moulding +priority: 1 +condition: "step1_moulding_options == '++' || step1_moulding_options == '+++'" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_caput +description: prompt for caput +priority: 1 +condition: "step1_caput=='++' || step1_caput == '+++'" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_general_examination_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_general_examination_relevance.yml new file mode 100644 index 000000000..129d21b34 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_general_examination_relevance.yml @@ -0,0 +1,56 @@ +--- +name: step1_prompt_for_management_of_hypertension +description: prompt_for_management_of_hypertension +priority: 1 +condition: "step1_systolic >= 130 || step1_diastolic >= 90" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_management_of_hypotension +description: prompt_for_management_of_hypotension +priority: 1 +condition: "(!step1_systolic.equals('') && step1_systolic < 100) || (!step1_diastolic.equals('') && step1_diastolic < 60)" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_urine +description: prompt_for_urine +priority: 1 +condition: "step1_urine_protein.contains('++') || step1_urine_protein.contains('+++') || step1_urine_acetone.contains('++') || step1_urine_acetone.contains('+++')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_lie +description: prompt_for_lie +priority: 1 +condition: "step1_lie.contains('transverse') || step1_lie.contains('oblique')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_fetal_distress +description: prompt for fetal distress +priority: 1 +condition: "!step1_fetal_heart_rate.equals('') && (step1_fetal_heart_rate > 160 || step1_fetal_heart_rate < 120)" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_respiratory_rate +description: prompt for respiratory rate management +priority: 1 +condition: "!step1_respiratory_rate.equals('') && (step1_respiratory_rate < 16 || step1_respiratory_rate > 24)" +actions: + - "isRelevant = true" +--- +name: step1_presentation +description: presentation prompt +priority: 1 +condition: "step1_lie.contains('longitudinal') || step1_lie.contains('oblique')" +actions: + - "isRelevant = true" +--- +name: step1_contraction_in_ten_minutes +description: contraction_in_ten_minutes prompt +priority: 1 +condition: "!step1_contraction_frequency.equals('') && !step1_contraction_frequency.contains('no_contraction') " +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_hiv_test_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_hiv_test_relevance.yml new file mode 100644 index 000000000..e51917995 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_hiv_test_relevance.yml @@ -0,0 +1,35 @@ +--- +name: step1_reason_for_no_hiv_test +description: reasons for no HIV test relevance +priority: 1 +condition: "step1_hiv_test_conducted.contains('no')" +actions: + - "isRelevant = true" +--- +name: step1_hiv +description: hiv relevance +priority: 1 +condition: "step1_hiv_test_conducted.contains('yes')" +actions: + - "isRelevant = true" +--- +name: step1_hiv_counselling_before_testing +description: show the hiv counselling question if the person isn't known positive +priority: 1 +condition: "step1_hiv_test_conducted.contains('yes')" +actions: + - "isRelevant = true" +--- +name: step1_hiv_counselling_after_testing +description: show the hiv counselling question after getting the test results +priority: 1 +condition: "step1_hiv_test_conducted.contains('yes')" +actions: + - "isRelevant = true" +--- +name: step1_pmtct_test_date +description: pmtct_test_date calculation +priority: 1 +condition: "step1_hiv_test_conducted.contains('yes')" +actions: + - "calculation = helper.getDateToday()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_labour_progress_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_labour_progress_relevance.yml new file mode 100644 index 000000000..c49c8182e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_labour_progress_relevance.yml @@ -0,0 +1,28 @@ +--- +name: step1_notify_cervix_dilation_alert +description: Cervix dilation is not empty +condition: "step1_cervix_dilation != 0 && step1_cervix_dilation <= global_cervix_dilation_alert_limit && step1_cervix_dilation > global_cervix_dilation_action_limit" +priority: 1 +actions: + - "isRelevant = true" +--- +name: step1_notify_cervix_dilation_action +description: Cervix dilation is not empty +condition: "step1_cervix_dilation != 0 && step1_cervix_dilation <= global_cervix_dilation_action_limit" +priority: 1 +actions: + - "isRelevant = true" +--- +name: step1_head_descent_alert +description: Cervix dilation is not empty +condition: "(step1_descent_presenting_part == 5 && global_partograph_duration >= 4) || (step1_descent_presenting_part == 4 && global_partograph_duration >= 8) || (step1_descent_presenting_part == 3 && global_partograph_duration >= 12) || (step1_descent_presenting_part == 2 && global_partograph_duration >= 16) || (step1_descent_presenting_part == 1 && global_partograph_duration >= 20)" +priority: 1 +actions: + - "isRelevant = true" +--- +name: step1_contraction_every_half_hour_time +description: contraction_every_half_hour_time +condition: "step1_contraction_every_half_hour_frequency != ''" +priority: 1 +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_mode_of_delivery_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_mode_of_delivery_relevance.yml new file mode 100644 index 000000000..4c7b0e0cc --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_mode_of_delivery_relevance.yml @@ -0,0 +1,14 @@ +--- +name: step1_delivery_mode_caesarian_reason +description: Reason for cesarean delivery +priority: 1 +condition: "step1_mode_of_delivery == 'cesarean'" +actions: + - "isRelevant = true" +--- +name: step1_delivery_mode_caesarian_reason_other +description: Reason for cesarean delivery +priority: 1 +condition: "step1_delivery_mode_caesarian_reason.contains('others')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_mother_observation_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_mother_observation_relevance.yml new file mode 100644 index 000000000..34f294de6 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_mother_observation_relevance.yml @@ -0,0 +1,14 @@ +--- +name: step1_prompt_for_management_of_hypertension +description: prompt_for_management_of_hypertension +priority: 1 +condition: "step1_systolic >= 130 || step1_diastolic >= 90" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_management_of_hypotension +description: prompt_for_management_of_hypotension +priority: 1 +condition: "(!step1_systolic.equals('') && step1_systolic < 100) || (!step1_diastolic.equals('') && step1_diastolic < 60)" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_mother_status_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_mother_status_relevance.yml new file mode 100644 index 000000000..1408d4c9e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_mother_status_relevance.yml @@ -0,0 +1,15 @@ +--- +name: step1_supervised_by_occupation +description: supervised_by_occupation relevance +priority: 1 +condition: "step1_designation_of_delivery_personnel.contains('student')" +actions: + - "isRelevant = true" +--- +name: step1_name_of_supervising_person +description: name_of_supervising_person relevance +priority: 1 +condition: "step1_designation_of_delivery_personnel.contains('student')" +actions: + - "isRelevant = true" + diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_mother_wellbeing_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_mother_wellbeing_relevance.yml new file mode 100644 index 000000000..d47f59b94 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_mother_wellbeing_relevance.yml @@ -0,0 +1,42 @@ +--- +name: step1_prompt_for_management_of_hypertension +description: prompt_for_management_of_hypertension +priority: 1 +condition: "step1_systolic >= 130 || step1_diastolic >= 90" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_management_of_hypotension +description: prompt_for_management_of_hypotension +priority: 1 +condition: "(!step1_systolic.equals('') && step1_systolic < 100) || (!step1_diastolic.equals('') && step1_diastolic < 60)" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_urine +description: prompt_for_urine +priority: 1 +condition: "step1_urine_protein.contains('++') || step1_urine_protein.contains('+++') || step1_urine_acetone.contains('++') || step1_urine_acetone.contains('+++')|| step1_urine_volume.contains('++') || step1_urine_volume.contains('+++')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_respiratory_rate +description: prompt for respiratory rate management +priority: 1 +condition: "!step1_respiratory_rate.equals('') && (step1_respiratory_rate < 16 || step1_respiratory_rate > 24)" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_acetone +description: prompt for acetone +priority: 1 +condition: "step1_urine_acetone=='++' || step1_urine_acetone == '+++'" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_protein +description: prompt for protein +priority: 1 +condition: "step1_urine_protein=='++' || step1_urine_protein == '+++'" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_partograph_monitoring_time_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_partograph_monitoring_time_calculation.yml new file mode 100644 index 000000000..bb1e7f3f4 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_partograph_monitoring_time_calculation.yml @@ -0,0 +1,14 @@ +--- +name: step1_last_partograph_monitoring_time +description: last_partograph_monitoring_time calculated +priority: 1 +condition: "true" +actions: + - "calculation = step1_partograph_date == global_partograph_monitoring_date? global_partograph_monitoring_time : '00:00'" +--- +name: step1_thirty_minutes_ago +description: last_partograph_monitoring_time calculated +priority: 1 +condition: "true" +actions: + - "calculation = global_partograph_limit" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_registration_current_labour_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_registration_current_labour_calculation.yml new file mode 100644 index 000000000..bea9c52ec --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_registration_current_labour_calculation.yml @@ -0,0 +1,37 @@ +--- +name: step1_labour_onset_timestamp +description: labour_onset_timestamp +priority: 1 +condition: "true" +actions: + - "def checkRelevance(labourOnsetDateString, labourOnsetTimeString) { + import java.util.*; + import java.text.SimpleDateFormat; + + + SimpleDateFormat simpleDateFormat = new SimpleDateFormat('dd-MM-yyyy HH:mm'); + String dateString = labourOnsetDateString+' '+labourOnsetTimeString; + + Date date = simpleDateFormat.parse(dateString); + return date.getTime(); + }" + - "calculation = step1_labour_onset_date != '' && step1_labour_onset_time != '' ? checkRelevance(step1_labour_onset_date, step1_labour_onset_time) : 0" +--- +name: step1_membrane_raptured_date_timestamp +description: membrane_raptured_date_timestamp +priority: 1 +condition: "true" +actions: + - "def checkRelevance(membraneRupturedDateString, membraneRupturedTimeString) { + import java.util.*; + import java.text.SimpleDateFormat; + + + SimpleDateFormat simpleDateFormat = new SimpleDateFormat('dd-MM-yyyy HH:mm'); + String dateString = membraneRupturedDateString+' '+membraneRupturedTimeString; + + Date date = simpleDateFormat.parse(dateString); + return date.getTime(); + }" + - "calculation = step1_membrane_ruptured_date != '' && step1_membrane_ruptured_time != '' ? checkRelevance(step1_membrane_ruptured_date, step1_membrane_ruptured_time) : 0" + diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_registration_current_labour_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_registration_current_labour_relevance.yml new file mode 100644 index 000000000..88dafbb6b --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_registration_current_labour_relevance.yml @@ -0,0 +1,29 @@ +--- +name: step1_prompt_for_ruptured_membrane +description: prompt_for_ruptured_membrane +priority: 1 +condition: "step1_membrane.equals('ruptured') && step1_labour_onset_timestamp <= step1_membrane_raptured_date_timestamp" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_prom +description: prompt_for_prom +priority: 1 +condition: "step1_membrane.equals('ruptured') && step1_membrane_ruptured_date != '' && step1_membrane_ruptured_time != '' && step1_labour_onset_date != '' && step1_labour_onset_time != '' && step1_labour_onset_timestamp > step1_membrane_raptured_date_timestamp" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_fetal_movement +description: prompt_for_fetal_movement +priority: 1 +condition: "step1_fetal_movement.equals('absent')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_reduced_fetal_movement +description: prompt_for_reduced_fetal_movement +priority: 1 +condition: "step1_fetal_movement.equals('present') && step1_movement_status.equals('reduced')" +actions: + - "isRelevant = true" + diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_registration_obstetric_history_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_registration_obstetric_history_calculation.yml new file mode 100644 index 000000000..caa02e07f --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_registration_obstetric_history_calculation.yml @@ -0,0 +1,44 @@ +--- +name: step1_gest_age +description: Gestational age calculated +priority: 1 +condition: "true" +actions: + - "calculation = (helper.getDifferenceDays(step1_edd != '' ? helper.subtractDuration(step1_edd,'280d') : step1_last_menstrual_period)-helper.getDifferenceDays(helper.getDateToday())) /7" + +--- +name: step1_gest_age_note +description: Gestational age calculated +priority: 1 +condition: "true" +actions: + - "calculation = step1_gest_age" + +--- +name: step1_edd +description: Edd calculated +priority: 1 +condition: "true" +actions: + - "calculation = helper.addDuration(step1_last_menstrual_period,'280d')" +--- +name: step1_edd_note +description: Edd calculated +priority: 1 +condition: "true" +actions: + - "calculation = helper.addDuration(step1_last_menstrual_period,'280d')" +--- +name: step1_gravida_minus_para +description: Gravida minus para +priority: 1 +condition: "true" +actions: + - "calculation = (step1_gravida - step1_para)" +--- +name: step1_children_alive +description: children_alive +priority: 1 +condition: "!step1_para.equals('') && step1_para > 0" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_registration_obstetric_history_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_registration_obstetric_history_relevance.yml new file mode 100644 index 000000000..525c0df88 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_registration_obstetric_history_relevance.yml @@ -0,0 +1,7 @@ +--- +name: step1_prompt_for_grand_multiparity +description: prompt_for_grand_multiparity relevance +priority: 1 +condition: "step1_gravida >= 5 && step1_para >= 4" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_stage4_newborn_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_stage4_newborn_calculation.yml new file mode 100644 index 000000000..f02b28eef --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_stage4_newborn_calculation.yml @@ -0,0 +1,140 @@ +--- +name: step1_apgar_score_at_1_minute +description: apgar_score_at_1_minute calculation +priority: 1 +condition: "step1_apgar_activity_score_at_1_minute != '' && step1_apgar_pulse_score_at_1_minute != '' && step1_apgar_grimace_on_stimulation_score_at_1_minute != '' && step1_apgar_appearance_score_at_1_minute != '' && step1_apgar_respiration_score_at_1_minute != ''" +actions: + - "calculation = step1_apgar_activity_score_at_1_minute + step1_apgar_pulse_score_at_1_minute + step1_apgar_grimace_on_stimulation_score_at_1_minute + step1_apgar_appearance_score_at_1_minute + step1_apgar_respiration_score_at_1_minute" +--- +name: step1_prompt_for_normal_apgar_score_at_1_minute +description: prompt_for_normal_apgar_score info +priority: 1 +condition: "step1_apgar_score_at_1_minute != ''" +actions: + - "calculation = ['apgar_score':step1_apgar_score_at_1_minute]" +--- +name: step1_prompt_for_abnormal_apgar_score_at_1_minute +description: prompt_for_abnormal_apgar_score info +priority: 1 +condition: "step1_apgar_score_at_1_minute != ''" +actions: + - "calculation = ['apgar_score':step1_apgar_score_at_1_minute]" +--- +name: step1_apgar_score_at_5_minutes +description: apgar_score_at_5_minutes calculation +priority: 1 +condition: "step1_apgar_activity_score_at_5_minutes != '' && step1_apgar_pulse_score_at_5_minutes != '' && step1_apgar_grimace_on_stimulation_score_at_5_minutes != '' && step1_apgar_appearance_score_at_5_minutes != '' && step1_apgar_respiration_score_at_5_minutes != ''" +actions: + - "calculation = step1_apgar_activity_score_at_5_minutes + step1_apgar_pulse_score_at_5_minutes + step1_apgar_grimace_on_stimulation_score_at_5_minutes + step1_apgar_appearance_score_at_5_minutes + step1_apgar_respiration_score_at_5_minutes" +--- +name: step1_apgar_score_at_5_minutes_test +description: apgar_score_at_1_minute calculation +priority: 1 +condition: "true" +actions: + - "calculation = step1_apgar_score_at_5_minutes > 0 && step1_apgar_score_at_5_minutes < 7 ? 'true':'false'" +--- +name: step1_prompt_for_normal_apgar_score_at_5_minutes +description: prompt_for_normal_apgar_score info +priority: 1 +condition: "step1_apgar_score_at_5_minutes != ''" +actions: + - "calculation = ['apgar_score':step1_apgar_score_at_5_minutes]" +--- +name: step1_prompt_for_abnormal_apgar_score_at_5_minutes +description: prompt_for_abnormal_apgar_score info +priority: 1 +condition: "step1_apgar_score_at_5_minutes != ''" +actions: + - "calculation = ['apgar_score':step1_apgar_score_at_5_minutes]" +--- +name: step1_followup_visit_date +description: hei follow-up visit date +priority: 1 +condition: "step1_risk_category != ''" +actions: + - "calculation = helper.getDateToday()" +--- +name: step1_prophylaxis_arv_for_high_risk_given +description: prophylaxis_arv_for_high_risk_given +priority: 1 +condition: "step1_risk_category.equals('high')" +actions: + - "calculation = 'true'" +--- +name: step1_visit_number +description: visit_number +priority: 1 +condition: "step1_risk_category != ''" +actions: + - "calculation = 1" +--- +name: step1_prophylaxis_arv_for_high_and_low_risk_given +description: prophylaxis_arv_for_high_and_low_risk_given +priority: 1 +condition: "step1_risk_category.equals('low')" +actions: + - "calculation = 'true'" +--- +name: step1_type_of_hiv_test +description: type_of_hiv_test +priority: 1 +condition: "step1_risk_category == 'high' " +actions: + - "calculation = 'DNA PCR'" +--- +name: step1_visit_number +description: visit_number calculation +priority: 1 +condition: "step1_risk_category != ''" +actions: + - "calculation = 0" +--- +name: step1_delivery_date +description: delivery_date calculation +priority: 1 +condition: "true" +actions: + - "calculation = global_child_number == '1st' ? global_delivery_date : step1_child_delivery_date" +--- +name: step1_next_facility_visit_date +description: next_facility_visit_date calculation +priority: 2 +condition: "step1_delivery_date != '' && step1_delivery_date != '0'" +actions: + - "calculation = helper.addDuration(step1_delivery_date, '6w')" +--- +name: step1_visit_number +description: visit_number calculation +priority: 1 +condition: "step1_collect_dbs.equals('yes')" +actions: + - "calculation = 'DNA PCR'" +--- +name: step1_reasons_for_not_keeping_the_baby_warm_skin_to_skin +description: reasons_for_not_keeping_the_baby_warm_skin_to_skin calculation +priority: 1 +condition: "step1_reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_low_apgar_score != '' || step1_reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_normal_apgar_score != ''" +actions: + - "calculation = step1_reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_low_apgar_score != ''? step1_reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_low_apgar_score : step1_reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_normal_apgar_score" +--- +name: step1_delivery_time +description: delivery_time calculation +priority: 1 +condition: "true" +actions: + - "calculation = global_child_number == '1st' ? global_delivery_time : step1_child_delivery_time" +--- +name: step1_mother_status +description: mother_status calculation +priority: 1 +condition: "true" +actions: + - "calculation = global_mother_status" +--- +name: step1_resuscitation +description: resuscitation calculation +priority: 1 +condition: "step1_newborn_status.contains('alive') && step1_apgar_score_at_5_minutes > 0" +actions: + - "calculation = step1_apgar_score_at_5_minutes < 7 ? step1_resuscitation_question : 'no_resuscitation'" diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_stage4_newborn_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_stage4_newborn_relevance.yml new file mode 100644 index 000000000..b03fa3a29 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_stage4_newborn_relevance.yml @@ -0,0 +1,778 @@ +--- +name: step1_sex +description: sex +priority: 1 +condition: "step1_newborn_status.contains('alive') || step1_newborn_status.contains('still_birth')" +actions: + - "isRelevant = true" +--- +name: step1_still_birth_choice +description: still_birth_choice +priority: 1 +condition: "step1_newborn_status.contains('still_birth')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_apgar_at_1_minute +description: prompt_for_apgar_at_1_minute +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer1 +description: spacer1 +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_score_activity_label +description: apgar_score_activity_label +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer2 +description: spacer2 +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_activity_score_at_1_minute +description: apgar_activity_score_at_1_minute +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer3 +description: spacer3 +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_pulse_score_label +description: apgar_pulse_score_label +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer4 +description: spacer4 +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_pulse_score_at_1_minute +description: apgar_pulse_score_at_1_minute +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer5 +description: spacer5 +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_grimace_on_stimulation_score_label +description: apgar_grimace_on_stimulation_score_label +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer6 +description: spacer6 +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_grimace_on_stimulation_score_at_1_minute +description: apgar_grimace_on_stimulation_score_at_1_minute +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer7 +description: spacer7 +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_appearance_score_label +description: apgar_appearance_score_label +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer8 +description: spacer8 +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_appearance_score_at_1_minute +description: apgar_appearance_score_at_1_minute +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer9 +description: spacer9 +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_respiration_score_label +description: apgar_respiration_score_label +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer10 +description: spacer10 +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer11 +description: spacer11 +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_respiration_score_at_1_minute +description: apgar_respiration_score_at_1_minute +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_score_at_1_minute +description: apgar_score_at_1_minute +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer11 +description: spacer11 +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_apgar_at_5_minute +description: prompt_for_apgar_at_5_minute relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer12 +description: spacer12 relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_score_activity_label_at_5_mins +description: apgar_score_activity_label_at_5_mins relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer13 +description: spacer13 relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_activity_score_at_5_minutes +description: apgar_activity_score_at_5_minutes relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer14 +description: spacer14 relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_pulse_score_label_at_5_mins +description: apgar_pulse_score_label_at_5_mins relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer15 +description: spacer15 relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_pulse_score_at_5_minutes +description: apgar_pulse_score_at_5_minutes relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer16 +description: spacer16 relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_grimace_on_stimulation_score_label_at_5_mins +description: apgar_grimace_on_stimulation_score_label_at_5_mins relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer17 +description: spacer17 relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_grimace_on_stimulation_score_at_5_minutes +description: apgar_grimace_on_stimulation_score_at_5_minutes relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer18 +description: spacer18 relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_appearance_score_label_at_5_mins +description: apgar_appearance_score_label_at_5_mins relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer19 +description: spacer19 relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_appearance_score_at_5_minutes +description: apgar_appearance_score_at_5_minutes relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer20 +description: spacer20 relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_respiration_score_label_at_5_mins +description: apgar_respiration_score_label_at_5_mins relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer21 +description: spacer21 relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_respiration_score_at_5_minutes +description: apgar_respiration_score_at_5_minutes relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_apgar_score_at_5_minutes +description: apgar_score_at_5_minutes relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_spacer22 +description: spacer22 relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_normal_apgar_score_at_5_minutes +description: prompt_for_normal_apgar_score_at_5_minutes relevance +priority: 1 +condition: "step1_newborn_status == 'alive' && step1_apgar_score_at_5_minutes!= '' && step1_apgar_score_at_5_minutes!= '0' && step1_apgar_score_at_5_minutes >= 7 " +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_abnormal_apgar_score_at_5_minutes +description: prompt_for_abnormal_apgar_score_at_5_minutes relevance +priority: 1 +condition: "step1_newborn_status == 'alive' && step1_apgar_score_at_5_minutes!= '' && step1_apgar_score_at_5_minutes!= '0' && step1_apgar_score_at_5_minutes > 0 && step1_apgar_score_at_5_minutes < 7 " +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_normal_apgar_score_at_1_minute +description: prompt_for_normal_apgar_score_at_1_minute relevance +priority: 1 +condition: "step1_newborn_status == 'alive' && step1_apgar_score_at_1_minute!= '' && step1_apgar_score_at_1_minute!= '0' && step1_apgar_score_at_1_minute >= 7 " +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_abnormal_apgar_score_at_1_minute +description: prompt_for_abnormal_apgar_score_at_1_minute relevance +priority: 1 +condition: "step1_newborn_status == 'alive' && step1_apgar_score_at_1_minute!= '' && step1_apgar_score_at_1_minute!= '0' && step1_apgar_score_at_1_minute > 0 && step1_apgar_score_at_1_minute < 7 " +actions: + - "isRelevant = true" +--- +name: step1_resuscitation_question +description: resuscitation relevance +priority: 1 +condition: "step1_newborn_status.contains('alive') && step1_apgar_score_at_5_minutes > 0 && step1_apgar_score_at_5_minutes < 7" +actions: + - "isRelevant = true" +--- +name: step1_temperature +description: temperature relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_weight +description: weight relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_underweight +description: prompt_for_underweight relevance +priority: 1 +condition: "step1_weight != '' && step1_weight != '0' && step1_weight < 2.5" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_overweight +description: prompt_for_overweight relevance +priority: 1 +condition: "step1_weight != '' && step1_weight != '0' && step1_weight > 3.8" +actions: + - "isRelevant = true" +--- +name: step1_heart_rate +description: heart_rate relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_keep_warm +description: keep_warm relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_respiratory_rate +description: respiratory_rate relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_cord_bleeding +description: cord_bleeding relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_cord_bleeding +description: prompt_for_cord_bleeding relevance +priority: 1 +condition: "step1_cord_bleeding.contains('yes')" +actions: + - "isRelevant = true" +--- +name: step1_early_bf_1hr +description: early_bf_1hr relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_reason_for_not_breast_feeding_within_one_hour +description: reason_for_not_breast_feeding_within_one_hour relevance +priority: 1 +condition: "step1_early_bf_1hr.contains('no')" +actions: + - "isRelevant = true" +--- +name: step1_other_reason_for_not_breast_feeding_within_one_hour +description: other_reason_for_not_breast_feeding_within_one_hour relevance +priority: 1 +condition: "step1_reason_for_not_breast_feeding_within_one_hour.contains('other')" +actions: + - "isRelevant = true" +--- +name: step1_eye_care +description: eye_care relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_reason_for_not_giving_eye_care +description: eye_care relevance +priority: 1 +condition: "step1_eye_care.contains('no')" +actions: + - "isRelevant = true" +--- +name: step1_other_reason_for_not_giving_eye_care +description: other_reason_for_not_giving_eye_care relevance +priority: 1 +condition: "step1_reason_for_not_giving_eye_care.contains('other')" +actions: + - "isRelevant = true" +--- +name: step1_risk_category +description: risk_category relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_high_risk +description: prompt_for_high_risk relevance +priority: 1 +condition: "step1_risk_category.contains('high')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_low_risk +description: prompt_for_low_risk relevance +priority: 1 +condition: "step1_risk_category.contains('low')" +actions: + - "isRelevant = true" +--- +name: step1_provided_azt_nvp_syrup +description: provided_azt_nvp_syrup relevance +priority: 1 +condition: "step1_risk_category.contains('high')" +actions: + - "isRelevant = true" +--- +name: step1_provided_other_combinations +description: provided_other_combinations relevance +priority: 1 +condition: "step1_provided_azt_nvp_syrup.contains('no')" +actions: + - "isRelevant = true" +--- +name: step1_specify_the_combinations +description: specify_the_combinations relevance +priority: 1 +condition: "step1_provided_other_combinations.contains('yes')" +actions: + - "isRelevant = true" +--- +name: step1_number_of_azt_nvp_days_dispensed +description: number_of_azt_nvp_days_dispensed relevance +priority: 1 +condition: "step1_provided_azt_nvp_syrup.equals('yes') || step1_provided_other_combinations.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_reason_for_not_providing_other_combination +description: reason_for_not_providing_other_combination relevance +priority: 1 +condition: "step1_provided_other_combinations.equals('no')" +actions: + - "isRelevant = true" +--- +name: step1_other_reason_for_not_providing_other_combination +description: other_reason_for_not_providing_other_combination relevance +priority: 1 +condition: "step1_reason_for_not_providing_other_combination.equals('other')" +actions: + - "isRelevant = true" +--- +name: step1_collect_dbs +description: collect_dbs relevance +priority: 1 +condition: "step1_risk_category.equals('high')" +actions: + - "isRelevant = true" +--- +name: step1_reason_not_collecting_dbs +description: reason_not_collecting_dbs relevance +priority: 1 +condition: "step1_collect_dbs.equals('no')" +actions: + - "isRelevant = true" +--- +name: step1_sample_id +description: sample_id relevance +priority: 1 +condition: "step1_collect_dbs.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_sample_collection_date +description: sample_collection_date relevance +priority: 1 +condition: "step1_collect_dbs.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_dna_pcr_collection_time +description: dna_pcr_collection_time relevance +priority: 1 +condition: "step1_collect_dbs.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_provided_nvp_syrup +description: provided_nvp_syrup relevance +priority: 1 +condition: "step1_risk_category.equals('low')" +actions: + - "isRelevant = true" +--- +name: step1_number_of_nvp_days_dispensed +description: number_of_nvp_days_dispensed relevance +priority: 1 +condition: "step1_provided_nvp_syrup.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_reason_for_not_providing_nvp_syrup +description: reason_for_not_providing_nvp_syrup relevance +priority: 1 +condition: "step1_provided_nvp_syrup.equals('no')" +actions: + - "isRelevant = true" +--- +name: step1_other_reason_for_not_providing_nvp_syrup +description: other_reason_for_not_providing_nvp_syrup relevance +priority: 1 +condition: "step1_reason_for_not_providing_nvp_syrup.equals('other')" +actions: + - "isRelevant = true" +--- +name: step1_child_bcg_vaccination +description: child_bcg_vaccination relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_child_opv0_vaccination +description: child_opv0_vaccination relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_child_hepatitis_b_vaccination +description: child_hepatitis_b_vaccination relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_respiratory_rate +description: prompt for respiratory rate management +priority: 1 +condition: "step1_respiratory_rate != '' && step1_respiratory_rate != '0' && step1_respiratory_rate != '0' && (step1_respiratory_rate < 40 || step1_respiratory_rate > 60)" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_fetal_distress +description: prompt for fetal distress +priority: 1 +condition: "step1_heart_rate != '' && step1_heart_rate != '0' && step1_heart_rate != '0' && (step1_heart_rate > 160 || step1_heart_rate < 120)" +actions: + - "isRelevant = true" +--- +name: step1_reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_low_apgar_score +description: step1_reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_low_apgar_score relevance +priority: 1 +condition: "step1_keep_warm.contains('no') && step1_apgar_score_at_5_minutes < 7" +actions: + - "isRelevant = true" +--- +name: step1_reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_normal_apgar_score +description: reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_normal_apgar_score relevance +priority: 1 +condition: "step1_keep_warm.contains('no') && step1_apgar_score_at_5_minutes >= 7" +actions: + - "isRelevant = true" +--- +name: step1_other_reason_for_not_keeping_the_baby_warm_skin_to_skin +description: other_reason_for_not_keeping_the_baby_warm_skin_to_skin relevance +priority: 1 +condition: "step1_reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_normal_apgar_score.equals('other') || step1_reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_low_apgar_score.equals('other')" +actions: + - "isRelevant = true" +--- +name: step1_child_delivery_date +description: child_delivery_date relevance +priority: 1 +condition: "global_child_number != '1st'" +actions: + - "isRelevant = true" +--- +name: step1_child_delivery_time +description: child_delivery_time relevance +priority: 1 +condition: "global_child_number != '1st'" +actions: + - "isRelevant = true" +--- +name: step1_notify_client_has_fever +description: notify_client_has_fever relevance +priority: 1 +condition: "step1_temperature != '' && step1_temperature != '0' && step1_temperature > 37.8" +actions: + - "isRelevant = true" +--- +name: step1_notify_client_has_hypothermia +description: notify_client_has_hypothermia relevance +priority: 1 +condition: "step1_temperature != '' && step1_temperature != '0' && step1_temperature < 36.5" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_bcg_vacc_not_provided +description: prompt_for_bcg_vacc_not_provided relevance +priority: 1 +condition: "step1_child_bcg_vaccination.contains('no')" +actions: + - "isRelevant = true" +--- +name: step1_reason_for_not_providing_bcg_vacc +description: reason_for_not_providing_bcg_vacc relevance +priority: 1 +condition: "step1_child_bcg_vaccination.contains('no')" +actions: + - "isRelevant = true" +--- +name: step1_other_reason_for_not_providing_bcg_vacc +description: other_reason_for_not_providing_bcg_vacc relevance +priority: 1 +condition: "step1_reason_for_not_providing_bcg_vacc.contains('others')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_opv0_vacc_not_provided +description: prompt_for_opv0_vacc_not_provided relevance +priority: 1 +condition: "step1_child_opv0_vaccination.contains('no')" +actions: + - "isRelevant = true" +--- +name: step1_reason_for_not_providing_opv0_vacc +description: reason_for_not_providing_opv0_vacc relevance +priority: 1 +condition: "step1_child_opv0_vaccination.contains('no')" +actions: + - "isRelevant = true" +--- +name: step1_other_reason_for_not_providing_opv0_vacc +description: other_reason_for_not_providing_opv0_vacc relevance +priority: 1 +condition: "step1_reason_for_not_providing_opv0_vacc.contains('others')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_hepatitis_b_not_provided +description: prompt_for_hepatitis_b_not_provided relevance +priority: 1 +condition: "step1_child_hepatitis_b_vaccination.contains('no')" +actions: + - "isRelevant = true" +--- +name: step1_reason_for_not_providing_hepatitis_b_vacc +description: reason_for_not_providing_hepatitis_b_vacc relevance +priority: 1 +condition: "step1_child_hepatitis_b_vaccination.contains('no')" +actions: + - "isRelevant = true" +--- +name: step1_other_reason_for_not_providing_hepatitis_b_injection +description: other_reason_for_not_providing_hepatitis_b_injection relevance +priority: 1 +condition: "step1_reason_for_not_providing_hepatitis_b_vacc.contains('others')" +actions: + - "isRelevant = true" +--- +name: step1_child_vitamin_k_injection +description: child_vitamin_k_injection relevance +priority: 1 +condition: "step1_newborn_status.contains('alive')" +actions: + - "isRelevant = true" +--- +name: step1_reason_for_not_providing_vitamin_k_injection +description: reason_for_not_providing_vitamin_k_injection relevance +priority: 1 +condition: "step1_child_vitamin_k_injection.contains('no')" +actions: + - "isRelevant = true" +--- +name: step1_other_reason_for_not_providing_vitamin_k_injection +description: other_reason_for_not_providing_vitamin_k_injection relevance +priority: 1 +condition: "step1_reason_for_not_providing_vitamin_k_injection.contains('others')" +actions: + - "isRelevant = true" + diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_test_rules.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_test_rules.yml new file mode 100644 index 000000000..124e60837 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_test_rules.yml @@ -0,0 +1,14 @@ +--- +name: step1_hb_test_date +description: HB test date calculated +priority: 1 +condition: "true" +actions: + - "calculation = helper.getDateToday()" +--- +name: step1_prompt_for_moderate_anaemia_management +description: prompt for moderate anaemia management +priority: 1 +condition: "!step1_hb_level.equals('') && Float.parseFloat(step1_hb_level) > 8.5 && Float.parseFloat(step1_hb_level) <= 11.4" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_triage_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_triage_calculation.yml new file mode 100644 index 000000000..35093315d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_triage_calculation.yml @@ -0,0 +1,37 @@ +--- +name: step1_bmi +description: BMI calculated +priority: 1 +condition: "true" +actions: + - "calculation = Float.parseFloat(step1_weight) / (Float.parseFloat(step1_height) * Float.parseFloat(step1_height) / 10000)" +--- +name: step4_gest_age +description: Gestational age calculated +priority: 1 +condition: "true" +actions: + - "calculation = (helper.getDifferenceDays(step4_edd != '' ? helper.subtractDuration(step4_edd,'280d') : step4_last_menstrual_period)-helper.getDifferenceDays(helper.getDateToday())) /7" + +--- +name: step4_gest_age_note +description: Gestational age calculated +priority: 1 +condition: "true" +actions: + - "calculation = step4_gest_age" + +--- +name: step4_edd +description: Edd calculated +priority: 1 +condition: "true" +actions: + - "calculation = helper.addDuration(step4_last_menstrual_period,'280d')" +--- +name: step4_edd_note +description: Edd calculated +priority: 1 +condition: "true" +actions: + - "calculation = helper.addDuration(step4_last_menstrual_period,'280d')" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_triage_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_triage_relevance.yml new file mode 100644 index 000000000..f8bad7f01 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_triage_relevance.yml @@ -0,0 +1,49 @@ +--- +name: step1_prompt_for_management_of_hypertension +description: prompt_for_management_of_hypertension +priority: 1 +condition: "step1_systolic >= 130 || step1_diastolic >= 90" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_management_of_hypotension +description: prompt_for_management_of_hypotension +priority: 1 +condition: "(step1_systolic.equals('') && step1_systolic < 100) || (!step1_diastolic.equals('') && step1_diastolic < 60)" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_fetal_distress +description: prompt for fetal distress +priority: 1 +condition: "!step1_fetal_heart_rate.equals('') && (step1_fetal_heart_rate > 160 || step1_fetal_heart_rate < 120)" +actions: + - "isRelevant = true" +--- +name: step1_bmi +description: BMI should be visible once height and weight are filled +priority: 1 +condition: "!step1_weight.equals('') && !step1_height.equals('')" +actions: + - "isRelevant = true" +--- +name: step1_management_provided_for_mild_anaemia +description: management_provided_for_mild_anaemia question relevance +priority: 1 +condition: "!step1_hb_level.equals('') && Float.parseFloat(step1_hb_level) > 8.5 && Float.parseFloat(step1_hb_level) <= 11" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_respiratory_rate +description: prompt for respiratory rate management +priority: 1 +condition: "!step1_respiratory_rate.equals('') && step1_respiratory_rate < 16 || step1_respiratory_rate > 24" +actions: + - "isRelevant = true" +--- +name: step1_pmtct_test_date +description: pmtct_test_date management +priority: 1 +condition: "!step1_hiv.equals('unknown') && !step1_hiv.equals('')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_true_labour_confirmation_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_true_labour_confirmation_calculation.yml new file mode 100644 index 000000000..a2ea588d8 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_true_labour_confirmation_calculation.yml @@ -0,0 +1,24 @@ +--- +name: step1_labour_confirmation +description: Labour Confirmation calculation +priority: 1 +condition: "true" +actions: + - 'def getLabourConfirmation(trueLabour, admitClient) { + import java.util.*; + int value = 0; + if (trueLabour.contains("painful_uterine_contraction")) + value =+1; + + if (trueLabour.contains("bloody_vaginal_discharge")) + value =+1; + + if (trueLabour.contains("effacement_and_dilatation")) + value =+1; + + if (trueLabour.contains("progressive_descent")) + value =+1; + + return value >= 2 || admitClient == "yes"; + }' + - "calculation = getLabourConfirmation(step1_true_labour, step1_admit_client)" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_vaginal_examination_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_vaginal_examination_calculation.yml new file mode 100644 index 000000000..a2a96809a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_vaginal_examination_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_labour_onset_time +description: labour_onset_time calculated +priority: 1 +condition: "true" +actions: + - "calculation = step1_vaginal_exam_date == global_labour_onset_date? global_labour_onset_time : '00:00'" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_vaginal_examination_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_vaginal_examination_relevance.yml new file mode 100644 index 000000000..371f92256 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/labour_and_delivery_vaginal_examination_relevance.yml @@ -0,0 +1,70 @@ +--- +name: step1_prompt_for_cervix_dilation +description: prompt for Cervix dilation +priority: 1 +condition: "step1_cervix_dilation < 3 && step1_cervix_dilation != 0" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_presenting_part +description: prompt_for_presenting_part +priority: 1 +condition: "step1_presenting_part.contains('breech') || step1_presenting_part.contains('brow') || step1_presenting_part.contains('shoulder') || step1_presenting_part.contains('face') || step1_presenting_part.contains('cord')" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_amniotic_fluid +description: prompt_for_amniotic_fluid +priority: 1 +condition: "!step1_amniotic_fluid.equals('') && (step1_amniotic_fluid.contains('meconium_stained_liquor') || step1_amniotic_fluid.contains('blood_stained_liquor'))" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_moulding +description: prompt for moulding +priority: 1 +condition: "step1_moulding_options == 'sutures_overlapped_reducible' || step1_moulding_options == 'sutures_overlapped_not_reducible'" +actions: + - "isRelevant = true" +--- +name: step1_moulding_options +description: moulding_options relevance +priority: 1 +condition: "step1_moulding.contains('yes') || global_moulding.contains('yes')" +actions: + - "isRelevant = true" +--- +name: step1_occiput_position +description: occiput position relevance +priority: 1 +condition: "step1_presenting_part == 'vertex'" +actions: + - "isRelevant = true" +--- +name: step1_mento_position +description: mento position relevance +priority: 1 +condition: "step1_presenting_part == 'face'" +actions: + - "isRelevant = true" +--- +name: step1_sacro_position +description: sacro position relevance +priority: 1 +condition: "step1_presenting_part == 'breech'" +actions: + - "isRelevant = true" +--- +name: step1_dorso_position +description: Dorso position relevance +priority: 1 +condition: "step1_presenting_part == 'shoulder'" +actions: + - "isRelevant = true" +--- +name: step1_moulding +description: relevance for moulding +priority: 1 +condition: "!global_moulding.contains('yes') && step1_presenting_part != 'breech' && step1_presenting_part != 'shoulder' && step1_presenting_part != ''" +actions: + - "isRelevant = true" diff --git a/opensrp-chw-hf/src/main/assets/rule/ltfu_referral_form_rules.yml b/opensrp-chw-hf/src/main/assets/rule/ltfu_referral_form_rules.yml new file mode 100644 index 000000000..ddf2084aa --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/ltfu_referral_form_rules.yml @@ -0,0 +1,63 @@ +--- +name: "problem_for_on_art_visibility" +description: "Show options for clients on ART" +priority: 1 +condition: "on_art['yes'] != null" +actions: + - "problem_for_on_art_visibility = true" +--- +name: "problem_for_not_on_art_visibility" +description: "Show options for clients not on ART" +priority: 1 +condition: "on_art['no'] != null" +actions: + - "problem_for_not_on_art_visibility = true" +--- +name: "problem_calculation" +description: "Selected problem" +priority: 1 +condition: "true" +actions: + - "problem_calculation = (problem_for_on_art != null && !problem_for_on_art.isEmpty()) + ? problem_for_on_art : (problem_for_not_on_art != null && !problem_for_not_on_art.isEmpty()) + ? problem_for_not_on_art : null" +--- +name: "referral_date_calculation" +description: "Referral date calculation" +priority: 1 +condition: "true" +actions: + - "referral_date_calculation = System.currentTimeMillis()" +--- +name: "referral_time_calculation" +description: "Referral time calculation" +priority: 1 +condition: "true" +actions: + - "def getDate(dateFormat) { + import java.util.*; + import java.text.SimpleDateFormat; + return new SimpleDateFormat(dateFormat).format(System.currentTimeMillis()); + }" + - "referral_time_calculation = getDate('HH:mm:ss.SSS')" +--- +name: "referral_type_calculation" +description: "Referral type calculation" +priority: 1 +condition: "true" +actions: + - "referral_type_calculation = 'facility_to_community_referral'" +--- +name: "referral_status_calculation" +description: "Referral type calculation" +priority: 1 +condition: "true" +actions: + - "referral_status_calculation = 'PENDING'" +--- +name: "service_before_referral_calculation" +description: "Service Before Referral" +condition: "true" +priority: 1 +actions: + - "service_before_referral_calculation = 'None'" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/male_partner_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/male_partner_calculation.yml new file mode 100644 index 000000000..3fa5102b3 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/male_partner_calculation.yml @@ -0,0 +1,49 @@ +--- +name: step2_age_calculated +description: Age calculated +priority: 1 +condition: "true" +actions: + - "calculation = (!step2_dob_unknown.equals('') && step2_dob_unknown.contains('dob_unknown')) ? step2_age : helper.getDifferenceDays(step2_dob) / 365.25" +--- +name: step2_wra +description: wra calculation +priority: 1 +condition: "step2_sex == 'Female' && (step2_age_calculated >= 10 && step2_age_calculated <= 49)" +actions: + - "calculation = 1" +--- +name: step2_surname +description: set surname as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_fam_name" +--- +name: step2_first_name +description: set surname as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_client_first_name" +--- +name: step2_middle_name +description: set surname as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_client_middle_name" +--- +name: step2_reasons_for_registration +description: set reasons for registration +priority: 1 +condition: "true" +actions: + - "calculation = 'male_engagement'" +--- +name: step2_sex +description: set sex as male by default +priority: 1 +condition: "true" +actions: + - "calculation = 'Male'" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/male_partner_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/male_partner_relevance.yml new file mode 100644 index 000000000..48e4e1f80 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/male_partner_relevance.yml @@ -0,0 +1,63 @@ +--- +name: step2_dob +description: dob relevance +priority: 1 +condition: "!step2_dob_unknown.contains('dob_unknown')" +actions: + - "isRelevant = true" +--- +name: step2_dob_unknown +description: dob unknown relevance +priority: 1 +condition: "step2_dob.equals('')" +actions: + - "isRelevant = true" +--- +name: step2_age +description: age relevance +priority: 1 +condition: "step2_dob_unknown.contains('dob_unknown')" +actions: + - "isRelevant = true" +--- +name: step2_phone_number +description: phone number relevance +priority: 1 +condition: "step2_is_primary_caregiver == 'Yes'" +actions: + - "isRelevant = true" +--- +name: step2_id_avail +description: identity relevance +priority: 1 +condition: "(step2_dob != '' && helper.formatDate(step2_dob,'y') >= 18) || (step2_age != '' && step2_age >= 18)" +actions: + - "isRelevant = true" +--- +name: step2_marital_status +description: marital_status relevance +priority: 1 +condition: "(step2_dob != '' && helper.formatDate(step2_dob,'y') > 10) || (step2_age != '' && step2_age > 10)" +actions: + - "isRelevant = true" +--- +name: step2_insurance_provider_other +description: insurance_provider_other relevance +priority: 1 +condition: "!step2_insurance_provider.equals('') && step2_insurance_provider.equals('Other')" +actions: + - "isRelevant = true" +--- +name: step2_insurance_provider_number +descripltion: insurance number relevance +priority: 1 +condition: "!step2_insurance_provider.equals('') && !step2_insurance_provider.contains('None')" +actions: + - "isRelevant = true" +--- +name: step2_type_of_disability +description: type_of_disability relevance +priority: 1 +condition: "step2_disabilities.equals('Yes')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/mark_as_deceased_client_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/mark_as_deceased_client_calculation.yml new file mode 100644 index 000000000..1927faa3e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/mark_as_deceased_client_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_age_at_death +description: Calculated age_at_death +priority: 1 +condition: "step1_dod != '' && step1_dob != ''" +actions: + - "calculation = helper.getDuration(step1_dod , step1_dob)" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct-followup-rules.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct-followup-rules.yml new file mode 100755 index 000000000..12b04068d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct-followup-rules.yml @@ -0,0 +1,7 @@ +--- +name: schedule_every_month +description: monthly +priority: 1 +condition: "true" +actions: + - "pmtctFollowUpRule.updateDueDates()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_cd4_test_results_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_cd4_test_results_calculation.yml new file mode 100644 index 000000000..cc0a7aab6 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_cd4_test_results_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_cd4_result_date +description: cd4 result date calculation +priority: 1 +condition: "true" +actions: + - "calculation = helper.getDateToday()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_community_followup_referral_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_community_followup_referral_calculation.yml new file mode 100644 index 000000000..de280d352 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_community_followup_referral_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_pmtct_community_referral_date +description: pmtct_community_referral_date calculation +priority: 1 +condition: "true" +actions: + - "calculation = helper.getDateToday()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_community_followup_referral_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_community_followup_referral_relevance.yml new file mode 100644 index 000000000..d941d7bd9 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_community_followup_referral_relevance.yml @@ -0,0 +1,7 @@ +--- +name: "step1_last_client_visit_date" +description: "last client visit date relevance" +priority: 1 +condition: "(!step1_reasons_for_issuing_community_referral.equals('') && step1_reasons_for_issuing_community_referral != 'Other' && step1_reasons_for_issuing_community_referral != 'mother_champion_services')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_eac_first_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_eac_first_relevance.yml new file mode 100644 index 000000000..7963a5271 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_eac_first_relevance.yml @@ -0,0 +1,14 @@ +--- +name: step1_eac_day_2 +description: EAC day 2 date relevance +priority: 1 +condition: "!step1_eac_day_1.equals('') && (helper.getDifferenceDays(step1_eac_day_1)-helper.getDifferenceDays(helper.getDateToday())) >= 1" +actions: + - "isRelevant = true" +--- +name: step1_eac_day_3 +description: EAC day 3 date relevance +priority: 1 +condition: "!step1_eac_day_2.equals('') && (helper.getDifferenceDays(step1_eac_day_2)-helper.getDifferenceDays(helper.getDateToday())) >= 1" +actions: + - "isRelevant = true" diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_eac_visits_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_eac_visits_calculation.yml new file mode 100644 index 000000000..f2bc26fcc --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_eac_visits_calculation.yml @@ -0,0 +1,14 @@ +--- +name: step1_eac_completion_status +description: eac_completion_status is complete if additional_visit is no +priority: 1 +condition: "true" +actions: + - "calculation = (step1_additional_session != '' && step1_additional_session == 'no') ? 'complete' : 'incomplete'" +--- +name: step1_form_submission_timestamp +description: visit_date is the date of the eac +priority: 1 +condition: "true" +actions: + - "calculation = helper.getDateTimeToday()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_eac_visits_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_eac_visits_relevance.yml new file mode 100644 index 000000000..430beed99 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_eac_visits_relevance.yml @@ -0,0 +1,14 @@ +--- +name: step1_additional_session +description: relevant if the session is above 2 +priority: 1 +condition: "global_eac_session_number > 2 " +actions: + - "isRelevant = true" +--- +name: step1_patient_adherence_before_eac +description: relevant if the session is 1 +priority: 1 +condition: "global_eac_session_number == 1" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_followup_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_followup_calculation.yml new file mode 100644 index 000000000..dc0f228fd --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_followup_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_followup_visit_date +description: pmtct follow-up visit date +priority: 1 +condition: "true" +actions: + - "calculation = helper.getDateToday()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_form_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_form_calculation.yml new file mode 100644 index 000000000..5bbc92613 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_form_calculation.yml @@ -0,0 +1,35 @@ +--- +name: step1_pmtct_register_date +description: date of pmtct registration +priority: 1 +condition: "true" +actions: + - "calculation = step1_is_transfer_in_client.contains('yes') ? step1_pmtct_register_date_from_originating_facility : step1_is_transfer_in_client.contains('no') ? step1_pmtct_register_date_at_this_facility : helper.getDateToday()" +--- +name: step2_next_facility_visit_date +description: next facility visit date is date today if the client is transfer in else the next facility visit date is null +priority: 1 +condition: "step1_is_transfer_in_client.equals('yes')" +actions: + - "calculation = step1_is_transfer_in_client.contains('yes') ? helper.getDateToday() : '' " +--- +name: step2_followup_status +description: setting followup status to continuing with services if the client is transfer in else the followup status is null +priority: 1 +condition: "step1_is_transfer_in_client.equals('yes')" +actions: + - "calculation = step1_is_transfer_in_client.contains('yes') ? 'continuing_with_services' : '' " +--- +name: step1_hiv_registration_date +description: date of hiv registration +priority: 1 +condition: "true" +actions: + - "calculation = helper.getTimeInMillis()" +--- +name: step2_test_results +description: hiv status of the client +priority: 1 +condition: "!step2_hiv_status.equals('') || !step1_known_on_art.equals('')" +actions: + - "calculation = (!step1_known_on_art.equals('') && step1_known_on_art.contains('yes')) ? 'positive' : step2_hiv_status" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_fv_baseline_investigation_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_fv_baseline_investigation_calculation.yml new file mode 100644 index 000000000..f594e79c0 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_fv_baseline_investigation_calculation.yml @@ -0,0 +1,14 @@ +--- +name: step1_liver_function_test_conducted +description: check to decide if liver function test is conducted +priority: 1 +condition: "true" +actions: + - "calculation = global_isLiverFunctionTestConducted ? 'test_conducted' : step1_liver_function_test_conducted_question" +--- +name: step1_renal_function_test_conducted +description: check to decide if renal function test is conducted +priority: 1 +condition: "true" +actions: + - "calculation = global_isRenalFunctionTestConducted ? 'test_conducted' : step1_renal_function_test_conducted_question" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_fv_baseline_investigation_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_fv_baseline_investigation_relevance.yml new file mode 100644 index 000000000..200f93435 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_fv_baseline_investigation_relevance.yml @@ -0,0 +1,28 @@ +--- +name: step1_liver_function_test_conducted_question +description: liver function test conducted relevance +priority: 1 +condition: "!global_isLiverFunctionTestConducted" +actions: + - "isRelevant = true" +--- +name: step1_receive_liver_function_test_results +description: liver function test results relevance +priority: 1 +condition: "(step1_liver_function_test_conducted_question.contains('test_conducted') || global_isLiverFunctionTestConducted) && !global_isLiverFunctionTestResultsFilled" +actions: + - "isRelevant = true" +--- +name: step1_renal_function_test_conducted_question +description: renal function test conducted relevance +priority: 1 +condition: "!global_isRenalFunctionTestConducted" +actions: + - "isRelevant = true" +--- +name: step1_receive_renal_function_test_results +description: renal function test results relevance +priority: 1 +condition: "(step1_renal_function_test_conducted_question.contains('test_conducted') || global_isRenalFunctionTestConducted) && !global_isRenalFunctionTestResultsFilled" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_fv_counselling_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_fv_counselling_relevance.yml new file mode 100644 index 000000000..5bece3d40 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_fv_counselling_relevance.yml @@ -0,0 +1,7 @@ +--- +name: step1_followup_status +description: followup_status relevance +priority: 1 +condition: "global_is_visit_zero" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_hvl_suppression_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_hvl_suppression_relevance.yml new file mode 100644 index 000000000..a752d7c99 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_hvl_suppression_relevance.yml @@ -0,0 +1,28 @@ +--- +name: step1_hvl_suppression_after_eac_1 +description: hvl_suppression_after_eac relevance +priority: 1 +condition: "global_eac_visit == 'first_done'" +actions: + - "isRelevant = true" +--- +name: step1_hvl_suppression_after_eac_2 +description: hvl_suppression_after_eac relevance +priority: 1 +condition: "global_eac_visit == 'second_done'" +actions: + - "isRelevant = true" +--- +name: step1_hvl_suppression +description: hvl_suppression relevance +priority: 1 +condition: "global_eac_visit == 'not_done'" +actions: + - "isRelevant = true" +--- +name: step1_notify_continue_regimen_followup +description: notification to continue regimen relevance +priority: 1 +condition: "!step1_hvl_result.equals('') && step1_hvl_result <= 1000" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_hvl_test_results_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_hvl_test_results_calculation.yml new file mode 100644 index 000000000..d5d74b238 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_hvl_test_results_calculation.yml @@ -0,0 +1,14 @@ +--- +name: step1_hvl_result_date +description: hvl result date calculation +priority: 1 +condition: "true" +actions: + - "calculation = helper.getDateToday()" +--- +name: step1_enroll_to_eac +description: enroll to eac is 'yes' if the hvl result is greater than 1000 for before eac or if plan for patient is enroll_to_eac after eac +priority: 1 +condition: "true" +actions: + - "calculation = (step1_hvl_result > 1000 && !global_is_after_eac) || (step1_plan_for_patient.contains('extend_eac_sessions') && global_is_after_eac ) ? 'yes' : 'no'" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_hvl_test_results_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_hvl_test_results_relevance.yml new file mode 100644 index 000000000..0be562ec8 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_hvl_test_results_relevance.yml @@ -0,0 +1,91 @@ +--- +name: step1_notify_continue_eac +description: notify_continue_eac if is before eac and viral load is greater or equal to 1000 +priority: 1 +condition: "!global_is_after_eac && step1_hvl_result >= 1000" +actions: + - "isRelevant = true" +--- +name: step1_discuss_plan_prompt +description: discuss_plan_prompt if is after eac and viral load is greater or equal to 1000 +priority: 1 +condition: "global_is_after_eac && step1_hvl_result >= 1000" +actions: + - "isRelevant = true" +--- +name: step1_significant_drop_in_viral_load +description: significant_drop_in_viral_load relevance +priority: 1 +condition: "global_is_after_eac" +actions: + - "isRelevant = true" +--- +name: step1_patient_presenting_oi_or_immunosuppression +description: patient_presenting_oi_or_immunosuppression relevance +priority: 1 +condition: "global_is_after_eac" +actions: + - "isRelevant = true" +--- +name: step1_history_of_chronic_diarrhea_or_vomiting +description: history_of_chronic_diarrhea_or_vomiting relevance +priority: 1 +condition: "global_is_after_eac" +actions: + - "isRelevant = true" +--- +name: step1_use_of_traditional_medications +description: use_of_traditional_medications relevance +priority: 1 +condition: "global_is_after_eac" +actions: + - "isRelevant = true" +--- +name: step1_history_of_arv_side_effects +description: history_of_arv_side_effects relevance +priority: 1 +condition: "global_is_after_eac" +actions: + - "isRelevant = true" +--- +name: step1_plan_for_patient +description: plan_for_patient relevance +priority: 1 +condition: "global_is_after_eac && step1_hvl_result >= 1000" +actions: + - "isRelevant = true" +--- +name: step1_plan_for_patient_comment +description: plan_for_patient_comment relevance +priority: 1 +condition: "global_is_after_eac && step1_hvl_result >= 1000" +actions: + - "isRelevant = true" +--- +name: step1_review_team_lead_name +description: review_team_lead_name relevance +priority: 1 +condition: "global_is_after_eac && step1_hvl_result >= 1000" +actions: + - "isRelevant = true" +--- +name: step1_arv_regimen_plan +description: arv_regimen_plan relevance +priority: 1 +condition: "global_is_after_eac && step1_hvl_result < 1000" +actions: + - "isRelevant = true" +--- +name: step1_assessor_name +description: assessor_name relevance +priority: 1 +condition: "global_is_after_eac && step1_hvl_result < 1000" +actions: + - "isRelevant = true" +--- +name: step1_notify_continue_regimen +description: notify_continue_regimen relevance +priority: 1 +condition: "global_is_after_eac && step1_hvl_result < 1000" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_registation_for_clients_post_pnc_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_registation_for_clients_post_pnc_calculation.yml new file mode 100644 index 000000000..f9075262c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_registation_for_clients_post_pnc_calculation.yml @@ -0,0 +1,42 @@ +--- +name: step1_pmtct_register_date +description: date of pmtct registration +priority: 1 +condition: "true" +actions: + - "calculation = step1_is_transfer_in_client.contains('yes') ? step1_pmtct_register_date_from_originating_facility : step1_is_transfer_in_client.contains('no') ? step1_pmtct_register_date_at_this_facility : helper.getDateToday()" +--- +name: step1_next_facility_visit_date +description: next facility visit date is date today if the client is transfer in else the next facility visit date is null +priority: 1 +condition: "step1_is_transfer_in_client.equals('yes')" +actions: + - "calculation = step1_is_transfer_in_client.contains('yes') ? helper.getDateToday() : '' " +--- +name: step1_followup_status +description: setting followup status to continuing with services if the client is transfer in else the followup status is null +priority: 1 +condition: "step1_is_transfer_in_client.equals('yes')" +actions: + - "calculation = step1_is_transfer_in_client.contains('yes') ? 'continuing_with_services' : '' " +--- +name: step1_hiv_registration_date +description: date of hiv registration +priority: 1 +condition: "true" +actions: + - "calculation = helper.getTimeInMillis()" +--- +name: step1_test_results +description: hiv status of the client +priority: 1 +condition: "!step1_hiv_status.equals('') || !step1_known_on_art.equals('')" +actions: + - "calculation = (!step1_known_on_art.equals('') && step1_known_on_art.contains('yes')) ? 'positive' : step1_hiv_status" +--- +name: step1_hiv +description: hiv status of the client +priority: 1 +condition: "true" +actions: + - "calculation = step1_test_results" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_registration_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_registration_calculation.yml new file mode 100644 index 000000000..971fe1db4 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_registration_calculation.yml @@ -0,0 +1,28 @@ +--- +name: step1_known_on_art_client +description: known_on_art_client info +priority: 1 +condition: "true" +actions: + - "calculation = ['ctc_number':global_ctc_number]" +--- +name: step1_ctc_number +description: ctc_number calculation +priority: 1 +condition: "true" +actions: + - "calculation = global_ctc_number" +--- +name: step1_followup_visit_date +description: followup_visit_date calculation +priority: 1 +condition: "true" +actions: + - "calculation = helper.getDateToday()" +--- +name: step1_arv_regimen +description: arv_regimen calculation +priority: 1 +condition: "true" +actions: + - "calculation = !step1_first_line.equals('') ? step1_first_line : (!step1_second_line.equals('') ? step1_second_line : (!step1_third_line.equals('') ? step1_third_line : ''))" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_registration_for_clients_post_pnc_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_registration_for_clients_post_pnc_relevance.yml new file mode 100644 index 000000000..94a01e02a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_registration_for_clients_post_pnc_relevance.yml @@ -0,0 +1,105 @@ +--- +name: step1_ctc_number +description: ctc_number relevance +priority: 1 +condition: "step1_known_on_art.contains('yes') || step1_has_the_client_been_provided_with_ctc_number.contains('yes')" +actions: + - "isRelevant = true" +--- +name: step1_has_the_client_been_provided_with_ctc_number +description: has_the_client_been_provided_with_ctc_number relevance +priority: 1 +condition: "(!step1_hiv_status.equals('') && step1_hiv_status.contains('positive'))" +actions: + - "isRelevant = true" +--- +name: step1_hiv +description: hiv relevance +priority: 1 +condition: "!step1_medical_surgical_history.contains('known_on_art')" +actions: + - "isRelevant = true" +--- +name: step1_is_test_at_32 +description: is_test_at_32 relevance +priority: 1 +condition: "!step1_gest_age.equals('') && !step1_hiv.equals('') && step1_gest_age >= 32 && step1_hiv.contains('negative')" +actions: + - "isRelevant = true" +--- +name: step1_pmtct_register_date_from_originating_facility +description: pmtct_register_date_from_originating_facility relevance +priority: 1 +condition: "step1_is_transfer_in_client.equals('yes') && step1_known_on_art.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_clinical_staging_disease +description: clinical_staging_disease relevance +priority: 1 +condition: "step1_is_transfer_in_client.equals('yes') && step1_known_on_art.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_on_tb_treatment +description: on_tb_treatment relevance +priority: 1 +condition: "step1_is_transfer_in_client.equals('yes') && step1_known_on_art.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_was_the_test_for_cd4_count_conducted +description: was_the_test_for_cd4_count_conducted relevance +priority: 1 +condition: "step1_is_transfer_in_client.equals('yes') && step1_known_on_art.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_was_the_test_for_cd4_count_conducted +description: was_the_test_for_cd4_count_conducted relevance +priority: 1 +condition: "step1_is_transfer_in_client.equals('yes') && step1_known_on_art.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_was_the_hvl_test_conducted +description: was_the_hvl_test_conducted relevance +priority: 1 +condition: "step1_is_transfer_in_client.equals('yes') && step1_known_on_art.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_arv_line +description: arv_line relevance +priority: 1 +condition: "step1_is_transfer_in_client.equals('yes') && step1_known_on_art.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_pmtct_register_date_at_this_facility +description: pmtct_register_date_at_this_facility relevance +priority: 1 +condition: "step1_known_on_art.equals('yes') && step1_is_transfer_in_client.equals('no')" +actions: + - "isRelevant = true" +--- +name: step1_risk_category +description: risk_category relevance +priority: 1 +condition: "step1_known_on_art.equals('yes') || step1_hiv_status.equals('positive')" +actions: + - "isRelevant = true" +--- +name: step1_delivery_date +description: delivery_date relevance +priority: 1 +condition: "step1_known_on_art.equals('yes') || step1_hiv_status.equals('positive')" +actions: + - "isRelevant = true" +--- +name: step1_no_immediate_new_born +description: no_immediate_new_born relevance +priority: 1 +condition: "step1_known_on_art.equals('yes') || step1_hiv_status.equals('positive')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_registration_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_registration_relevance.yml new file mode 100644 index 000000000..4df43741d --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_registration_relevance.yml @@ -0,0 +1,42 @@ +--- +name: step2_ctc_number +description: ctc_number relevance +priority: 1 +condition: "step1_known_on_art.contains('yes') || step2_has_the_client_been_provided_with_ctc_number.contains('yes')" +actions: + - "isRelevant = true" +--- +name: step2_has_the_client_been_provided_with_ctc_number +description: has_the_client_been_provided_with_ctc_number relevance +priority: 1 +condition: "(!step2_hiv_status.equals('') && step2_hiv_status.contains('positive'))" +actions: + - "isRelevant = true" +--- +name: step2_hiv +description: hiv relevance +priority: 1 +condition: "!step1_medical_surgical_history.contains('known_on_art')" +actions: + - "isRelevant = true" +--- +name: step2_is_test_at_32 +description: is_test_at_32 relevance +priority: 1 +condition: "!step2_gest_age.equals('') && !step2_hiv.equals('') && step2_gest_age >= 32 && step2_hiv.contains('negative')" +actions: + - "isRelevant = true" +--- +name: step1_pmtct_register_date_from_originating_facility +description: pmtct_register_date_from_originating_facility relevance +priority: 1 +condition: "step1_is_transfer_in_client.equals('yes') && step1_known_on_art.equals('yes')" +actions: + - "isRelevant = true" +--- +name: step1_pmtct_register_date_at_this_facility +description: pmtct_register_date_at_this_facility relevance +priority: 1 +condition: "step1_is_transfer_in_client.equals('no') && step1_known_on_art.equals('yes')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pmtct_tb_screening_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pmtct_tb_screening_relevance.yml new file mode 100644 index 000000000..f0f083227 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pmtct_tb_screening_relevance.yml @@ -0,0 +1,42 @@ +--- +name: step1_eligibility_for_tpt +description: tpt eligibility relevance +priority: 1 +condition: "(step1_investigate_for_tb.contains('negative') || step1_tb_symptoms_screening.contains('chk_none'))" +actions: + - "isRelevant = true" +--- +name: step1_has_been_provided_with_tpt_before +description: has_been_provided_with_tpt_before relevance +priority: 1 +condition: "(step1_investigate_for_tb.contains('negative') || step1_tb_symptoms_screening.contains('chk_none')) && !global_is_provided_with_tpt_before" +actions: + - "isRelevant = true" +--- +name: step1_completed_tpt +description: completed_tpt relevance +priority: 1 +condition: "(step1_investigate_for_tb.contains('negative') || step1_tb_symptoms_screening.contains('chk_none')) && global_is_provided_with_tpt_before && !global_has_the_client_completed_tpt" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_tpt_eligibility +description: prompt_for_tpt_eligibility relevance +priority: 1 +condition: "(step1_investigate_for_tb.contains('negative') || step1_tb_symptoms_screening.contains('chk_none')) && !step1_has_been_provided_with_tpt_before.contains('yes') && !step1_has_been_provided_with_tpt_before.equals('') && !global_has_the_client_completed_tpt" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_tpt_ineligibility +description: prompt_for_tpt_ineligibility relevance +priority: 1 +condition: "(step1_investigate_for_tb.contains('negative') || step1_tb_symptoms_screening.contains('chk_none')) && step1_has_been_provided_with_tpt_before.contains('yes') && !step1_has_been_provided_with_tpt_before.equals('')" +actions: + - "isRelevant = true" +--- +name: step1_is_client_provided_with_tpt +description: is_client_provided_with_tpt relevance +priority: 1 +condition: "(step1_investigate_for_tb.contains('negative') || step1_tb_symptoms_screening.contains('chk_none')) && ((step1_has_been_provided_with_tpt_before.contains('no') || step1_has_been_provided_with_tpt_before.contains('partial')) && !step1_has_been_provided_with_tpt_before.equals('') && !global_is_provided_with_tpt_before) || step1_completed_tpt.contains('no')" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pnc_child_examination_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pnc_child_examination_relevance.yml new file mode 100644 index 000000000..60f112503 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pnc_child_examination_relevance.yml @@ -0,0 +1,21 @@ +--- +name: step1_child_bcg_vaccination +description: child_bcg_vaccination relevance +priority: 1 +condition: "!global_is_eligible_for_bcg" +actions: + - "isRelevant = true" +--- +name: step1_child_opv0_vaccination +description: child_opv0_vaccination relevance +priority: 1 +condition: "!global_is_eligible_for_opv0" +actions: + - "isRelevant = true" +--- +name: step1_kangaroo_enrollment +description: kangaroo_enrollment relevance +priority: 1 +condition: "global_is_eligible_for_kangaroo" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pnc_followup_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/pnc_followup_calculation.yml new file mode 100644 index 000000000..dc0f228fd --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pnc_followup_calculation.yml @@ -0,0 +1,7 @@ +--- +name: step1_followup_visit_date +description: pmtct follow-up visit date +priority: 1 +condition: "true" +actions: + - "calculation = helper.getDateToday()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pnc_immunization_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pnc_immunization_relevance.yml new file mode 100644 index 000000000..03589d48e --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pnc_immunization_relevance.yml @@ -0,0 +1,14 @@ +--- +name: step1_tetanus_vaccination +description: tetanus_vaccination relevance +priority: 1 +condition: "global_is_eligible_for_tetanus" +actions: + - "isRelevant = true" +--- +name: step1_hepatitis_b_vaccination +description: hepatitis_b_vaccination relevance +priority: 1 +condition: "global_is_eligible_for_hepatitis_b" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pnc_mother_general_examination_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pnc_mother_general_examination_relevance.yml new file mode 100644 index 000000000..ba83d7613 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pnc_mother_general_examination_relevance.yml @@ -0,0 +1,35 @@ +--- +name: step1_prompt_for_moderate_anaemia_management +description: prompt for moderate anaemia management +priority: 1 +condition: "!step1_hb_level.equals('') && Float.parseFloat(step1_hb_level) > 8.5 && Float.parseFloat(step1_hb_level) <= 11.4" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_management_of_hypertension +description: prompt_for_management_of_hypertension +priority: 1 +condition: "(!step1_systolic.equals('') && step1_systolic >= 140) || (!step1_diastolic.equals('') && step1_diastolic >= 90)" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_management_of_hypotension +description: prompt_for_management_of_hypotension +priority: 1 +condition: "(!step1_systolic.equals('') && step1_systolic < 90) || (!step1_diastolic.equals('') && step1_diastolic < 60)" +actions: + - "isRelevant = true" +--- +name: step1_prompt_for_mental_illness +description: prompt_for_mental_illness +priority: 1 +condition: "step1_puerperal_psychosis.contains('yes') || step1_mental_illness_symptom.contains('yes')" +actions: + - "isRelevant = true" +--- +name: step1_hiv_antibody_test +description: hiv_antibody_test +priority: 1 +condition: "!global_anti_body_test_conducted && global_is_a_child_without_mother" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/pnc_no_mother_registration_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/pnc_no_mother_registration_calculation.yml new file mode 100644 index 000000000..06a5e8bb2 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pnc_no_mother_registration_calculation.yml @@ -0,0 +1,56 @@ +--- +name: step2_age_calculated +description: Age calculated +priority: 1 +condition: "true" +actions: + - "calculation = step1_age" +--- +name: step2_age +description: Age calculated +priority: 1 +condition: "true" +actions: + - "calculation = step1_age" +--- +name: step2_surname +description: set surname as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_fam_name" +--- +name: step2_first_name +description: set first name as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_client_first_name" +--- +name: step2_middle_name +description: set middle name as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_client_middle_name" +--- +name: step2_sex +description: set sex as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_sex" +--- +name: step2_dob +description: set dob as the one added in step one +priority: 1 +condition: "true" +actions: + - "calculation = step1_dob" +--- +name: step2_delivery_date +description: set delivery date +priority: 1 +condition: "true" +actions: + - "calculation = step1_dob" diff --git a/opensrp-chw-hf/src/main/assets/rule/pnc_no_mother_registration_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pnc_no_mother_registration_relevance.yml new file mode 100644 index 000000000..7862d7969 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pnc_no_mother_registration_relevance.yml @@ -0,0 +1,7 @@ +--- +name: step1_prompt_for_underweight +description: Prompt for underweight relevance if child weight is less than 2.5 +priority: 1 +condition: "!step1_weight.equals('') && step1_weight < 2.5" +actions: + - "isRelevant = true" diff --git a/opensrp-chw-hf/src/main/assets/rule/pnc_nutritional_supplement_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/pnc_nutritional_supplement_relevance.yml new file mode 100644 index 000000000..66a1516e9 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/pnc_nutritional_supplement_relevance.yml @@ -0,0 +1,7 @@ +--- +name: step1_vitamin_a +description: vitamin_a relevance +priority: 1 +condition: "global_is_eligible_for_vitamin_a" +actions: + - "isRelevant = true" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/prep_initiation_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/prep_initiation_calculation.yml new file mode 100644 index 000000000..85ffce00c --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/prep_initiation_calculation.yml @@ -0,0 +1,45 @@ +--- +name: step1_prep_initiation_date +description: prep_initiation_date calculation +priority: 1 +condition: "step1_prep_status.equals('initiated')" +actions: + - "calculation = helper.getDateToday()" +--- +name: step1_maximum_date_for_next_visit +description: Calculate the maximum date for the next follow-up visit +priority: 1 +condition: "step1_prep_pills_number != '' " +actions: + - "def getMaxDate(number_of_pills) { + import java.util.Calendar; + import java.util.Locale; + import java.text.SimpleDateFormat; + + int numberOfPills = number_of_pills; + numberOfPills-=-3; + + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.DATE, numberOfPills); + return new SimpleDateFormat('dd-MM-yyyy', Locale.getDefault()).format(cal.getTime()); + }" + - "calculation = getMaxDate(step1_prep_pills_number)" +--- +name: step1_minimum_date_for_next_visit +description: Calculate the minimum date for the next follow-up visit +priority: 1 +condition: "step1_prep_pills_number != '' " +actions: + - "def getMinimumDate(number_of_pills) { + import java.util.Calendar; + import java.util.Locale; + import java.text.SimpleDateFormat; + + int nPills = number_of_pills; + + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DATE, nPills - 3); + + return new SimpleDateFormat('dd-MM-yyyy', Locale.getDefault()).format(calendar.getTime()); + }" + - "calculation = getMinimumDate(step1_prep_pills_number)" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/prep_initiation_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/prep_initiation_relevance.yml new file mode 100644 index 000000000..6caabf8f1 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/prep_initiation_relevance.yml @@ -0,0 +1,49 @@ +--- +name: step1_prep_drug_offered +description: prep_drug_offered +priority: 1 +condition: "step1_prep_status != '' && (!(step1_prep_status == 'not_initiated' || step1_prep_status == 'discontinued_quit' ))" +actions: + - "isRelevant = true " +--- +name: step1_other_prep_drug_offered +description: other_prep_drug_offered +priority: 1 +condition: "step1_prep_drug_offered != '' && step1_prep_drug_offered == 'other_drugs'" +actions: + - "isRelevant = true " +--- +name: step1_prep_pills_number +description: prep_pills_number +priority: 1 +condition: "step1_prep_drug_offered != ''" +actions: + - "isRelevant = true " +--- +name: step1_reasons_stopping_prep +description: step1_reasons_stopping_prep +priority: 1 +condition: "step1_prep_status != '' && step1_prep_status == 'discontinued_quit'" +actions: + - "isRelevant = true " +--- +name: step1_next_visit_date +description: step1_next_visit_date +priority: 1 +condition: "step1_prep_status != '' && step1_prep_status != 'discontinued_quit'" +actions: + - "isRelevant = true " +--- +name: step1_prep_adherence +description: step1_prep_adherence +priority: 1 +condition: "step1_prep_status != '' && step1_prep_status != 'not_initiated' && step1_prep_status != 'initiated' && step1_prep_status != 're_start'" +actions: + - "isRelevant = true " +--- +name: step1_prep_side_effects +description: step1_prep_side_effects +priority: 1 +condition: "step1_prep_status != '' && step1_prep_status != 'not_initiated' && step1_prep_status != 'initiated' && step1_prep_status != 're_start'" +actions: + - "isRelevant = true " \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/prep_screening_calculation.yml b/opensrp-chw-hf/src/main/assets/rule/prep_screening_calculation.yml new file mode 100644 index 000000000..dfc9ba139 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/prep_screening_calculation.yml @@ -0,0 +1,34 @@ +--- +name: step1_should_initiate +description: check if client is eligible to initiate for prep +priority: 1 +condition: "true" +actions: + - "calculation= ((step1_diabetes != '' && step1_diabetes == 'not_treated') + || (step1_blood_pressure != '' && step1_blood_pressure == 'not_treated') + || (step1_kidney_disease != '' && step1_kidney_disease == 'not_treated') + || (step1_nephrotoxic_drugs != '' && step1_nephrotoxic_drugs == 'yes') + || (step1_weight_35_or_above != '' && step1_weight_35_or_above == 'no') + || (step1_crcl_results != '' && step1_crcl_results == 'less_than_60' ) + || (step1_acute_hiv != '' && step1_acute_hiv == 'yes')) ? 'no' : 'yes'" +--- +name: step1_hbv_test_date +description: hbv_test_date calculation +priority: 1 +condition: "step1_tested_hbv == 'yes'" +actions: + - "calculation = helper.getDateToday()" +--- +name: step1_hcv_test_date +description: hcv_test_date calculation +priority: 1 +condition: "step1_tested_hcv == 'yes'" +actions: + - "calculation = helper.getDateToday()" +--- +name: step1_crcl_test_date +description: crcl_test_date calculation +priority: 1 +condition: "step1_tested_crcl == 'yes'" +actions: + - "calculation = helper.getDateToday()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/prep_screening_relevance.yml b/opensrp-chw-hf/src/main/assets/rule/prep_screening_relevance.yml new file mode 100644 index 000000000..02184bca4 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/prep_screening_relevance.yml @@ -0,0 +1,84 @@ +--- +name: step1_blood_pressure +description: check if client is eligible to initiate for prep +priority: 1 +condition: "step1_diabetes != '' && step1_diabetes != 'not_treated'" +actions: + - "isRelevant = true " +--- +name: step1_kidney_disease +description: check if client is eligible to initiate for prep +priority: 1 +condition: "step1_blood_pressure != '' && step1_blood_pressure != 'not_treated'" +actions: + - "isRelevant = true " +--- +name: step1_nephrotoxic_drugs +description: nephrotoxic_drugs relevance +priority: 1 +condition: "step1_kidney_disease != '' && step1_kidney_disease != 'not_treated'" +actions: + - "isRelevant = true " +--- +name: step1_tested_hbv +description: tested_hbv relevance +priority: 1 +condition: "step1_nephrotoxic_drugs != '' && step1_nephrotoxic_drugs != 'yes' && global_should_record_hbv_tests" +actions: + - "isRelevant = true " +--- +name: step1_tested_hcv +description: tested_hcv relevance +priority: 1 +condition: "step1_nephrotoxic_drugs != '' && step1_nephrotoxic_drugs != 'yes' && global_should_record_hcv_tests" +actions: + - "isRelevant = true " +--- +name: step1_tested_crcl +description: check if client is eligible to initiate for prep +priority: 1 +condition: "step1_nephrotoxic_drugs != '' && step1_nephrotoxic_drugs != 'yes' && global_should_record_crcl_tests" +actions: + - "isRelevant = true" +--- +name: step1_should_test_for_crcl +description: show prompt +priority: 1 +condition: "step1_tested_crcl == 'no' && global_should_record_crcl_tests" +actions: + - "isRelevant = true" +--- +name: step1_hcv_results +description: hcv_results relevance +priority: 1 +condition: "(step1_tested_hcv != '' && step1_tested_hcv == 'yes') || global_record_rcl_tests_results" +actions: + - "isRelevant = true " +--- +name: step1_weight_35_or_above +description: check if client is eligible to initiate for prep +priority: 1 +condition: "(step1_tested_crcl != '' && (step1_tested_crcl == 'no' || (step1_tested_crcl == 'yes' && step1_crcl_results != '' && step1_crcl_results != 'less_than_60')) || (step1_nephrotoxic_drugs != '' && step1_nephrotoxic_drugs != 'yes' && !global_should_record_crcl_tests)) " +actions: + - "isRelevant = true " +--- +name: step1_acute_hiv +description: check if client is eligible to initiate for prep +priority: 1 +condition: "step1_weight_35_or_above != '' && step1_weight_35_or_above != 'no'" +actions: + - "isRelevant = true " +--- +name: step1_prompt_for_prep_eligibility +description: check if client is eligible to initiate for prep +priority: 1 +condition: "step1_should_initiate == 'yes'" +actions: + - "isRelevant = true " +--- +name: step1_prompt_for_prep_ineligibility +description: check if client is eligible to initiate for prep +priority: 1 +condition: "step1_diabetes != '' && step1_should_initiate != 'yes'" +actions: + - "isRelevant = true " \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/tb_community_followup_referral_rules.yml b/opensrp-chw-hf/src/main/assets/rule/tb_community_followup_referral_rules.yml new file mode 100644 index 000000000..6182f893a --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/tb_community_followup_referral_rules.yml @@ -0,0 +1,21 @@ +--- +name: "reason_for_issuing_community_referral_other_visibility" +description: "reason_for_issuing_community_referral_other symptoms" +priority: 1 +condition: "reasons_for_issuing_community_referral['Other'] != null" +actions: + - "reason_for_issuing_community_referral_other_visibility = true" +--- +name: "last_client_visit_date_visibility" +description: "last_client_visit_date visibility" +priority: 1 +condition: "reasons_for_issuing_community_referral['Other'] == null" +actions: + - "last_client_visit_date_visibility = true" +--- +name: "tb_community_referral_date_calculation" +description: "hiv_community_referral_date calculation" +priority: 1 +condition: "true" +actions: + - "tb_community_referral_date_calculation = System.currentTimeMillis()" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/tb_outcome_rules.yml b/opensrp-chw-hf/src/main/assets/rule/tb_outcome_rules.yml new file mode 100644 index 000000000..c9bea0010 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/tb_outcome_rules.yml @@ -0,0 +1,40 @@ +--- +name: "problem_other_visibility" +description: "Specify other symptoms" +priority: 1 +condition: "problem['Other'] != null" +actions: + - "problem_other_visibility = true" +--- +name: "test_results_visibility" +description: "test_results visibility" +priority: 1 +condition: "action_taken_tb_problems['tested'] != null" +actions: + - "test_results_visibility = true" +--- +name: "enrolled_to_clinic_visibility" +description: "enrolled_to_clinic visibility" +priority: 1 +condition: "test_results['positive'] != null && action_taken_tb_problems['tested'] != null " +actions: + - "enrolled_to_clinic_visibility = true" +--- +name: "tb_clinic_number_visibility" +description: "tb_clinic_number visibility" +priority: 1 +condition: "enrolled_to_clinic['yes'] != null" +actions: + - "tb_clinic_number_visibility = true" +--- +name: "tb_facility_visit_date_calculation" +description: "tb_facility_visit_date calculation" +priority: 1 +condition: "true" +actions: + - "def getDate(dateFormat) { + import java.util.*; + import java.text.SimpleDateFormat; + return new SimpleDateFormat(dateFormat).format(Calendar.getInstance().getTime()); + }" + - "tb_facility_visit_date_calculation = getDate('yyyy-MM-dd hh:mm:ss') " \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/assets/rule/tb_registration_form_rules.yml b/opensrp-chw-hf/src/main/assets/rule/tb_registration_form_rules.yml new file mode 100644 index 000000000..e23e22ba4 --- /dev/null +++ b/opensrp-chw-hf/src/main/assets/rule/tb_registration_form_rules.yml @@ -0,0 +1,42 @@ +--- +name: "district_council_number_of_current_tb_client_visibility" +description: "district council number of current tb client when a family with tb client is chosen" +priority: 1 +condition: "place_of_domicile.value == 'A family with TB patient'" +actions: + - "district_council_number_of_current_tb_client_visibility = true" +--- +name: "community_gathering_visibility" +description: "Display community gathering types if community gathering is chosen" +priority: 1 +condition: "place_of_domicile.value == 'Community Gathering'" +actions: + - "community_gathering_visibility = true" +--- +name: "other_community_gathering_visibility" +description: "Display other community gathering types if others is chosen" +priority: 1 +condition: "community_gathering.value == 'Others'" +actions: + - "other_community_gathering_visibility = true" +--- +name: "tb_registration_date_calculation" +description: "calculating the registration date" +priority: 1 +condition: "true" +actions: + - "tb_registration_date_calculation = System.currentTimeMillis()" +--- +name: "client_tb_status_during_registration_calculation" +description: "calculating client_tb_status_during_registration" +priority: 1 +condition: "true" +actions: + - "client_tb_status_during_registration_calculation = 'Positive'" +--- +name: "test_results_calculation" +description: "calculating test_results" +priority: 1 +condition: "true" +actions: + - "test_results_calculation = 'Positive'" \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/DefaultHFApplicationFlv.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/DefaultHFApplicationFlv.java new file mode 100644 index 000000000..262ec72e4 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/DefaultHFApplicationFlv.java @@ -0,0 +1,33 @@ +package org.smartregister.chw.hf; + +public class DefaultHFApplicationFlv implements HealthFacilityApplication.Flavor { + @Override + public boolean hasCdp() { + return true; + } + + @Override + public boolean hasHivst() { + return true; + } + + @Override + public boolean hasKvpPrEP() { + return true; + } + + @Override + public boolean hasMalaria() { + return false; + } + + @Override + public boolean hasLD() { + return true; + } + + @Override + public boolean hasChildModule() { + return false; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/HealthFacilityApplication.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/HealthFacilityApplication.java index 70dde5e9f..71bceb2a4 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/HealthFacilityApplication.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/HealthFacilityApplication.java @@ -7,6 +7,7 @@ import com.crashlytics.android.Crashlytics; import com.crashlytics.android.core.CrashlyticsCore; import com.evernote.android.job.JobManager; +import com.mapbox.mapboxsdk.Mapbox; import org.jetbrains.annotations.NotNull; import org.smartregister.AllConstants; @@ -14,11 +15,10 @@ import org.smartregister.CoreLibrary; import org.smartregister.P2POptions; import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.cdp.CdpLibrary; import org.smartregister.chw.core.application.CoreChwApplication; import org.smartregister.chw.core.contract.CoreApplication; -import org.smartregister.chw.core.custom_views.NavigationMenu; import org.smartregister.chw.core.loggers.CrashlyticsTree; -import org.smartregister.chw.core.provider.CoreAllClientsRegisterQueryProvider; import org.smartregister.chw.core.service.CoreAuthorizationService; import org.smartregister.chw.core.utils.ChildDBConstants; import org.smartregister.chw.core.utils.ChwDBConstants; @@ -27,24 +27,45 @@ import org.smartregister.chw.fp.FpLibrary; import org.smartregister.chw.hf.activity.AllClientsRegisterActivity; import org.smartregister.chw.hf.activity.AncRegisterActivity; +import org.smartregister.chw.hf.activity.CdpRegisterActivity; import org.smartregister.chw.hf.activity.ChildRegisterActivity; import org.smartregister.chw.hf.activity.FamilyProfileActivity; import org.smartregister.chw.hf.activity.FamilyRegisterActivity; import org.smartregister.chw.hf.activity.FpRegisterActivity; +import org.smartregister.chw.hf.activity.HeiRegisterActivity; +import org.smartregister.chw.hf.activity.HivIndexContactsContactsRegisterActivity; +import org.smartregister.chw.hf.activity.HivRegisterActivity; +import org.smartregister.chw.hf.activity.HivstRegisterActivity; +import org.smartregister.chw.hf.activity.HtsRegisterActivity; +import org.smartregister.chw.hf.activity.KvpRegisterActivity; +import org.smartregister.chw.hf.activity.LDRegisterActivity; +import org.smartregister.chw.hf.activity.LTFURegisterActivity; import org.smartregister.chw.hf.activity.LoginActivity; import org.smartregister.chw.hf.activity.MalariaRegisterActivity; +import org.smartregister.chw.hf.activity.PmtctRegisterActivity; import org.smartregister.chw.hf.activity.PncRegisterActivity; +import org.smartregister.chw.hf.activity.PrEPRegisterActivity; import org.smartregister.chw.hf.activity.ReferralRegisterActivity; +import org.smartregister.chw.hf.activity.ReportsActivity; import org.smartregister.chw.hf.configs.AllClientsRegisterRowOptions; +import org.smartregister.chw.hf.custom_view.FacilityMenu; import org.smartregister.chw.hf.custom_view.HfNavigationMenu; import org.smartregister.chw.hf.job.HfJobCreator; import org.smartregister.chw.hf.model.NavigationModel; +import org.smartregister.chw.hf.provider.HfAllClientsRegisterQueryProvider; import org.smartregister.chw.hf.repository.HfChwRepository; import org.smartregister.chw.hf.repository.HfTaskRepository; import org.smartregister.chw.hf.sync.HfClientProcessor; import org.smartregister.chw.hf.sync.HfSyncConfiguration; +import org.smartregister.chw.hiv.HivLibrary; +import org.smartregister.chw.hivst.HivstLibrary; +import org.smartregister.chw.kvp.KvpLibrary; +import org.smartregister.chw.ld.LDLibrary; import org.smartregister.chw.malaria.MalariaLibrary; +import org.smartregister.chw.pmtct.PmtctLibrary; import org.smartregister.chw.pnc.PncLibrary; +import org.smartregister.chw.referral.ReferralLibrary; +import org.smartregister.chw.tb.TbLibrary; import org.smartregister.commonregistry.CommonFtsObject; import org.smartregister.configurableviews.ConfigurableViewsLibrary; import org.smartregister.configurableviews.helper.JsonSpecHelper; @@ -70,11 +91,17 @@ import java.util.Map; import io.fabric.sdk.android.Fabric; +import io.ona.kujaku.KujakuLibrary; import timber.log.Timber; public class HealthFacilityApplication extends CoreChwApplication implements CoreApplication { + private static final Flavor flavor = new DefaultHFApplicationFlv(); private CommonFtsObject commonFtsObject; + public static Flavor getApplicationFlavor() { + return flavor; + } + @Override public FamilyMetadata getMetadata() { return FormUtils.getFamilyMetadata(new FamilyProfileActivity(), getDefaultLocationLevel(), getFacilityHierarchy(), getFamilyLocationFields()); @@ -104,7 +131,25 @@ public String getDefaultLocationLevel() { registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.REFERRALS_REGISTER_ACTIVITY, ReferralRegisterActivity.class); registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.ALL_CLIENTS_REGISTERED_ACTIVITY, AllClientsRegisterActivity.class); registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.MALARIA_REGISTER_ACTIVITY, MalariaRegisterActivity.class); - registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.FP_REGISTER_ACTIVITY, FpRegisterActivity.class); + + if (!BuildConfig.BUILD_FOR_BORESHA_AFYA_SOUTH) { + registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.FP_REGISTER_ACTIVITY, FpRegisterActivity.class); + } else { + registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.HIV_REGISTER_ACTIVITY, HivRegisterActivity.class); + registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.HTS_REGISTER_ACTIVITY, HtsRegisterActivity.class); + registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.HIV_INDEX_REGISTER_ACTIVITY, HivIndexContactsContactsRegisterActivity.class); + registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.PMTCT_REGISTER_ACTIVITY, PmtctRegisterActivity.class); + registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.HEI, HeiRegisterActivity.class); + registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.REPORTS, ReportsActivity.class); + registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.LD, LDRegisterActivity.class); + registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.LTFU_REFERRALS_REGISTER_ACTIVITY, LTFURegisterActivity.class); + registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.HIV_SELF_TESTING_REGISTER_ACTIVITY, HivstRegisterActivity.class); + registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.KVP_REGISTER_ACTIVITY, KvpRegisterActivity.class); + registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.PrEP_REGISTER_ACTIVITY, PrEPRegisterActivity.class); + registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.CDP_REGISTER_ACTIVITY, CdpRegisterActivity.class); +// TODO uncomment these when NACP is ready to test these modules + //registeredActivities.put(CoreConstants.REGISTERED_ACTIVITIES.TB_REGISTER_ACTIVITY, TbRegisterActivity.class); + } return registeredActivities; } @@ -173,8 +218,8 @@ public void onCreate() { HealthFacilityApplication.getInstance().getApplicationContext().getAssets()); //Setup Navigation menu. Done only once when app is created - NavigationMenu.setupNavigationMenu(this, new HfNavigationMenu(), new NavigationModel(), - getRegisteredActivities(), false); + FacilityMenu.setupNavigationMenu(this, new HfNavigationMenu(), new NavigationModel(), + getRegisteredActivities(), true); if (BuildConfig.DEBUG) { Timber.plant(new Timber.DebugTree()); @@ -201,11 +246,50 @@ public void onCreate() { ReportingLibrary.init(context, getRepository(), null, BuildConfig.VERSION_CODE, BuildConfig.DATABASE_VERSION); AncLibrary.init(context, getRepository(), BuildConfig.VERSION_CODE, BuildConfig.DATABASE_VERSION); PncLibrary.init(context, getRepository(), BuildConfig.VERSION_CODE, BuildConfig.DATABASE_VERSION); - MalariaLibrary.init(context, getRepository(), BuildConfig.VERSION_CODE, BuildConfig.DATABASE_VERSION); + if (flavor.hasMalaria()) { + MalariaLibrary.init(context, getRepository(), BuildConfig.VERSION_CODE, BuildConfig.DATABASE_VERSION); + } FpLibrary.init(context, getRepository(), BuildConfig.VERSION_CODE, BuildConfig.DATABASE_VERSION); + + if (flavor.hasCdp()) { + CdpLibrary.init(context, getRepository(), BuildConfig.VERSION_CODE, BuildConfig.DATABASE_VERSION); + } + + //setup referral library + ReferralLibrary.init(this); + ReferralLibrary.getInstance().setAppVersion(BuildConfig.VERSION_CODE); + ReferralLibrary.getInstance().setDatabaseVersion(BuildConfig.DATABASE_VERSION); + + //Setup hiv library + HivLibrary.init(this); + HivLibrary.getInstance().setAppVersion(BuildConfig.VERSION_CODE); + HivLibrary.getInstance().setDatabaseVersion(BuildConfig.DATABASE_VERSION); + + //Setup hivst library + if (flavor.hasHivst()) { + HivstLibrary.init(context, getRepository(), BuildConfig.VERSION_CODE, BuildConfig.DATABASE_VERSION); + } + + if (flavor.hasKvpPrEP()) { + KvpLibrary.init(context, getRepository(), BuildConfig.VERSION_CODE, BuildConfig.DATABASE_VERSION); + } + + //Setup tb library + TbLibrary.init(this); + TbLibrary.getInstance().setAppVersion(BuildConfig.VERSION_CODE); + TbLibrary.getInstance().setDatabaseVersion(BuildConfig.DATABASE_VERSION); + + //Setup pmtct library + PmtctLibrary.init(context, getRepository(), BuildConfig.VERSION_CODE, BuildConfig.DATABASE_VERSION); + + //Setup L&D library + if (flavor.hasLD()) { + LDLibrary.init(context, getRepository(), BuildConfig.VERSION_CODE, BuildConfig.DATABASE_VERSION); + } + //Needed for all clients register OpdLibrary.init(context, getRepository(), - new OpdConfiguration.Builder(CoreAllClientsRegisterQueryProvider.class) + new OpdConfiguration.Builder(HfAllClientsRegisterQueryProvider.class) .setBottomNavigationEnabled(true) .setOpdRegisterRowOptions(AllClientsRegisterRowOptions.class) .build(), @@ -226,6 +310,15 @@ public void onCreate() { } // set up processor FamilyLibrary.getInstance().setClientProcessorForJava(HfClientProcessor.getInstance(getApplicationContext())); + + //initialize Map + initializeMapBox(); + } + + protected void initializeMapBox() { + // Init Kujaku + Mapbox.getInstance(getApplicationContext(), BuildConfig.MAPBOX_SDK_ACCESS_TOKEN); + KujakuLibrary.init(getApplicationContext()); } @Override @@ -240,7 +333,7 @@ public void logoutCurrentUser() { Timber.i("Logged out user %s", getContext().allSharedPreferences().fetchRegisteredANM()); } - public boolean getChildFlavorUtil(){ + public boolean getChildFlavorUtil() { return true; } @@ -283,4 +376,18 @@ public Map getFTSSortMap() { }); return map; } + + public interface Flavor { + boolean hasCdp(); + + boolean hasHivst(); + + boolean hasKvpPrEP(); + + boolean hasMalaria(); + + boolean hasLD(); + + boolean hasChildModule(); + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncBaselineInvestigationAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncBaselineInvestigationAction.java new file mode 100644 index 000000000..5fde48c36 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncBaselineInvestigationAction.java @@ -0,0 +1,144 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.HfAncDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.chw.referral.util.JsonFormConstants; +import org.smartregister.family.util.JsonFormUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncBaselineInvestigationAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private HashMap checkObject = new HashMap<>(); + private Context context; + private boolean isClientOnART; + + public AncBaselineInvestigationAction(MemberObject memberObject, boolean isClientOnART) { + this.memberObject = memberObject; + this.isClientOnART = isClientOnART; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @Override + public String getPreProcessed() { + JSONObject baselineInvestigationForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.AncFirstVisit.getBaselineInvestigation()); + try { + baselineInvestigationForm.getJSONObject("global").put("gestational_age", memberObject.getGestationAge()); + baselineInvestigationForm.getJSONObject("global").put("known_positive", isClientOnART); + JSONArray fields = baselineInvestigationForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + JSONObject hivTestNumberField = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "hiv_test_number"); + if (hivTestNumberField != null) { + hivTestNumberField.put(JsonFormUtils.VALUE, HfAncDao.getNextHivTestNumber(memberObject.getBaseEntityId())); + } + } catch (JSONException e) { + e.printStackTrace(); + } + return baselineInvestigationForm.toString(); + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + JSONObject global = jsonObject.getJSONObject("global"); + checkObject.clear(); + boolean isKnownPositive = global.getBoolean("known_positive"); + + String bloodGroup = CoreJsonFormUtils.getValue(jsonObject, "blood_group"); + boolean bloodGroupCheck = StringUtils.isNotBlank(bloodGroup) && !(bloodGroup.equalsIgnoreCase("Blood Group") || bloodGroup.equalsIgnoreCase("Kundi la damu")); + + checkObject.put("glucose_in_urine", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "glucose_in_urine"))); + checkObject.put("protein_in_urine", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "protein_in_urine"))); + checkObject.put("blood_group", bloodGroupCheck); + if (!bloodGroup.equalsIgnoreCase("test_not_conducted")) + checkObject.put("rh_factor", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "rh_factor"))); + checkObject.put("hb_level_test", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "hb_level_test"))); + checkObject.put("blood_for_glucose_test", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "blood_for_glucose_test"))); + checkObject.put("syphilis", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "syphilis"))); + checkObject.put("hepatitis", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "hepatitis"))); + checkObject.put("other_stds", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "other_stds"))); + + if (!isKnownPositive) { + checkObject.put("hiv_qn", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "hiv_qn"))); + } + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + JSONObject baselineInvestigationCompletionStatus = JsonFormUtils.getFieldJSONObject(fields, "baseline_investigation_completion_status"); + assert baselineInvestigationCompletionStatus != null; + baselineInvestigationCompletionStatus.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, VisitUtils.getActionStatus(checkObject)); + } catch (JSONException e) { + Timber.e(e); + } + + if (jsonObject != null) { + return jsonObject.toString(); + } + return null; + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.v("onPayloadReceived"); + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + if (status.equalsIgnoreCase(VisitUtils.Ongoing)) { + return BaseAncHomeVisitAction.Status.PARTIALLY_COMPLETED; + } + return BaseAncHomeVisitAction.Status.PENDING; + } + + @Override + public String evaluateSubTitle() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) + return context.getString(R.string.baseline_investigation_conducted); + return ""; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncBirthReviewAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncBirthReviewAction.java new file mode 100644 index 000000000..cd0aeb15f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncBirthReviewAction.java @@ -0,0 +1,100 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncBirthReviewAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private String delivery_place; + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public AncBirthReviewAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + delivery_place = CoreJsonFormUtils.getValue(jsonObject, "delivery_place"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(delivery_place)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + + stringBuilder.append(context.getString(R.string.review_birth_emergency_plan)); + + return stringBuilder.toString(); + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(delivery_place)) + return BaseAncHomeVisitAction.Status.PENDING; + else { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncConsultationAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncConsultationAction.java new file mode 100644 index 000000000..9a3cf294d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncConsultationAction.java @@ -0,0 +1,154 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.family.util.JsonFormUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncConsultationAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private HashMap checkObject = new HashMap<>(); + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public AncConsultationAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + JSONObject global = jsonObject.getJSONObject("global"); + checkObject.clear(); + int clientAge = global.getInt("client_age"); + int gestAge = 12; + try { + gestAge = Integer.parseInt(CoreJsonFormUtils.getValue(jsonObject, "gest_age_consultation")); + } catch (Exception e) { + Timber.e(e); + } + + String lie = CoreJsonFormUtils.getValue(jsonObject, "lie"); + boolean lieCheck = StringUtils.isNotBlank(lie) && !(lie.equalsIgnoreCase("Lie") || lie.equalsIgnoreCase("Mlalo wa mtoto tumboni")); + + String presentation = CoreJsonFormUtils.getValue(jsonObject, "presentation"); + boolean presentationCheck = StringUtils.isNotBlank(presentation) && !(presentation.equalsIgnoreCase("Presentation") || presentation.equalsIgnoreCase("Kitangulizi cha mtoto")); + + checkObject.put("examination_findings", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "examination_findings"))); + if (clientAge < 25) { + checkObject.put("height", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "height"))); + } + checkObject.put("weight", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "weight"))); + if (gestAge >= 20) { + checkObject.put("fundal_height", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "fundal_height"))); + checkObject.put("fetal_heart_rate", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "fetal_heart_rate"))); + } + if (gestAge >= 36) { + checkObject.put("lie", lieCheck); + if (lie.contains("longitudinal")) { + checkObject.put("presentation", presentationCheck); + } + } + checkObject.put("systolic", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "systolic"))); + checkObject.put("diastolic", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "diastolic"))); + checkObject.put("pulse_rate", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "pulse_rate"))); + checkObject.put("temperature", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "temperature"))); + checkObject.put("breast", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "breast"))); + checkObject.put("lymph_node_under_arm", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "lymph_node_under_arm"))); + checkObject.put("lymph_node_cervical", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "lymph_node_cervical"))); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String jsonPayload) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + JSONObject consultationCompletionStatus = JsonFormUtils.getFieldJSONObject(fields, "consultation_completion_status"); + assert consultationCompletionStatus != null; + consultationCompletionStatus.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, VisitUtils.getActionStatus(checkObject)); + } catch (JSONException e) { + Timber.e(e); + } + + if (jsonObject != null) { + return jsonObject.toString(); + } + return null; + } + + @Override + public String evaluateSubTitle() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) + return context.getString(R.string.anc_consultation_done); + return ""; + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + if (status.equalsIgnoreCase(VisitUtils.Ongoing)) { + return BaseAncHomeVisitAction.Status.PARTIALLY_COMPLETED; + } + return BaseAncHomeVisitAction.Status.PENDING; + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncCounsellingAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncCounsellingAction.java new file mode 100644 index 000000000..05c27c61c --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncCounsellingAction.java @@ -0,0 +1,118 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.HfAncJsonFormUtils; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.family.util.JsonFormUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncCounsellingAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private HashMap checkObject = new HashMap<>(); + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public AncCounsellingAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + checkObject.clear(); + checkObject.put("counselling", StringUtils.isNotBlank(HfAncJsonFormUtils.getCheckBoxValue(jsonObject, "given_counselling"))); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String jsonPayload) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + JSONObject counsellingCompletionStatus = JsonFormUtils.getFieldJSONObject(fields, "counselling_completion_status"); + assert counsellingCompletionStatus != null; + counsellingCompletionStatus.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, VisitUtils.getActionStatus(checkObject)); + } catch (JSONException e) { + Timber.e(e); + } + + if (jsonObject != null) { + return jsonObject.toString(); + } + return null; + } + + @Override + public String evaluateSubTitle() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) + return context.getString(R.string.counselling_given); + return ""; + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + if (status.equalsIgnoreCase(VisitUtils.Ongoing)) { + return BaseAncHomeVisitAction.Status.PARTIALLY_COMPLETED; + } + return BaseAncHomeVisitAction.Status.PENDING; + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncLabTestAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncLabTestAction.java new file mode 100644 index 000000000..07a1e4340 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncLabTestAction.java @@ -0,0 +1,141 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.family.util.JsonFormUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncLabTestAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private HashMap checkObject = new HashMap<>(); + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public AncLabTestAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + JSONObject global = jsonObject.getJSONObject("global"); + boolean bloodGroupComplete = global.getBoolean("blood_group_complete"); + boolean hivTestComplete = global.getBoolean("hiv_test_complete"); + + String bloodGroup = CoreJsonFormUtils.getValue(jsonObject, "blood_group"); + boolean bloodGroupCheck = StringUtils.isNotBlank(bloodGroup) && !(bloodGroup.equalsIgnoreCase("Blood Group") || bloodGroup.equalsIgnoreCase("Kundi la damu")); + + String hivStatus = global.getString("hiv_status"); + int gestAge = global.getInt("gestational_age"); + boolean hivTestAt32Complete = global.getBoolean("hiv_test_at_32_complete"); + boolean syphilisTestComplete = global.getBoolean("syphilis_test_complete"); + boolean hepatitisTestComplete = global.getBoolean("hepatitis_test_complete"); + checkObject.clear(); + checkObject.put("hb_level_test", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "hb_level_test"))); + checkObject.put("blood_for_glucose_test", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "blood_for_glucose_test"))); + checkObject.put("glucose_in_urine", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "glucose_in_urine"))); + checkObject.put("protein_in_urine", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "protein_in_urine"))); + if(!bloodGroupComplete){ + checkObject.put("blood_group", bloodGroupCheck); + if(!bloodGroup.contains("test_not_conducted")){ + checkObject.put("rh_factor", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "rh_factor"))); + } + } + if(!hivTestComplete || ((gestAge >= 32 && hivStatus.contains("negative")) && !hivTestAt32Complete)){ + checkObject.put("hiv", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "hiv"))); + } + if(!syphilisTestComplete){ + checkObject.put("syphilis", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "syphilis"))); + } + if(!hepatitisTestComplete){ + checkObject.put("hepatitis", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "hepatitis"))); + } + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String jsonPayload) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + JSONObject labTestCompletionStatus = JsonFormUtils.getFieldJSONObject(fields, "lab_test_completion_status"); + assert labTestCompletionStatus != null; + labTestCompletionStatus.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, VisitUtils.getActionStatus(checkObject)); + } catch (JSONException e) { + Timber.e(e); + } + + if (jsonObject != null) { + return jsonObject.toString(); + } + return null; + } + + @Override + public String evaluateSubTitle() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) + return context.getString(R.string.lab_tests_complete); + return ""; + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + if (status.equalsIgnoreCase(VisitUtils.Ongoing)) { + return BaseAncHomeVisitAction.Status.PARTIALLY_COMPLETED; + } + return BaseAncHomeVisitAction.Status.PENDING; + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncMalariaInvestigationAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncMalariaInvestigationAction.java new file mode 100644 index 000000000..e3c42b898 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncMalariaInvestigationAction.java @@ -0,0 +1,123 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.family.util.JsonFormUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncMalariaInvestigationAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private HashMap checkObject = new HashMap<>(); + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public AncMalariaInvestigationAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + JSONObject global = jsonObject.getJSONObject("global"); + boolean llinProvided = global.getBoolean("llin_provided"); + checkObject.clear(); + checkObject.put("client_on_malaria_medication", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "client_on_malaria_medication"))); + if(!llinProvided){ + checkObject.put("llin_provision", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "llin_provision"))); + } + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String jsonPayload) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + JSONObject malariaInvestigationCompletionStatus = JsonFormUtils.getFieldJSONObject(fields, "malaria_investigation_completion_status"); + assert malariaInvestigationCompletionStatus != null; + malariaInvestigationCompletionStatus.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, VisitUtils.getActionStatus(checkObject)); + } catch (JSONException e) { + Timber.e(e); + } + + if (jsonObject != null) { + return jsonObject.toString(); + } + return null; + } + + @Override + public String evaluateSubTitle() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) + return context.getString(R.string.malaria_investigation_complete); + return ""; + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + if (status.equalsIgnoreCase(VisitUtils.Ongoing)) { + return BaseAncHomeVisitAction.Status.PARTIALLY_COMPLETED; + } + return BaseAncHomeVisitAction.Status.PENDING; + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncMedicalAndSurgicalHistoryAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncMedicalAndSurgicalHistoryAction.java new file mode 100644 index 000000000..9814884c1 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncMedicalAndSurgicalHistoryAction.java @@ -0,0 +1,98 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncMedicalAndSurgicalHistoryAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private String anc_medical_surgical_history; + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + + public AncMedicalAndSurgicalHistoryAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + anc_medical_surgical_history = CoreJsonFormUtils.getValue(jsonObject, "anc_medical_surgical_history"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(anc_medical_surgical_history)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + + //TODO ilakoze extract to string recources + stringBuilder.append("Medical And Surgical History Filled"); + + return stringBuilder.toString(); + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(anc_medical_surgical_history)) + return BaseAncHomeVisitAction.Status.PENDING; + else { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncNextFollowupVisitAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncNextFollowupVisitAction.java new file mode 100644 index 000000000..6fd164ce5 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncNextFollowupVisitAction.java @@ -0,0 +1,99 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncNextFollowupVisitAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + + private String jsonPayload; + + private String next_facility_visit_date; + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public AncNextFollowupVisitAction() { + + } + + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + next_facility_visit_date = CoreJsonFormUtils.getValue(jsonObject, "next_facility_visit_date"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(next_facility_visit_date)) + return null; + + return next_facility_visit_date; + + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(next_facility_visit_date)) + return BaseAncHomeVisitAction.Status.PENDING; + else { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncObstetricExaminationAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncObstetricExaminationAction.java new file mode 100644 index 000000000..f1dccbe2d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncObstetricExaminationAction.java @@ -0,0 +1,138 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.family.util.JsonFormUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncObstetricExaminationAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private HashMap checkObject = new HashMap<>(); + private Context context; + + public AncObstetricExaminationAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + if (status.equalsIgnoreCase(VisitUtils.Ongoing)) { + return BaseAncHomeVisitAction.Status.PARTIALLY_COMPLETED; + } + return BaseAncHomeVisitAction.Status.PENDING; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + int gestAge = Integer.parseInt(CoreJsonFormUtils.getValue(jsonObject, "gest_age")); + String abdominalContour = CoreJsonFormUtils.getValue(jsonObject, "abdominal_contour"); + boolean abdominalContourCheck = !(abdominalContour.equalsIgnoreCase("Abdominal Contour") || abdominalContour.equalsIgnoreCase("Umbo la Tumbo")); + + String lie = CoreJsonFormUtils.getValue(jsonObject, "lie"); + boolean lieCheck = StringUtils.isNotBlank(lie) && !(lie.equalsIgnoreCase("Lie") || lie.equalsIgnoreCase("Mlalo wa mtoto tumboni")); + + String presentation = CoreJsonFormUtils.getValue(jsonObject, "presentation"); + boolean presentationCheck = StringUtils.isNotBlank(presentation) && !(presentation.equalsIgnoreCase("Presentation") || presentation.equalsIgnoreCase("Kitangulizi cha mtoto")); + + checkObject.clear(); + checkObject.put("weight", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "weight"))); + checkObject.put("height", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "height"))); + checkObject.put("systolic", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "systolic"))); + checkObject.put("diastolic", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "diastolic"))); + checkObject.put("pulse_rate", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "pulse_rate"))); + checkObject.put("temperature", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "temperature"))); + checkObject.put("abdominal_scars", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "abdominal_scars"))); + checkObject.put("abdominal_movement_with_respiration", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "abdominal_movement_with_respiration"))); + checkObject.put("abdominal_contour", abdominalContourCheck); + checkObject.put("abnormal_vaginal_discharge", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "abnormal_vaginal_discharge"))); + checkObject.put("vaginal_sores", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "vaginal_sores"))); + checkObject.put("vaginal_swelling", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "vaginal_swelling"))); + + if (gestAge >= 20) { + checkObject.put("fundal_height", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "fundal_height"))); + checkObject.put("fetal_heart_rate", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "fetal_heart_rate"))); + } + if (gestAge > 35) { + checkObject.put("lie", lieCheck); + if (lie.contains("longitudinal")) { + checkObject.put("presentation", presentationCheck); + } + } + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + JSONObject obstetric_examination_completion_status = JsonFormUtils.getFieldJSONObject(fields, "obstetric_examination_completion_status"); + assert obstetric_examination_completion_status != null; + obstetric_examination_completion_status.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, VisitUtils.getActionStatus(checkObject)); + } catch (JSONException e) { + Timber.e(e); + } + + if (jsonObject != null) { + return jsonObject.toString(); + } + return null; + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.v("onPayloadReceived"); + } + + @Override + public String evaluateSubTitle() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) + return context.getString(R.string.obstetric_exam_complete); + return ""; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncPartnerRegistrationAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncPartnerRegistrationAction.java new file mode 100644 index 000000000..bb22637e2 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncPartnerRegistrationAction.java @@ -0,0 +1,99 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncPartnerRegistrationAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private String partner_surname; + private String partner_firstname; + private String partner_middlename; + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public AncPartnerRegistrationAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + partner_surname = CoreJsonFormUtils.getValue(jsonObject, "partner_surname"); + partner_middlename = CoreJsonFormUtils.getValue(jsonObject, "partner_middle_name"); + partner_firstname = CoreJsonFormUtils.getValue(jsonObject, "partner_first_name"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(partner_surname)) + return null; + + return context.getString(R.string.partner_registered) + ": " + partner_firstname + " " + partner_middlename + " " + partner_surname; + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(partner_surname)) + return BaseAncHomeVisitAction.Status.PENDING; + else { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncPartnerTestingAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncPartnerTestingAction.java new file mode 100644 index 000000000..ee2799d06 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncPartnerTestingAction.java @@ -0,0 +1,99 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncPartnerTestingAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private String partner_hiv_results; + private String partner_syphilis_results; + private String partner_hepatitis_results; + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public AncPartnerTestingAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + partner_hiv_results = CoreJsonFormUtils.getValue(jsonObject, "partner_hiv"); + partner_syphilis_results = CoreJsonFormUtils.getValue(jsonObject,"partner_syphilis"); + partner_hepatitis_results = CoreJsonFormUtils.getValue(jsonObject, "partner_hepatitis"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(partner_hiv_results) && StringUtils.isBlank(partner_syphilis_results) && StringUtils.isBlank(partner_hepatitis_results)) + return null; + + return context.getString(R.string.partner_tested); + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(partner_hiv_results) && StringUtils.isBlank(partner_syphilis_results) && StringUtils.isBlank(partner_hepatitis_results)) + return BaseAncHomeVisitAction.Status.PENDING; + else { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncPharmacyAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncPharmacyAction.java new file mode 100644 index 000000000..6c30f8f36 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncPharmacyAction.java @@ -0,0 +1,124 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.family.util.JsonFormUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncPharmacyAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private HashMap checkObject = new HashMap<>(); + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public AncPharmacyAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + JSONObject global = jsonObject.getJSONObject("global"); + checkObject.clear(); + int gestAge = global.getInt("gestational_age"); + boolean dewormingGiven = global.getBoolean("deworming_given"); + checkObject.put("iron_folate_supplements", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "iron_folate_supplements"))); + if (gestAge >= 13 && !dewormingGiven) { + checkObject.put("deworming", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "deworming"))); + } + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String jsonPayload) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + JSONObject pharmacyCompletionStatus = JsonFormUtils.getFieldJSONObject(fields, "pharmacy_completion_status"); + assert pharmacyCompletionStatus != null; + pharmacyCompletionStatus.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, VisitUtils.getActionStatus(checkObject)); + } catch (JSONException e) { + Timber.e(e); + } + + if (jsonObject != null) { + return jsonObject.toString(); + } + return null; + } + + @Override + public String evaluateSubTitle() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) + return context.getString(R.string.med_and_supp_issued); + return ""; + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + if (status.equalsIgnoreCase(VisitUtils.Ongoing)) { + return BaseAncHomeVisitAction.Status.PARTIALLY_COMPLETED; + } + return BaseAncHomeVisitAction.Status.PENDING; + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncPregnancyStatusAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncPregnancyStatusAction.java new file mode 100644 index 000000000..863d89439 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncPregnancyStatusAction.java @@ -0,0 +1,125 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.chw.referral.util.JsonFormConstants; +import org.smartregister.family.util.JsonFormUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncPregnancyStatusAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private HashMap checkObject = new HashMap<>(); + protected String pregnancy_status; + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + + public AncPregnancyStatusAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + int gestationAge = memberObject.getGestationAge(); + JSONArray fields = jsonObject.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + JSONObject pregnancyStatusObject = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "pregnancy_status"); + + if (pregnancyStatusObject != null) { + if (gestationAge >= 28) { + pregnancyStatusObject.getJSONArray("options").remove(1); + } else { + pregnancyStatusObject.getJSONArray("options").remove(2); + } + } + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + checkObject.clear(); + checkObject.put("pregnancy_status", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "pregnancy_status"))); + pregnancy_status = CoreJsonFormUtils.getValue(jsonObject, "pregnancy_status"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String jsonPayload) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + JSONObject pregnancyStatusCompletionStatus = JsonFormUtils.getFieldJSONObject(fields, "pregnancy_status_completion_status"); + assert pregnancyStatusCompletionStatus != null; + pregnancyStatusCompletionStatus.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, VisitUtils.getActionStatus(checkObject)); + } catch (JSONException e) { + Timber.e(e); + } + + if (jsonObject != null) { + return jsonObject.toString(); + } + return null; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(pregnancy_status)) + return null; + return pregnancy_status; + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(pregnancy_status)) + return BaseAncHomeVisitAction.Status.PENDING; + else { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncTbScreeningAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncTbScreeningAction.java new file mode 100644 index 000000000..f85038ab8 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncTbScreeningAction.java @@ -0,0 +1,115 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.family.util.JsonFormUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncTbScreeningAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private HashMap checkObject = new HashMap<>(); + private Context context; + + + public AncTbScreeningAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + checkObject.clear(); + checkObject.put("on_tb_treatment", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "on_tb_treatment"))); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + JSONObject tbScreeningCompletionStatus = JsonFormUtils.getFieldJSONObject(fields, "tb_screening_completion_status"); + assert tbScreeningCompletionStatus != null; + tbScreeningCompletionStatus.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, VisitUtils.getActionStatus(checkObject)); + } catch (JSONException e) { + Timber.e(e); + } + + if (jsonObject != null) { + return jsonObject.toString(); + } + return null; + } + + @Override + public String evaluateSubTitle() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) + return context.getString(R.string.pmtct_tb_screening); + return ""; + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + if (status.equalsIgnoreCase(VisitUtils.Ongoing)) { + return BaseAncHomeVisitAction.Status.PARTIALLY_COMPLETED; + } + return BaseAncHomeVisitAction.Status.PENDING; + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncTriageAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncTriageAction.java new file mode 100644 index 000000000..368bd2583 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncTriageAction.java @@ -0,0 +1,120 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.family.util.JsonFormUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncTriageAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private HashMap checkObject = new HashMap<>(); + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public AncTriageAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + checkObject.clear(); + checkObject.put("rapid_examination", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "rapid_examination"))); + checkObject.put("reasons_to_clinic", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "reasons_to_clinic"))); + checkObject.put("danger_signs", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "danger_signs"))); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String jsonPayload) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + JSONObject triageCompletionStatus = JsonFormUtils.getFieldJSONObject(fields, "triage_completion_status"); + assert triageCompletionStatus != null; + triageCompletionStatus.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, VisitUtils.getActionStatus(checkObject)); + } catch (JSONException e) { + Timber.e(e); + } + + if (jsonObject != null) { + return jsonObject.toString(); + } + return null; + } + + @Override + public String evaluateSubTitle() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) + return context.getString(R.string.triage_complete); + return ""; + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + if (status.equalsIgnoreCase(VisitUtils.Ongoing)) { + return BaseAncHomeVisitAction.Status.PARTIALLY_COMPLETED; + } + return BaseAncHomeVisitAction.Status.PENDING; + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncTt1VaccinationAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncTt1VaccinationAction.java new file mode 100644 index 000000000..9b438db21 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncTt1VaccinationAction.java @@ -0,0 +1,98 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncTt1VaccinationAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private String tt1_vaccination_given; + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + + public AncTt1VaccinationAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + tt1_vaccination_given = CoreJsonFormUtils.getValue(jsonObject, "tt1_vaccination_given"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(tt1_vaccination_given)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + + //TODO ilakoze extract to string recources + stringBuilder.append("TT1 Vaccination Given"); + + return stringBuilder.toString(); + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(tt1_vaccination_given)) + return BaseAncHomeVisitAction.Status.PENDING; + else { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncTtVaccinationAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncTtVaccinationAction.java new file mode 100644 index 000000000..5a3b2bff1 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/AncTtVaccinationAction.java @@ -0,0 +1,119 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.family.util.JsonFormUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncTtVaccinationAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private HashMap checkObject = new HashMap<>(); + private String jsonPayload; + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public AncTtVaccinationAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + checkObject.clear(); + checkObject.put("completed_tt_vaccination", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "completed_tt_vaccination"))); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String jsonPayload) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + JSONObject ttVaccinationCompletionStatus = JsonFormUtils.getFieldJSONObject(fields, "tt_vaccination_completion_status"); + assert ttVaccinationCompletionStatus != null; + ttVaccinationCompletionStatus.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, VisitUtils.getActionStatus(checkObject)); + } catch (JSONException e) { + Timber.e(e); + } + + if (jsonObject != null) { + return jsonObject.toString(); + } + return null; + + } + + @Override + public String evaluateSubTitle() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) + return context.getString(R.string.tt_vaccination_filled); + return ""; + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + String status = VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(VisitUtils.Complete)) { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + if (status.equalsIgnoreCase(VisitUtils.Ongoing)) { + return BaseAncHomeVisitAction.Status.PARTIALLY_COMPLETED; + } + return BaseAncHomeVisitAction.Status.PENDING; + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiAntibodyTestAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiAntibodyTestAction.java new file mode 100644 index 000000000..b9b8d47f1 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiAntibodyTestAction.java @@ -0,0 +1,117 @@ +package org.smartregister.chw.hf.actionhelper; + +import static org.smartregister.chw.core.utils.Utils.getCommonPersonObjectClient; +import static org.smartregister.chw.core.utils.Utils.getDuration; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.HeiDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; +import org.smartregister.chw.pmtct.util.JsonFormUtils; +import org.smartregister.chw.referral.util.JsonFormConstants; +import org.smartregister.commonregistry.CommonPersonObjectClient; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class HeiAntibodyTestAction implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private String test_result; + private Context context; + private String subTitle; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + + public HeiAntibodyTestAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + JSONArray fields = jsonObject.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + + //update fields + JSONObject testAtAge = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "test_at_age"); + testAtAge.put(JsonFormUtils.VALUE, HeiDao.getNextHivTestAge(memberObject.getBaseEntityId())); + + JSONObject actualAge = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "actual_age"); + CommonPersonObjectClient client = getCommonPersonObjectClient(memberObject.getBaseEntityId()); + actualAge.put(JsonFormUtils.VALUE, getDuration(org.smartregister.family.util.Utils.getValue(client.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.DOB, false))); + + + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + test_result = CoreJsonFormUtils.getValue(jsonObject, "hiv_test_result"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(test_result)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(context.getString(R.string.antibody_test_results_filled)); + + return stringBuilder.toString(); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(test_result)) + return BasePmtctHomeVisitAction.Status.PENDING; + else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiArvPrescriptionHighOrLowRiskInfantAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiArvPrescriptionHighOrLowRiskInfantAction.java new file mode 100644 index 000000000..859b592e0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiArvPrescriptionHighOrLowRiskInfantAction.java @@ -0,0 +1,94 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class HeiArvPrescriptionHighOrLowRiskInfantAction implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private String provided_nvp_syrup; + private Context context; + private String subTitle; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + + public HeiArvPrescriptionHighOrLowRiskInfantAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + provided_nvp_syrup = CoreJsonFormUtils.getValue(jsonObject, "provided_nvp_syrup"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(provided_nvp_syrup)) + return null; + + return provided_nvp_syrup.equalsIgnoreCase("yes") ? context.getString(R.string.hei_arv_prescription_given) : context.getString(R.string.hei_arv_prescription_not_given); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(provided_nvp_syrup)) + return BasePmtctHomeVisitAction.Status.PENDING; + else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiArvPrescrptionHighRiskInfantAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiArvPrescrptionHighRiskInfantAction.java new file mode 100644 index 000000000..8ca26ecbe --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiArvPrescrptionHighRiskInfantAction.java @@ -0,0 +1,96 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class HeiArvPrescrptionHighRiskInfantAction implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private String provided_azt_nvp_syrup; + private String provided_other_combinations; + private Context context; + private String subTitle; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + + public HeiArvPrescrptionHighRiskInfantAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + provided_azt_nvp_syrup = CoreJsonFormUtils.getValue(jsonObject, "provided_azt_nvp_syrup"); + provided_other_combinations = CoreJsonFormUtils.getValue(jsonObject, "provided_other_combinations"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(provided_azt_nvp_syrup)) + return null; + + return provided_azt_nvp_syrup.equalsIgnoreCase("yes") ? context.getString(R.string.hei_arv_prescription_given) : provided_other_combinations.equalsIgnoreCase("yes") ? context.getString(R.string.other_combination_given) : context.getString(R.string.arv_pres_other_combinations_not_given); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(provided_azt_nvp_syrup)) + return BasePmtctHomeVisitAction.Status.PENDING; + else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiCtxAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiCtxAction.java new file mode 100644 index 000000000..6e29e39fd --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiCtxAction.java @@ -0,0 +1,94 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class HeiCtxAction implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private String prescribed_ctx; + private Context context; + private String subTitle; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + + public HeiCtxAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + prescribed_ctx = CoreJsonFormUtils.getValue(jsonObject, "prescribed_ctx"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(prescribed_ctx)) + return null; + + return prescribed_ctx.equalsIgnoreCase("yes") ? context.getString(R.string.ctx_given) : context.getString(R.string.ctx_not_given); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(prescribed_ctx)) + return BasePmtctHomeVisitAction.Status.PENDING; + else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiDnaPcrTestAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiDnaPcrTestAction.java new file mode 100644 index 000000000..1803c62b2 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/HeiDnaPcrTestAction.java @@ -0,0 +1,97 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class HeiDnaPcrTestAction implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private String sample_id; + private Context context; + private String subTitle; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + + public HeiDnaPcrTestAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + sample_id = CoreJsonFormUtils.getValue(jsonObject, "sample_id"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(sample_id)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(context.getString(R.string.dna_pcr_sample_collected)); + + return stringBuilder.toString(); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(sample_id)) + return BasePmtctHomeVisitAction.Status.PENDING; + else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDBloodGroupTestActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDBloodGroupTestActionHelper.java new file mode 100644 index 000000000..2afdab136 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDBloodGroupTestActionHelper.java @@ -0,0 +1,90 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.util.JsonFormUtils; + +import java.util.List; +import java.util.Map; + +/** + * Created by Ilakoze Jumanne on 2022-10-25 + */ +public class LDBloodGroupTestActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private final Context context; + private String blood_group; + + public LDBloodGroupTestActionHelper(Context context) { + this.context = context; + } + + @Override + public void onJsonFormLoaded(String jsonString, Context context, Map> details) { + //Todo: Implement here + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + blood_group = JsonFormUtils.getFieldValue(jsonPayload, "blood_group"); + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + return null; + } + + @Override + public String evaluateSubTitle() { + if (isCompleted()) { + return context.getString(R.string.lb_fully_completed_action); + } else if (isPartiallyCompleted()) { + return context.getString(R.string.lb_partially_completed_action); + } + return ""; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isCompleted()) { + return BaseLDVisitAction.Status.COMPLETED; + } else { + return isPartiallyCompleted() ? BaseLDVisitAction.Status.PARTIALLY_COMPLETED : BaseLDVisitAction.Status.PENDING; + } + + } + + @Override + public void onPayloadReceived(BaseLDVisitAction ldVisitAction) { + //Todo: Implement + } + + private boolean isCompleted() { + boolean actionCompleted; + actionCompleted = StringUtils.isNotBlank(blood_group); + return actionCompleted; + } + + private boolean isPartiallyCompleted() { + return (StringUtils.isNotBlank(blood_group)); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDGeneralExaminationActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDGeneralExaminationActionHelper.java new file mode 100644 index 000000000..d87b32518 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDGeneralExaminationActionHelper.java @@ -0,0 +1,171 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.LDDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.chw.referral.util.JsonFormConstants; +import org.smartregister.util.JsonFormUtils; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * Created by Kassim Sheghembe on 2022-05-09 + */ +public class LDGeneralExaminationActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private String general_condition; + private String pulse_rate; + private String respiratory_rate; + private String temperature; + private String systolic; + private String diastolic; + private String urineProtein; + private String urineAcetone; + private String fundal_height; + private String contraction_frequency; + private String fetal_heart_rate; + private final Context context; + private final MemberObject memberObject; + + public LDGeneralExaminationActionHelper(Context context, MemberObject memberObject) { + this.context = context; + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonString, Context context, Map> details) { + } + + @Override + public String getPreProcessed() { + JSONObject generalExaminationForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.LDVisit.getLdGeneralExamination()); + try { + if (generalExaminationForm != null) { + + JSONArray fields = generalExaminationForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + JSONObject fundalHeight = JsonFormUtils.getFieldJSONObject(fields, "fundal_height"); + JSONObject lie = JsonFormUtils.getFieldJSONObject(fields, "lie"); + + if (fundalHeightCaptured(memberObject.getBaseEntityId()) && fundalHeight != null) { + fundalHeight.put("hidden", true); + } + + if (featalLieCaptured(memberObject.getBaseEntityId()) && lie != null) { + lie.put("hidden", true); + } + + } + } catch (Exception e) { + Timber.e(e); + } + return generalExaminationForm.toString(); + } + + @Override + public void onPayloadReceived(String jsonPayload) { + general_condition = JsonFormUtils.getFieldValue(jsonPayload, "general_condition"); + pulse_rate = JsonFormUtils.getFieldValue(jsonPayload, "pulse_rate"); + respiratory_rate = JsonFormUtils.getFieldValue(jsonPayload, "respiratory_rate"); + temperature = JsonFormUtils.getFieldValue(jsonPayload, "temperature"); + systolic = JsonFormUtils.getFieldValue(jsonPayload, "systolic"); + diastolic = JsonFormUtils.getFieldValue(jsonPayload, "diastolic"); + urineProtein = JsonFormUtils.getFieldValue(jsonPayload, "urine_protein"); + urineAcetone = JsonFormUtils.getFieldValue(jsonPayload, "urine_acetone"); + fundal_height = JsonFormUtils.getFieldValue(jsonPayload, "fundal_height"); + contraction_frequency = JsonFormUtils.getFieldValue(jsonPayload, "contraction_frequency"); + fetal_heart_rate = JsonFormUtils.getFieldValue(jsonPayload, "fetal_heart_rate"); + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + return null; + } + + @Override + public String evaluateSubTitle() { + if (isFullyCompleted()) { + return context.getString(R.string.lb_fully_completed_action); + } else if (isPartiallyCompleted()) { + return context.getString(R.string.lb_partially_completed_action); + } else { + return ""; + } + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isFullyCompleted()) { + return BaseLDVisitAction.Status.COMPLETED; + } else if (isPartiallyCompleted()) { + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + } else { + return BaseLDVisitAction.Status.PENDING; + } + } + + @Override + public void onPayloadReceived(BaseLDVisitAction ldVisitAction) { + + } + + private boolean isFullyCompleted() { + return (StringUtils.isNotBlank(general_condition) && + StringUtils.isNotBlank(pulse_rate) && + StringUtils.isNotBlank(respiratory_rate) && + StringUtils.isNotBlank(temperature) && + StringUtils.isNotBlank(systolic) && + StringUtils.isNotBlank(diastolic) && + StringUtils.isNotBlank(urineAcetone) && + StringUtils.isNotBlank(urineProtein) && + fundalHeightCaptured(memberObject.getBaseEntityId()) || StringUtils.isNotBlank(fundal_height) && + StringUtils.isNotBlank(contraction_frequency) && + StringUtils.isNotBlank(fetal_heart_rate) + ); + } + + private boolean isPartiallyCompleted() { + return (StringUtils.isNotBlank(general_condition) || + StringUtils.isNotBlank(pulse_rate) || + StringUtils.isNotBlank(respiratory_rate) || + StringUtils.isNotBlank(temperature) || + StringUtils.isNotBlank(systolic) || + StringUtils.isNotBlank(diastolic) || + StringUtils.isNotBlank(urineAcetone) || + StringUtils.isNotBlank(urineProtein) || + StringUtils.isNotBlank(fundal_height) || + StringUtils.isNotBlank(contraction_frequency) || + StringUtils.isNotBlank(fetal_heart_rate) + ); + } + + public static boolean fundalHeightCaptured(String baseEntityId) { + return LDDao.getFundalHeight(baseEntityId) != null; + } + + public static boolean featalLieCaptured(String baseEntityId) { + return LDDao.getFetalLie(baseEntityId) != null; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDHBTestActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDHBTestActionHelper.java new file mode 100644 index 000000000..92ce6d2de --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDHBTestActionHelper.java @@ -0,0 +1,84 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.util.JsonFormUtils; + +import java.util.List; +import java.util.Map; + +/** + * Author: issyzac on 2022-07-6 + */ + +public class LDHBTestActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private final Context context; + private String hbTestConducted; + + public LDHBTestActionHelper(Context context) { + this.context = context; + } + + @Override + public void onJsonFormLoaded(String jsonString, Context context, Map> details) { + //Todo: Implement here + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + hbTestConducted = JsonFormUtils.getFieldValue(jsonPayload, "hb_test_conducted"); + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + return null; + } + + @Override + public String evaluateSubTitle() { + if (isCompleted()) { + return context.getString(R.string.lb_fully_completed_action); + } + return ""; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isCompleted()) { + return BaseLDVisitAction.Status.COMPLETED; + } else { + return BaseLDVisitAction.Status.PENDING; + } + + } + + @Override + public void onPayloadReceived(BaseLDVisitAction ldVisitAction) { + //Todo: Implement + } + + private boolean isCompleted() { + return StringUtils.isNotBlank(hbTestConducted); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDHIVTestActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDHIVTestActionHelper.java new file mode 100644 index 000000000..4a2e88a16 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDHIVTestActionHelper.java @@ -0,0 +1,106 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.util.JsonFormUtils; + +import java.util.List; +import java.util.Map; + +/** + * Created by Kassim Sheghembe on 2022-05-17 + */ +public class LDHIVTestActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private final Context context; + private String hiv_test_conducted; + private String hiv_counselling_before_testing; + private String hiv; + private String hiv_counselling_after_testing; + + public LDHIVTestActionHelper(Context context) { + this.context = context; + } + + @Override + public void onJsonFormLoaded(String jsonString, Context context, Map> details) { + //Todo: Implement here + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + hiv_test_conducted = JsonFormUtils.getFieldValue(jsonPayload, "hiv_test_conducted"); + hiv_counselling_before_testing = JsonFormUtils.getFieldValue(jsonPayload, "hiv_counselling_before_testing"); + hiv = JsonFormUtils.getFieldValue(jsonPayload, "hiv"); + hiv_counselling_after_testing = JsonFormUtils.getFieldValue(jsonPayload, "hiv_counselling_after_testing"); + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + return null; + } + + @Override + public String evaluateSubTitle() { + if (isCompleted()) { + return context.getString(R.string.lb_fully_completed_action); + } else if (isPartiallyCompleted()) { + return context.getString(R.string.lb_partially_completed_action); + } + return ""; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isCompleted()) { + return BaseLDVisitAction.Status.COMPLETED; + } else { + return isPartiallyCompleted() ? BaseLDVisitAction.Status.PARTIALLY_COMPLETED : BaseLDVisitAction.Status.PENDING; + } + + } + + @Override + public void onPayloadReceived(BaseLDVisitAction ldVisitAction) { + //Todo: Implement + } + + private boolean isCompleted() { + boolean actionCompleted; + if (StringUtils.isNotBlank(hiv_test_conducted) && hiv_test_conducted.equalsIgnoreCase("no")) { + actionCompleted = true; + } else { + actionCompleted = (StringUtils.isNotBlank(hiv_test_conducted) && + StringUtils.isNotBlank(hiv_counselling_before_testing) && + StringUtils.isNotBlank(hiv) && + StringUtils.isNotBlank(hiv_counselling_after_testing)); + } + return actionCompleted; + } + + private boolean isPartiallyCompleted() { + return (StringUtils.isNotBlank(hiv_test_conducted) || + StringUtils.isNotBlank(hiv_counselling_before_testing) || + StringUtils.isNotBlank(hiv) || + StringUtils.isNotBlank(hiv_counselling_after_testing)); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDMalariaTestActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDMalariaTestActionHelper.java new file mode 100644 index 000000000..b658692f0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDMalariaTestActionHelper.java @@ -0,0 +1,91 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.JsonFormUtils; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * Author issyzac on 2022-07-13 + */ + +public class LDMalariaTestActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private final Context context; + private String malariaTest; + + public LDMalariaTestActionHelper(Context context){ + this.context = context; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + //TODO: implement + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try{ + malariaTest = JsonFormUtils.getFieldValue(jsonPayload, "malaria"); + }catch (Exception e){ + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + String subtitle = ""; + if (malariaTest != null && !malariaTest.isEmpty()){ + subtitle = context.getString(R.string.malaria_test_result) + " : "; + if (malariaTest.equalsIgnoreCase("positive")){ + subtitle += context.getString(R.string.positive); + }else if (malariaTest.equalsIgnoreCase("negative")){ + subtitle += context.getString(R.string.negative); + }else if (malariaTest.equalsIgnoreCase("test_not_conducted")){ + subtitle += context.getString(R.string.test_not_conducted); + } + } + return subtitle; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (malariaTest != null && !malariaTest.isEmpty()){ + return BaseLDVisitAction.Status.COMPLETED; + }else{ + return BaseLDVisitAction.Status.PENDING; + } + } + + @Override + public void onPayloadReceived(BaseLDVisitAction baseLDVisitAction) { + //TODO: implement + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographFetalWellBeingActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographFetalWellBeingActionHelper.java new file mode 100644 index 000000000..f16674ec3 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographFetalWellBeingActionHelper.java @@ -0,0 +1,143 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; +import android.os.Build; + +import androidx.annotation.RequiresApi; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.LDDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.chw.referral.util.JsonFormConstants; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author issyzac 5/7/22 + */ +public class LDPartographFetalWellBeingActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + protected MemberObject memberObject; + private String fetalHeartRate; + private String amnioticFluid; + private String caput; + private String mouldingOptions; + private Context context; + final private String baseEntityId; + + public LDPartographFetalWellBeingActionHelper(MemberObject memberObject, String baseEntityId) { + this.memberObject = memberObject; + this.baseEntityId = baseEntityId; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @RequiresApi(api = Build.VERSION_CODES.KITKAT) + @Override + public String getPreProcessed() { + JSONObject fetalWellBeingForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.LabourAndDeliveryPartograph.getFetalWellBingForm()); + if (fetalWellBeingForm != null) { + try { + fetalWellBeingForm.getJSONObject("global").put("moulding", LDDao.getMoulding(baseEntityId) == null ? "" : LDDao.getMoulding(baseEntityId)); + JSONArray fields = fetalWellBeingForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + + JSONObject mouldingOptions = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "moulding_options"); + + if (LDDao.getPresentingPart(baseEntityId) != null && (LDDao.getPresentingPart(baseEntityId).equalsIgnoreCase("breech") || LDDao.getPresentingPart(baseEntityId).equalsIgnoreCase("shoulder"))) { + if (mouldingOptions != null) mouldingOptions.put("hidden", true); + } else if (LDDao.getMoulding(baseEntityId) != null && LDDao.getMoulding(baseEntityId).equalsIgnoreCase("yes")) { + mouldingOptions.getJSONArray("options").remove(0); + } + + JSONObject amnioticFluid = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "amniotic_fluid"); + + if (LDDao.getAmnioticFluidState(baseEntityId) != null && !LDDao.getAmnioticFluidState(baseEntityId).equalsIgnoreCase("membrane_intact")) { + amnioticFluid.getJSONArray("options").remove(0); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + + return fetalWellBeingForm.toString(); + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + fetalHeartRate = CoreJsonFormUtils.getValue(jsonObject, "fetal_heart_rate"); + caput = CoreJsonFormUtils.getValue(jsonObject, "caput"); + mouldingOptions = CoreJsonFormUtils.getValue(jsonObject, "moulding_options"); + amnioticFluid = CoreJsonFormUtils.getValue(jsonObject, "amniotic_fluid"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + if (allFieldsCompleted()) + return context.getString(R.string.ld_partograph_fetal_wellbeing_completed); + else if (anyFieldCompleted()) + return context.getString(R.string.ld_partograph_fetal_wellbeing_pending); + return ""; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (allFieldsCompleted()) + return BaseLDVisitAction.Status.COMPLETED; + else if (anyFieldCompleted()) + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + else + return BaseLDVisitAction.Status.PENDING; + } + + @Override + public void onPayloadReceived(BaseLDVisitAction baseLDVisitAction) { + Timber.v("onPayloadReceived"); + } + + private boolean allFieldsCompleted() { + return StringUtils.isNotBlank(fetalHeartRate) && + StringUtils.isNotBlank(amnioticFluid); + } + + private boolean anyFieldCompleted() { + return StringUtils.isNotBlank(fetalHeartRate) || + StringUtils.isNotBlank(caput) || + StringUtils.isNotBlank(mouldingOptions) || + StringUtils.isNotBlank(amnioticFluid); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographLabourProgressActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographLabourProgressActionHelper.java new file mode 100644 index 000000000..0d93859d7 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographLabourProgressActionHelper.java @@ -0,0 +1,228 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; +import android.os.Build; + +import androidx.annotation.RequiresApi; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.LDDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.chw.referral.util.JsonFormConstants; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import timber.log.Timber; + +/** + * @author issyzac 5/7/22 + */ +public class LDPartographLabourProgressActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + protected MemberObject memberObject; + private String cervixDilation; + private String descentPresentingPart; + private String contractionFrequency; + private Context context; + + final private String currentPartographDate; + final private String currentPartographTime; + + public LDPartographLabourProgressActionHelper(MemberObject memberObject, String currentPartographDate, String currentPartographTime) { + this.memberObject = memberObject; + this.currentPartographDate = currentPartographDate; + this.currentPartographTime = currentPartographTime; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @RequiresApi(api = Build.VERSION_CODES.KITKAT) + @Override + public String getPreProcessed() { + + JSONObject progressOfLabourForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.LabourAndDeliveryPartograph.getProgressOfLabourForm()); + try { + + setPatographAlerts(progressOfLabourForm); + + JSONArray fields = progressOfLabourForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + populateLabourProgressForm(fields, memberObject.getBaseEntityId()); + } catch (JSONException e) { + Timber.e(e); + } + + return progressOfLabourForm.toString(); + } + + private void setPatographAlerts(JSONObject form) { + + String cervixDilationAlertLimit = ""; + String cervixDilationActionLimit = ""; + String partographDuration = ""; + + String concatPartographTimeAndDate = currentPartographDate + " " + currentPartographTime; + Long firstPartographTime = LDDao.getPartographStartTime(memberObject.getBaseEntityId()); + + if (firstPartographTime == null) + return; + + long currentPartographTimestamp; + + try { + + Date parseDate = (new SimpleDateFormat("dd-MM-yyyy HH:mm", Locale.getDefault())).parse(concatPartographTimeAndDate); + currentPartographTimestamp = parseDate.getTime(); + + // Calucalte time difference + // in milliseconds + long timeDifference = currentPartographTimestamp - firstPartographTime; + int hoursDifference = (int) TimeUnit.MILLISECONDS.toHours(timeDifference); + + partographDuration = String.valueOf(hoursDifference); + + int alertLimit = hoursDifference + 3; // 3 is the cervix dilation value when partograph begins + int actionLimit = hoursDifference >= 1 ? alertLimit - 4 : 0; + + cervixDilationAlertLimit = String.valueOf(alertLimit); + cervixDilationActionLimit = String.valueOf(actionLimit); + + } catch (ParseException e) { + Timber.e(e); + } + + try { + form.getJSONObject("global").put("cervix_dilation_alert_limit", cervixDilationAlertLimit); + form.getJSONObject("global").put("cervix_dilation_action_limit", cervixDilationActionLimit); + form.getJSONObject("global").put("partograph_duration", partographDuration); + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + cervixDilation = CoreJsonFormUtils.getValue(jsonObject, "cervix_dilation"); + descentPresentingPart = CoreJsonFormUtils.getValue(jsonObject, "descent_presenting_part"); + contractionFrequency = CoreJsonFormUtils.getValue(jsonObject, "contraction_every_half_hour_frequency"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + if (allFieldsCompleted()) + return context.getString(R.string.ld_partograph_labor_progress_completed); + else if (anyFieldCompleted()) + return context.getString(R.string.ld_partograph_labor_progress_pending); + return ""; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (allFieldsCompleted()) + return BaseLDVisitAction.Status.COMPLETED; + else if (anyFieldCompleted()) + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + else + return BaseLDVisitAction.Status.PENDING; + } + + @Override + public void onPayloadReceived(BaseLDVisitAction baseLDVisitAction) { + Timber.v("onPayloadReceived"); + } + + private boolean allFieldsCompleted() { + return StringUtils.isNotBlank(cervixDilation) && + StringUtils.isNotBlank(descentPresentingPart) && + StringUtils.isNotBlank(contractionFrequency); + } + + private boolean anyFieldCompleted() { + return StringUtils.isNotBlank(cervixDilation) || + StringUtils.isNotBlank(descentPresentingPart) || + StringUtils.isNotBlank(contractionFrequency); + } + + private void populateLabourProgressForm(JSONArray fields, String baseEntityId) throws JSONException { + JSONObject cervixDilation = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "cervix_dilation"); + JSONObject descentPresentingPart = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "descent_presenting_part"); + if (LDDao.getCervixDilation(baseEntityId) != null) { + cervixDilation.put("start_number", LDDao.getCervixDilation(baseEntityId)); + + //Limit number of selectors + int cervixDilationValue = Integer.parseInt(LDDao.getCervixDilation(baseEntityId)); + int numberOfSelectors = 11 - cervixDilationValue; + cervixDilation.put("number_of_selectors", numberOfSelectors); + } + + if (LDDao.getDescent(baseEntityId) != null && descentPresentingPart != null) { + int descent = 5; + try { + descent = Integer.parseInt(LDDao.getDescent(baseEntityId)); + } catch (NumberFormatException e) { + Timber.e(e); + } + + if (descent == 0) { + descentPresentingPart.getJSONArray("options").remove(4); + descentPresentingPart.getJSONArray("options").remove(3); + descentPresentingPart.getJSONArray("options").remove(2); + descentPresentingPart.getJSONArray("options").remove(1); + descentPresentingPart.getJSONArray("options").remove(0); + } + if (descent == 1) { + descentPresentingPart.getJSONArray("options").remove(3); + descentPresentingPart.getJSONArray("options").remove(2); + descentPresentingPart.getJSONArray("options").remove(1); + descentPresentingPart.getJSONArray("options").remove(0); + } + if (descent == 2) { + descentPresentingPart.getJSONArray("options").remove(2); + descentPresentingPart.getJSONArray("options").remove(1); + descentPresentingPart.getJSONArray("options").remove(0); + } else if (descent == 3) { + descentPresentingPart.getJSONArray("options").remove(1); + descentPresentingPart.getJSONArray("options").remove(0); + } else if (descent == 4) { + descentPresentingPart.getJSONArray("options").remove(0); + } + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographMotherWellBeingActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographMotherWellBeingActionHelper.java new file mode 100644 index 000000000..4cfaeca28 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographMotherWellBeingActionHelper.java @@ -0,0 +1,126 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author issyzac 5/7/22 + */ +public class LDPartographMotherWellBeingActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + protected MemberObject memberObject; + private String pulseRate; + private String respiratoryRate; + private String temperature; + private String systolic; + private String diastolic; + private String urineProtein; + private String urineAcetone; + private String urineVolume; + private Context context; + + public LDPartographMotherWellBeingActionHelper(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + pulseRate = CoreJsonFormUtils.getValue(jsonObject, "pulse_rate"); + respiratoryRate = CoreJsonFormUtils.getValue(jsonObject, "respiratory_rate"); + temperature = CoreJsonFormUtils.getValue(jsonObject, "temperature"); + systolic = CoreJsonFormUtils.getValue(jsonObject, "systolic"); + diastolic = CoreJsonFormUtils.getValue(jsonObject, "diastolic"); + urineProtein = CoreJsonFormUtils.getValue(jsonObject, "urine_protein"); + urineAcetone = CoreJsonFormUtils.getValue(jsonObject, "urine_acetone"); + urineVolume = CoreJsonFormUtils.getValue(jsonObject, "urine_volume"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + if (allFieldsCompleted()) + return context.getString(R.string.ld_partograph_mother_wellbeing_completed); + else if (anyFieldCompleted()) + return context.getString(R.string.ld_partograph_mother_wellbeing_pending); + return ""; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (allFieldsCompleted()) + return BaseLDVisitAction.Status.COMPLETED; + else if (anyFieldCompleted()) + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + else + return BaseLDVisitAction.Status.PENDING; + } + + @Override + public void onPayloadReceived(BaseLDVisitAction baseLDVisitAction) { + Timber.v("onPayloadReceived"); + } + + private boolean allFieldsCompleted() { + return StringUtils.isNotBlank(pulseRate) && + StringUtils.isNotBlank(respiratoryRate) && + StringUtils.isNotBlank(temperature) && + StringUtils.isNotBlank(systolic) && + StringUtils.isNotBlank(diastolic) && + StringUtils.isNotBlank(urineProtein) && + StringUtils.isNotBlank(urineAcetone) && + StringUtils.isNotBlank(urineVolume); + } + + private boolean anyFieldCompleted() { + return StringUtils.isNotBlank(pulseRate) || + StringUtils.isNotBlank(respiratoryRate) || + StringUtils.isNotBlank(temperature) || + StringUtils.isNotBlank(systolic) || + StringUtils.isNotBlank(diastolic) || + StringUtils.isNotBlank(urineProtein) || + StringUtils.isNotBlank(urineAcetone) || + StringUtils.isNotBlank(urineVolume); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographTimeActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographTimeActionHelper.java new file mode 100644 index 000000000..b82b8ff3e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographTimeActionHelper.java @@ -0,0 +1,198 @@ +package org.smartregister.chw.hf.actionhelper; + +import static org.smartregister.opd.utils.OpdConstants.KEY.VALUE; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.time.DateUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.LDDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.chw.referral.util.JsonFormConstants; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import timber.log.Timber; + +/** + * @author issyzac 5/12/22 + */ +public class LDPartographTimeActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private Context context; + private boolean editMode; + protected String time; + protected String date; + private final MemberObject memberObject; + private final DateFormat hourFormat = new SimpleDateFormat("HH:mm"); + private final DateFormat completeDateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm"); + + public LDPartographTimeActionHelper(MemberObject memberObject, boolean editMode) { + this.memberObject = memberObject; + this.editMode = editMode; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @Override + public String getPreProcessed() { + JSONObject partographTimeForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.LabourAndDeliveryPartograph.getPartographTimeForm()); + if (partographTimeForm != null) { + try { + + String baseEntityId = memberObject.getBaseEntityId(); + + JSONArray fields = partographTimeForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + populatePartograhDateTimeForm(fields, baseEntityId); + populatePartographHealthcareProviderNameForm(fields, baseEntityId); + + String partographDate = null; + String partographTime = null; + if (LDDao.getPartographDate(baseEntityId) != null) { + partographDate = LDDao.getPartographDate(baseEntityId); + } else if (LDDao.getVaginalExaminationDate(baseEntityId) != null) { + partographDate = LDDao.getVaginalExaminationDate(baseEntityId); + } else if (LDDao.getLabourOnsetDate(baseEntityId) != null) { + partographDate = LDDao.getLabourOnsetDate(baseEntityId); + } + + if (partographDate != null) { + partographTimeForm.getJSONObject("global").put("partograph_monitoring_date", partographDate); + } + + if (editMode && LDDao.getPreviousPartographTime(baseEntityId) != null) { + partographTime = LDDao.getPreviousPartographTime(baseEntityId); + }else if (!editMode && LDDao.getPartographTime(baseEntityId) != null) { + partographTime = LDDao.getPartographTime(baseEntityId); + } else if (LDDao.getVaginalExaminationTime(baseEntityId) != null) { + partographTime = LDDao.getVaginalExaminationTime(baseEntityId); + } else if (LDDao.getLabourOnsetTime(baseEntityId) != null) { + partographTime = LDDao.getLabourOnsetTime(baseEntityId); + } + + Date now = new Date(); + String partographLimit = ""; + + try { + + String completePartographDateString = partographDate + " " + partographTime; + Date partoDate = completeDateFormat.parse(completePartographDateString); + + long lastPartographDiff = TimeUnit.MILLISECONDS.toMinutes(now.getTime() - partoDate.getTime()); + + if (lastPartographDiff > 30) { + Date thirtyMinutesAgo = new Date(); //now + int thirtyMinutesLimit = -30; + thirtyMinutesAgo = DateUtils.addMinutes(thirtyMinutesAgo, thirtyMinutesLimit); + partographLimit = hourFormat.format(thirtyMinutesAgo); + partographTimeForm.getJSONObject("global").put("partograph_limit", partographLimit); + } + + } catch (Exception e) { + Timber.e(e); + } + + if (partographTime != null) { + partographTimeForm.getJSONObject("global").put("partograph_monitoring_time", partographTime); + } + + } catch (JSONException e) { + e.printStackTrace(); + } + } + + return partographTimeForm.toString(); + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + time = CoreJsonFormUtils.getValue(jsonObject, "partograph_time"); + date = CoreJsonFormUtils.getValue(jsonObject, "partograph_date"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isNotBlank(time)) + return context.getString(R.string.partograph_time, time); + else + return ""; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(time) || StringUtils.isBlank(date)) + return BaseLDVisitAction.Status.PENDING; + else + return BaseLDVisitAction.Status.COMPLETED; + } + + @Override + public void onPayloadReceived(BaseLDVisitAction baseLDVisitAction) { + /* + * TODO: Capture values after form was filled by the user + */ + } + + private void populatePartograhDateTimeForm(JSONArray fields, String baseEntityId) throws JSONException { + JSONObject partographDate = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "partograph_date"); + + if (LDDao.getPartographDate(baseEntityId) != null) { + partographDate.put("min_date", LDDao.getPartographDate(baseEntityId)); + } else if (LDDao.getVaginalExaminationDate(baseEntityId) != null) { + partographDate.put("min_date", LDDao.getVaginalExaminationDate(baseEntityId)); + } else if (LDDao.getLabourOnsetDate(baseEntityId) != null) { + partographDate.put("min_date", LDDao.getLabourOnsetDate(baseEntityId)); + } + partographDate.put("value", new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(Calendar.getInstance().getTime())); + } + + private void populatePartographHealthcareProviderNameForm(JSONArray fields, String baseEntityId) throws JSONException { + JSONObject nameOfTheHealthCareProviderJsonObject = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "name_of_the_health_care_provider"); + String nameOfHealthcareProvider = org.smartregister.chw.hf.dao.LDDao.getHealthcareProviderNameWhoConductedLastPartographSession(baseEntityId); + + if (nameOfHealthcareProvider != null) { + nameOfTheHealthCareProviderJsonObject.put("editable", true); + nameOfTheHealthCareProviderJsonObject.put("read_only", true); + nameOfTheHealthCareProviderJsonObject.put(VALUE, nameOfHealthcareProvider); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographTreatmentDuringLabourActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographTreatmentDuringLabourActionHelper.java new file mode 100644 index 000000000..e95355abc --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDPartographTreatmentDuringLabourActionHelper.java @@ -0,0 +1,108 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author issyzac 5/19/22 + */ +public class LDPartographTreatmentDuringLabourActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + MemberObject memberObject; + Context context; + + private String drugsAdministered; + private String drugs; + private String ivFluid; + private String oxytocin_units_per_liter; + private String oxytocin_drops_per_minute; + + public LDPartographTreatmentDuringLabourActionHelper(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonString, Context context, Map> details) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + drugsAdministered = CoreJsonFormUtils.getValue(jsonObject, "drugs_administered"); + drugs = CoreJsonFormUtils.getValue(jsonObject, "drugs_provided"); + ivFluid = CoreJsonFormUtils.getValue(jsonObject, "iv_fluid_provided"); + oxytocin_units_per_liter = CoreJsonFormUtils.getValue(jsonObject, "oxytocin_units_per_liter"); + oxytocin_drops_per_minute = CoreJsonFormUtils.getValue(jsonObject, "oxytocin_drops_per_minute"); + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return ""; + } + + @Override + public String postProcess(String jsonPayload) { + return null; + } + + @Override + public String evaluateSubTitle() { + String subtitle = "" + context.getString(R.string.partograph_treatment_during_labour_drugs_administered) + ""; + + if (drugsAdministered.contains("oxytocin")) + subtitle += "\n" + context.getString(R.string.partograph_treatment_during_labour_oxytocin_ul) + " : " + oxytocin_units_per_liter + "\n" + context.getString(R.string.partograph_treatment_during_labour_oxytocin_drops_min) + " : " + oxytocin_drops_per_minute; + + if (drugsAdministered.contains("drugs")) + subtitle += "\n" + context.getString(R.string.partograph_treatment_during_labour_drugs) + " : " + drugs; + + if (drugsAdministered.contains("iv_fluid")) + subtitle += "\n" + context.getString(R.string.partograph_treatment_during_labour_iv_fluid) + " : " + ivFluid; + + if (drugsAdministered.contains("none")) + subtitle += "\n" + context.getString(R.string.partograph_treatment_during_labour_none); + + return StringUtils.isNotBlank(drugsAdministered) ? + subtitle : ""; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isNotBlank(drugsAdministered)) { + return BaseLDVisitAction.Status.COMPLETED; + } else { + return BaseLDVisitAction.Status.PENDING; + } + } + + @Override + public void onPayloadReceived(BaseLDVisitAction ldVisitAction) { + Timber.v("Payload received"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationAdmissionAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationAdmissionAction.java new file mode 100644 index 000000000..a1986bcac --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationAdmissionAction.java @@ -0,0 +1,118 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author ilakozejumanne@gmail.com + * 06/05/2022 + */ +public class LDRegistrationAdmissionAction implements BaseLDVisitAction.LDVisitActionHelper { + protected MemberObject memberObject; + private String admissionDate; + private String admissionTime; + private String admittingPersonName; + private String admissionFrom; + private Context context; + + public LDRegistrationAdmissionAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + admissionDate = CoreJsonFormUtils.getValue(jsonObject, "admission_date"); + admissionTime = CoreJsonFormUtils.getValue(jsonObject, "admission_time"); + admittingPersonName = CoreJsonFormUtils.getValue(jsonObject, "admitting_person_name"); + admissionFrom = CoreJsonFormUtils.getValue(jsonObject, "admission_from"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public void onPayloadReceived(BaseLDVisitAction baseAncHomeVisitAction) { + Timber.v("onPayloadReceived"); + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isAllFieldsCompleted()) + return BaseLDVisitAction.Status.COMPLETED; + else if (isAnyFieldCompleted()) + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + else + return BaseLDVisitAction.Status.PENDING; + } + + @Override + public String evaluateSubTitle() { + if (isAllFieldsCompleted()) + return context.getString(R.string.ld_registration_admission_information_complete); + else if (isAnyFieldCompleted()) + return context.getString(R.string.ld_registration_admission_information_pending); + else + return ""; + } + + /** + * evaluate if all fields are completed + **/ + private boolean isAllFieldsCompleted() { + return !StringUtils.isBlank(admissionDate) && + !StringUtils.isBlank(admissionTime) && + !StringUtils.isBlank(admittingPersonName) && + !StringUtils.isBlank(admissionFrom); + } + + /** + * evaluate if any field has been completed + **/ + private boolean isAnyFieldCompleted() { + return !StringUtils.isBlank(admissionDate) || + !StringUtils.isBlank(admissionTime) || + !StringUtils.isBlank(admittingPersonName) || + !StringUtils.isBlank(admissionFrom); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationAncClinicFindingsAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationAncClinicFindingsAction.java new file mode 100644 index 000000000..b2c328bf3 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationAncClinicFindingsAction.java @@ -0,0 +1,140 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author ilakozejumanne@gmail.com + * 06/05/2022 + */ +public class LDRegistrationAncClinicFindingsAction implements BaseLDVisitAction.LDVisitActionHelper { + protected MemberObject memberObject; + private String numberOfVisits; + private String iptDoses; + private String ttDoses; + private String llinUsed; + private String hbLevel; + private String hbTestDate; + private String pmtct; + private String syphilis; + private String bloodGroup; + private String hbTestConducted; + private Context context; + + public LDRegistrationAncClinicFindingsAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + numberOfVisits = CoreJsonFormUtils.getValue(jsonObject, "number_of_visits"); + iptDoses = CoreJsonFormUtils.getValue(jsonObject, "ipt_doses"); + ttDoses = CoreJsonFormUtils.getValue(jsonObject, "tt_doses"); + llinUsed = CoreJsonFormUtils.getValue(jsonObject, "llin_used"); + hbTestConducted = CoreJsonFormUtils.getValue(jsonObject, "hb_test"); + hbLevel = CoreJsonFormUtils.getValue(jsonObject, "hb_level"); + hbTestDate = CoreJsonFormUtils.getValue(jsonObject, "hb_test_date"); + pmtct = CoreJsonFormUtils.getValue(jsonObject, "anc_hiv_status"); + syphilis = CoreJsonFormUtils.getValue(jsonObject, "syphilis"); + bloodGroup = CoreJsonFormUtils.getValue(jsonObject, "blood_group"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public void onPayloadReceived(BaseLDVisitAction baseAncHomeVisitAction) { + Timber.v("onPayloadReceived"); + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isAllFieldsCompleted()) + return BaseLDVisitAction.Status.COMPLETED; + else if (isAnyFieldCompleted()) + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + else + return BaseLDVisitAction.Status.PENDING; + } + + @Override + public String evaluateSubTitle() { + if (isAllFieldsCompleted()) + return context.getString(R.string.ld_registration_anc_clinic_findings_complete); + else if (isAnyFieldCompleted()) + return context.getString(R.string.ld_registration_anc_clinic_findings_pending); + return ""; + } + + /** + * evaluate if all fields are completed + **/ + private boolean isAllFieldsCompleted() { + return !StringUtils.isBlank(numberOfVisits) && + !StringUtils.isBlank(iptDoses) && + !StringUtils.isBlank(ttDoses) && + !StringUtils.isBlank(llinUsed) && + (!hbTestConducted.equals("yes") || (!StringUtils.isBlank(hbLevel) && + !StringUtils.isBlank(hbTestDate))) && + !StringUtils.isBlank(pmtct) && + !StringUtils.isBlank(syphilis) && + !StringUtils.isBlank(bloodGroup); + } + + /** + * evaluate if any field has been completed + **/ + private boolean isAnyFieldCompleted() { + return !StringUtils.isBlank(numberOfVisits) || + !StringUtils.isBlank(iptDoses) || + !StringUtils.isBlank(ttDoses) || + !StringUtils.isBlank(llinUsed) || + !StringUtils.isBlank(hbLevel) || + !StringUtils.isBlank(hbTestDate) || + !StringUtils.isBlank(pmtct) || + !StringUtils.isBlank(syphilis) || + !StringUtils.isBlank(bloodGroup); + + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationCurrentLabourAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationCurrentLabourAction.java new file mode 100644 index 000000000..794e5d1f5 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationCurrentLabourAction.java @@ -0,0 +1,123 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author ilakozejumanne@gmail.com + * 06/05/2022 + */ +public class LDRegistrationCurrentLabourAction implements BaseLDVisitAction.LDVisitActionHelper { + protected MemberObject memberObject; + private String labourOnsetDate; + private String labourOnsetTime; + private String rupturedMembrane; + private String fetalMovement; + private Context context; + private String reasonsForAdmission; + + public void setReasonsForAdmission(String reasonsForAdmission) { + this.reasonsForAdmission = reasonsForAdmission; + } + + public LDRegistrationCurrentLabourAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + + if (reasonsForAdmission != null && (reasonsForAdmission.contains("elective_cesarean_section") || reasonsForAdmission.contains("induction"))) { + labourOnsetDate = "none"; + labourOnsetTime = "none"; + } else { + labourOnsetDate = CoreJsonFormUtils.getValue(jsonObject, "labour_onset_date"); + labourOnsetTime = CoreJsonFormUtils.getValue(jsonObject, "labour_onset_time"); + } + rupturedMembrane = CoreJsonFormUtils.getValue(jsonObject, "membrane"); + fetalMovement = CoreJsonFormUtils.getValue(jsonObject, "fetal_movement"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public void onPayloadReceived(BaseLDVisitAction baseAncHomeVisitAction) { + Timber.v("onPayloadReceived"); + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isAllFieldsCompleted()) + return BaseLDVisitAction.Status.COMPLETED; + else if (isAnyFieldCompleted()) + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + else + return BaseLDVisitAction.Status.PENDING; + } + + @Override + public String evaluateSubTitle() { + if (isAllFieldsCompleted()) + return context.getString(R.string.ld_registration_current_labour_complete); + else if (isAnyFieldCompleted()) + return context.getString(R.string.ld_registration_current_labour_pending); + return ""; + } + + /** + * evaluate if all fields are completed + **/ + private boolean isAllFieldsCompleted() { + return !StringUtils.isBlank(labourOnsetDate) && !StringUtils.isBlank(labourOnsetTime) && !StringUtils.isBlank(rupturedMembrane) && !StringUtils.isBlank(fetalMovement); + } + + /** + * evaluate if any field has been completed + **/ + private boolean isAnyFieldCompleted() { + return !StringUtils.isBlank(labourOnsetDate) || !StringUtils.isBlank(labourOnsetTime) || !StringUtils.isBlank(rupturedMembrane) || !StringUtils.isBlank(fetalMovement); + + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationObstetricHistoryAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationObstetricHistoryAction.java new file mode 100644 index 000000000..24bed5254 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationObstetricHistoryAction.java @@ -0,0 +1,134 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author ilakozejumanne@gmail.com + * 06/05/2022 + */ +public class LDRegistrationObstetricHistoryAction implements BaseLDVisitAction.LDVisitActionHelper { + protected MemberObject memberObject; + private String gravida; + protected String para; + private String childrenAlive; + private String numberOfAbortion; + private String lastMenstrualPeriod; + private Context context; + + public LDRegistrationObstetricHistoryAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + gravida = CoreJsonFormUtils.getValue(jsonObject, "gravida"); + para = CoreJsonFormUtils.getValue(jsonObject, "para"); + childrenAlive = CoreJsonFormUtils.getValue(jsonObject, "children_alive"); + numberOfAbortion = CoreJsonFormUtils.getValue(jsonObject, "number_of_abortion"); + lastMenstrualPeriod = CoreJsonFormUtils.getValue(jsonObject, "last_menstrual_period"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public void onPayloadReceived(BaseLDVisitAction baseAncHomeVisitAction) { + Timber.v("onPayloadReceived"); + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isAllFieldsCompleted()) + return BaseLDVisitAction.Status.COMPLETED; + else if (isAnyFieldCompleted()) + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + else + return BaseLDVisitAction.Status.PENDING; + } + + @Override + public String evaluateSubTitle() { + if (isAllFieldsCompleted()) + return context.getString(R.string.ld_registration_obstetric_history_complete); + else if (isAnyFieldCompleted()) + return context.getString(R.string.ld_registration_obstetric_history_pending); + return ""; + } + + /** + * evaluate if all fields are completed + **/ + private boolean isAllFieldsCompleted() { + return !StringUtils.isBlank(gravida) && + !StringUtils.isBlank(para) && + isNumberOfChildrenAliveFilled() && + !StringUtils.isBlank(numberOfAbortion) && + !StringUtils.isBlank(lastMenstrualPeriod); + } + + /** + * evaluate if any field has been completed + **/ + private boolean isAnyFieldCompleted() { + return !StringUtils.isBlank(gravida) || + !StringUtils.isBlank(para) || + isNumberOfChildrenAliveFilled() || + !StringUtils.isBlank(numberOfAbortion) || + !StringUtils.isBlank(lastMenstrualPeriod); + } + + private boolean isNumberOfChildrenAliveFilled() { + if (!StringUtils.isBlank(para)) { + try { + int paraNumber = Integer.parseInt(para); + if (paraNumber > 0) { + return !StringUtils.isBlank(childrenAlive); + } + } catch (Exception e) { + Timber.e(e); + } + } + return true; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationPastObstetricHistoryAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationPastObstetricHistoryAction.java new file mode 100644 index 000000000..a62a2f799 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationPastObstetricHistoryAction.java @@ -0,0 +1,133 @@ +package org.smartregister.chw.hf.actionhelper; + +import static org.smartregister.util.JsonFormUtils.VALUE; + +import android.content.Context; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.chw.referral.util.JsonFormConstants; + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author ilakozejumanne@gmail.com + * 30/05/2022 + */ +public class LDRegistrationPastObstetricHistoryAction implements BaseLDVisitAction.LDVisitActionHelper { + protected MemberObject memberObject; + private Context context; + private int para; + private Boolean isFormComplete; + + public LDRegistrationPastObstetricHistoryAction(MemberObject memberObject, int para) { + this.memberObject = memberObject; + this.para = para; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @Override + public String getPreProcessed() { + JSONObject labourAndDeliveryPastObstetricHistoryForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryPastObstetricHistory()); + if (labourAndDeliveryPastObstetricHistoryForm != null) { + try { + JSONArray fields = labourAndDeliveryPastObstetricHistoryForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + JSONObject paraOneObject = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "para_1_obstetric_history"); + + for (int i = 1; i < para; i++) { + JSONObject paraObject = new JSONObject(paraOneObject.toString()); + paraObject.put("key", "para_" + (i + 1) + "_obstetric_history"); + paraObject.put("openmrs_entity_id", "para_" + (i + 1) + "_obstetric_history"); + paraObject.put("text", MessageFormat.format(context.getString(R.string.para_obstretric_history), i + 1)); + fields.put(paraObject); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + + return labourAndDeliveryPastObstetricHistoryForm.toString(); + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + JSONArray fields = jsonObject.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + + List expansionPanelsFilled = new ArrayList(); + for (int i = 0; i < fields.length(); i++) { + JSONObject field = fields.getJSONObject(i); + if (field.has(VALUE) && field.getJSONArray(VALUE).length() > 0) { + expansionPanelsFilled.add(true); + } + } + if (expansionPanelsFilled.size() == fields.length()) { + isFormComplete = true; + } else if (expansionPanelsFilled.size() > 0 && expansionPanelsFilled.size() < fields.length()) { + isFormComplete = false; + } else if (expansionPanelsFilled.size() == 0) { + isFormComplete = null; + } + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public void onPayloadReceived(BaseLDVisitAction baseAncHomeVisitAction) { + Timber.v("onPayloadReceived"); + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isFormComplete == null) + return BaseLDVisitAction.Status.PENDING; + else if (isFormComplete) + return BaseLDVisitAction.Status.COMPLETED; + else + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + } + + @Override + public String evaluateSubTitle() { + if (isFormComplete == null) + return ""; + else if (isFormComplete) + return context.getString(R.string.ld_registration_past_obstetric_history_complete); + else + return context.getString(R.string.ld_registration_past_obstetric_history_pending); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationTriageAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationTriageAction.java new file mode 100644 index 000000000..a1019b46e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationTriageAction.java @@ -0,0 +1,133 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.HfAncJsonFormUtils; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author ilakozejumanne@gmail.com + * 06/05/2022 + */ +public class LDRegistrationTriageAction implements BaseLDVisitAction.LDVisitActionHelper { + protected MemberObject memberObject; + private String systolic; + private String diastolic; + private String pulseRate; + private String respiratoryRate; + private String fetalHeartRate; + private String temperature; + private String weight; + private String dangerSigns; + private Context context; + + public LDRegistrationTriageAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + systolic = CoreJsonFormUtils.getValue(jsonObject, "systolic"); + diastolic = CoreJsonFormUtils.getValue(jsonObject, "diastolic"); + pulseRate = CoreJsonFormUtils.getValue(jsonObject, "pulse_rate"); + respiratoryRate = CoreJsonFormUtils.getValue(jsonObject, "respiratory_rate"); + fetalHeartRate = CoreJsonFormUtils.getValue(jsonObject, "fetal_heart_rate"); + temperature = CoreJsonFormUtils.getValue(jsonObject, "temperature"); + weight = CoreJsonFormUtils.getValue(jsonObject, "weight"); + dangerSigns = HfAncJsonFormUtils.getCheckBoxValue(jsonObject, "danger_signs"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public void onPayloadReceived(BaseLDVisitAction baseAncHomeVisitAction) { + Timber.v("onPayloadReceived"); + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isAllFieldsCompleted()) + return BaseLDVisitAction.Status.COMPLETED; + else if (isAnyFieldCompleted()) + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + else + return BaseLDVisitAction.Status.PENDING; + } + + @Override + public String evaluateSubTitle() { + if (isAllFieldsCompleted()) + return context.getString(R.string.ld_registration_triage_action_subtitle_complete); + else if (isAnyFieldCompleted()) + return context.getString(R.string.ld_registration_triage_action_subtitle_pending); + return ""; + } + + /** + * evaluate if all fields are completed + **/ + public boolean isAllFieldsCompleted() { + return !StringUtils.isBlank(systolic) && + !StringUtils.isBlank(diastolic) && + !StringUtils.isBlank(pulseRate) && + !StringUtils.isBlank(respiratoryRate) && + !StringUtils.isBlank(fetalHeartRate) && + !StringUtils.isBlank(temperature) && + !StringUtils.isBlank(weight) && + !StringUtils.isBlank(dangerSigns); + } + + /** + * evaluate if any field is completed + **/ + public boolean isAnyFieldCompleted() { + return !StringUtils.isBlank(systolic) || + !StringUtils.isBlank(diastolic) || + !StringUtils.isBlank(pulseRate) || + !StringUtils.isBlank(respiratoryRate) || + !StringUtils.isBlank(fetalHeartRate) || + !StringUtils.isBlank(temperature) || + !StringUtils.isBlank(weight) || + !StringUtils.isBlank(dangerSigns); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationTrueLabourConfirmationAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationTrueLabourConfirmationAction.java new file mode 100644 index 000000000..177b2e04c --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDRegistrationTrueLabourConfirmationAction.java @@ -0,0 +1,104 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author ilakozejumanne@gmail.com + * 06/05/2022 + */ +public class LDRegistrationTrueLabourConfirmationAction implements BaseLDVisitAction.LDVisitActionHelper { + protected MemberObject memberObject; + private String trueLabour; + protected String labourConfirmation; + protected String clientAdmitted; + private Context context; + + public LDRegistrationTrueLabourConfirmationAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + trueLabour = CoreJsonFormUtils.getValue(jsonObject, "true_labour"); + labourConfirmation = CoreJsonFormUtils.getValue(jsonObject, "labour_confirmation"); + clientAdmitted = CoreJsonFormUtils.getValue(jsonObject, "admit_client"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public void onPayloadReceived(BaseLDVisitAction baseAncHomeVisitAction) { + Timber.v("onPayloadReceived"); + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isAllFieldsCompleted()) + return BaseLDVisitAction.Status.COMPLETED; + else + return BaseLDVisitAction.Status.PENDING; + } + + @Override + public String evaluateSubTitle() { + if (isAllFieldsCompleted() && (labourConfirmation.equalsIgnoreCase("true") || clientAdmitted.equalsIgnoreCase("yes"))) { + if (clientAdmitted.equalsIgnoreCase("yes")) { + return context.getString(R.string.ld_registration_true_labour_client_admitted); + } + return context.getString(R.string.ld_registration_true_labour_complete); + } else if (isAllFieldsCompleted() && labourConfirmation.equalsIgnoreCase("false")) { + return context.getString(R.string.ld_registration_true_labour_confirmation_done); + } + return ""; + } + + /** + * evaluate if all fields are completed + **/ + public boolean isAllFieldsCompleted() { + return !StringUtils.isBlank(trueLabour); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDSyphilisTestActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDSyphilisTestActionHelper.java new file mode 100644 index 000000000..fb9a760f6 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDSyphilisTestActionHelper.java @@ -0,0 +1,91 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.JsonFormUtils; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * Author issyzac on 2022-07-13 + */ + +public class LDSyphilisTestActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private final Context context; + private String syphilisTest; + + public LDSyphilisTestActionHelper(Context context){ + this.context = context; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + //TODO: implement + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try{ + syphilisTest = JsonFormUtils.getFieldValue(jsonPayload, "syphilis"); + }catch (Exception e){ + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + String subtitle = ""; + if (syphilisTest != null && !syphilisTest.isEmpty()){ + subtitle = context.getString(R.string.syphilis_test_result) + " : "; + if (syphilisTest.equalsIgnoreCase("positive")){ + subtitle += context.getString(R.string.positive); + } else if (syphilisTest.equalsIgnoreCase("negative")){ + subtitle += context.getString(R.string.negative); + }else if (syphilisTest.equalsIgnoreCase("test_not_conducted")){ + subtitle += context.getString(R.string.test_not_conducted); + } + } + return subtitle; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (syphilisTest != null && !syphilisTest.isEmpty()){ + return BaseLDVisitAction.Status.COMPLETED; + }else{ + return BaseLDVisitAction.Status.PENDING; + } + } + + @Override + public void onPayloadReceived(BaseLDVisitAction baseLDVisitAction) { + //TODO: implement + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDVaginalExaminationActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDVaginalExaminationActionHelper.java new file mode 100644 index 000000000..8a8aa1927 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/LDVaginalExaminationActionHelper.java @@ -0,0 +1,205 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; +import android.os.Build; + +import androidx.annotation.RequiresApi; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.ld.dao.LDDao; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.chw.referral.util.JsonFormConstants; +import org.smartregister.util.JsonFormUtils; + +import java.util.List; +import java.util.Map; + +/** + * Created by Kassim Sheghembe on 2022-05-09 + */ +public class LDVaginalExaminationActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private final Context context; + + private String vaginal_exam_date; + private String vaginal_exam_time; + private String cervix_state; + private String cervix_dilation; + private String presenting_part; + private String moulding; + private String station; + private String decision; + private final String baseEntityId; + + public LDVaginalExaminationActionHelper(Context context, String baseEntityId) { + this.context = context; + this.baseEntityId = baseEntityId; + } + + @Override + public void onJsonFormLoaded(String jsonString, Context context, Map> details) { + + } + + @RequiresApi(api = Build.VERSION_CODES.KITKAT) + @Override + public String getPreProcessed() { + JSONObject vaginalExaminationForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.LDVisit.getLdVaginalExamination()); + if (vaginalExaminationForm != null) { + try { + JSONArray fields = vaginalExaminationForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + populateVaginalExaminationForm(fields, baseEntityId); + + String presentingPart = LDDao.getPresentingPart(baseEntityId); + //Check if presenting part field has been filled out, if true do not show it again + if (presentingPart != null) { + JSONObject presentingPartField = org.smartregister.chw.hf.utils.JsonFormUtils.getFieldJSONObject(fields, Constants.LDFormFields.VaginalExamination.PRESENTING_PART); + if (presentingPartField != null) presentingPartField.put("hidden", true); + + JSONObject occiputPosition = org.smartregister.chw.hf.utils.JsonFormUtils.getFieldJSONObject(fields, Constants.LDFormFields.VaginalExamination.OCCIPUT_POSITION); + if (occiputPosition != null) occiputPosition.put("hidden", true); + + JSONObject mentoPosition = org.smartregister.chw.hf.utils.JsonFormUtils.getFieldJSONObject(fields, Constants.LDFormFields.VaginalExamination.MENTO_POSITION); + if (mentoPosition != null) mentoPosition.put("hidden", true); + + JSONObject sacroPosition = org.smartregister.chw.hf.utils.JsonFormUtils.getFieldJSONObject(fields, Constants.LDFormFields.VaginalExamination.SACRO_POSITION); + if (sacroPosition != null) sacroPosition.put("hidden", true); + + JSONObject dorsoPosition = org.smartregister.chw.hf.utils.JsonFormUtils.getFieldJSONObject(fields, Constants.LDFormFields.VaginalExamination.DORSO_POSITION); + if (dorsoPosition != null) dorsoPosition.put("hidden", true); + + JSONObject moldingField = org.smartregister.chw.hf.utils.JsonFormUtils.getFieldJSONObject(fields, Constants.LDFormFields.VaginalExamination.MOULDING); + if (presentingPart.equalsIgnoreCase("shoulder") || presentingPart.equalsIgnoreCase("breech")) + moldingField.put("hidden", true); + } + + if (LDDao.getLabourOnsetDate(baseEntityId) != null) { + vaginalExaminationForm.getJSONObject("global").put("labour_onset_date", LDDao.getLabourOnsetDate(baseEntityId)); + } + + if (LDDao.getLabourOnsetTime(baseEntityId) != null) { + vaginalExaminationForm.getJSONObject("global").put("labour_onset_time", LDDao.getLabourOnsetTime(baseEntityId)); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + + try { + vaginalExaminationForm.getJSONObject("global").put("moulding", LDDao.getMoulding(baseEntityId) == null ? "" : LDDao.getMoulding(baseEntityId)); + JSONArray fields = vaginalExaminationForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + + JSONObject amnioticFluid = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "amniotic_fluid"); + + if (LDDao.getMembraneState(baseEntityId) != null && LDDao.getMembraneState(baseEntityId).equalsIgnoreCase("ruptured")) { + amnioticFluid.getJSONArray("options").remove(0); + } + } catch (JSONException e) { + e.printStackTrace(); + } + return vaginalExaminationForm.toString(); + } + + @Override + public void onPayloadReceived(String jsonPayload) { + vaginal_exam_date = JsonFormUtils.getFieldValue(jsonPayload, "vaginal_exam_date"); + vaginal_exam_time = JsonFormUtils.getFieldValue(jsonPayload, "vaginal_exam_time"); + cervix_state = JsonFormUtils.getFieldValue(jsonPayload, "cervix_state"); + cervix_dilation = JsonFormUtils.getFieldValue(jsonPayload, "cervix_dilation"); + presenting_part = JsonFormUtils.getFieldValue(jsonPayload, "presenting_part"); + + //If the presenting part is null, trying to make sure that it was not previously filled. + if (presenting_part == null) + presenting_part = LDDao.getPresentingPart(baseEntityId); + + if (LDDao.getMoulding(baseEntityId) != null && !LDDao.getMoulding(baseEntityId).equalsIgnoreCase("yes") && !StringUtils.isNotBlank(presenting_part) && !presenting_part.equalsIgnoreCase("breech") && !presenting_part.equalsIgnoreCase("shoulder")) { + moulding = JsonFormUtils.getFieldValue(jsonPayload, "moulding"); + } else + moulding = "no"; + station = JsonFormUtils.getFieldValue(jsonPayload, "station"); + decision = JsonFormUtils.getFieldValue(jsonPayload, "decision"); + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + return null; + } + + @Override + public String evaluateSubTitle() { + if (isFullyCompleted()) { + return context.getString(R.string.lb_fully_completed_action); + } else if (isPartiallyCompleted()) { + return context.getString(R.string.lb_partially_completed_action); + } else { + return ""; + } + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isFullyCompleted()) { + return BaseLDVisitAction.Status.COMPLETED; + } else if (isPartiallyCompleted()) { + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + } else { + return BaseLDVisitAction.Status.PENDING; + } + } + + @Override + public void onPayloadReceived(BaseLDVisitAction ldVisitAction) { + + } + + private boolean isFullyCompleted() { + return (StringUtils.isNotBlank(vaginal_exam_date) && + StringUtils.isNotBlank(vaginal_exam_time) && + StringUtils.isNotBlank(cervix_state) && + StringUtils.isNotBlank(cervix_dilation) && + (StringUtils.isNotBlank(presenting_part) && !presenting_part.equalsIgnoreCase("Presenting part")) && + (StringUtils.isNotBlank(moulding)) && + StringUtils.isNotBlank(station) && + StringUtils.isNotBlank(decision) + ); + } + + private boolean isPartiallyCompleted() { + return (StringUtils.isNotBlank(vaginal_exam_date) || + StringUtils.isNotBlank(vaginal_exam_time) || + StringUtils.isNotBlank(cervix_state) || + StringUtils.isNotBlank(cervix_dilation) || + (StringUtils.isNotBlank(presenting_part) && !presenting_part.equalsIgnoreCase("Presenting part")) || + StringUtils.isNotBlank(moulding) || + StringUtils.isNotBlank(station) || + StringUtils.isNotBlank(decision) + ); + } + + private void populateVaginalExaminationForm(JSONArray fields, String baseEntityId) throws JSONException { + JSONObject vaginalExamDate = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "vaginal_exam_date"); + + if (LDDao.getVaginalExaminationDate(baseEntityId) != null) { + vaginalExamDate.put("min_date", LDDao.getVaginalExaminationDate(baseEntityId)); + } else if (LDDao.getLabourOnsetDate(baseEntityId) != null) { + vaginalExamDate.put("min_date", LDDao.getLabourOnsetDate(baseEntityId)); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/MaternalComplicationLabourActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/MaternalComplicationLabourActionHelper.java new file mode 100644 index 000000000..09611d20d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/MaternalComplicationLabourActionHelper.java @@ -0,0 +1,105 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.HfAncJsonFormUtils; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.util.JsonFormUtils; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * Created by Kassim Sheghembe on 2022-07-06 + */ +public class MaternalComplicationLabourActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private String maternal_complications_before_delivery; + private String maternal_complications_during_and_after_delivery; + private String completionStatus; + private Context context; + + @Override + public void onJsonFormLoaded(String jsonString, Context context, Map> details) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + maternal_complications_before_delivery = HfAncJsonFormUtils.getCheckBoxValue(jsonObject, "maternal_complications_before_delivery"); + maternal_complications_during_and_after_delivery = HfAncJsonFormUtils.getCheckBoxValue(jsonObject, "maternal_complications_during_and_after_delivery"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + try { + + JSONObject jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + + JSONObject maternal_complications_module_status = JsonFormUtils.getFieldJSONObject(fields, "maternal_complications_module_status"); + assert maternal_complications_module_status != null; + maternal_complications_module_status.remove(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE); + maternal_complications_module_status.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, completionStatus); + + return jsonObject.toString(); + + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isNotBlank(maternal_complications_before_delivery) && StringUtils.isNotBlank(maternal_complications_during_and_after_delivery)) { + completionStatus = context.getString(R.string.lb_fully_completed_action); + } else if (StringUtils.isNotBlank(maternal_complications_before_delivery) || StringUtils.isNotBlank(maternal_complications_during_and_after_delivery)) { + completionStatus = context.getString(R.string.lb_partially_completed_action); + } + return completionStatus; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isNotBlank(maternal_complications_before_delivery) && StringUtils.isNotBlank(maternal_complications_during_and_after_delivery)) + return BaseLDVisitAction.Status.COMPLETED; + else if (StringUtils.isNotBlank(maternal_complications_before_delivery) || StringUtils.isNotBlank(maternal_complications_during_and_after_delivery)) + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + else + return BaseLDVisitAction.Status.PENDING; + } + + @Override + public void onPayloadReceived(BaseLDVisitAction ldVisitAction) { + //Todo: Implement here + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/MotherStatusActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/MotherStatusActionHelper.java new file mode 100644 index 000000000..7f64e53e2 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/MotherStatusActionHelper.java @@ -0,0 +1,324 @@ +package org.smartregister.chw.hf.actionhelper; + +import static org.smartregister.chw.hf.interactor.LDPostDeliveryManagementMotherActivityInteractor.ordinal; +import static org.smartregister.util.JsonFormUtils.KEY; +import static org.smartregister.util.JsonFormUtils.VALUE; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.util.AppExecutors; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.LDDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.ld.LDLibrary; +import org.smartregister.chw.ld.contract.BaseLDVisitContract; +import org.smartregister.chw.ld.domain.Visit; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.chw.referral.util.JsonFormConstants; +import org.smartregister.util.JsonFormUtils; + +import java.text.MessageFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import timber.log.Timber; + +/** + * Created by Kassim Sheghembe on 2022-07-04 + */ +public class MotherStatusActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + protected String status; + private String cause_of_death; + private String time_of_death; + private String delivery_place; + private String designation_of_delivery_personnel; + private String name_of_delivery_person; + private String delivery_date; + private String completionStatus; + private int numberOfChildrenBorn = 0; + private String delivery_time; + private Context context; + private final String baseEntityId; + private final LinkedHashMap actionList; + private final BaseLDVisitContract.InteractorCallBack callBack; + private Map> details; + private final boolean isEdit; + + public MotherStatusActionHelper(Context context, String baseEntityId, LinkedHashMap actionList, BaseLDVisitContract.InteractorCallBack callBack, boolean isEdit) { + this.context = context; + this.baseEntityId = baseEntityId; + this.actionList = actionList; + this.callBack = callBack; + this.isEdit = isEdit; + } + + @Override + public void onJsonFormLoaded(String jsonString, Context context, Map> details) { + this.context = context; + this.details = details; + } + + @Override + public String getPreProcessed() { + JSONObject motherStatusForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.LDPostDeliveryMotherManagement.getLdPostDeliveryManagementMotherStatus()); + try { + JSONArray fields = motherStatusForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + + String modeOfDelivery = LDDao.getModeOfDelivery(baseEntityId); + + if (modeOfDelivery != null && !modeOfDelivery.isEmpty()) { + JSONObject modeOfDeliveryQuestion = JsonFormUtils.getFieldJSONObject(fields, "mode_of_delivery"); + modeOfDeliveryQuestion.put("type", "hidden"); + + } + + if (modeOfDelivery != null && (modeOfDelivery.equalsIgnoreCase("cesarean") || modeOfDelivery.equalsIgnoreCase("vacuum_extraction"))) { + JSONObject placeOfDelivery = JsonFormUtils.getFieldJSONObject(fields, "delivery_place"); + placeOfDelivery.getJSONArray("values").remove(3); + placeOfDelivery.getJSONArray("values").remove(2); + placeOfDelivery.getJSONArray("values").remove(1); + placeOfDelivery.getJSONArray("keys").remove(3); + placeOfDelivery.getJSONArray("keys").remove(2); + placeOfDelivery.getJSONArray("keys").remove(1); + placeOfDelivery.getJSONArray("openmrs_choice_ids").remove(3); + placeOfDelivery.getJSONArray("openmrs_choice_ids").remove(2); + placeOfDelivery.getJSONArray("openmrs_choice_ids").remove(1); + } + + JSONObject hivJsonObject = JsonFormUtils.getFieldJSONObject(fields, "hiv"); + String hivStatus = LDDao.getHivStatus(baseEntityId); + if (hivJsonObject != null && hivStatus != null) { + hivJsonObject.put(VALUE, hivStatus); + } + + } catch (JSONException e) { + Timber.e(e); + } + + return motherStatusForm.toString(); + } + + @Override + public void onPayloadReceived(String jsonPayload) { + status = JsonFormUtils.getFieldValue(jsonPayload, "status"); + cause_of_death = JsonFormUtils.getFieldValue(jsonPayload, "cause_of_death"); + time_of_death = JsonFormUtils.getFieldValue(jsonPayload, "time_of_death"); + delivery_place = JsonFormUtils.getFieldValue(jsonPayload, "delivery_place"); + designation_of_delivery_personnel = JsonFormUtils.getFieldValue(jsonPayload, "designation_of_delivery_personnel"); + name_of_delivery_person = JsonFormUtils.getFieldValue(jsonPayload, "name_of_delivery_person"); + delivery_date = JsonFormUtils.getFieldValue(jsonPayload, "delivery_date"); + delivery_time = JsonFormUtils.getFieldValue(jsonPayload, "delivery_time"); + try { + String number_children_string = JsonFormUtils.getFieldValue(jsonPayload, "number_of_children_born"); + if (StringUtils.isNotBlank(number_children_string)) { + numberOfChildrenBorn = Integer.parseInt(number_children_string); + } + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + + JSONObject mother_status_module_status = JsonFormUtils.getFieldJSONObject(fields, "mother_status_module_status"); + assert mother_status_module_status != null; + mother_status_module_status.remove(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE); + mother_status_module_status.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, completionStatus); + updateDeliveryDuration(jsonPayload, fields); + + Iterator> itr = actionList.entrySet().iterator(); + while (itr.hasNext()) { + Map.Entry entry = itr.next(); + if (entry.getKey().contains(MessageFormat.format(context.getString(R.string.ld_new_born_status_action_title), ""))) { + itr.remove(); + } + } + + } catch (Exception e) { + Timber.e(e); + } + + if (numberOfChildrenBorn > 0) { + startActionForChild(); + } + return jsonObject.toString(); + + } + + @Override + public String evaluateSubTitle() { + if (isFullyCompleted()) { + completionStatus = context.getString(R.string.lb_fully_completed_action); + } else if (isPartiallyCompleted()) { + completionStatus = context.getString(R.string.lb_partially_completed_action); + } + return completionStatus; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isFullyCompleted()) { + return BaseLDVisitAction.Status.COMPLETED; + } else if (isPartiallyCompleted()) { + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + } else { + return BaseLDVisitAction.Status.PENDING; + } + } + + @Override + public void onPayloadReceived(BaseLDVisitAction ldVisitAction) { + //Todo: Implement here + } + + private boolean isFullyCompleted() { + boolean completed = false; + if (StringUtils.isNotBlank(status)) { + if (status.equalsIgnoreCase("alive")) { + if ((StringUtils.isNotBlank(delivery_place) && !delivery_place.equalsIgnoreCase("Place of delivery")) && + StringUtils.isNotBlank(delivery_date)) { + completed = !delivery_place.equalsIgnoreCase("at_a_health_facility") || (StringUtils.isNotBlank(designation_of_delivery_personnel) && + StringUtils.isNotBlank(name_of_delivery_person)); + } + } else { + if ((StringUtils.isNotBlank(delivery_place) && !delivery_place.equalsIgnoreCase("Place of delivery")) && + StringUtils.isNotBlank(cause_of_death) && StringUtils.isNotBlank(time_of_death) && StringUtils.isNotBlank(delivery_date)) { + completed = !delivery_place.equalsIgnoreCase("at_a_health_facility") || (StringUtils.isNotBlank(designation_of_delivery_personnel) && + StringUtils.isNotBlank(name_of_delivery_person)); + } + } + } + return completed; + } + + private boolean isPartiallyCompleted() { + boolean partialCompletion = false; + if (StringUtils.isNotBlank(status)) { + if (status.equalsIgnoreCase("alive")) { + // Because of spinner delivery place is never blank it is the value of the hint + if (delivery_place.equalsIgnoreCase("Place of delivery") || StringUtils.isBlank(delivery_date)) { + partialCompletion = true; + } else if (delivery_place.equalsIgnoreCase("at_a_health_facility")) { + partialCompletion = StringUtils.isBlank(designation_of_delivery_personnel) || StringUtils.isBlank(name_of_delivery_person); + } + } else { + if (delivery_place.equalsIgnoreCase("Place of delivery") || StringUtils.isBlank(delivery_date) || StringUtils.isBlank(cause_of_death) || + StringUtils.isBlank(time_of_death)) { + partialCompletion = true; + } else if (delivery_place.equalsIgnoreCase("at_a_health_facility")) { + partialCompletion = StringUtils.isBlank(designation_of_delivery_personnel) || StringUtils.isBlank(name_of_delivery_person); + } + } + } + return partialCompletion; + } + + private void updateDeliveryDuration(String jsonPayload, JSONArray fields) throws ParseException, JSONException { + String deliveryDate = JsonFormUtils.getFieldValue(jsonPayload, "delivery_date"); + String deliveryTime = JsonFormUtils.getFieldValue(jsonPayload, "delivery_time"); + String labourOnsetDate; + String labourOnsetTime; + if (LDDao.getLabourOnsetDate(baseEntityId) != null && LDDao.getLabourOnsetTime(baseEntityId) != null) { + labourOnsetDate = LDDao.getLabourOnsetDate(baseEntityId); + labourOnsetTime = LDDao.getLabourOnsetTime(baseEntityId); + } else { + labourOnsetDate = LDDao.getAdmissionDate(baseEntityId); + labourOnsetTime = LDDao.getAdmissionTime(baseEntityId); + } + + // Add a check here if delivery date is not yet filled + if (StringUtils.isNotBlank(deliveryDate) && StringUtils.isNotBlank(deliveryTime)) { + + String labourOnsetDateTime = labourOnsetDate + " " + labourOnsetTime; + String deliveryDateTime = deliveryDate + " " + deliveryTime; + + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm", Locale.getDefault()); + + Date date1 = simpleDateFormat.parse(labourOnsetDateTime); + Date date2 = simpleDateFormat.parse(deliveryDateTime); + + long msDiff = date2.getTime() - date1.getTime(); + + for (int i = 0; i < fields.length(); i++) { + if (fields.getJSONObject(i).getString(KEY).equalsIgnoreCase("labour_duration")) { + fields.getJSONObject(i).put(VALUE, msDiff); + } + } + } + } + + private void startActionForChild() { + for (int i = 0; i < numberOfChildrenBorn; i++) { + // Get visit details for each individual child + try { + if (isEdit) { + Visit lastVisit = LDLibrary.getInstance().visitRepository().getLatestVisit(baseEntityId, "Post Delivery Mother Management"); + if (lastVisit != null) { + Visit lastImmediateNewBornCareVisit = LDLibrary.getInstance().visitRepository().getVisitsByParentVisitId(lastVisit.getVisitId(), "LND " + ordinal(i + 1) + " Newborn").get(0); + + if (lastImmediateNewBornCareVisit != null) { + details = org.smartregister.chw.ld.util.VisitUtils.getVisitGroups(LDLibrary.getInstance().visitDetailsRepository().getVisits(lastImmediateNewBornCareVisit.getVisitId())); + } + } + } + } catch (Exception e){ + Timber.e(e); + } + + String title; + if (numberOfChildrenBorn == 1) { + title = MessageFormat.format(context.getString(R.string.ld_new_born_status_action_title), ""); + } else { + title = MessageFormat.format(context.getString(R.string.ld_new_born_status_action_title), "of " + ordinal(i + 1) + " baby"); + } + NewBornActionHelper actionHelper = new NewBornActionHelper(baseEntityId, delivery_date, delivery_time, numberOfChildrenBorn, status, ordinal(i + 1)); + BaseLDVisitAction action = null; + try { + action = new BaseLDVisitAction.Builder(context, title) + .withOptional(false) + .withHelper(actionHelper) + .withDetails(details) + .withBaseEntityID(org.smartregister.chw.anc.util.JsonFormUtils.generateRandomUUIDString()) + .withProcessingMode(BaseLDVisitAction.ProcessingMode.SEPARATE) + .withFormName(Constants.JsonForm.LDPostDeliveryMotherManagement.getLdNewBornStatus()) + .build(); + + actionList.put(title, action); + } catch (BaseLDVisitAction.ValidationException e) { + Timber.e(e); + } + } + + //Calling the callback method to preload the actions in the actionns list. + new AppExecutors().mainThread().execute(() -> callBack.preloadActions(actionList)); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/NewBornActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/NewBornActionHelper.java new file mode 100644 index 000000000..5ea6cb6e9 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/NewBornActionHelper.java @@ -0,0 +1,429 @@ +package org.smartregister.chw.hf.actionhelper; + +import static org.smartregister.chw.hf.utils.Constants.HIV_STATUS.POSITIVE; +import static org.smartregister.chw.hf.utils.JsonFormUtils.ENCOUNTER_TYPE; +import static org.smartregister.util.JsonFormUtils.FIELDS; +import static org.smartregister.util.JsonFormUtils.KEY; +import static org.smartregister.util.JsonFormUtils.STEP1; + +import android.content.Context; +import android.os.Build; + +import androidx.annotation.RequiresApi; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.LDDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.util.JsonFormUtils; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * Created by Kassim Sheghembe on 2022-07-06 + */ +public class NewBornActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private final String baseEntityId; + private Context context; + private String deliveryDate; + private String deliveryTime; + private int numberOfChildrenBorn; + private String status; + private String childNumber; + + private String newbornStatus; + private String still_birth_choice; + private String sex; + private String apgar_activity_score_at_1_minute; + private String apgar_pulse_score_at_1_minute; + private String apgar_grimace_on_stimulation_score_at_1_minute; + private String apgar_appearance_score_at_1_minute; + private String apgar_respiration_score_at_1_minute; + private String apgar_activity_score_at_5_minutes; + private String apgar_pulse_score_at_5_minutes; + private String apgar_grimace_on_stimulation_score_at_5_minutes; + private String apgar_appearance_score_at_5_minutes; + private String apgar_respiration_score_at_5_minutes; + private String resuscitation; + private String temperature; + private String weight; + private String heart_rate; + private String keep_warm; + private String respiratory_rate; + private String cord_bleeding; + private String early_bf_1hr; + private String reason_for_not_breast_feeding_within_one_hour; + private String eye_care; + private String child_bcg_vaccination; + private String child_opv0_vaccination; + private String risk_category; + private String provided_azt_nvp_syrup; + private String provided_other_combinations; + private String specify_the_combinations; + private String number_of_azt_nvp_days_dispensed; + private String reason_for_not_providing_other_combination; + private String collect_dbs; + private String reason_not_collecting_dbs; + private String sample_collection_date; + private String dna_pcr_collection_time; + private String sample_id; + private String provided_nvp_syrup; + private String number_of_nvp_days_dispensed; + private String reason_for_not_providing_nvp_syrup; + private String other_reason_for_not_providing_nvp_syrup; + private int apgarScoreAt5Minutes = -1; + + private String moduleCompletionStatus; + + public NewBornActionHelper(String baseEntityId, String deliveryDate, String deliveryTime, int numberOfChildrenBorn, String status, String childNumber) { + this.baseEntityId = baseEntityId; + this.deliveryDate = deliveryDate; + this.deliveryTime = deliveryTime; + this.numberOfChildrenBorn = numberOfChildrenBorn; + this.status = status; + this.childNumber = childNumber; + } + + @Override + public void onJsonFormLoaded(String jsonString, Context context, Map> details) { + this.context = context; + } + + @RequiresApi(api = Build.VERSION_CODES.KITKAT) + @Override + public String getPreProcessed() { + JSONObject newBornForm = org.smartregister.chw.core.utils.FormUtils.getFormUtils().getFormJson(Constants.JsonForm.LDPostDeliveryMotherManagement.getLdNewBornStatus()); + String hivStatus = LDDao.getHivStatus(baseEntityId); + + try { + newBornForm.getJSONObject("global").put("delivery_date", deliveryDate); + newBornForm.getJSONObject("global").put("delivery_time", deliveryTime); + newBornForm.getJSONObject("global").put("number_of_children_born", numberOfChildrenBorn); + newBornForm.getJSONObject("global").put("child_number", childNumber); + newBornForm.getJSONObject("global").put("mother_status", status); + } catch (Exception e) { + Timber.e(e); + } + + JSONArray fields = null; + try { + fields = newBornForm.getJSONObject(STEP1).getJSONArray(FIELDS); + } catch (JSONException e) { + e.printStackTrace(); + } + + if (fields != null && hivStatus != null && !hivStatus.equalsIgnoreCase(POSITIVE)) { + try { + for (int x = 0; x < fields.length(); x++) { + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("risk_category")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("prompt_for_high_risk")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("prompt_for_low_risk")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("provided_azt_nvp_syrup")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("provided_other_combinations")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("specify_the_combinations")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("number_of_azt_nvp_days_dispensed")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("reason_for_not_providing_other_combination")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("other_reason_for_not_providing_other_combination")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("collect_dbs")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("reason_not_collecting_dbs")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("sample_id")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("sample_collection_date")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("dna_pcr_collection_time")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("provided_nvp_syrup")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("number_of_nvp_days_dispensed")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("reason_for_not_providing_nvp_syrup")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("other_reason_for_not_providing_nvp_syrup")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("prophylaxis_arv_for_high_risk_given")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("prophylaxis_arv_for_high_and_low_risk_given")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("visit_number")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("next_facility_visit_date")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("followup_visit_date")) + fields.remove(x); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("reason_for_not_breast_feeding_within_one_hour") && status.equals("died")) { + fields.getJSONObject(x).getJSONArray("options").remove(0); + } + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_normal_apgar_score") && status.equals("died")) { + fields.getJSONObject(x).getJSONArray("options").remove(0); + } + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_low_apgar_score") && status.equals("died")) { + fields.getJSONObject(x).getJSONArray("options").remove(0); + } + } + + } catch (JSONException e) { + e.printStackTrace(); + } + } else if (fields != null && hivStatus != null && hivStatus.equalsIgnoreCase(POSITIVE)) { + try { + for (int x = 0; x < fields.length(); x++) { + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("sample_collection_date")) + fields.getJSONObject(x).put("min_date", deliveryDate); + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("reason_for_not_breast_feeding_within_one_hour") && status.equals("died")) { + fields.getJSONObject(x).getJSONArray("options").remove(0); + } + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_normal_apgar_score") && status.equals("died")) { + fields.getJSONObject(x).getJSONArray("options").remove(0); + } + if (fields.getJSONObject(x).getString(KEY).equalsIgnoreCase("reasons_for_not_keeping_the_baby_warm_skin_to_skin_for_low_apgar_score") && status.equals("died")) { + fields.getJSONObject(x).getJSONArray("options").remove(0); + } + } + + } catch (JSONException e) { + e.printStackTrace(); + } + } + + return newBornForm.toString(); + } + + @Override + public void onPayloadReceived(String jsonPayload) { + newbornStatus = JsonFormUtils.getFieldValue(jsonPayload, "newborn_status"); + still_birth_choice = JsonFormUtils.getFieldValue(jsonPayload, "still_birth_choice"); + sex = JsonFormUtils.getFieldValue(jsonPayload, "sex"); + apgar_activity_score_at_1_minute = JsonFormUtils.getFieldValue(jsonPayload, "apgar_activity_score_at_1_minute"); + apgar_pulse_score_at_1_minute = JsonFormUtils.getFieldValue(jsonPayload, "apgar_pulse_score_at_1_minute"); + apgar_grimace_on_stimulation_score_at_1_minute = JsonFormUtils.getFieldValue(jsonPayload, "apgar_grimace_on_stimulation_score_at_1_minute"); + apgar_appearance_score_at_1_minute = JsonFormUtils.getFieldValue(jsonPayload, "apgar_appearance_score_at_1_minute"); + apgar_respiration_score_at_1_minute = JsonFormUtils.getFieldValue(jsonPayload, "apgar_respiration_score_at_1_minute"); + apgar_activity_score_at_5_minutes = JsonFormUtils.getFieldValue(jsonPayload, "apgar_activity_score_at_5_minutes"); + apgar_pulse_score_at_5_minutes = JsonFormUtils.getFieldValue(jsonPayload, "apgar_pulse_score_at_5_minutes"); + apgar_grimace_on_stimulation_score_at_5_minutes = JsonFormUtils.getFieldValue(jsonPayload, "apgar_grimace_on_stimulation_score_at_5_minutes"); + apgar_appearance_score_at_5_minutes = JsonFormUtils.getFieldValue(jsonPayload, "apgar_appearance_score_at_5_minutes"); + apgar_respiration_score_at_5_minutes = JsonFormUtils.getFieldValue(jsonPayload, "apgar_respiration_score_at_5_minutes"); + resuscitation = JsonFormUtils.getFieldValue(jsonPayload, "resuscitation"); + + try { + apgarScoreAt5Minutes = Integer.parseInt(apgar_respiration_score_at_5_minutes); + } catch (Exception e) { + Timber.e(e); + } + + temperature = JsonFormUtils.getFieldValue(jsonPayload, "temperature"); + weight = JsonFormUtils.getFieldValue(jsonPayload, "weight"); + heart_rate = JsonFormUtils.getFieldValue(jsonPayload, "heart_rate"); + keep_warm = JsonFormUtils.getFieldValue(jsonPayload, "keep_warm"); + respiratory_rate = JsonFormUtils.getFieldValue(jsonPayload, "respiratory_rate"); + cord_bleeding = JsonFormUtils.getFieldValue(jsonPayload, "cord_bleeding"); + early_bf_1hr = JsonFormUtils.getFieldValue(jsonPayload, "early_bf_1hr"); + reason_for_not_breast_feeding_within_one_hour = JsonFormUtils.getFieldValue(jsonPayload, "reason_for_not_breast_feeding_within_one_hour"); + eye_care = JsonFormUtils.getFieldValue(jsonPayload, "eye_care"); + child_bcg_vaccination = JsonFormUtils.getFieldValue(jsonPayload, "child_bcg_vaccination"); + child_opv0_vaccination = JsonFormUtils.getFieldValue(jsonPayload, "child_opv0_vaccination"); + risk_category = JsonFormUtils.getFieldValue(jsonPayload, "risk_category"); + provided_azt_nvp_syrup = JsonFormUtils.getFieldValue(jsonPayload, "provided_azt_nvp_syrup"); + provided_other_combinations = JsonFormUtils.getFieldValue(jsonPayload, "provided_other_combinations"); + specify_the_combinations = JsonFormUtils.getFieldValue(jsonPayload, "specify_the_combinations"); + number_of_azt_nvp_days_dispensed = JsonFormUtils.getFieldValue(jsonPayload, "number_of_azt_nvp_days_dispensed"); + reason_for_not_providing_other_combination = JsonFormUtils.getFieldValue(jsonPayload, "reason_for_not_providing_other_combination"); + collect_dbs = JsonFormUtils.getFieldValue(jsonPayload, "collect_dbs"); + reason_not_collecting_dbs = JsonFormUtils.getFieldValue(jsonPayload, "reason_not_collecting_dbs"); + sample_collection_date = JsonFormUtils.getFieldValue(jsonPayload, "sample_collection_date"); + dna_pcr_collection_time = JsonFormUtils.getFieldValue(jsonPayload, "dna_pcr_collection_time"); + sample_id = JsonFormUtils.getFieldValue(jsonPayload, "sample_id"); + provided_nvp_syrup = JsonFormUtils.getFieldValue(jsonPayload, "provided_nvp_syrup"); + number_of_nvp_days_dispensed = JsonFormUtils.getFieldValue(jsonPayload, "number_of_nvp_days_dispensed"); + reason_for_not_providing_nvp_syrup = JsonFormUtils.getFieldValue(jsonPayload, "reason_for_not_providing_nvp_syrup"); + other_reason_for_not_providing_nvp_syrup = JsonFormUtils.getFieldValue(jsonPayload, "other_reason_for_not_providing_nvp_syrup"); + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + jsonObject.remove(ENCOUNTER_TYPE); + jsonObject.putOpt(ENCOUNTER_TYPE, "LND " + childNumber + " Newborn"); + + JSONArray fields = JsonFormUtils.fields(jsonObject); + + JSONObject newborn_stage_four_module_status = JsonFormUtils.getFieldJSONObject(fields, "newborn_stage_four_module_status"); + assert newborn_stage_four_module_status != null; + newborn_stage_four_module_status.remove(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE); + newborn_stage_four_module_status.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, moduleCompletionStatus); + + return jsonObject.toString(); + } catch (JSONException e) { + Timber.e(e); + } + return null; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isNotBlank(newbornStatus)) { + if (isFullyCompleted()) { + moduleCompletionStatus = context.getString(R.string.lb_fully_completed_action); + } else if (isPartiallyCompleted()) { + moduleCompletionStatus = context.getString(R.string.lb_partially_completed_action); + } + return moduleCompletionStatus; + } + return null; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + BaseLDVisitAction.Status status = BaseLDVisitAction.Status.PENDING; + if (StringUtils.isNotBlank(newbornStatus)) { + if (isFullyCompleted()) { + status = BaseLDVisitAction.Status.COMPLETED; + } else if (isPartiallyCompleted()) { + status = BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + } + } + + return status; + } + + @Override + public void onPayloadReceived(BaseLDVisitAction ldVisitAction) { + //implement + } + + private boolean isFullyCompleted() { + if (newbornStatus.equalsIgnoreCase("alive")) { + return allFirstLevelFieldsCompleted() && breastFeedingWithin1HourCompleted() && isRiskCategoryCompleted(); + } else { + return StringUtils.isNotBlank(still_birth_choice); + } + } + + private boolean isPartiallyCompleted() { + if (newbornStatus.equalsIgnoreCase("alive")) { + return !allFirstLevelFieldsCompleted() || !breastFeedingWithin1HourCompleted() || !isRiskCategoryCompleted(); + } else { + return StringUtils.isBlank(still_birth_choice); + } + } + + private boolean allFirstLevelFieldsCompleted() { + + return (StringUtils.isNotBlank(sex) && StringUtils.isNotBlank(apgar_activity_score_at_1_minute) && + StringUtils.isNotBlank(apgar_pulse_score_at_1_minute) && StringUtils.isNotBlank(apgar_grimace_on_stimulation_score_at_1_minute) && + StringUtils.isNotBlank(apgar_appearance_score_at_1_minute) && StringUtils.isNotBlank(apgar_respiration_score_at_1_minute) && + StringUtils.isNotBlank(apgar_activity_score_at_5_minutes) && StringUtils.isNotBlank(apgar_pulse_score_at_5_minutes) && + StringUtils.isNotBlank(apgar_grimace_on_stimulation_score_at_5_minutes) && StringUtils.isNotBlank(apgar_appearance_score_at_5_minutes) && + StringUtils.isNotBlank(apgar_respiration_score_at_5_minutes) && resuscitationsComplete() && + StringUtils.isNotBlank(temperature) && StringUtils.isNotBlank(weight) && + StringUtils.isNotBlank(heart_rate) && StringUtils.isNotBlank(keep_warm) && + StringUtils.isNotBlank(respiratory_rate) && StringUtils.isNotBlank(cord_bleeding) && + StringUtils.isNotBlank(early_bf_1hr) && StringUtils.isNotBlank(eye_care) && + StringUtils.isNotBlank(child_bcg_vaccination) && StringUtils.isNotBlank(child_opv0_vaccination)); + + } + + private boolean resuscitationsComplete() { + if (apgarScoreAt5Minutes == -1) { + return false; + } else if (apgarScoreAt5Minutes > 6) { + return true; + } else { + return StringUtils.isNotBlank(resuscitation); + } + } + + private boolean breastFeedingWithin1HourCompleted() { + if (StringUtils.isNotBlank(early_bf_1hr)) { + if (early_bf_1hr.equalsIgnoreCase("no")) { + return StringUtils.isNotBlank(reason_for_not_breast_feeding_within_one_hour); + } else { + return true; + } + } + return false; + } + + private boolean isRiskCategoryCompleted() { + boolean riskCategoryCompletionStatus = false; + + String hivStatus = LDDao.getHivStatus(baseEntityId); + if (!hivStatus.equalsIgnoreCase(POSITIVE)) + return true; + + if (StringUtils.isNotBlank(risk_category)) { + if (risk_category.equalsIgnoreCase("high")) { + boolean providedAztNvpSyrupCompletion = false; + boolean collectDBSCompletion = false; + if (StringUtils.isNotBlank(provided_azt_nvp_syrup)) { + if (provided_azt_nvp_syrup.equalsIgnoreCase("yes")) { + providedAztNvpSyrupCompletion = StringUtils.isNotBlank(number_of_azt_nvp_days_dispensed); + } else { + if (StringUtils.isNotBlank(provided_other_combinations)) { + if (provided_other_combinations.equalsIgnoreCase("yes")) { + providedAztNvpSyrupCompletion = StringUtils.isNotBlank(specify_the_combinations) && StringUtils.isNotBlank(number_of_azt_nvp_days_dispensed); + } else { + providedAztNvpSyrupCompletion = StringUtils.isNotBlank(reason_for_not_providing_other_combination); + } + } + } + } + + if (StringUtils.isNotBlank(collect_dbs)) { + if (collect_dbs.equalsIgnoreCase("yes")) { + collectDBSCompletion = StringUtils.isNotBlank(dna_pcr_collection_time) && StringUtils.isNotBlank(sample_collection_date) && StringUtils.isNotBlank(sample_id); + } else { + collectDBSCompletion = StringUtils.isNotBlank(reason_not_collecting_dbs); + } + } + riskCategoryCompletionStatus = providedAztNvpSyrupCompletion && collectDBSCompletion; + } else { + if (StringUtils.isNotBlank(provided_nvp_syrup)) { + if (provided_nvp_syrup.equalsIgnoreCase("yes")) { + riskCategoryCompletionStatus = StringUtils.isNotBlank(number_of_nvp_days_dispensed); + } else { + riskCategoryCompletionStatus = (StringUtils.isNotBlank(reason_for_not_providing_nvp_syrup) && + !reason_for_not_providing_nvp_syrup.equalsIgnoreCase("other")) || + (StringUtils.isNotBlank(reason_for_not_providing_nvp_syrup) && + reason_for_not_providing_nvp_syrup.equalsIgnoreCase("other") && + StringUtils.isNotBlank(other_reason_for_not_providing_nvp_syrup)); + } + } + } + } + return riskCategoryCompletionStatus; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctArvLineAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctArvLineAction.java new file mode 100644 index 000000000..03a57b6bb --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctArvLineAction.java @@ -0,0 +1,95 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PmtctArvLineAction implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private String prescribed_regimes; + private Context context; + private String subTitle; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + + public PmtctArvLineAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + prescribed_regimes = CoreJsonFormUtils.getValue(jsonObject, "prescribed_regimes"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(prescribed_regimes)) + return null; + + return prescribed_regimes.equalsIgnoreCase("yes") ? context.getString(R.string.given_arv_prescription) : context.getString(R.string.not_given_arv_prescription); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(prescribed_regimes)) + return BasePmtctHomeVisitAction.Status.PENDING; + else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctBaselineInvestigationAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctBaselineInvestigationAction.java new file mode 100644 index 000000000..a29b7c101 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctBaselineInvestigationAction.java @@ -0,0 +1,104 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PmtctBaselineInvestigationAction implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private String liver_function_test_conducted; + private String receive_liver_function_test_results; + private String renal_function_test_conducted; + private String receive_renal_function_test_results; + private Context context; + private String subTitle; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + + public PmtctBaselineInvestigationAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + liver_function_test_conducted = CoreJsonFormUtils.getValue(jsonObject, "liver_function_test_conducted"); + receive_liver_function_test_results = CoreJsonFormUtils.getValue(jsonObject, "receive_liver_function_test_results"); + renal_function_test_conducted = CoreJsonFormUtils.getValue(jsonObject, "renal_function_test_conducted"); + receive_renal_function_test_results = CoreJsonFormUtils.getValue(jsonObject, "receive_renal_function_test_results"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(liver_function_test_conducted) && StringUtils.isBlank(receive_liver_function_test_results) && StringUtils.isBlank(renal_function_test_conducted) && StringUtils.isBlank(receive_renal_function_test_results)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(context.getString(R.string.pmtct_baseline_investigation_complete)); + + return stringBuilder.toString(); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(liver_function_test_conducted) && StringUtils.isBlank(receive_liver_function_test_results) && StringUtils.isBlank(renal_function_test_conducted) && StringUtils.isBlank(receive_renal_function_test_results)) + return BasePmtctHomeVisitAction.Status.PENDING; + else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctCd4SampleCollection.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctCd4SampleCollection.java new file mode 100644 index 000000000..d53ca274f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctCd4SampleCollection.java @@ -0,0 +1,98 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PmtctCd4SampleCollection implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private String cd4_sample_id; + private Context context; + private String subTitle; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + + public PmtctCd4SampleCollection(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + cd4_sample_id = CoreJsonFormUtils.getValue(jsonObject, "cd4_sample_id"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(cd4_sample_id)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(context.getString(R.string.cd4_sample_collected)); + + return stringBuilder.toString(); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(cd4_sample_id)) + return BasePmtctHomeVisitAction.Status.PENDING; + else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctCounsellingAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctCounsellingAction.java new file mode 100644 index 000000000..45bcef828 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctCounsellingAction.java @@ -0,0 +1,95 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PmtctCounsellingAction implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private String is_client_counselled; + private Context context; + private String subTitle; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + + public PmtctCounsellingAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + is_client_counselled = CoreJsonFormUtils.getValue(jsonObject, "is_client_counselled"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(is_client_counselled)) + return null; + + return is_client_counselled.equalsIgnoreCase("yes") ? context.getString(R.string.pmtct_counselling) : context.getString(R.string.pmtct_counselling_not_given); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(is_client_counselled)) + return BasePmtctHomeVisitAction.Status.PENDING; + else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctDiseaseStagingAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctDiseaseStagingAction.java new file mode 100644 index 000000000..add144763 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctDiseaseStagingAction.java @@ -0,0 +1,98 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PmtctDiseaseStagingAction implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private String clinical_staging_disease; + private Context context; + private String subTitle; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + + public PmtctDiseaseStagingAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + clinical_staging_disease = CoreJsonFormUtils.getValue(jsonObject, "clinical_staging_disease"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(clinical_staging_disease)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(context.getString(R.string.pmtct_clinical_disease_staging)); + + return stringBuilder.toString(); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(clinical_staging_disease)) + return BasePmtctHomeVisitAction.Status.PENDING; + else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctFollowupStatusAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctFollowupStatusAction.java new file mode 100644 index 000000000..39988e8d7 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctFollowupStatusAction.java @@ -0,0 +1,96 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PmtctFollowupStatusAction implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + protected String followup_status; + private Context context; + private String subTitle; + + public PmtctFollowupStatusAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + followup_status = CoreJsonFormUtils.getValue(jsonObject, "followup_status"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(followup_status)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("Followup Status Recorded"); + + return stringBuilder.toString(); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(followup_status)) + return BasePmtctHomeVisitAction.Status.PENDING; + else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctNextFollowupVisitAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctNextFollowupVisitAction.java new file mode 100644 index 000000000..e446591b6 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctNextFollowupVisitAction.java @@ -0,0 +1,98 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PmtctNextFollowupVisitAction implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + + private String jsonPayload; + + private String next_facility_visit_date; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public PmtctNextFollowupVisitAction() { + + } + + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + next_facility_visit_date = CoreJsonFormUtils.getValue(jsonObject, "next_facility_visit_date"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(next_facility_visit_date)) + return null; + + return next_facility_visit_date; + + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(next_facility_visit_date)) + return BasePmtctHomeVisitAction.Status.PENDING; + else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctTbScreeningAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctTbScreeningAction.java new file mode 100644 index 000000000..014f38442 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctTbScreeningAction.java @@ -0,0 +1,97 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PmtctTbScreeningAction implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private String on_tb_treatment; + private Context context; + private String subTitle; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + + public PmtctTbScreeningAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + on_tb_treatment = CoreJsonFormUtils.getValue(jsonObject, "on_tb_treatment"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(on_tb_treatment)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(context.getString(R.string.pmtct_tb_screening)); + + return stringBuilder.toString(); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(on_tb_treatment)) + return BasePmtctHomeVisitAction.Status.PENDING; + else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctVisitAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctVisitAction.java new file mode 100644 index 000000000..856372c5a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PmtctVisitAction.java @@ -0,0 +1,93 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.text.MessageFormat; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PmtctVisitAction implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private String visit; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + + public PmtctVisitAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try{ + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + }catch (Exception e){ + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try{ + JSONObject jsonObject = new JSONObject(jsonPayload); + visit = CoreJsonFormUtils.getValue(jsonObject, ""); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(visit)) + return null; + + return MessageFormat.format("Visit Date: {0}", visit); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(visit)) { + return BasePmtctHomeVisitAction.Status.PENDING; + } else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction){ + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncChildGeneralExamination.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncChildGeneralExamination.java new file mode 100644 index 000000000..a74c6a1cf --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncChildGeneralExamination.java @@ -0,0 +1,99 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PncChildGeneralExamination implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private String child_activeness; + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public PncChildGeneralExamination(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + child_activeness = CoreJsonFormUtils.getValue(jsonObject, "child_activeness"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(child_activeness)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(context.getString(R.string.child_general_examination_complete)); + + return stringBuilder.toString(); + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(child_activeness)) + return BaseAncHomeVisitAction.Status.PENDING; + else { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncFamilyPlanningServicesAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncFamilyPlanningServicesAction.java new file mode 100644 index 000000000..fcd0cb5f1 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncFamilyPlanningServicesAction.java @@ -0,0 +1,99 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PncFamilyPlanningServicesAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private String education_counselling_given; + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public PncFamilyPlanningServicesAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + education_counselling_given = CoreJsonFormUtils.getValue(jsonObject, "education_counselling_given"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(education_counselling_given)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(context.getString(R.string.family_planning_services_complete)); + + return stringBuilder.toString(); + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(education_counselling_given)) + return BaseAncHomeVisitAction.Status.PENDING; + else { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncHivTestingAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncHivTestingAction.java new file mode 100644 index 000000000..d17386d84 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncHivTestingAction.java @@ -0,0 +1,96 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PncHivTestingAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private String hiv_test_result; + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public PncHivTestingAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + hiv_test_result = CoreJsonFormUtils.getValue(jsonObject, "hiv"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(hiv_test_result)) + return null; + + return hiv_test_result.equalsIgnoreCase("test_not_conducted") ? context.getString(R.string.hiv_testing_not_done) : context.getString(R.string.hiv_testing_done); + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(hiv_test_result)) + return BaseAncHomeVisitAction.Status.PENDING; + else { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncImmunizationAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncImmunizationAction.java new file mode 100644 index 000000000..97d9be77d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncImmunizationAction.java @@ -0,0 +1,101 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PncImmunizationAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private String tetanus_vaccination; + private String hepatitis_b_vaccination; + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public PncImmunizationAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + tetanus_vaccination = CoreJsonFormUtils.getValue(jsonObject, "tetanus_vaccination"); + hepatitis_b_vaccination = CoreJsonFormUtils.getValue(jsonObject, "hepatitis_b_vaccination"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(tetanus_vaccination) && StringUtils.isBlank(hepatitis_b_vaccination)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(context.getString(R.string.immunization_complete)); + + return stringBuilder.toString(); + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(tetanus_vaccination) && StringUtils.isBlank(hepatitis_b_vaccination)) + return BaseAncHomeVisitAction.Status.PENDING; + else { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncMotherGeneralExaminationAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncMotherGeneralExaminationAction.java new file mode 100644 index 000000000..133fa0029 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncMotherGeneralExaminationAction.java @@ -0,0 +1,99 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PncMotherGeneralExaminationAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private String systolic; + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public PncMotherGeneralExaminationAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + systolic = CoreJsonFormUtils.getValue(jsonObject, "systolic"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(systolic)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(context.getString(R.string.mother_general_examination_complete)); + + return stringBuilder.toString(); + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(systolic)) + return BaseAncHomeVisitAction.Status.PENDING; + else { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncNutrionSupplementAction.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncNutrionSupplementAction.java new file mode 100644 index 000000000..0955517af --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PncNutrionSupplementAction.java @@ -0,0 +1,103 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.HfPncDao; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PncNutrionSupplementAction implements BaseAncHomeVisitAction.AncHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + + private String iron_and_folic_acid; + private BaseAncHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public PncNutrionSupplementAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + JSONObject nutritionSupplementForm = null; + JSONObject global = null; + try { + nutritionSupplementForm = new JSONObject(jsonPayload); + global = nutritionSupplementForm.getJSONObject("global"); + global.put("is_eligible_for_vitamin_a", HfPncDao.isMotherEligibleForVitaminA(memberObject.getBaseEntityId())); + return nutritionSupplementForm.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + iron_and_folic_acid = CoreJsonFormUtils.getValue(jsonObject, "iron_and_folic_acid"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(iron_and_folic_acid)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(context.getString(R.string.nutritional_supplements_complete)); + + return stringBuilder.toString(); + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(iron_and_folic_acid)) + return BaseAncHomeVisitAction.Status.PENDING; + else { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.d("onPayloadReceived"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PostDeliveryFamilyPlanningActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PostDeliveryFamilyPlanningActionHelper.java new file mode 100644 index 000000000..f902f779b --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PostDeliveryFamilyPlanningActionHelper.java @@ -0,0 +1,113 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import com.vijay.jsonwizard.constants.JsonFormConstants; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONObject; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.util.JsonFormUtils; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * Created by Kassim Sheghembe on 2022-07-04 + */ +public class PostDeliveryFamilyPlanningActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private String family_planning_counselling_after_delivery; + private String family_planning_methods_selected; + private String completionStatus; + private Context context; + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + family_planning_counselling_after_delivery = JsonFormUtils.getFieldValue(jsonPayload, "family_planning_counselling_after_delivery"); + family_planning_methods_selected = JsonFormUtils.getFieldValue(jsonPayload, "family_planning_methods_selected"); + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + JSONObject jsonObject = null; + + try { + + jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + + JSONObject family_planning_module_status = JsonFormUtils.getFieldJSONObject(fields, "family_planning_module_status"); + if (family_planning_module_status != null) { + family_planning_module_status.remove(JsonFormConstants.VALUE); + family_planning_module_status.put(JsonFormConstants.VALUE, completionStatus); + } + + return jsonObject.toString(); + + } catch (Exception e) { + Timber.e(e); + } + + return null; + } + + @Override + public String evaluateSubTitle() { + if (isFullyCompleted()) { + completionStatus = context.getString(R.string.lb_fully_completed_action); + } else if (isPartiallyCompleted()) { + completionStatus = context.getString(R.string.lb_partially_completed_action); + } + return completionStatus; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isFullyCompleted()) { + return BaseLDVisitAction.Status.COMPLETED; + } else if (isPartiallyCompleted()) { + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + } else { + return BaseLDVisitAction.Status.PENDING; + } + } + + @Override + public void onPayloadReceived(BaseLDVisitAction baseLDVisitAction) { + + } + + private boolean isFullyCompleted() { + return StringUtils.isNotBlank(family_planning_counselling_after_delivery) && StringUtils.isNotBlank(family_planning_methods_selected); + } + + private boolean isPartiallyCompleted() { + return StringUtils.isNotBlank(family_planning_counselling_after_delivery) || StringUtils.isNotBlank(family_planning_methods_selected); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PostDeliveryObservationActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PostDeliveryObservationActionHelper.java new file mode 100644 index 000000000..99ed74ba6 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/PostDeliveryObservationActionHelper.java @@ -0,0 +1,172 @@ +package org.smartregister.chw.hf.actionhelper; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONObject; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.util.JsonFormUtils; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * Created by Kassim Sheghembe on 2022-07-06 + */ +public class PostDeliveryObservationActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private String vagina_observation; + private String vaginal_bleeding_observation; + private String perineum_observation; + private String degree_of_perineum_tear; + private String perineum_repair_occupation; + private String perineum_repair_person_name; + private String cervix_observation; + private String systolic; + private String diastolic; + private String pulse_rate; + private String temperature; + private String uterus_contraction; + private String urination; + private String observation_date; + private String observation_time; + private String completionStatus; + private Context context; + + @Override + public void onJsonFormLoaded(String jsonString, Context context, Map> details) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + vagina_observation = JsonFormUtils.getFieldValue(jsonPayload, "vagina_observation"); + vaginal_bleeding_observation = JsonFormUtils.getFieldValue(jsonPayload, "vaginal_bleeding_observation"); + perineum_observation = JsonFormUtils.getFieldValue(jsonPayload, "perineum_observation"); + degree_of_perineum_tear = JsonFormUtils.getFieldValue(jsonPayload, "degree_of_perineum_tear"); + perineum_repair_occupation = JsonFormUtils.getFieldValue(jsonPayload, "perineum_repair_occupation"); + perineum_repair_person_name = JsonFormUtils.getFieldValue(jsonPayload, "perineum_repair_person_name"); + cervix_observation = JsonFormUtils.getFieldValue(jsonPayload, "cervix_observation"); + systolic = JsonFormUtils.getFieldValue(jsonPayload, "systolic"); + diastolic = JsonFormUtils.getFieldValue(jsonPayload, "diastolic"); + pulse_rate = JsonFormUtils.getFieldValue(jsonPayload, "pulse_rate"); + temperature = JsonFormUtils.getFieldValue(jsonPayload, "temperature"); + uterus_contraction = JsonFormUtils.getFieldValue(jsonPayload, "uterus_contraction"); + urination = JsonFormUtils.getFieldValue(jsonPayload, "urination"); + observation_date = JsonFormUtils.getFieldValue(jsonPayload, "observation_date"); + observation_time = JsonFormUtils.getFieldValue(jsonPayload, "observation_time"); + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + try { + + JSONObject jsonObject = new JSONObject(jsonPayload); + JSONArray fields = JsonFormUtils.fields(jsonObject); + + JSONObject mother_observation_module_status = JsonFormUtils.getFieldJSONObject(fields, "mother_observation_module_status"); + if (mother_observation_module_status != null) { + mother_observation_module_status.remove(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE); + mother_observation_module_status.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, completionStatus); + } + return jsonObject.toString(); + + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public String evaluateSubTitle() { + if (isFullyCompleted()) { + completionStatus = context.getString(R.string.lb_fully_completed_action); + } else if (isPartiallyCompleted()) { + completionStatus = context.getString(R.string.lb_partially_completed_action); + } + return completionStatus; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (isFullyCompleted()) { + return BaseLDVisitAction.Status.COMPLETED; + } else if (isPartiallyCompleted()) { + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + } else { + return BaseLDVisitAction.Status.PENDING; + } + } + + @Override + public void onPayloadReceived(BaseLDVisitAction ldVisitAction) { + //Todo: Implement here + } + + private boolean isFullyCompleted() { + boolean complete = false; + if (StringUtils.isNotBlank(vagina_observation) && StringUtils.isNotBlank(perineum_observation) && + StringUtils.isNotBlank(cervix_observation) && StringUtils.isNotBlank(systolic) && + StringUtils.isNotBlank(diastolic) && StringUtils.isNotBlank(pulse_rate) && + StringUtils.isNotBlank(temperature) && StringUtils.isNotBlank(uterus_contraction) && + StringUtils.isNotBlank(urination) && StringUtils.isNotBlank(observation_date) && StringUtils.isNotBlank(observation_time)) { + complete = true; + if (vagina_observation.contains("chk_bleeding") && perineum_observation.contains("tear")) { + complete = StringUtils.isNotBlank(vaginal_bleeding_observation) && StringUtils.isNotBlank(degree_of_perineum_tear) && + (StringUtils.isNotBlank(perineum_repair_occupation) && !perineum_repair_occupation.contains("Perineum repaired by")) && StringUtils.isNotBlank(perineum_repair_person_name); + } else if (vagina_observation.contains("chk_bleeding")) { + complete = StringUtils.isNotBlank(vaginal_bleeding_observation); + } else if (perineum_observation.contains("tear")) { + complete = StringUtils.isNotBlank(degree_of_perineum_tear) && StringUtils.isNotBlank(perineum_repair_occupation) && + StringUtils.isNotBlank(perineum_repair_person_name); + } + } + + return complete; + } + + private boolean isPartiallyCompleted() { + boolean partialCompletion = false; + if (StringUtils.isNotBlank(vagina_observation)) { + if (StringUtils.isBlank(perineum_observation) || + StringUtils.isBlank(cervix_observation) || StringUtils.isBlank(systolic) || + StringUtils.isBlank(diastolic) || StringUtils.isBlank(pulse_rate) || + StringUtils.isBlank(temperature) || StringUtils.isBlank(uterus_contraction) || + StringUtils.isBlank(urination) || StringUtils.isBlank(observation_date) || StringUtils.isBlank(observation_time)) { + partialCompletion = true; + } else { + if (vagina_observation.contains("chk_bleeding") && perineum_observation.contains("tear")) { + partialCompletion = StringUtils.isBlank(vaginal_bleeding_observation) || StringUtils.isBlank(degree_of_perineum_tear) || + (StringUtils.isNotBlank(perineum_repair_occupation) && perineum_repair_occupation.contains("Perineum repaired by")) || + StringUtils.isBlank(perineum_repair_person_name); + } else if (vagina_observation.contains("chk_bleeding")) { + partialCompletion = StringUtils.isBlank(vaginal_bleeding_observation); + } else if (perineum_observation.contains("tear")) { + partialCompletion = StringUtils.isBlank(degree_of_perineum_tear) || (StringUtils.isNotBlank(perineum_repair_occupation) && + perineum_repair_occupation.contains("Perineum repaired by")) || StringUtils.isBlank(perineum_repair_person_name); + } + } + } + return partialCompletion; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpCervicalCancerScreeningActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpCervicalCancerScreeningActionHelper.java new file mode 100644 index 000000000..083a169a9 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpCervicalCancerScreeningActionHelper.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpCervicalCancerScreeningActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String cervical_cancer_screening; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + cervical_cancer_screening = CoreJsonFormUtils.getValue(jsonObject, "cervical_cancer_screening"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(cervical_cancer_screening)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpClientStatusActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpClientStatusActionHelper.java new file mode 100644 index 000000000..d7f02cd2f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpClientStatusActionHelper.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpClientStatusActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String client_status; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + client_status = CoreJsonFormUtils.getValue(jsonObject, "client_status"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(client_status)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpCondomProvisionActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpCondomProvisionActionHelper.java new file mode 100644 index 000000000..cd28892f3 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpCondomProvisionActionHelper.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpCondomProvisionActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String condoms_given; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + condoms_given = CoreJsonFormUtils.getValue(jsonObject, "condoms_given"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(condoms_given)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpFamilyPlanningActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpFamilyPlanningActionHelper.java new file mode 100644 index 000000000..0da1817b9 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpFamilyPlanningActionHelper.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpFamilyPlanningActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String family_planning_service; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + family_planning_service = CoreJsonFormUtils.getValue(jsonObject, "family_planning_service"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(family_planning_service)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpGbvAnalysisActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpGbvAnalysisActionHelper.java new file mode 100644 index 000000000..0c0b38743 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpGbvAnalysisActionHelper.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpGbvAnalysisActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String gbv_screening; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + gbv_screening = CoreJsonFormUtils.getValue(jsonObject, "gbv_screening"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(gbv_screening)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpHealthEducationHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpHealthEducationHelper.java new file mode 100644 index 000000000..4ddb9b7cf --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpHealthEducationHelper.java @@ -0,0 +1,81 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpHealthEducationHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String health_education_provided; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + health_education_provided = CoreJsonFormUtils.getValue(jsonObject, "health_education_provided"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(health_education_provided)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpHepatitisActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpHepatitisActionHelper.java new file mode 100644 index 000000000..68c142820 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpHepatitisActionHelper.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpHepatitisActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String hep_b_testing; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + hep_b_testing = CoreJsonFormUtils.getValue(jsonObject, "hep_b_testing"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(hep_b_testing)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpHtsActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpHtsActionHelper.java new file mode 100644 index 000000000..6eb68b36f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpHtsActionHelper.java @@ -0,0 +1,82 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpHtsActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + protected String hiv_status; + private String previous_hiv_testing_method; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + previous_hiv_testing_method = CoreJsonFormUtils.getValue(jsonObject, "previous_hiv_testing_method"); + hiv_status = CoreJsonFormUtils.getValue(jsonObject, "hiv_status"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(previous_hiv_testing_method)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpIecSbccActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpIecSbccActionHelper.java new file mode 100644 index 000000000..f851fb5fd --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpIecSbccActionHelper.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpIecSbccActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String iec_sbcc_materials; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + iec_sbcc_materials = CoreJsonFormUtils.getValue(jsonObject, "iec_sbcc_materials"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(iec_sbcc_materials)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpMatActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpMatActionHelper.java new file mode 100644 index 000000000..b37c40b81 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpMatActionHelper.java @@ -0,0 +1,81 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpMatActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String mat_provided; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + mat_provided = CoreJsonFormUtils.getValue(jsonObject, "mat_provided"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(mat_provided)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpOtherServicesActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpOtherServicesActionHelper.java new file mode 100644 index 000000000..56c98dbe9 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpOtherServicesActionHelper.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpOtherServicesActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String other_services_referrals_provided; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + other_services_referrals_provided = CoreJsonFormUtils.getValue(jsonObject, "other_services_referrals_provided"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(other_services_referrals_provided)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpPrepPepActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpPrepPepActionHelper.java new file mode 100644 index 000000000..d7fa30487 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpPrepPepActionHelper.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpPrepPepActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String enrolled_to_prep; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + enrolled_to_prep = CoreJsonFormUtils.getValue(jsonObject, "enrolled_to_prep"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(enrolled_to_prep)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpStiScreeningActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpStiScreeningActionHelper.java new file mode 100644 index 000000000..b48d9b1e5 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpStiScreeningActionHelper.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpStiScreeningActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String sti_screening; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + sti_screening = CoreJsonFormUtils.getValue(jsonObject, "sti_screening"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(sti_screening)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpTbScreeningActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpTbScreeningActionHelper.java new file mode 100644 index 000000000..4a00b9543 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpTbScreeningActionHelper.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpTbScreeningActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String tb_screening; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + tb_screening = CoreJsonFormUtils.getValue(jsonObject, "tb_screening"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(tb_screening)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpVmmcActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpVmmcActionHelper.java new file mode 100644 index 000000000..125fcfd3c --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/kvp/KvpVmmcActionHelper.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.actionhelper.kvp; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class KvpVmmcActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String vmcc_provided; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + vmcc_provided = CoreJsonFormUtils.getValue(jsonObject, "vmcc_provided"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(vmcc_provided)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/prep/PrEPInitiationActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/prep/PrEPInitiationActionHelper.java new file mode 100644 index 000000000..beaf11d17 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/prep/PrEPInitiationActionHelper.java @@ -0,0 +1,109 @@ +package org.smartregister.chw.hf.actionhelper.prep; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.dao.KvpDao; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; +import org.smartregister.family.util.JsonFormUtils; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import timber.log.Timber; + +public class PrEPInitiationActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String prep_status; + private String jsonPayload; + private String baseEntityId; + SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + + public PrEPInitiationActionHelper(String baseEntityId) { + this.baseEntityId = baseEntityId; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + JSONArray fields = jsonObject.getJSONObject(org.smartregister.chw.hf.utils.Constants.JsonFormConstants.STEP1).getJSONArray(org.smartregister.chw.referral.util.JsonFormConstants.FIELDS); + JSONObject prepPillsNumber = JsonFormUtils.getFieldJSONObject(fields, "prep_pills_number"); + + + String enrollmentDateString = KvpDao.getPrepInitiationDate(baseEntityId); + if (enrollmentDateString != null) { + Date enrollmentDate = df.parse(enrollmentDateString); + if (enrollmentDate != null) { + Date threeMonthsAgo = new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(90)); + if (enrollmentDate.before(threeMonthsAgo)) { + prepPillsNumber.remove("v_max"); + } + } + } + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + prep_status = CoreJsonFormUtils.getValue(jsonObject, "prep_status"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(prep_status)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/prep/PrEPOtherServicesActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/prep/PrEPOtherServicesActionHelper.java new file mode 100644 index 000000000..9ef73b1e3 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/prep/PrEPOtherServicesActionHelper.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.actionhelper.prep; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class PrEPOtherServicesActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + private String health_edu_sti_provided; + private String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + health_edu_sti_provided = CoreJsonFormUtils.getValue(jsonObject, "health_edu_sti_provided"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(health_edu_sti_provided)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/prep/PrEPScreeningActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/prep/PrEPScreeningActionHelper.java new file mode 100644 index 000000000..6bd4e7317 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/prep/PrEPScreeningActionHelper.java @@ -0,0 +1,128 @@ +package org.smartregister.chw.hf.actionhelper.prep; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.dao.HfKvpDao; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import timber.log.Timber; + +public class PrEPScreeningActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + protected String should_initiate; + private String jsonPayload; + private String baseEntityId; + + public PrEPScreeningActionHelper(String baseEntityId) { + this.baseEntityId = baseEntityId; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + JSONObject global = jsonObject.getJSONObject("global"); + + Date hbvTestDate = HfKvpDao.getHbvTestDate(baseEntityId); + if (hbvTestDate != null) { + Date threeMonthsAgo = new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(180)); + global.put("should_record_hbv_tests", hbvTestDate.before(threeMonthsAgo)); + } else { + global.put("should_record_hbv_tests", true); + } + + Date hcvTestDate = HfKvpDao.getHcvTestDate(baseEntityId); + if (hcvTestDate != null) { + Date threeMonthsAgo = new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(180)); + global.put("should_record_hcv_tests", hcvTestDate.before(threeMonthsAgo)); + } else { + global.put("should_record_hcv_tests", true); + } + + Date crclTestDate = HfKvpDao.getCrclTestDate(baseEntityId); + if (crclTestDate != null) { + Date threeMonthsAgo = new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(180)); + global.put("should_record_crcl_tests", crclTestDate.before(threeMonthsAgo)); + } else { + global.put("should_record_crcl_tests", true); + } + + String crclResults = HfKvpDao.getCrclResults(baseEntityId); + global.put("record_rcl_tests_results", crclResults != null && crclResults.equalsIgnoreCase("no_results")); + + if (crclTestDate != null && crclResults != null && crclResults.equalsIgnoreCase("less_than_60")) { + Date fourDaysAgo = new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(14)); + global.put("should_record_crcl_tests", crclTestDate.before(fourDaysAgo)); + } + + + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + should_initiate = CoreJsonFormUtils.getValue(jsonObject, "should_initiate"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(should_initiate)) { + return BaseKvpVisitAction.Status.PENDING; + } else if (should_initiate.equalsIgnoreCase("no")) { + return BaseKvpVisitAction.Status.PARTIALLY_COMPLETED; + } else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/prep/PrEPVisitTypeActionHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/prep/PrEPVisitTypeActionHelper.java new file mode 100644 index 000000000..ea23d8d4a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/actionhelper/prep/PrEPVisitTypeActionHelper.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.actionhelper.prep; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; + +import java.util.List; +import java.util.Map; + +public class PrEPVisitTypeActionHelper implements BaseKvpVisitAction.KvpVisitActionHelper { + + protected String visit_type; + protected String jsonPayload; + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + visit_type = CoreJsonFormUtils.getValue(jsonObject, "visit_type"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BaseKvpVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseKvpVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(visit_type)) + return BaseKvpVisitAction.Status.PENDING; + else { + return BaseKvpVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BaseKvpVisitAction baseKvpVisitAction) { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AboveFiveChildProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AboveFiveChildProfileActivity.java index e99411d24..436a8637b 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AboveFiveChildProfileActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AboveFiveChildProfileActivity.java @@ -1,7 +1,7 @@ package org.smartregister.chw.hf.activity; import org.smartregister.chw.core.activity.CoreAboveFiveChildProfileActivity; -import org.smartregister.chw.hf.model.ChildProfileModel; +import org.smartregister.chw.core.model.CoreChildProfileModel; import org.smartregister.chw.hf.presenter.HfChildProfilePresenter; import org.smartregister.family.util.Constants; @@ -14,6 +14,6 @@ protected void initializePresenter() { familyName = ""; } - presenter = new HfChildProfilePresenter(this, new ChildProfileModel(familyName), childBaseEntityId); + presenter = new HfChildProfilePresenter(this, new CoreChildProfileModel(familyName), childBaseEntityId); } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AllClientsMemberProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AllClientsMemberProfileActivity.java new file mode 100644 index 000000000..b0cfe873f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AllClientsMemberProfileActivity.java @@ -0,0 +1,392 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.chw.hf.utils.Constants.JsonForm.HIV_REGISTRATION; +import static org.smartregister.chw.hf.utils.JsonFormUtils.getAutoPopulatedJsonEditFormString; +import static org.smartregister.util.Utils.getName; + +import android.content.Context; +import android.os.Build; +import android.view.Menu; +import android.view.MenuItem; +import android.widget.TextView; + +import androidx.annotation.RequiresApi; +import androidx.viewpager.widget.ViewPager; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.activity.CoreAllClientsMemberProfileActivity; +import org.smartregister.chw.core.activity.CoreFamilyProfileActivity; +import org.smartregister.chw.core.contract.CoreAllClientsMemberContract; +import org.smartregister.chw.core.dao.AncDao; +import org.smartregister.chw.core.form_data.NativeFormsDataBinder; +import org.smartregister.chw.core.fragment.FamilyCallDialogFragment; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.Utils; +import org.smartregister.chw.fp.util.FamilyPlanningConstants; +import org.smartregister.chw.hf.BuildConfig; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.custom_view.FamilyMemberFloatingMenu; +import org.smartregister.chw.hf.dataloader.FamilyMemberDataLoader; +import org.smartregister.chw.hf.fragment.FamilyOtherMemberProfileFragment; +import org.smartregister.chw.hf.presenter.FamilyOtherMemberActivityPresenter; +import org.smartregister.chw.hf.presenter.HfAllClientsMemberPresenter; +import org.smartregister.chw.hf.utils.AllClientsUtils; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.LFTUFormUtils; +import org.smartregister.chw.hivst.dao.HivstDao; +import org.smartregister.chw.kvp.dao.KvpDao; +import org.smartregister.chw.ld.dao.LDDao; +import org.smartregister.chw.malaria.dao.MalariaDao; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.family.adapter.ViewPagerAdapter; +import org.smartregister.family.fragment.BaseFamilyOtherMemberProfileFragment; +import org.smartregister.family.model.BaseFamilyOtherMemberProfileActivityModel; +import org.smartregister.family.util.DBConstants; +import org.smartregister.view.contract.BaseProfileContract; + +import timber.log.Timber; + +public class AllClientsMemberProfileActivity extends CoreAllClientsMemberProfileActivity { + + private FamilyMemberFloatingMenu familyFloatingMenu; + private CoreAllClientsMemberContract.Presenter allClientsMemberPresenter; + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + super.onCreateOptionsMenu(menu); + String gender = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.GENDER, false); + menu.findItem(R.id.action_location_info).setVisible(true); + menu.findItem(R.id.action_pregnancy_out_come).setVisible(false); + menu.findItem(R.id.action_remove_member).setVisible(true); + if (BuildConfig.BUILD_FOR_BORESHA_AFYA_SOUTH) { + AllClientsUtils.updateHivMenuItems(baseEntityId, menu); + // AllClientsUtils.updateTbMenuItems(baseEntityId, menu); + + } + if (isOfReproductiveAge(commonPersonObject, gender) && gender.equalsIgnoreCase("female") && !AncDao.isANCMember(baseEntityId)) { + menu.findItem(R.id.action_pregnancy_confirmation).setVisible(true); + menu.findItem(R.id.action_anc_registration).setVisible(true); + menu.findItem(R.id.action_pregnancy_out_come).setVisible(true); + menu.findItem(R.id.action_pmtct_register).setVisible(true); + } else + menu.findItem(R.id.action_anc_registration).setVisible(false); + + if (HealthFacilityApplication.getApplicationFlavor().hasLD()) { + menu.findItem(R.id.action_ld_registration).setVisible(isOfReproductiveAge(commonPersonObject, gender) && gender.equalsIgnoreCase("female") && !LDDao.isRegisteredForLD(baseEntityId)); + } + + menu.findItem(R.id.action_sick_child_follow_up).setVisible(false); + if (HealthFacilityApplication.getApplicationFlavor().hasMalaria()) + menu.findItem(R.id.action_malaria_diagnosis).setVisible(!MalariaDao.isRegisteredForMalaria(baseEntityId)); + + if (HealthFacilityApplication.getApplicationFlavor().hasHivst()) { + String dob = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false); + int age = Utils.getAgeFromDate(dob); + menu.findItem(R.id.action_hivst_registration).setVisible(!HivstDao.isRegisteredForHivst(baseEntityId) && age >= 15); + } + if (HealthFacilityApplication.getApplicationFlavor().hasKvpPrEP()) { + String dob = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false); + int age = Utils.getAgeFromDate(dob); + menu.findItem(R.id.action_kvp_registration).setVisible(!KvpDao.isRegisteredForKvp(baseEntityId) && age >= 15); + } + return true; + } + + @Override + protected void setupViews() { + super.setupViews(); + TextView toolbarTitleView = findViewById(org.smartregister.chw.core.R.id.toolbar_title); + String toolbarTitle = getIntent().getStringExtra(CoreConstants.INTENT_KEY.TOOLBAR_TITLE); + if (StringUtils.isNotBlank(toolbarTitle)) { + toolbarTitleView.setText(toolbarTitle); + } else { + toolbarTitleView.setText(getString(org.smartregister.chw.core.R.string.return_to_all_client)); + } + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == org.smartregister.chw.core.R.id.action_pregnancy_confirmation) { + startPregnancyConfirmation(); + return true; + } + if (itemId == org.smartregister.chw.core.R.id.action_pmtct_register) { + startPmtctRegisration(); + return true; + } + if (itemId == org.smartregister.chw.core.R.id.action_anc_registration) { + startAncTransferInRegistration(); + return true; + } + if (itemId == org.smartregister.chw.core.R.id.action_location_info) { + JSONObject preFilledForm = getAutoPopulatedJsonEditFormString( + CoreConstants.JSON_FORM.getFamilyDetailsRegister(), this, + getFamilyRegistrationDetails(), Utils.metadata().familyRegister.updateEventType); + if (preFilledForm != null) startFormActivity(preFilledForm); + return true; + } else if (itemId == org.smartregister.chw.core.R.id.action_malaria_diagnosis) { + startHfMalariaFollowupForm(); + return true; + } + + return super.onOptionsItemSelected(item); + } + + @Override + public FamilyOtherMemberActivityPresenter presenter() { + return (FamilyOtherMemberActivityPresenter) presenter; + } + + @Override + protected void startAncRegister() { + AncRegisterActivity.startAncRegistrationActivity(AllClientsMemberProfileActivity.this, baseEntityId, PhoneNumber, + CoreConstants.JSON_FORM.getAncRegistration(), null, familyBaseEntityId, familyName); + } + + @Override + protected void startPncRegister() { + PncRegisterActivity.startPncRegistrationActivity(AllClientsMemberProfileActivity.this, baseEntityId, PhoneNumber, + CoreConstants.JSON_FORM.getPregnancyOutcome(), null, familyBaseEntityId, familyName, null, false); + } + + @Override + protected void startMalariaRegister() { + MalariaRegisterActivity.startMalariaRegistrationActivity(AllClientsMemberProfileActivity.this, baseEntityId); + + } + + @Override + protected void startHivRegister() { + try { + HivRegisterActivity.startHIVFormActivity(AllClientsMemberProfileActivity.this, baseEntityId, HIV_REGISTRATION, (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, HIV_REGISTRATION).toString()); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + protected void startTbRegister() { + try { + TbRegisterActivity.startTbFormActivity(AllClientsMemberProfileActivity.this, baseEntityId, CoreConstants.JSON_FORM.getTbRegistration(), (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, CoreConstants.JSON_FORM.getTbRegistration()).toString()); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + protected void startFpRegister() { + String dob = org.smartregister.family.util.Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false); + String gender = org.smartregister.family.util.Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.GENDER, false); + + FpRegisterActivity.startFpRegistrationActivity(this, baseEntityId, dob, CoreConstants.JSON_FORM.getFpRegistrationForm(gender), + FamilyPlanningConstants.ActivityPayload.REGISTRATION_PAYLOAD_TYPE); + } + + + @Override + protected void startFpChangeMethod() { + String dob = org.smartregister.family.util.Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false); + String gender = org.smartregister.family.util.Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.GENDER, false); + + FpRegisterActivity.startFpRegistrationActivity(this, baseEntityId, dob, CoreConstants.JSON_FORM.getFpChangeMethodForm(gender), + FamilyPlanningConstants.ActivityPayload.CHANGE_METHOD_PAYLOAD_TYPE); + } + + @Override + protected void removeIndividualProfile() { + IndividualProfileRemoveActivity.startIndividualProfileActivity(AllClientsMemberProfileActivity.this, + commonPersonObject, familyBaseEntityId, familyHead, primaryCaregiver, AllClientsRegisterActivity.class.getCanonicalName()); + } + + @Override + protected void startEditMemberJsonForm(Integer title_resource, CommonPersonObjectClient client) { + String titleString = title_resource != null ? getResources().getString(title_resource) : null; + CommonPersonObjectClient commonPersonObjectClient = getFamilyRegistrationDetails(); + String uniqueID = commonPersonObjectClient.getColumnmaps().get(DBConstants.KEY.UNIQUE_ID); + boolean isPrimaryCareGiver = commonPersonObject.getCaseId().equalsIgnoreCase(primaryCaregiver); + + NativeFormsDataBinder binder = new NativeFormsDataBinder(getContext(), commonPersonObject.getCaseId()); + binder.setDataLoader(new FamilyMemberDataLoader(familyName, isPrimaryCareGiver, titleString, + Utils.metadata().familyMemberRegister.updateEventType, uniqueID)); + JSONObject jsonObject = binder.getPrePopulatedForm(CoreConstants.JSON_FORM.getAllClientUpdateRegistrationInfoForm()); + + try { + startFormActivity(jsonObject); + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + protected BaseProfileContract.Presenter getFamilyOtherMemberActivityPresenter( + String familyBaseEntityId, String baseEntityId, String familyHead, String primaryCaregiver, String villageTown, String familyName) { + return new FamilyOtherMemberActivityPresenter(this, new BaseFamilyOtherMemberProfileActivityModel(), + null, familyBaseEntityId, baseEntityId, familyHead, primaryCaregiver, villageTown, familyName); + } + + @Override + protected FamilyMemberFloatingMenu getFamilyMemberFloatingMenu() { + if (familyFloatingMenu == null) { + familyFloatingMenu = new FamilyMemberFloatingMenu(this); + } + return familyFloatingMenu; + } + + @Override + protected Context getFamilyOtherMemberProfileActivity() { + return AllClientsMemberProfileActivity.this; + } + + @Override + protected Class getFamilyProfileActivity() { + return FamilyProfileActivity.class; + } + + @Override + protected void initializePresenter() { + super.initializePresenter(); + onClickFloatingMenu = this; + allClientsMemberPresenter = new HfAllClientsMemberPresenter(this, baseEntityId); + } + + @Override + protected ViewPager setupViewPager(ViewPager viewPager) { + adapter = new ViewPagerAdapter(getSupportFragmentManager()); + BaseFamilyOtherMemberProfileFragment profileOtherMemberFragment = FamilyOtherMemberProfileFragment.newInstance(this.getIntent().getExtras()); + adapter.addFragment(profileOtherMemberFragment, ""); + + viewPager.setAdapter(adapter); + + return viewPager; + } + + public void setFamilyName(String familyName) { + this.familyName = familyName; + } + + @Override + protected BaseFamilyOtherMemberProfileFragment getFamilyOtherMemberProfileFragment() { + return FamilyOtherMemberProfileFragment.newInstance(getIntent().getExtras()); + } + + @Override + protected void startMalariaFollowUpVisit() { + //Do nothing - not required for HF + } + + @Override + protected void startHfMalariaFollowupForm() { + MalariaFollowUpVisitActivityHelper.startMalariaFollowUpActivity(this, baseEntityId); + } + + @Override + protected void startPmtctRegisration() { + PncRegisterActivity.startPncRegistrationActivity(AllClientsMemberProfileActivity.this, baseEntityId, PhoneNumber, + Constants.JsonForm.getPmtctRegistrationForClientsPostPnc(), null, familyBaseEntityId, familyName, null, false); + } + + @Override + protected void startLDRegistration() { + String firstName = org.smartregister.family.util.Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.FIRST_NAME, true); + String middleName = org.smartregister.family.util.Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.MIDDLE_NAME, true); + String lastName = org.smartregister.family.util.Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.LAST_NAME, true); + + String dob = org.smartregister.family.util.Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, true); + int age = StringUtils.isNotBlank(dob) ? org.smartregister.family.util.Utils.getAgeFromDate(dob) : 0; + + try { + LDRegistrationFormActivity.startMe(this, baseEntityId, false, getName(getName(firstName, middleName), lastName), String.valueOf(age)); + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + protected void startHivstRegistration() { + String gender = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.GENDER, false); + String dob = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false); + int age = Utils.getAgeFromDate(dob); + HivstRegisterActivity.startHivstRegistrationActivity(AllClientsMemberProfileActivity.this, baseEntityId, gender,age); + } + + @Override + protected void startKvpPrEPRegistration() { + //do nothing--> this is for chw + } + + @Override + protected void startKvpRegistration() { + String gender = AllClientsUtils.getClientGender(baseEntityId); + String dob = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false); + int age = Utils.getAgeFromDate(dob); + if (gender.equalsIgnoreCase(Constants.GENDER.MALE)) { + KvpRegisterActivity.startKvpScreeningMale(AllClientsMemberProfileActivity.this, baseEntityId, gender, age); + } + if (gender.equalsIgnoreCase(Constants.GENDER.FEMALE)) { + KvpRegisterActivity.startKvpScreeningFemale(AllClientsMemberProfileActivity.this, baseEntityId, gender, age); + } + } + + @Override + protected void startPrEPRegistration() { + String gender = AllClientsUtils.getClientGender(baseEntityId); + String dob = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false); + int age = Utils.getAgeFromDate(dob); + PrEPRegisterActivity.startMe(this, baseEntityId, gender, age); + } + + @Override + protected void startAgywScreening() { + //do nothing + } + + @Override + protected void setIndependentClient(boolean isIndependentClient) { + super.isIndependent = isIndependentClient; + } + + @RequiresApi(api = Build.VERSION_CODES.KITKAT) + @Override + public void onClickMenu(int viewId) { + if (viewId == R.id.call_layout) { + FamilyCallDialogFragment.launchDialog(this, familyBaseEntityId); + } + if (viewId == R.id.refer_to_facility_layout) { + String gender = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.GENDER, false); + String dob = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false); + LFTUFormUtils.startLTFUReferral(this, baseEntityId, gender, Utils.getAgeFromDate(dob)); + } + } + + @Override + public CoreAllClientsMemberContract.Presenter getAllClientsMemberPresenter() { + return allClientsMemberPresenter; + } + + private boolean isOfReproductiveAge(CommonPersonObjectClient commonPersonObject, String gender) { + if (gender.equalsIgnoreCase("Female")) { + return Utils.isMemberOfReproductiveAge(commonPersonObject, 10, 49); + } else if (gender.equalsIgnoreCase("Male")) { + return Utils.isMemberOfReproductiveAge(commonPersonObject, 15, 49); + } else { + return false; + } + } + + protected void startPregnancyConfirmation() { + AncRegisterActivity.startAncRegistrationActivity(AllClientsMemberProfileActivity.this, baseEntityId, PhoneNumber, + CoreConstants.JSON_FORM.ANC_PREGNANCY_CONFIRMATION, null, familyBaseEntityId, familyName); + } + + protected void startAncTransferInRegistration() { + AncRegisterActivity.startAncRegistrationActivity(AllClientsMemberProfileActivity.this, baseEntityId, PhoneNumber, + Constants.JSON_FORM.ANC_TRANSFER_IN_REGISTRATION, null, familyBaseEntityId, familyName); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AllClientsRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AllClientsRegisterActivity.java index 1f57d05f2..776a4051d 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AllClientsRegisterActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AllClientsRegisterActivity.java @@ -1,17 +1,32 @@ package org.smartregister.chw.hf.activity; import android.content.Intent; +import android.view.MenuItem; import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; +import com.google.android.material.bottomnavigation.LabelVisibilityMode; + +import org.smartregister.AllConstants; import org.smartregister.chw.core.activity.CoreAllClientsRegisterActivity; -import org.smartregister.chw.core.presenter.CoreAllClientsRegisterPresenter; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.fragment.AdvancedSearchFragment; import org.smartregister.chw.hf.fragment.AllClientsRegisterFragment; +import org.smartregister.chw.hf.model.HfAllClientsRegisterModel; +import org.smartregister.chw.hf.presenter.HfAllClientRegisterPresenter; +import org.smartregister.family.util.Utils; import org.smartregister.helper.BottomNavigationHelper; import org.smartregister.opd.contract.OpdRegisterActivityContract; import org.smartregister.opd.presenter.BaseOpdRegisterActivityPresenter; import org.smartregister.view.fragment.BaseRegisterFragment; +import java.util.Arrays; +import java.util.List; + +import timber.log.Timber; + public class AllClientsRegisterActivity extends CoreAllClientsRegisterActivity { @Override @@ -19,25 +34,83 @@ protected BaseRegisterFragment getRegisterFragment() { return new AllClientsRegisterFragment(); } + @Override + protected Fragment[] getOtherFragments() { + Fragment[] fragments = new Fragment[1]; + fragments[0] = new AdvancedSearchFragment(false); + return fragments; + } + + @Override + public List getViewIdentifiers() { + return Arrays.asList(Utils.metadata().familyRegister.config); + } + + @Override + public void startRegistration() { + startFormActivity(CoreConstants.JSON_FORM.getAllClientRegistrationForm(), null, null); + } + + + @Override + public void startFormActivity(String formName, String entityId, String metaData) { + try { + String locationId = org.smartregister.family.util.Utils.context().allSharedPreferences().getPreference(AllConstants.CURRENT_LOCATION_ID); + ((HfAllClientRegisterPresenter) presenter()).startForm(formName, entityId, metaData, locationId); + + } catch (Exception e) { + Timber.e(e); + displayToast(org.smartregister.family.R.string.error_unable_to_start_form); + } + } + @Override protected void registerBottomNavigation() { bottomNavigationHelper = new BottomNavigationHelper(); - bottomNavigationView = findViewById(org.smartregister.R.id.bottom_navigation); - FamilyRegisterActivity.registerBottomNavigation(bottomNavigationHelper, bottomNavigationView, this); + bottomNavigationView = findViewById(R.id.bottom_navigation); + bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED); + bottomNavigationView.getMenu().clear(); + bottomNavigationView.inflateMenu(R.menu.bottom_nav_all_clients_menu); + bottomNavigationHelper.disableShiftMode(bottomNavigationView); + bottomNavigationView.setOnNavigationItemSelectedListener(this); + bottomNavigationView.getMenu().removeItem(org.smartregister.family.R.id.action_job_aids); + bottomNavigationView.getMenu().findItem(R.id.action_register).setTitle(R.string.add_client).setIcon(R.drawable.ic_input_add); } @Override - protected BaseOpdRegisterActivityPresenter createPresenter(@NonNull OpdRegisterActivityContract.View view, @NonNull OpdRegisterActivityContract.Model model) { - return new CoreAllClientsRegisterPresenter(view, model); + protected BaseOpdRegisterActivityPresenter createPresenter( + @NonNull OpdRegisterActivityContract.View view, @NonNull OpdRegisterActivityContract.Model model) { + return new HfAllClientRegisterPresenter(view, model); } @Override public void switchToBaseFragment() { - Intent intent = new Intent(this, FamilyRegisterActivity.class); + Intent intent = new Intent(this, AllClientsRegisterActivity.class); startActivity(intent); finish(); } + @Override + public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) { + switch (menuItem.getItemId()) { + case R.id.action_search: + switchToFragment(1); + return true; + case R.id.action_family: + switchToBaseFragment(); + break; + case R.id.action_register: + startRegistration(); + break; + default: + return true; + } + return true; + } + + public OpdRegisterActivityContract.Model createActivityModel() { + return new HfAllClientsRegisterModel(this); + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AllMaleClientsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AllMaleClientsActivity.java new file mode 100644 index 000000000..f1d1181a3 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AllMaleClientsActivity.java @@ -0,0 +1,45 @@ +package org.smartregister.chw.hf.activity; + +import android.view.View; +import android.widget.ImageView; + +import androidx.fragment.app.FragmentTransaction; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.fragment.AllMaleClientsRegisterFragment; +import org.smartregister.view.activity.SecuredActivity; + +public class AllMaleClientsActivity extends SecuredActivity implements View.OnClickListener { + @Override + protected void onCreation() { + setContentView(R.layout.activity_all_male_clients); + setupViews(); + } + + @Override + protected void onResumption() { + //overridden + } + + public void setupViews() { + ImageView closeImageView = findViewById(R.id.close); + closeImageView.setOnClickListener(this); + + loadFragment(); + } + + private void loadFragment() { + FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); + // Replace the contents of the container with the new fragment + ft.replace(R.id.fragment_placeholder, new AllMaleClientsRegisterFragment()); + ft.commit(); + } + + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.close) { + finish(); + } + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncFilterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncFilterActivity.java new file mode 100644 index 000000000..85591da92 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncFilterActivity.java @@ -0,0 +1,163 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.chw.hf.utils.Constants.FILTERS_ENABLED; +import static org.smartregister.chw.hf.utils.Constants.FILTER_APPOINTMENT_DATE; +import static org.smartregister.chw.hf.utils.Constants.FILTER_HIV_STATUS; +import static org.smartregister.chw.hf.utils.Constants.FILTER_IS_REFERRED; +import static org.smartregister.chw.hf.utils.Constants.REQUEST_FILTERS; + +import android.app.DatePickerDialog; +import android.content.Intent; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.Spinner; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.SwitchCompat; +import androidx.appcompat.widget.Toolbar; + +import org.joda.time.DateTime; +import org.smartregister.chw.hf.R; + +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; + +public class AncFilterActivity extends AppCompatActivity { + private final Calendar mCalendar = Calendar.getInstance(); + private final SimpleDateFormat mDateFormat = new SimpleDateFormat("dd-MM-yyyy", Locale.ENGLISH); + private SwitchCompat enableFilter; + private TextView summaryAppointmentDate; + private SwitchCompat referredFromCommunityFilter; + private Spinner hivStatusFilter; + private List hivFilterOptions; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_anc_filter); + + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + setTitle("Filter"); + + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + final Drawable upArrow = getResources().getDrawable(org.smartregister.chw.core.R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setElevation(0); + } + toolbar.setNavigationOnClickListener(v -> finish()); + hivFilterOptions = Arrays.asList(getResources().getStringArray(R.array.hiv_status_filter_options)); + + setupViews(); + boolean filterEnabled = getIntent().getBooleanExtra(FILTERS_ENABLED, false); + boolean filterIsReferred = getIntent().getBooleanExtra(FILTER_IS_REFERRED, false); + String filterHivStatus = getIntent().getStringExtra(FILTER_HIV_STATUS); + String appointmentDate = getIntent().getStringExtra(FILTER_APPOINTMENT_DATE); + if (filterEnabled) { + enableFilter.setChecked(true); + if (filterIsReferred) { + referredFromCommunityFilter.setChecked(true); + } + + if (appointmentDate != null) { + summaryAppointmentDate.setText(appointmentDate); + } + + if (filterHivStatus != null) { + if (hivFilterOptions.contains(filterHivStatus)) { + hivStatusFilter.setSelection(hivFilterOptions.indexOf(filterHivStatus)); + } + } + } + } + + public void setupViews() { + enableFilter = findViewById(R.id.enable_filter_switch); + TextView filterStatus = findViewById(R.id.filter_status); + summaryAppointmentDate = findViewById(R.id.summary_appointment_date); + LinearLayout filterList = findViewById(R.id.filters_list); + hivStatusFilter = findViewById(R.id.hiv_status_filter); + referredFromCommunityFilter = findViewById(R.id.switch_for_referred); + LinearLayout nextAppointmentDate = findViewById(R.id.next_appointment_date); + + if (enableFilter.isChecked()) { + filterList.setVisibility(View.VISIBLE); + } else { + filterList.setVisibility(View.GONE); + } + + enableFilter.setOnCheckedChangeListener((compoundButton, b) -> { + if (b) { + filterStatus.setText(R.string.filter_status_on); + filterList.setVisibility(View.VISIBLE); + } else { + filterStatus.setText(R.string.filter_status_off); + filterList.setVisibility(View.GONE); + summaryAppointmentDate.setText(R.string.none); + hivStatusFilter.setSelection(0); + referredFromCommunityFilter.setChecked(false); + } + }); + + DatePickerDialog.OnDateSetListener datePickerListener = (mView, year, monthOfYear, dayOfMonth) -> { + mCalendar.set(Calendar.YEAR, year); + mCalendar.set(Calendar.MONTH, monthOfYear); + mCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth); + summaryAppointmentDate.setText(mDateFormat.format(mCalendar.getTime())); + }; + + nextAppointmentDate.setOnClickListener(view -> { + DatePickerDialog dialog = new DatePickerDialog(AncFilterActivity.this, datePickerListener, mCalendar + .get(Calendar.YEAR), mCalendar.get(Calendar.MONTH), + mCalendar.get(Calendar.DAY_OF_MONTH)); + + dialog.getDatePicker().setSpinnersShown(true); + dialog.getDatePicker().setMinDate(new Date().getTime()); + dialog.getDatePicker().setMaxDate(new DateTime().plusMonths(6).toDate().getTime()); + + dialog.show(); + }); + + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.filter_activity_menu, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == R.id.action_save) { + Intent intent = new Intent(); + intent.putExtra(FILTERS_ENABLED, enableFilter.isChecked()); + if (enableFilter.isChecked()) { + intent.putExtra(FILTER_APPOINTMENT_DATE, summaryAppointmentDate.getText()); + intent.putExtra(FILTER_IS_REFERRED, referredFromCommunityFilter.isChecked()); + intent.putExtra(FILTER_HIV_STATUS, hivFilterOptions.get(hivStatusFilter.getSelectedItemPosition())); + } + + setResult(REQUEST_FILTERS, intent); + setResult(RESULT_OK, intent); + finish(); + + return true; + } + return super.onOptionsItemSelected(item); + } + + +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncFirstFacilityVisitActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncFirstFacilityVisitActivity.java new file mode 100644 index 000000000..3b8297c26 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncFirstFacilityVisitActivity.java @@ -0,0 +1,119 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.TransactionTooLargeException; +import android.widget.Toast; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.activity.BaseAncHomeVisitActivity; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.presenter.BaseAncHomeVisitPresenter; +import org.smartregister.chw.core.R; +import org.smartregister.chw.core.task.RunnableTask; +import org.smartregister.chw.hf.domain.JSONObjectHolder; +import org.smartregister.chw.hf.interactor.AncFirstFacilityVisitInteractor; +import org.smartregister.chw.hf.schedulers.HfScheduleTaskExecutor; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.util.LangUtils; + +import java.text.MessageFormat; +import java.util.Date; + +import timber.log.Timber; + +/** + * @author ilakozejumanne@gmail.com + * 11-10-2021 + */ +public class AncFirstFacilityVisitActivity extends BaseAncHomeVisitActivity { + private long mLastExecutionTime = 0; + private static final long MINIMUM_INTERVAL_MS = 3000; + + public static void startMe(Activity activity, String baseEntityID, Boolean isEditMode) { + Intent intent = new Intent(activity, AncFirstFacilityVisitActivity.class); + intent.putExtra(org.smartregister.chw.anc.util.Constants.ANC_MEMBER_OBJECTS.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(org.smartregister.chw.anc.util.Constants.ANC_MEMBER_OBJECTS.EDIT_MODE, isEditMode); + activity.startActivityForResult(intent, org.smartregister.chw.anc.util.Constants.REQUEST_CODE_HOME_VISIT); + } + + @Override + protected void registerPresenter() { + presenter = new BaseAncHomeVisitPresenter(memberObject, this, new AncFirstFacilityVisitInteractor()); + } + + @Override + public void submittedAndClose() { + Runnable runnable = () -> HfScheduleTaskExecutor.getInstance().execute(memberObject.getBaseEntityId(), Constants.Events.ANC_FIRST_FACILITY_VISIT, new Date()); + Utils.startAsyncTask(new RunnableTask(runnable), null); + super.submittedAndClose(); + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + + Form form = new Form(); + form.setActionBarBackground(R.color.family_actionbar); + form.setWizard(false); + + Intent intent; + + try { + if (jsonForm.getString("encounter_type").equals("Emergency Plan")) { + // Set the large JSONObject in JSONObjectHolder + JSONObjectHolder.getInstance().setLargeJSONObject(jsonForm); + intent = new Intent(this, HfJsonWizardFormActivity.class); + } else { + intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + } + } catch (JSONException e) { + e.printStackTrace(); + intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + } + + intent.putExtra(org.smartregister.family.util.Constants.WizardFormActivity.EnableOnCloseDialog, false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + + + //Necessary evil to disable multiple sequential clicks of actions that do sometimes cause app crushes + long currentTime = System.currentTimeMillis(); + if (currentTime - mLastExecutionTime < MINIMUM_INTERVAL_MS) { + // too soon to execute the function again, ignore this call + return; + } + + // record the current time as the last execution time + mLastExecutionTime = currentTime; + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + protected void attachBaseContext(Context base) { + // get language from prefs + String lang = LangUtils.getLanguage(base.getApplicationContext()); + super.attachBaseContext(LangUtils.setAppLocale(base, lang)); + } + + @Override + public void redrawHeader(MemberObject memberObject) { + tvTitle.setText(MessageFormat.format("{0}, {1} \u00B7 {2}", memberObject.getFullName(), memberObject.getAge(), getString(org.smartregister.chw.hf.R.string.anc_first_visit))); + } + + @Override + public void onDestroy() { + try { + super.onDestroy(); + } catch (Exception e) { + Timber.e(e); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncMedicalHistoryActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncMedicalHistoryActivity.java index 9df1a8938..6684ab4c7 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncMedicalHistoryActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncMedicalHistoryActivity.java @@ -6,8 +6,10 @@ import org.smartregister.chw.anc.domain.MemberObject; import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.presenter.BaseAncMedicalHistoryPresenter; import org.smartregister.chw.anc.util.Constants; import org.smartregister.chw.core.activity.CoreAncMedicalHistoryActivity; +import org.smartregister.chw.hf.interactor.AncMedicalHistoryInteractor; import java.util.List; @@ -20,6 +22,11 @@ public static void startMe(Activity activity, MemberObject memberObject) { activity.startActivity(intent); } + @Override + public void initializePresenter() { + presenter = new BaseAncMedicalHistoryPresenter(new AncMedicalHistoryInteractor(), this, memberObject.getBaseEntityId()); + } + @Override public View renderView(List visits) { super.renderView(visits); diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncMedicalHistoryActivityFlv.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncMedicalHistoryActivityFlv.java index b475b4b94..0df637f53 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncMedicalHistoryActivityFlv.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncMedicalHistoryActivityFlv.java @@ -1,17 +1,38 @@ package org.smartregister.chw.hf.activity; +import android.app.Activity; import android.content.Context; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.style.BulletSpan; +import android.text.style.StyleSpan; import android.view.View; +import android.widget.LinearLayout; import android.widget.TextView; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.WordUtils; +import org.joda.time.DateTime; +import org.joda.time.Days; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; import org.smartregister.chw.core.activity.DefaultAncMedicalHistoryActivityFlv; import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; import java.text.MessageFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Locale; import java.util.Map; +import timber.log.Timber; + public class AncMedicalHistoryActivityFlv extends DefaultAncMedicalHistoryActivityFlv { + private final StyleSpan boldSpan = new StyleSpan(android.graphics.Typeface.BOLD); @Override protected void processAncCard(String has_card, Context context) { @@ -26,9 +47,9 @@ protected void processHealthFacilityVisit(List> hf_visits, C if (hf_visits != null && hf_visits.size() > 0) { linearLayoutHealthFacilityVisit.setVisibility(View.VISIBLE); - int x = 0; + int x = 1; for (Map vals : hf_visits) { - View view = inflater.inflate(R.layout.medial_history_anc_visit, null); + View view = inflater.inflate(R.layout.medical_history_anc_visit, null); TextView tvTitle = view.findViewById(R.id.title); TextView tvTests = view.findViewById(R.id.tests); @@ -39,7 +60,7 @@ protected void processHealthFacilityVisit(List> hf_visits, C view.findViewById(R.id.ifa_received).setVisibility(View.GONE); - tvTitle.setText(MessageFormat.format(context.getString(R.string.anc_visit_date), (hf_visits.size() - x), vals.get("anc_visit_date"))); + tvTitle.setText(MessageFormat.format(context.getString(R.string.anc_visit_date), (x), vals.get("anc_hf_visit_date"))); tvTests.setText(MessageFormat.format(context.getString(R.string.tests_done_details), vals.get("tests_done"))); linearLayoutHealthFacilityVisitDetails.addView(view, 0); @@ -48,4 +69,180 @@ protected void processHealthFacilityVisit(List> hf_visits, C } } } + + @Override + public void processViewData(List visits, Context context) { + + if (visits.size() > 0) { + + int days = 0; + String has_card = "No"; + List> hfVisitsMaps = new ArrayList<>(); + + int x = 0; + while (x < visits.size()) { + + // the first object in this list is the days difference + if (x == 0) { + days = Days.daysBetween(new DateTime(visits.get(visits.size() - 1).getDate()), new DateTime()).getDays(); + } + + // anc card + if (has_card.equalsIgnoreCase("No")) { + List details = visits.get(x).getVisitDetails().get("anc_card"); + if (details != null && StringUtils.isNotBlank(details.get(0).getHumanReadable())) { + has_card = details.get(0).getHumanReadable(); + } + + } + + + String[] hf_params = {"gest_age", "medical_surgical_history", "other_medical_surgical_history", "ctc_number", "gravida", "parity", + "glucose_in_urine", "reason_for_not_conducting_glucose_in_urine_test", "other_reason_for_not_conducting_glucose_in_urine_test", "protein_in_urine", "reason_for_not_conducting_protein_in_urine_test", "other_reason_for_not_conducting_protein_in_urine_test", "blood_group", "reason_for_not_conducting_blood_group_test", "other_reason_for_not_conducting_blood_group_test", "rh_factor", "hb_level_test", "hb_level", "reason_for_not_conducting_hb_test", "other_reason_hb_test_not_conducted", "blood_for_glucose_test", "type_of_blood_for_glucose_test", "blood_for_glucose", "hiv", "reason_for_not_conducting_hiv_test", "other_reason_for_not_conducting_hiv_test", "hiv_counselling_before_testing", "hiv_counselling_after_testing", "syphilis", "reason_for_not_conducting_syphilis_test", "other_reason_for_not_conducting_syphilis_test", "syphilis_treatment", "hepatitis", "prescribe_arv_hepb_at_above_twenty_eight", "reason_for_not_conducting_hepatitis_test", "other_reason_for_not_conducting_hepatitis_test", "other_stds", "other_stds_treatment", "reason_for_not_giving_medication_for_other_stds", "other_reason_for_not_giving_medication_for_other_stds", + "weight", "height", "systolic", "diastolic", "pulse_rate", "temperature", "fundal_height", "abdominal_scars", "abdominal_movement_with_respiration", "abdominal_contour", "fundal_height", "lie", "presentation", "fetal_heart_rate", "abnormal_vaginal_discharge", "vaginal_sores", "vaginal_swelling", + "tt_vaccination", "tt_vaccination_type", + "client_on_malaria_medication", "mRDT_for_malaria", "reason_for_not_conducting_malaria_test", "other_reason_for_not_conducting_malaria_test", "llin_provision", "reason_for_not_providing_llin", "other_reason_llin_not_given", + "delivery_place", "name_of_hf", "transport", "birth_companion", "emergency_funds", "household_support", "blood_donor", + "next_facility_visit_date"}; + extractHFVisit(visits, hf_params, hfVisitsMaps, x, context); + + x++; + } + + processLastVisit(days, context); + processAncCard(has_card, context); + processFacilityVisit(hfVisitsMaps, visits, context); + } + } + + private void extractHFVisit(List sourceVisits, String[] hf_params, List> hf_visits, int iteration, Context context) { + // get the hf details + LinkedHashMap map = new LinkedHashMap<>(); + for (String param : hf_params) { + try { + List details = sourceVisits.get(iteration).getVisitDetails().get(param); + map.put(param, getTexts(context, details)); + } catch (Exception e) { + e.printStackTrace(); + } + + } + hf_visits.add(map); + } + + + private void processLastVisit(int days, Context context) { + linearLayoutLastVisit.setVisibility(View.VISIBLE); + if (days < 1) { + customFontTextViewLastVisit.setText(org.smartregister.chw.core.R.string.less_than_twenty_four); + } else { + customFontTextViewLastVisit.setText(StringUtils.capitalize(MessageFormat.format(context.getString(org.smartregister.chw.core.R.string.days_ago), String.valueOf(days)))); + } + } + + + protected void processFacilityVisit(List> hfVisitsDetails, List visits, Context context) { + if (hfVisitsDetails != null && hfVisitsDetails.size() > 0) { + linearLayoutHealthFacilityVisit.setVisibility(View.VISIBLE); + + int x = 0; + for (Map vals : hfVisitsDetails) { + View view = inflater.inflate(R.layout.medical_history_anc_visit, null); + + TextView tvTitle = view.findViewById(R.id.title); + TextView tvEdit = view.findViewById(R.id.textview_edit); + LinearLayout visitDetailsLayout = view.findViewById(R.id.visit_details_layout); + + + // Updating visibility of EDIT button if the visit is the last visit + if (x == visits.size() - 1) + tvEdit.setVisibility(View.VISIBLE); + else + tvEdit.setVisibility(View.GONE); + + + tvTitle.setText(MessageFormat.format(context.getString(org.smartregister.chw.core.R.string.anc_visit_date), x + 1, new SimpleDateFormat("dd-MM-yyyy HH:mm:ss", Locale.getDefault()).format(visits.get(x).getDate()))); + + + tvEdit.setOnClickListener(view1 -> { + ((Activity) context).finish(); + Visit visit = visits.get(0); + if (visit != null && visit.getVisitType().equalsIgnoreCase(Constants.Events.ANC_FIRST_FACILITY_VISIT) && visit.getBaseEntityId() != null) + AncFirstFacilityVisitActivity.startMe((Activity) context, visit.getBaseEntityId(), true); + else if (visit != null && visit.getVisitType().equalsIgnoreCase(Constants.Events.ANC_RECURRING_FACILITY_VISIT) && visit.getBaseEntityId() != null) + AncRecurringFacilityVisitActivity.startMe((Activity) context, visit.getBaseEntityId(), true); + }); + + + for (LinkedHashMap.Entry entry : vals.entrySet()) { + TextView visitDetailTv = new TextView(context); + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams + ((int) LinearLayout.LayoutParams.MATCH_PARENT, (int) LinearLayout.LayoutParams.WRAP_CONTENT); + + visitDetailTv.setLayoutParams(params); + float scale = context.getResources().getDisplayMetrics().density; + int dpAsPixels = (int) (10 * scale + 0.5f); + visitDetailTv.setPadding(dpAsPixels, 0, 0, 0); + visitDetailsLayout.addView(visitDetailTv); + + + try { + int resource = context.getResources().getIdentifier("anc_" + entry.getKey(), "string", context.getPackageName()); + evaluateView(context, vals, visitDetailTv, entry.getKey(), resource, ""); + } catch (Exception e) { + Timber.e(e); + } + } + + + linearLayoutHealthFacilityVisitDetails.addView(view, 0); + + x++; + } + } + } + + private String getMapValue(Map map, String key) { + if (map.containsKey(key)) { + return map.get(key); + } + return ""; + } + + private void evaluateView(Context context, Map vals, TextView tv, String valueKey, int viewTitleStringResource, String valuePrefixInStringResources) { + if (StringUtils.isNotBlank(getMapValue(vals, valueKey))) { + SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(); + spannableStringBuilder.append(context.getString(viewTitleStringResource), boldSpan, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE).append("\n"); + + String stringValue = getMapValue(vals, valueKey); + String[] stringValueArray; + if (stringValue.contains(",")) { + stringValueArray = stringValue.split(","); + for (String value : stringValueArray) { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, value.trim()) + "\n", new BulletSpan(10), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + } + } else { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, stringValue)).append("\n"); + } + tv.setText(spannableStringBuilder); + } else { + tv.setVisibility(View.GONE); + } + } + + private String getStringResource(Context context, String prefix, String resourceName) { + int resourceId = context.getResources(). + getIdentifier(prefix + resourceName.trim(), "string", context.getPackageName()); + try { + return context.getString(resourceId); + } catch (Exception e) { + Timber.e(e); + if (resourceName.contains("_")) { + resourceName = resourceName.replace("_", " "); + resourceName = WordUtils.capitalize(resourceName); + } + return resourceName; + } + } + } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncMemberProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncMemberProfileActivity.java index 1ba2fc116..d0358a4e0 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncMemberProfileActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncMemberProfileActivity.java @@ -1,49 +1,97 @@ package org.smartregister.chw.hf.activity; +import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; +import static org.smartregister.chw.core.utils.Utils.updateToolbarTitle; +import static org.smartregister.chw.hf.utils.Constants.Events.ANC_FIRST_FACILITY_VISIT; +import static org.smartregister.chw.hf.utils.Constants.Events.ANC_RECURRING_FACILITY_VISIT; +import static org.smartregister.chw.hf.utils.Constants.PartnerRegistrationConstants.INTENT_BASE_ENTITY_ID; +import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; +import static org.smartregister.chw.hf.utils.JsonFormUtils.getAutoPopulatedJsonEditFormString; +import static org.smartregister.family.util.DBConstants.KEY.ENTITY_TYPE; +import static org.smartregister.util.JsonFormUtils.STEP1; + import android.app.Activity; import android.content.ContentValues; import android.content.Intent; import android.os.Bundle; +import android.text.format.DateFormat; import android.view.Menu; +import android.view.MenuItem; import android.view.View; +import android.widget.ImageView; +import android.widget.RelativeLayout; +import android.widget.TextView; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.rey.material.widget.Button; import org.apache.commons.lang3.StringUtils; +import org.jeasy.rules.api.Rules; import org.json.JSONArray; +import org.json.JSONException; import org.json.JSONObject; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.domain.Visit; import org.smartregister.chw.anc.util.Constants; import org.smartregister.chw.anc.util.DBConstants; import org.smartregister.chw.anc.util.NCUtils; import org.smartregister.chw.core.activity.CoreAncMemberProfileActivity; import org.smartregister.chw.core.application.CoreChwApplication; +import org.smartregister.chw.core.model.CoreAllClientsMemberModel; import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.HomeVisitUtil; +import org.smartregister.chw.core.utils.UpdateDetailsUtil; +import org.smartregister.chw.core.utils.VisitSummary; +import org.smartregister.chw.hf.HealthFacilityApplication; import org.smartregister.chw.hf.R; import org.smartregister.chw.hf.adapter.ReferralCardViewAdapter; +import org.smartregister.chw.hf.dao.FamilyDao; +import org.smartregister.chw.hf.dao.HfAncDao; +import org.smartregister.chw.hf.interactor.AncMemberProfileInteractor; +import org.smartregister.chw.hf.model.FamilyDetailsModel; import org.smartregister.chw.hf.model.FamilyProfileModel; +import org.smartregister.chw.hf.presenter.AncMemberProfilePresenter; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.chw.hiv.dao.HivDao; +import org.smartregister.chw.hivst.dao.HivstDao; +import org.smartregister.chw.ld.dao.LDDao; +import org.smartregister.chw.pmtct.dao.PmtctDao; import org.smartregister.clientandeventmodel.Event; import org.smartregister.commonregistry.AllCommonsRepository; +import org.smartregister.commonregistry.CommonPersonObject; import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.commonregistry.CommonRepository; import org.smartregister.domain.AlertStatus; import org.smartregister.domain.Task; +import org.smartregister.family.contract.FamilyProfileContract; import org.smartregister.family.domain.FamilyEventClient; import org.smartregister.family.interactor.FamilyProfileInteractor; import org.smartregister.family.util.JsonFormUtils; import org.smartregister.family.util.Utils; +import org.smartregister.opd.utils.OpdDbConstants; import org.smartregister.repository.AllSharedPreferences; +import org.smartregister.view.customcontrols.CustomFontTextView; +import java.text.MessageFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; import java.util.Date; +import java.util.HashMap; +import java.util.Locale; import java.util.Set; import timber.log.Timber; -import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; - public class AncMemberProfileActivity extends CoreAncMemberProfileActivity { private CommonPersonObjectClient commonPersonObjectClient; + private boolean hivPositive; + private boolean isKnownOnArt; + private String ctcNumber; + private String partnerBaseEntityId; + private RelativeLayout processVisitLayout; public static void startMe(Activity activity, String baseEntityID) { Intent intent = new Intent(activity, AncMemberProfileActivity.class); @@ -55,7 +103,7 @@ public static void startMe(Activity activity, String baseEntityID) { @Override protected void onCreation() { super.onCreation(); - findViewById(R.id.record_visit_panel).setVisibility(View.GONE); + findViewById(R.id.record_visit_panel).setVisibility(View.VISIBLE); setCommonPersonObjectClient(getClientDetailsByBaseEntityID(baseEntityID)); } @@ -69,6 +117,11 @@ public void initializeFloatingMenu() { } } + @Override + protected void registerPresenter() { + presenter = new AncMemberProfilePresenter(this, new AncMemberProfileInteractor(this), memberObject); + } + @Override public boolean usesPregnancyRiskProfileLayout() { return true; @@ -88,10 +141,8 @@ public void setFamilyStatus(AlertStatus status) { @Override public void setFamilyLocation() { - if (!StringUtils.isBlank(getMemberGPS())) { - view_family_location_row.setVisibility(View.VISIBLE); - rlFamilyLocation.setVisibility(View.VISIBLE); - } + view_family_location_row.setVisibility(View.GONE); + rlFamilyLocation.setVisibility(View.GONE); } private String getMemberGPS() { @@ -101,11 +152,25 @@ private String getMemberGPS() { @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); - menu.findItem(R.id.anc_danger_signs_outcome).setVisible(true); + menu.findItem(R.id.anc_danger_signs_outcome).setVisible(false); menu.findItem(R.id.action_anc_registration).setVisible(false); - menu.findItem(R.id.action_remove_member).setVisible(false); - menu.findItem(R.id.action_pregnancy_out_come).setVisible(false); + menu.findItem(R.id.action_remove_member).setVisible(true); + menu.findItem(R.id.action_pregnancy_out_come).setVisible(!HfAncDao.isClientClosed(baseEntityID)); menu.findItem(R.id.action_malaria_diagnosis).setVisible(false); + + if (HealthFacilityApplication.getApplicationFlavor().hasHivst()) { + int age = memberObject.getAge(); + menu.findItem(R.id.action_hivst_registration).setVisible(!HivstDao.isRegisteredForHivst(baseEntityID) && age >= 15); + } + + if (HealthFacilityApplication.getApplicationFlavor().hasLD()) { + menu.findItem(R.id.action_ld_registration).setVisible(memberObject.getGestationAge() >= 28 && !LDDao.isRegisteredForLD(baseEntityID)); + } + partnerBaseEntityId = HfAncDao.getPartnerBaseEntityId(memberObject.getBaseEntityId()); + if (StringUtils.isBlank(partnerBaseEntityId)) { + menu.findItem(R.id.action_anc_partner_followup_referral).setVisible(true); + } + menu.findItem(R.id.action_pmtct_register).setVisible(!PmtctDao.isRegisteredForPmtct(baseEntityID) && (hivPositive || HivDao.isRegisteredForHiv(baseEntityID) || HfAncDao.getHivStatus(baseEntityID).equalsIgnoreCase("positive"))); return true; } @@ -138,11 +203,24 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { } } else if (encounterType.equals(CoreConstants.EventType.ANC_DANGER_SIGNS_OUTCOME)) { ancMemberProfilePresenter().createAncDangerSignsOutcomeEvent(Utils.getAllSharedPreferences(), jsonString, baseEntityID); + } else if (encounterType.equals(CoreConstants.EventType.ANC_PARTNER_COMMUNITY_FOLLOWUP_REFERRAL)) { + ((AncMemberProfilePresenter) presenter()).createPartnerFollowupReferralEvent(Utils.getAllSharedPreferences(), jsonString, baseEntityID); + } else if (encounterType.equals(CoreConstants.EventType.ANC_PARTNER_TESTING)) { + ((AncMemberProfilePresenter) presenter()).savePartnerTestingEvent(Utils.getAllSharedPreferences(), jsonString, baseEntityID); + displayToast(R.string.recorded_partner_testing_results); + setupViews(); + } else if (form.getString(JsonFormUtils.ENCOUNTER_TYPE).equals(org.smartregister.chw.core.utils.Utils.metadata().familyRegister.updateEventType)) { + FamilyEventClient familyEventClient = new CoreAllClientsMemberModel().processJsonForm(jsonString, UpdateDetailsUtil.getFamilyBaseEntityId(getCommonPersonObjectClient())); + JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), STEP1, SYNC_LOCATION_ID); + familyEventClient.getEvent().setLocationId(CoreJsonFormUtils.getSyncLocationUUIDFromDropdown(syncLocationField)); + familyEventClient.getEvent().setEntityType(CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT); + new FamilyProfileInteractor().saveRegistration(familyEventClient, jsonString, true, (FamilyProfileContract.InteractorCallBack) ancMemberProfilePresenter()); } } catch (Exception e) { Timber.e(e, "AncMemberProfileActivity -- > onActivityResult"); } } + invalidateOptionsMenu(); } @Override @@ -177,16 +255,195 @@ public void openFamilyDueServices() { startActivity(intent); } + @Override + protected void startLDRegistration() { + try { + LDRegistrationFormActivity.startMe(this, baseEntityID, false, memberObject.getFullName(), String.valueOf(memberObject.getGestationAge())); + } catch (Exception e) { + Timber.e(e); + } + } + @Override public void setupViews() { super.setupViews(); + updateToolbarTitle(this, org.smartregister.chw.core.R.id.toolbar_title, memberObject.getFamilyName()); + if (!HfAncDao.isClientClosed(baseEntityID)) { + getButtonStatus(); + try { + VisitUtils.processVisits(); + } catch (Exception e) { + Timber.e(e); + } + Visit firstVisit = getVisit(ANC_FIRST_FACILITY_VISIT); + Visit lastVisit = getVisit(ANC_RECURRING_FACILITY_VISIT); + try { + setHivPositive(firstVisit, lastVisit); + } catch (JSONException e) { + e.printStackTrace(); + } + if ((firstVisit == null || HfAncDao.hasNoFollowups(baseEntityID)) && HfAncDao.getVisitNumber(baseEntityID) == 0) { + textview_record_anc_visit.setText(R.string.record_anc_first_visit); + } else { + textview_record_anc_visit.setText(R.string.record_anc_followup_visit); + } + + if (lastVisit == null) { + if (firstVisit != null) { + checkVisitStatus(firstVisit); + } + } else { + checkVisitStatus(lastVisit); + } + } else { + layoutRecordView.setVisibility(View.GONE); + pregnancyRiskLabel.setTextSize(12); + } + if (baseAncFloatingMenu != null) { FloatingActionButton floatingActionButton = baseAncFloatingMenu.findViewById(R.id.anc_fab); if (floatingActionButton != null) floatingActionButton.setImageResource(R.drawable.floating_call); } + + RelativeLayout partnerView = findViewById(R.id.rlPartnerView); + RelativeLayout registrationDetails = findViewById(R.id.rlRegistrationDetails); + RelativeLayout partnerTestingView = findViewById(R.id.rlPartnerTesting); + RelativeLayout partnerTestingHistoryView = findViewById(R.id.rlPartnerTestingHistory); + CustomFontTextView tvPartnerProfileView = findViewById(R.id.text_view_partner_profile); + CustomFontTextView tvPartnerDetails = findViewById(R.id.partner_details); + ImageView goToProfileBtn = findViewById(R.id.partner_arrow_image); + Button registerBtn = findViewById(R.id.register_partner_btn); + Button testingBtn = findViewById(R.id.test_partner_btn); + View partnerTestingBottomView = findViewById(R.id.partner_testing_row); + View partnerBottomView = findViewById(R.id.view_partner_row); + + findViewById(R.id.view_registration_details_row).setVisibility(View.VISIBLE); + registrationDetails.setVisibility(View.VISIBLE); + partnerView.setVisibility(View.VISIBLE); + partnerBottomView.setVisibility(View.VISIBLE); + partnerTestingHistoryView.setVisibility(View.VISIBLE); + + registrationDetails.setOnClickListener(this); + partnerView.setOnClickListener(this); + partnerTestingHistoryView.setOnClickListener(this); + registerBtn.setOnClickListener(this); + testingBtn.setOnClickListener(this); + partnerBaseEntityId = HfAncDao.getPartnerBaseEntityId(memberObject.getBaseEntityId()); + if (StringUtils.isNotBlank(partnerBaseEntityId)) { + try { + CommonPersonObjectClient partnerClient = getClientDetailsByBaseEntityID(partnerBaseEntityId); + HashMap clientDetails = (HashMap) partnerClient.getColumnmaps(); + tvPartnerProfileView.setText(R.string.view_partner_profile); + tvPartnerDetails.setVisibility(View.VISIBLE); + registerBtn.setVisibility(View.GONE); + goToProfileBtn.setVisibility(View.VISIBLE); + tvPartnerDetails.setText(MessageFormat.format("{0} {1} {2}", clientDetails.get("first_name"), clientDetails.get("middle_name"), clientDetails.get("last_name") != null ? clientDetails.get("last_name") : "")); + } catch (Exception e) { + Timber.e(e); + } + } + boolean retestPartnerAt32 = ((memberObject.getGestationAge() >= 32 && HfAncDao.getPartnerHivStatus(memberObject.getBaseEntityId()).equalsIgnoreCase("negative")) && !HfAncDao.isPartnerHivTestConductedAtWk32(memberObject.getBaseEntityId())); + boolean partnerTestedAll = (HfAncDao.isPartnerTestedForHiv(memberObject.getBaseEntityId()) && HfAncDao.isPartnerTestedForSyphilis(memberObject.getBaseEntityId()) && HfAncDao.isPartnerTestedForHepatitis(memberObject.getBaseEntityId())); + // HfAncDao.getPartnerHivTestNumber(memberObject.getBaseEntityId()) == 0 + if (HfAncDao.isPartnerRegistered(memberObject.getBaseEntityId()) && (!partnerTestedAll || retestPartnerAt32)) { + partnerTestingView.setVisibility(View.VISIBLE); + partnerTestingBottomView.setVisibility(View.VISIBLE); + } else { + partnerTestingView.setVisibility(View.GONE); + partnerTestingBottomView.setVisibility(View.GONE); + } + + if (HfAncDao.isPartnerRegistered(memberObject.getBaseEntityId()) && (!HfAncDao.getPartnerOtherStdsStatus(memberObject.getBaseEntityId()).equalsIgnoreCase("null") || HfAncDao.isPartnerTestedForHiv(memberObject.getBaseEntityId()) || HfAncDao.isPartnerTestedForSyphilis(memberObject.getBaseEntityId()) || HfAncDao.isPartnerTestedForHepatitis(memberObject.getBaseEntityId()))) { + partnerTestingHistoryView.setVisibility(View.VISIBLE); + } else { + partnerTestingHistoryView.setVisibility(View.GONE); + } + + this.findViewById(R.id.family_anc_head).setVisibility(View.GONE); + this.findViewById(R.id.primary_anc_caregiver).setVisibility(View.GONE); + + } + + private void setHivPositive(Visit firstVisit, Visit lastVisit) throws JSONException { + hivPositive = false; + ctcNumber = null; + isKnownOnArt = false; + JSONObject jsonObject = null; + if (firstVisit != null) { + jsonObject = new JSONObject(firstVisit.getJson()); + } + if (lastVisit != null) { + jsonObject = new JSONObject(lastVisit.getJson()); + } + + if (jsonObject != null) { + JSONArray obs = jsonObject.getJSONArray("obs"); + int obsSize = obs.length(); + for (int i = 0; i < obsSize; i++) { + JSONObject checkObj = obs.getJSONObject(i); + if (checkObj.getString("fieldCode").equalsIgnoreCase("known_on_art") && checkObj.getString("values").contains("true")) { + hivPositive = true; + isKnownOnArt = true; + } else if (checkObj.getString("fieldCode").equalsIgnoreCase("hiv")) { + JSONArray values = checkObj.getJSONArray("values"); + if (values.getString(0).equalsIgnoreCase("positive")) { + hivPositive = true; + } + } else if (checkObj.getString("fieldCode").equalsIgnoreCase("ctc_number")) { + JSONArray values = checkObj.getJSONArray("values"); + ctcNumber = values.getString(0); + } + } + } + + } + + private void checkVisitStatus(Visit visit) { + processVisitLayout = findViewById(R.id.rlProcessVisitBtn); + processVisitLayout.setVisibility(View.GONE); + boolean visitDone = visit.getProcessed(); + boolean formsCompleted = VisitUtils.isAncVisitComplete(visit); + if (!visitDone) { + showVisitInProgress(); + textViewUndo.setVisibility(View.GONE); + textViewAncVisitNot.setVisibility(View.GONE); + if (formsCompleted) { + showCompleteVisit(visit); + } + } else { + getButtonStatus(); + } + } + + private void showVisitInProgress() { + layoutRecordView.setVisibility(View.GONE); + tvEdit.setVisibility(View.VISIBLE); + layoutNotRecordView.setVisibility(View.VISIBLE); + textViewNotVisitMonth.setText(getContext().getString(R.string.visit_in_progress, "ANC")); + imageViewCross.setImageResource(R.drawable.activityrow_visit_in_progress); + } + + private void showCompleteVisit(Visit visit) { + TextView processVisitBtn = findViewById(R.id.textview_process_visit); + processVisitBtn.setOnClickListener(v -> { + try { + VisitUtils.manualProcessVisit(visit, AncMemberProfileActivity.this); + //reload views after visit is processed + setupViews(); + presenter().refreshProfileBottom(); + if (!baseEntityID.isEmpty()) { + memberObject = getMemberObject(baseEntityID); + ((AncMemberProfilePresenter) presenter()).refreshProfileTopSection(memberObject); + } + } catch (Exception e) { + Timber.e(e); + } + }); + processVisitLayout.setVisibility(View.VISIBLE); } + @Override public void setClientTasks(Set taskList) { if (notificationAndReferralRecyclerView != null && taskList.size() > 0) { @@ -219,9 +476,276 @@ protected void onCreate(Bundle savedInstanceState) { @Override protected void onResume() { super.onResume(); + setupViews(); + if (!baseEntityID.isEmpty()) { + memberObject = getMemberObject(baseEntityID); + ((AncMemberProfilePresenter) presenter()).refreshProfileTopSection(memberObject); + } ancMemberProfilePresenter().fetchTasks(); if (notificationAndReferralRecyclerView != null && notificationAndReferralRecyclerView.getAdapter() != null) { notificationAndReferralRecyclerView.getAdapter().notifyDataSetChanged(); } + setMemberGA(memberObject.getGestationAge() + ""); + } + + @Override + public void onClick(View view) { + super.onClick(view); + int id = view.getId(); + if (id == R.id.textview_record_visit || id == R.id.textview_record_reccuring_visit) { + Visit firstVisit = getVisit(ANC_FIRST_FACILITY_VISIT); + if ((firstVisit == null || HfAncDao.hasNoFollowups(baseEntityID)) && HfAncDao.getVisitNumber(baseEntityID) == 0) { + AncFirstFacilityVisitActivity.startMe(this, memberObject.getBaseEntityId(), false); + } else { + AncRecurringFacilityVisitActivity.startMe(this, memberObject.getBaseEntityId(), false); + } + } else if (id == R.id.textview_edit) { + Visit lastVisit = getVisit(ANC_RECURRING_FACILITY_VISIT); + if (lastVisit == null) + AncFirstFacilityVisitActivity.startMe(this, memberObject.getBaseEntityId(), true); + else + AncRecurringFacilityVisitActivity.startMe(this, memberObject.getBaseEntityId(), true); + } else if (id == R.id.rlPartnerView || id == R.id.register_partner_btn) { + if (StringUtils.isNotBlank(partnerBaseEntityId)) { + FamilyDetailsModel familyDetailsModel = FamilyDao.getFamilyDetail(partnerBaseEntityId); + + CommonPersonObjectClient commonPersonObjectClient = getClientDetailsByBaseEntityID(partnerBaseEntityId); + commonPersonObjectClient.setDetails(commonPersonObjectClient.getColumnmaps()); + String entityType = commonPersonObjectClient.getColumnmaps().get(ENTITY_TYPE); + Intent intent; + if (CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT.equals(entityType)) { + intent = new Intent(this, AllClientsMemberProfileActivity.class); + } else { + intent = new Intent(this, FamilyOtherMemberProfileActivity.class); + } + intent.putExtras(new Bundle()); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.BASE_ENTITY_ID, partnerBaseEntityId); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_BASE_ENTITY_ID, familyDetailsModel.getBaseEntityId()); + intent.putExtra(CoreConstants.INTENT_KEY.CHILD_COMMON_PERSON, commonPersonObjectClient); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_HEAD, familyDetailsModel.getFamilyHead()); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.PRIMARY_CAREGIVER, familyDetailsModel.getPrimaryCareGiver()); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_NAME, familyDetailsModel.getFamilyName()); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.VILLAGE_TOWN, familyDetailsModel.getVillageTown()); + intent.putExtra(CoreConstants.INTENT_KEY.TOOLBAR_TITLE, String.format(getString(R.string.return_to_anc_profile), memberObject.getFirstName())); + startActivity(intent); + } else { + Intent intent = new Intent(this, PartnerRegistrationActivity.class); + intent.putExtra(INTENT_BASE_ENTITY_ID, memberObject.getBaseEntityId()); + startActivity(intent); + setupViews(); + } + } else if (id == R.id.rlPartnerTestingHistory) { + AncPartnerTestingHistoryActivity.startMe(this, memberObject); + } else if (id == R.id.test_partner_btn) { + ((AncMemberProfilePresenter) presenter()).startPartnerTestingForm(memberObject); + } else if (id == R.id.rlRegistrationDetails) { + AncRegistrationDetailsActivity.startMe(this, memberObject); + } + } + + private void getButtonStatus() { + openVisitMonthView(); + textViewUndo.setVisibility(View.GONE); + boolean pmtctPendingRegistration = HfAncDao.getHivStatus(baseEntityID).equalsIgnoreCase("positive") && !PmtctDao.isRegisteredForPmtct(baseEntityID); + + Rules rules = CoreChwApplication.getInstance().getRulesEngineHelper().rules(CoreConstants.RULE_FILE.ANC_HOME_VISIT); + Visit lastNotDoneVisit = AncLibrary.getInstance().visitRepository().getLatestVisit(baseEntityID, org.smartregister.chw.anc.util.Constants.EVENT_TYPE.ANC_HOME_VISIT_NOT_DONE); + if (lastNotDoneVisit != null) { + Visit lastNotDoneVisitUndo = AncLibrary.getInstance().visitRepository().getLatestVisit(baseEntityID, org.smartregister.chw.anc.util.Constants.EVENT_TYPE.ANC_HOME_VISIT_NOT_DONE_UNDO); + if (lastNotDoneVisitUndo != null + && lastNotDoneVisitUndo.getDate().after(lastNotDoneVisit.getDate())) { + lastNotDoneVisit = null; + } + } + Visit latestVisit = getVisit(ANC_RECURRING_FACILITY_VISIT); + if (latestVisit == null) + latestVisit = getVisit(ANC_FIRST_FACILITY_VISIT); + String visitDate = latestVisit != null ? new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(latestVisit.getDate()) : null; + String lastVisitNotDone = lastNotDoneVisit != null ? new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).format(lastNotDoneVisit.getDate()) : null; + + VisitSummary visitSummary = HomeVisitUtil.getAncVisitStatus(this, rules, visitDate, lastVisitNotDone, getDateCreated()); + + String visitStatus = visitSummary.getVisitStatus(); + String monthString = null; + if (latestVisit != null) { + Calendar cal = Calendar.getInstance(); + int offset = cal.getTimeZone().getOffset(cal.getTimeInMillis()); + + Long longDate = latestVisit.getDate().getTime(); + Date date = new Date(longDate - (long) offset); + monthString = (String) DateFormat.format("MMMM", date); + } + + + if (visitStatus.equalsIgnoreCase(CoreConstants.VISIT_STATE.OVERDUE) && !pmtctPendingRegistration) { + textview_record_anc_visit.setBackgroundResource(org.smartregister.chw.core.R.drawable.record_btn_selector_overdue); + getLayoutVisibility(); + } else if ((visitStatus.equalsIgnoreCase(CoreConstants.VISIT_STATE.DUE) || visitStatus.equalsIgnoreCase("VISIT_THIS_MONTH")) && !pmtctPendingRegistration) { + textview_record_anc_visit.setBackgroundResource(org.smartregister.chw.core.R.drawable.record_btn_anc_selector); + getLayoutVisibility(); + } else if (visitStatus.equalsIgnoreCase(CoreConstants.VISIT_STATE.NOT_VISIT_THIS_MONTH) && !pmtctPendingRegistration) { + textViewUndo.setVisibility(View.VISIBLE); + textViewUndo.setText(getString(org.smartregister.chw.opensrp_chw_anc.R.string.undo)); + record_reccuringvisit_done_bar.setVisibility(View.GONE); + openVisitMonthView(); + } else if (visitStatus.equalsIgnoreCase("LESS_TWENTY_FOUR") && !pmtctPendingRegistration) { + layoutNotRecordView.setVisibility(View.VISIBLE); + textViewNotVisitMonth.setText(getContext().getString(org.smartregister.chw.core.R.string.anc_visit_done, monthString)); + tvEdit.setVisibility(View.GONE); + imageViewCross.setImageResource(org.smartregister.chw.core.R.drawable.activityrow_visited); + } else if (pmtctPendingRegistration) { + layoutNotRecordView.setVisibility(View.VISIBLE); + textViewNotVisitMonth.setText(getContext().getString(R.string.pmtct_pending_registration)); + tvEdit.setText(getContext().getString(R.string.register_button_text)); + tvEdit.setVisibility(View.VISIBLE); + tvEdit.setOnClickListener(v -> startPmtctRegistration()); + imageViewCross.setImageResource(org.smartregister.chw.core.R.drawable.activityrow_notvisited); + } + } + + @Override + public void setPregnancyRiskLabel(String pregnancyRiskLevel) { + if (pregnancyRiskLabel != null && StringUtils.isNotBlank(pregnancyRiskLevel)) { + int labelTextColor; + int background; + String labelText; + switch (pregnancyRiskLevel) { + case Constants.HOME_VISIT.PREGNANCY_RISK_LOW: + labelTextColor = context().getColorResource(org.smartregister.chw.opensrp_chw_anc.R.color.low_risk_text_green); + background = org.smartregister.chw.opensrp_chw_anc.R.drawable.low_risk_label; + labelText = getContext().getString(org.smartregister.chw.opensrp_chw_anc.R.string.low_pregnancy_risk); + break; + case Constants.HOME_VISIT.PREGNANCY_RISK_MEDIUM: + labelTextColor = context().getColorResource(org.smartregister.chw.opensrp_chw_anc.R.color.medium_risk_text_orange); + background = org.smartregister.chw.opensrp_chw_anc.R.drawable.medium_risk_label; + labelText = getContext().getString(org.smartregister.chw.opensrp_chw_anc.R.string.medium_pregnancy_risk); + break; + case Constants.HOME_VISIT.PREGNANCY_RISK_HIGH: + labelTextColor = context().getColorResource(org.smartregister.chw.opensrp_chw_anc.R.color.high_risk_text_red); + background = org.smartregister.chw.opensrp_chw_anc.R.drawable.high_risk_label; + labelText = getContext().getString(org.smartregister.chw.opensrp_chw_anc.R.string.high_pregnancy_risk); + break; + case org.smartregister.chw.hf.utils.Constants.Visits.TERMINATED: + labelTextColor = context().getColorResource(org.smartregister.chw.opensrp_chw_anc.R.color.high_risk_text_red); + background = org.smartregister.chw.opensrp_chw_anc.R.drawable.high_risk_label; + labelText = "Services Ended"; + break; + default: + labelTextColor = context().getColorResource(org.smartregister.chw.opensrp_chw_anc.R.color.default_risk_text_black); + background = org.smartregister.chw.opensrp_chw_anc.R.drawable.risk_label; + labelText = getContext().getString(org.smartregister.chw.opensrp_chw_anc.R.string.low_pregnancy_risk); + break; + } + pregnancyRiskLabel.setVisibility(View.GONE); + pregnancyRiskLabel.setText(labelText); + pregnancyRiskLabel.setTextColor(labelTextColor); + pregnancyRiskLabel.setBackgroundResource(background); + } + } + + @Override + protected void displayView() { + Visit lastAncHomeVisitNotDoneEvent = getVisit(Constants.EVENT_TYPE.ANC_HOME_VISIT_NOT_DONE); + Visit lastAncHomeVisitNotDoneUndoEvent = getVisit(Constants.EVENT_TYPE.ANC_HOME_VISIT_NOT_DONE_UNDO); + + if (lastAncHomeVisitNotDoneEvent != null && lastAncHomeVisitNotDoneUndoEvent != null && + lastAncHomeVisitNotDoneUndoEvent.getDate().before(lastAncHomeVisitNotDoneEvent.getDate()) + && ancHomeVisitNotDoneEvent(lastAncHomeVisitNotDoneEvent)) { + setVisitViews(); + } else if (lastAncHomeVisitNotDoneUndoEvent == null && lastAncHomeVisitNotDoneEvent != null && ancHomeVisitNotDoneEvent(lastAncHomeVisitNotDoneEvent)) { + setVisitViews(); + } + Visit firstVisit = getVisit(ANC_FIRST_FACILITY_VISIT); + Visit lastVisit = getVisit(ANC_RECURRING_FACILITY_VISIT); + try { + setHivPositive(firstVisit, lastVisit); + } catch (JSONException e) { + e.printStackTrace(); + } + if (lastVisit == null) { + if (firstVisit != null) { + checkVisitStatus(firstVisit); + } + } else { + checkVisitStatus(lastVisit); + } } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == org.smartregister.chw.core.R.id.action_pmtct_register) { + startPmtctRegistration(); + return true; + } else if (itemId == R.id.action_pregnancy_out_come) { + CommonPersonObjectClient client = getCommonPersonObjectClient(); + String familyBaseEntityId = org.smartregister.util.Utils.getValue(client.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.RELATIONAL_ID, false); + boolean motherHivStatus = hivPositive || HivDao.isRegisteredForHiv(baseEntityID) || isKnownOnArt || HfAncDao.isClientKnownOnArt(baseEntityID) || HfAncDao.getHivStatus(baseEntityID).equalsIgnoreCase("positive"); + + PncRegisterActivity.startPncRegistrationActivity(AncMemberProfileActivity.this, memberObject.getBaseEntityId(), null, CoreConstants.JSON_FORM.getPregnancyOutcome(), AncLibrary.getInstance().getUniqueIdRepository().getNextUniqueId().getOpenmrsId(), familyBaseEntityId, memberObject.getFamilyName(), memberObject.getLastMenstrualPeriod(), motherHivStatus); + return true; + } else if (itemId == R.id.action_anc_partner_followup_referral) { + ((AncMemberProfilePresenter) presenter()).startPartnerFollowupReferralForm(memberObject); + return true; + } else if (itemId == R.id.action_ld_registration) { + startLDRegistration(); + return true; + } else if (itemId == org.smartregister.chw.core.R.id.action_location_info) { + + JSONObject preFilledForm = getAutoPopulatedJsonEditFormString( + CoreConstants.JSON_FORM.getFamilyDetailsRegister(), this, + UpdateDetailsUtil.getFamilyRegistrationDetails(UpdateDetailsUtil.getFamilyBaseEntityId(getCommonPersonObjectClient())), Utils.metadata().familyRegister.updateEventType); + if (preFilledForm != null) + UpdateDetailsUtil.startUpdateClientDetailsActivity(preFilledForm, this); + return true; + } else if (itemId == R.id.action_hivst_registration) { + startHivstRegistration(); + return true; + } else if (itemId == org.smartregister.chw.core.R.id.action_remove_member) { + removeMember(); + return true; + } + + return super.onOptionsItemSelected(item); + } + + protected void startPmtctRegistration() { + try { + if (HivDao.isRegisteredForHiv(baseEntityID) || (HfAncDao.getHivStatus(baseEntityID).equalsIgnoreCase("positive") && !HfAncDao.getClientCtcNumber(baseEntityID).equals("null"))) { + String ctcNumber = HfAncDao.getClientCtcNumber(baseEntityID); + if (ctcNumber.equals("null")) + ctcNumber = HivDao.getMember(baseEntityID).getCtcNumber(); + PmtctRegisterActivity.startPmtctRegistrationActivity(this, baseEntityID, ctcNumber, true); + } else { + PmtctRegisterActivity.startPmtctRegistrationActivity(this, baseEntityID, ctcNumber, isKnownOnArt || HfAncDao.isClientKnownOnArt(baseEntityID)); + } + } catch (Exception e) { + Timber.e(e); + } + } + + private void startHivstRegistration() { + CommonRepository commonRepository = Utils.context().commonrepository(Utils.metadata().familyMemberRegister.tableName); + + final CommonPersonObject commonPersonObject = commonRepository.findByBaseEntityId(memberObject.getBaseEntityId()); + final CommonPersonObjectClient client = + new CommonPersonObjectClient(commonPersonObject.getCaseId(), commonPersonObject.getDetails(), ""); + client.setColumnmaps(commonPersonObject.getColumnmaps()); + String gender = Utils.getValue(commonPersonObject.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.GENDER, false); + HivstRegisterActivity.startHivstRegistrationActivity(this, baseEntityID, gender); + } + + protected void removeMember() { + CommonPersonObjectClient commonPersonObjectClient = getClientDetailsByBaseEntityID(memberObject.getBaseEntityId()); + if (commonPersonObjectClient.getColumnmaps().get("entity_type").toString().equals(CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT)) { + commonPersonObjectClient.getColumnmaps().put(OpdDbConstants.KEY.REGISTER_TYPE, CoreConstants.REGISTER_TYPE.INDEPENDENT); + } + + IndividualProfileRemoveActivity.startIndividualProfileActivity(this, + commonPersonObjectClient, + memberObject.getFamilyBaseEntityId(), memberObject.getFamilyHead(), + memberObject.getPrimaryCareGiver(), FpRegisterActivity.class.getCanonicalName()); + } + + } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncPartnerTestingHistoryActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncPartnerTestingHistoryActivity.java new file mode 100644 index 000000000..7ebacd616 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncPartnerTestingHistoryActivity.java @@ -0,0 +1,293 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.opd.utils.OpdConstants.JSON_FORM_KEY.VISIT_ID; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.style.BulletSpan; +import android.text.style.StyleSpan; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.WordUtils; +import org.joda.time.DateTime; +import org.joda.time.Days; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.presenter.BaseAncMedicalHistoryPresenter; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.core.activity.CoreAncMedicalHistoryActivity; +import org.smartregister.chw.core.activity.DefaultAncMedicalHistoryActivityFlv; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.CoreReferralUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.AncPartnerTestingHistoryInteractor; +import org.smartregister.chw.hf.utils.PmtctVisitUtils; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.repository.AllSharedPreferences; + +import java.text.MessageFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import timber.log.Timber; + +public class AncPartnerTestingHistoryActivity extends CoreAncMedicalHistoryActivity { + private static MemberObject ancMemberObject; + private final Flavor flavor = new LdExaminationDetailsActivityFlv(); + private ProgressBar progressBar; + + public static void startMe(Activity activity, MemberObject memberObject) { + Intent intent = new Intent(activity, AncPartnerTestingHistoryActivity.class); + ancMemberObject = memberObject; + activity.startActivity(intent); + } + + @Override + public void initializePresenter() { + presenter = new BaseAncMedicalHistoryPresenter(new AncPartnerTestingHistoryInteractor(), this, ancMemberObject.getBaseEntityId()); + } + + @Override + public void setUpView() { + linearLayout = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.linearLayoutMedicalHistory); + progressBar = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.progressBarMedicalHistory); + + TextView tvTitle = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.tvTitle); + tvTitle.setText(getString(org.smartregister.chw.opensrp_chw_anc.R.string.back_to, ancMemberObject.getFullName())); + + ((TextView) findViewById(R.id.medical_history)).setText(getString(R.string.anc_partner_testing_history_title)); + } + + @Override + public View renderView(List visits) { + super.renderView(visits); + View view = flavor.bindViews(this); + displayLoadingState(true); + flavor.processViewData(visits, this); + displayLoadingState(false); + TextView visitTitle = view.findViewById(org.smartregister.chw.core.R.id.customFontTextViewHealthFacilityVisitTitle); + visitTitle.setText(R.string.visits_history); + return view; + } + + @Override + public void displayLoadingState(boolean state) { + progressBar.setVisibility(state ? View.VISIBLE : View.GONE); + } + + public static void startFormForEdit(Integer title_resource, String formName, MemberObject memberObject, Context context, String deletedVisitId) { + try { + JSONObject form = CoreJsonFormUtils.getAncPncForm(title_resource, formName, memberObject, context); + form.put(VISIT_ID, deletedVisitId); + ((Activity) context).startActivityForResult(CoreJsonFormUtils.getAncPncStartFormIntent(form, context), JsonFormUtils.REQUEST_CODE_GET_JSON); + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == JsonFormUtils.REQUEST_CODE_GET_JSON && resultCode == RESULT_OK) { + AllSharedPreferences allSharedPreferences = org.smartregister.util.Utils.getAllSharedPreferences(); + try { + String jsonString = data.getStringExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON); + JSONObject form = new JSONObject(jsonString); + String encounterType = form.getString(JsonFormUtils.ENCOUNTER_TYPE); + if (encounterType.equals(CoreConstants.EventType.ANC_PARTNER_TESTING)) { + if (form.has(VISIT_ID)) { + String deletedVisitId = form.getString(VISIT_ID); + form.remove(VISIT_ID); + PmtctVisitUtils.deleteProcessedVisit(deletedVisitId, ancMemberObject.getBaseEntityId()); + } + + Event baseEvent = org.smartregister.chw.anc.util.JsonFormUtils.processJsonForm(allSharedPreferences, CoreReferralUtils.setEntityId(jsonString, ancMemberObject.getBaseEntityId()), CoreConstants.TABLE_NAME.ANC_MEMBER); + org.smartregister.chw.anc.util.JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(baseEvent))); + finish(); + } + } catch (Exception e) { + Timber.e(e, "AncPartnerTestingHistoryActivity -- > onActivityResult"); + } + } + } + + private static class LdExaminationDetailsActivityFlv extends DefaultAncMedicalHistoryActivityFlv { + private final StyleSpan boldSpan = new StyleSpan(android.graphics.Typeface.BOLD); + + @Override + protected void processAncCard(String has_card, Context context) { + // super.processAncCard(has_card, context); + linearLayoutAncCard.setVisibility(View.GONE); + } + + @Override + protected void processHealthFacilityVisit(List> hf_visits, Context context) { + //super.processHealthFacilityVisit(hf_visits, context); + } + + @Override + public void processViewData(List visits, Context context) { + + if (visits.size() > 0) { + int days = 0; + List> hf_visits = new ArrayList<>(); + + int x = 0; + while (x < visits.size()) { + LinkedHashMap visitDetails = new LinkedHashMap<>(); + + // the first object in this list is the days difference + if (x == 0) { + days = Days.daysBetween(new DateTime(visits.get(visits.size() - 1).getDate()), new DateTime()).getDays(); + } + + String[] ancPartnerTesting = {"partner_hiv", "reason_for_not_conducting_partner_hiv_test", "other_reason_for_not_conducting_partner_hiv_test", "register_for_hiv_services", "partner_ctc_number", "couple_testing", "partner_syphilis", "reason_for_not_conducting_partner_syphilis_test", "other_reason_for_not_conducting_partner_syphilis_test", "partner_syphilis_treatment", "partner_hepatitis", "reason_for_not_conducting_partner_hepatitis_test", "other_reason_for_not_conducting_partner_hepatitis_test", "partner_other_stds", "partner_other_stds_treatment", "partner_reason_for_not_giving_medication_for_other_stds", "partner_other_reason_for_not_giving_medication_for_other_stds"}; + extractVisitDetails(visits, ancPartnerTesting, visitDetails, x, context); + + hf_visits.add(visitDetails); + + x++; + } + + processLastVisit(days, context); + processVisit(hf_visits, context, visits); + } + } + + private void extractVisitDetails(List sourceVisits, String[] hf_params, LinkedHashMap visitDetailsMap, int iteration, Context context) { + // get the hf details + Map map = new HashMap<>(); + for (String param : hf_params) { + try { + List details = sourceVisits.get(iteration).getVisitDetails().get(param); + map.put(param, getTexts(context, details)); + } catch (Exception e) { + e.printStackTrace(); + } + + } + visitDetailsMap.putAll(map); + } + + + private void processLastVisit(int days, Context context) { + linearLayoutLastVisit.setVisibility(View.VISIBLE); + if (days < 1) { + customFontTextViewLastVisit.setText(org.smartregister.chw.core.R.string.less_than_twenty_four); + } else { + customFontTextViewLastVisit.setText(StringUtils.capitalize(MessageFormat.format(context.getString(org.smartregister.chw.core.R.string.days_ago), String.valueOf(days)))); + } + } + + + protected void processVisit(List> community_visits, Context context, List visits) { + if (community_visits != null && community_visits.size() > 0) { + linearLayoutHealthFacilityVisit.setVisibility(View.VISIBLE); + + int x = 0; + for (LinkedHashMap vals : community_visits) { + View view = inflater.inflate(R.layout.medical_history_visit, null); + TextView tvTitle = view.findViewById(R.id.title); + TextView tvEdit = view.findViewById(R.id.textview_edit); + LinearLayout visitDetailsLayout = view.findViewById(R.id.visit_details_layout); + + tvEdit.setTag(visits.get(x).getVisitId()); + + // Updating visibility of EDIT button if the visit is the last visit + if (x == visits.size() - 1) + tvEdit.setVisibility(View.VISIBLE); + else + tvEdit.setVisibility(View.GONE); + + tvTitle.setText(visits.get(x).getVisitType() + " " + new SimpleDateFormat("dd-MM-yyyy HH:mm:ss", Locale.getDefault()).format(visits.get(x).getDate())); + + for (LinkedHashMap.Entry entry : vals.entrySet()) { + TextView visitDetailTv = new TextView(context); + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams + ((int) LinearLayout.LayoutParams.MATCH_PARENT, (int) LinearLayout.LayoutParams.WRAP_CONTENT); + + visitDetailTv.setLayoutParams(params); + float scale = context.getResources().getDisplayMetrics().density; + int dpAsPixels = (int) (10 * scale + 0.5f); + visitDetailTv.setPadding(dpAsPixels, 0, 0, 0); + visitDetailsLayout.addView(visitDetailTv); + + + try { + int resource = context.getResources().getIdentifier("anc_" + entry.getKey(), "string", context.getPackageName()); + evaluateView(context, vals, visitDetailTv, entry.getKey(), resource, ""); + } catch (Exception e) { + Timber.e(e); + } + } + linearLayoutHealthFacilityVisitDetails.addView(view, 0); + tvEdit.setOnClickListener(view1 -> startFormForEdit(R.string.edit_partner_testing, CoreConstants.JSON_FORM.PARTNER_TESTING, ancMemberObject, context, view1.getTag().toString())); + + x++; + } + } + } + + private void evaluateView(Context context, Map vals, TextView tv, String valueKey, int viewTitleStringResource, String valuePrefixInStringResources) { + if (StringUtils.isNotBlank(getMapValue(vals, valueKey))) { + SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(); + spannableStringBuilder.append(context.getString(viewTitleStringResource), boldSpan, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE).append("\n"); + + String stringValue = getMapValue(vals, valueKey); + String[] stringValueArray; + if (stringValue.contains(",")) { + stringValueArray = stringValue.split(","); + for (String value : stringValueArray) { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, value.trim()) + "\n", new BulletSpan(10), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + } + } else { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, stringValue)).append("\n"); + } + tv.setText(spannableStringBuilder); + } else { + tv.setVisibility(View.GONE); + } + } + + + private String getMapValue(Map map, String key) { + if (map.containsKey(key)) { + return map.get(key); + } + return ""; + } + + private String getStringResource(Context context, String prefix, String resourceName) { + int resourceId = context.getResources(). + getIdentifier(prefix + resourceName.trim(), "string", context.getPackageName()); + try { + return context.getString(resourceId); + } catch (Exception e) { + Timber.e(e); + if (resourceName.contains("_")) { + resourceName = resourceName.replace("_", " "); + resourceName = WordUtils.capitalize(resourceName); + } + return resourceName; + } + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncRecurringFacilityVisitActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncRecurringFacilityVisitActivity.java new file mode 100644 index 000000000..e5b25bf70 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncRecurringFacilityVisitActivity.java @@ -0,0 +1,65 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; +import android.os.Build; + +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.anc.presenter.BaseAncHomeVisitPresenter; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.AncRecurringFacilityVisitInteractor; + +import java.text.MessageFormat; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * @author ilakozejumanne@gmail.com + * 17-10-2021 + */ +public class AncRecurringFacilityVisitActivity extends AncFirstFacilityVisitActivity { + + public static void startMe(Activity activity, String baseEntityID, Boolean isEditMode) { + Intent intent = new Intent(activity, AncRecurringFacilityVisitActivity.class); + intent.putExtra(org.smartregister.chw.anc.util.Constants.ANC_MEMBER_OBJECTS.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(org.smartregister.chw.anc.util.Constants.ANC_MEMBER_OBJECTS.EDIT_MODE, isEditMode); + activity.startActivityForResult(intent, org.smartregister.chw.anc.util.Constants.REQUEST_CODE_HOME_VISIT); + } + + @Override + protected void registerPresenter() { + presenter = new BaseAncHomeVisitPresenter(memberObject, this, new AncRecurringFacilityVisitInteractor(baseEntityID)); + } + + @Override + public void redrawHeader(MemberObject memberObject) { + tvTitle.setText(MessageFormat.format("{0}, {1} \u00B7 {2}", memberObject.getFullName(), memberObject.getAge(), getString(org.smartregister.chw.hf.R.string.anc_followup_visit))); + } + + + @Override + public void initializeActions(LinkedHashMap map) { + actionList.clear(); + + //Necessary evil to rearrange the actions according to a specific arrangement + if (map.containsKey(getString(R.string.anc_recuring_visit_pregnancy_status))) { + BaseAncHomeVisitAction pregnancyStatusAncHomeVisitAction = map.get(getString(R.string.anc_recuring_visit_pregnancy_status)); + actionList.put(getString(R.string.anc_recuring_visit_pregnancy_status), pregnancyStatusAncHomeVisitAction); + } + //====================End of Necessary evil ==================================== + + for (Map.Entry entry : map.entrySet()) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + actionList.putIfAbsent(entry.getKey(), entry.getValue()); + } else { + actionList.put(entry.getKey(), entry.getValue()); + } + } + + if (mAdapter != null) { + mAdapter.notifyDataSetChanged(); + } + displayProgressBar(false); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncRegisterActivity.java index 5cd36e4c3..ee41c3335 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncRegisterActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncRegisterActivity.java @@ -1,17 +1,65 @@ package org.smartregister.chw.hf.activity; +import static org.smartregister.chw.hf.utils.Constants.REQUEST_FILTERS; + import android.app.Activity; import android.content.Intent; +import android.widget.Toast; + +import androidx.annotation.MenuRes; +import androidx.fragment.app.Fragment; + +import com.google.android.material.bottomnavigation.LabelVisibilityMode; +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; +import org.apache.commons.lang3.StringUtils; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.model.BaseAncRegisterModel; +import org.smartregister.chw.anc.presenter.BaseAncRegisterPresenter; import org.smartregister.chw.anc.util.Constants; +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.chw.anc.util.NCUtils; import org.smartregister.chw.core.activity.CoreAncRegisterActivity; +import org.smartregister.chw.core.activity.CorePncRegisterActivity; +import org.smartregister.chw.core.dao.ChwNotificationDao; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.FormUtils; import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.HfAncDao; +import org.smartregister.chw.hf.fragment.AncReferralListRegisterFragment; import org.smartregister.chw.hf.fragment.AncRegisterFragment; +import org.smartregister.chw.hf.interactor.AncRegisterInteractor; +import org.smartregister.chw.hf.listener.AncBottomNavigationListener; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; import org.smartregister.helper.BottomNavigationHelper; +import org.smartregister.listener.BottomNavigationListener; +import org.smartregister.repository.AllSharedPreferences; import org.smartregister.view.fragment.BaseRegisterFragment; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import timber.log.Timber; + public class AncRegisterActivity extends CoreAncRegisterActivity { + private static String taskId = null; + private static String baseEntityId; + public static void startAncRegistrationActivity(Activity activity, String memberBaseEntityID, String phoneNumber, String formName, String uniqueId, String familyBaseID, String family_name) { Intent intent = new Intent(activity, AncRegisterActivity.class); @@ -26,12 +74,135 @@ public static void startAncRegistrationActivity(Activity activity, String member activity.startActivity(intent); } + public static void startAncRegistrationActivity(Activity activity, String memberBaseEntityID, String phoneNumber, String formName, + String uniqueId, String familyBaseID, String family_name, String taskID) { + Intent intent = new Intent(activity, AncRegisterActivity.class); + intent.putExtra(org.smartregister.chw.anc.util.Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, memberBaseEntityID); + phone_number = phoneNumber; + familyBaseEntityId = familyBaseID; + form_name = formName; + familyName = family_name; + unique_id = uniqueId; + baseEntityId = memberBaseEntityID; + intent.putExtra(org.smartregister.chw.anc.util.Constants.ACTIVITY_PAYLOAD.ACTION, org.smartregister.chw.anc.util.Constants.ACTIVITY_PAYLOAD_TYPE.REGISTRATION); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.TABLE_NAME, getFormTable()); + taskId = taskID; + activity.startActivity(intent); + } + + + @Override + public void startFormActivity(JSONObject jsonForm) { + try { + JSONObject stepOne = jsonForm.getJSONObject(JsonFormUtils.STEP1); + JSONArray jsonArray = stepOne.getJSONArray(JsonFormUtils.FIELDS); + + Map values = new HashMap<>(); + + values.put(DBConstants.KEY.TEMP_UNIQUE_ID, unique_id); + values.put(CoreConstants.JsonAssets.FAM_NAME, familyName); + values.put(CoreConstants.JsonAssets.FAMILY_MEMBER.PHONE_NUMBER, phone_number); + values.put(org.smartregister.family.util.DBConstants.KEY.RELATIONAL_ID, familyBaseEntityId); + values.put(DBConstants.KEY.LAST_MENSTRUAL_PERIOD, lastMenstrualPeriod); + if (taskId != null) { + List existingTaskIds = HfAncDao.getPresentTaskIds(baseEntityId); + if (!existingTaskIds.isEmpty()) { + ArrayList list = new ArrayList<>(Collections.singleton(existingTaskIds.toString())); + list.add(taskId); + String taskIdsString = list.toString(); + values.put(org.smartregister.chw.hf.utils.Constants.DBConstants.TASK_ID, taskIdsString); + } else { + values.put(org.smartregister.chw.hf.utils.Constants.DBConstants.TASK_ID, taskId); + } + } + try { + JSONObject min_date = CoreJsonFormUtils.getFieldJSONObject(jsonArray, "delivery_date"); + min_date.put("min_date", lastMenstrualPeriod); + } catch (Exception e) { + Timber.e(e); + } + + FormUtils.updateFormField(jsonArray, values); + + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + + if (jsonForm.getString("encounter_type").equals("ANC Partner Community Followup Referral")) { + form.setWizard(true); + form.setNavigationBackground(org.smartregister.chw.core.R.color.family_navigation); + form.setName(this.getString(R.string.anc_partner_followup_referral)); + form.setNextLabel(this.getResources().getString(org.smartregister.chw.core.R.string.next)); + form.setPreviousLabel(this.getResources().getString(org.smartregister.chw.core.R.string.back)); + form.setSaveLabel(this.getResources().getString(org.smartregister.chw.core.R.string.save)); + } else { + form.setWizard(true); + form.setNavigationBackground(org.smartregister.chw.core.R.color.family_navigation); + if (jsonForm.getString("encounter_type").equals("Pregnancy Confirmation")) { + form.setName(this.getString(R.string.pregnancy_confirmation)); + } else if (jsonForm.getString("encounter_type").equals("ANC Followup Client Registration")) { + form.setName(this.getString(R.string.anc_followup_client_registration)); + } + form.setNextLabel(this.getResources().getString(org.smartregister.chw.core.R.string.next)); + form.setPreviousLabel(this.getResources().getString(org.smartregister.chw.core.R.string.back)); + form.setSaveLabel(this.getResources().getString(org.smartregister.chw.core.R.string.save)); + } + + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + protected Fragment[] getOtherFragments() { + return new AncReferralListRegisterFragment[]{ + new AncReferralListRegisterFragment()}; + } + + public static String getFormTable() { + if (form_name != null && (form_name.equals(CoreConstants.JSON_FORM.getAncRegistration()) || form_name.equals(CoreConstants.JSON_FORM.ANC_PREGNANCY_CONFIRMATION))) { + return CoreConstants.TABLE_NAME.ANC_MEMBER; + } + return CoreConstants.TABLE_NAME.ANC_PREGNANCY_OUTCOME; + } + @Override protected void registerBottomNavigation() { super.registerBottomNavigation(); bottomNavigationHelper = new BottomNavigationHelper(); bottomNavigationView = findViewById(R.id.bottom_navigation); - FamilyRegisterActivity.registerBottomNavigation(bottomNavigationHelper, bottomNavigationView, this); + + if (bottomNavigationView != null) { + bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_clients); + bottomNavigationView.getMenu().removeItem(org.smartregister.chw.tb.R.id.action_register); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_search); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_library); + bottomNavigationView.getMenu().removeItem(R.id.action_scan_qr); +// +// bottomNavigationView.inflateMenu(getMenuResource()); +// bottomNavigationHelper.disableShiftMode(bottomNavigationView); + + BottomNavigationListener ancBottomNavigationListener = getBottomNavigation(this); + bottomNavigationView.setOnNavigationItemSelectedListener(ancBottomNavigationListener); + + } + } + + + @Override + public BottomNavigationListener getBottomNavigation(Activity activity) { + return new AncBottomNavigationListener(activity); + } + + @MenuRes + public int getMenuResource() { + return R.menu.bottom_nav_anc_menu; } @Override @@ -53,4 +224,116 @@ protected void startRegisterActivity(Class registerClass) { this.overridePendingTransition(R.anim.slide_in_up, R.anim.slide_out_up); this.finish(); } + + @Override + public String getRegisterEventType() { + return CoreConstants.EventType.ANC_PREGNANCY_CONFIRMATION; + } + + @Override + protected void initializePresenter() { + this.presenter = new BaseAncRegisterPresenter(this, new BaseAncRegisterModel(), new AncRegisterInteractor()); + } + + @Override + protected void onActivityResultExtended(int requestCode, int resultCode, Intent data) { + if (resultCode == Activity.RESULT_OK && requestCode == Constants.REQUEST_CODE_GET_JSON) { +// process the form + try { + String jsonString = data.getStringExtra(Constants.JSON_FORM_EXTRA.JSON); + Timber.d("JSONResult %s", jsonString); + + JSONObject form = new JSONObject(jsonString); + String encounter_type = form.optString(Constants.JSON_FORM_EXTRA.ENCOUNTER_TYPE); + String pregnancyConfirmationStatus = CoreJsonFormUtils.getValue(form, "pregnancy_confirmation_status"); + String table = data.getStringExtra(Constants.ACTIVITY_PAYLOAD.TABLE_NAME); + boolean isPregnancyConfirmed; + if (encounter_type.equals("ANC Followup Client Registration")) { + isPregnancyConfirmed = true; + } else { + isPregnancyConfirmed = pregnancyConfirmationStatus.equalsIgnoreCase("confirmed"); + } + + if (encounter_type.equalsIgnoreCase(getRegisterEventType()) || encounter_type.equals("ANC Followup Client Registration")) { + saveFormForPregnancyConfirmation(jsonString, table); + if (!isPregnancyConfirmed) { + closeForUnconfirmed(jsonString, table); + } + } else if (encounter_type.equalsIgnoreCase(Constants.EVENT_TYPE.PREGNANCY_OUTCOME)) { + + presenter().saveForm(jsonString, false, table); + + } else if (encounter_type.equalsIgnoreCase(CoreConstants.EventType.ANC_FOLLOWUP_CLIENT_REGISTRATION)) { + + presenter().saveForm(jsonString, false, table); + + } else if (encounter_type.startsWith(Constants.EVENT_TYPE.UPDATE_EVENT_CONDITION)) { + + presenter().saveForm(form.toString(), true, TABLE); + + } + } catch (Exception e) { + Timber.e(e); + Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show(); + } + } else if (resultCode == Activity.RESULT_OK && requestCode == REQUEST_FILTERS) { + ((AncRegisterFragment) mBaseFragment).onFiltersUpdated(requestCode, data); + } + } + + public static void saveFormForPregnancyConfirmation(String jsonString, String table) { + try { + JSONObject form = new JSONObject(jsonString); + JSONArray fields = org.smartregister.util.JsonFormUtils.fields(form); + JSONObject lmp = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, DBConstants.KEY.LAST_MENSTRUAL_PERIOD); + boolean hasLmp = StringUtils.isNotBlank(lmp.optString(JsonFormUtils.VALUE)); + + if (!hasLmp) { + JSONObject eddJson = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, DBConstants.KEY.EDD); + DateTimeFormatter dateTimeFormat = DateTimeFormat.forPattern("dd-MM-yyyy"); + + LocalDate lmpDate = dateTimeFormat.parseLocalDate(eddJson.optString(JsonFormUtils.VALUE)).plusDays(-280); + lmp.put(JsonFormUtils.VALUE, dateTimeFormat.print(lmpDate)); + } + processPregnancyConfirmation(form.toString(), table); + } catch (Exception e) { + Timber.e(e); + } + } + + public static void processPregnancyConfirmation(String jsonString, String table) throws Exception { + AllSharedPreferences allSharedPreferences = AncLibrary.getInstance().context().allSharedPreferences(); + Event baseEvent = org.smartregister.chw.anc.util.JsonFormUtils.processJsonForm(allSharedPreferences, jsonString, table); + org.smartregister.chw.anc.util.JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + String syncLocationId = ChwNotificationDao.getSyncLocationId(baseEvent.getBaseEntityId()); + if (syncLocationId != null) { + // Allows setting the ID for sync purposes + baseEvent.setLocationId(syncLocationId); + } + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(baseEvent))); + + } + + private static void closeForUnconfirmed(String json, String table) throws Exception { + AllSharedPreferences allSharedPreferences = AncLibrary.getInstance().context().allSharedPreferences(); + Event baseEvent = org.smartregister.chw.anc.util.JsonFormUtils.processJsonForm(allSharedPreferences, json, table); + org.smartregister.chw.anc.util.JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + String syncLocationId = ChwNotificationDao.getSyncLocationId(baseEvent.getBaseEntityId()); + if (syncLocationId != null) { + // Allows setting the ID for sync purposes + baseEvent.setLocationId(syncLocationId); + } + baseEvent.setFormSubmissionId(UUID.randomUUID().toString()); + baseEvent.setEventType("Pregnancy Unconfirmed"); + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(baseEvent))); + } + + + @Override + public Class getRegisterActivity(String register) { + if (register.equals(org.smartregister.chw.hf.utils.Constants.PregnancyConfirmationGroups.PREGNANCY_CONFIRMATION) || register.equals(CoreConstants.SERVICE_GROUPS.ANC)) + return AncRegisterActivity.class; + else + return CorePncRegisterActivity.class; + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncRegistrationDetailsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncRegistrationDetailsActivity.java new file mode 100644 index 000000000..5eb1fbdb0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncRegistrationDetailsActivity.java @@ -0,0 +1,456 @@ +package org.smartregister.chw.hf.activity; + +import static com.vijay.jsonwizard.constants.JsonFormConstants.COUNT; +import static org.smartregister.AllConstants.DEFAULT_LOCALITY_NAME; +import static org.smartregister.opd.utils.OpdConstants.JSON_FORM_KEY.VISIT_ID; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.style.BulletSpan; +import android.text.style.StyleSpan; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import com.gkemon.XMLtoPDF.PdfGenerator; +import com.gkemon.XMLtoPDF.PdfGeneratorListener; +import com.gkemon.XMLtoPDF.model.FailureResponse; +import com.gkemon.XMLtoPDF.model.SuccessResponse; +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.WordUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.presenter.BaseAncMedicalHistoryPresenter; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.core.activity.CoreAncMedicalHistoryActivity; +import org.smartregister.chw.core.activity.DefaultAncMedicalHistoryActivityFlv; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.CoreReferralUtils; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.AncRegistrationDetailsInteractor; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.PmtctVisitUtils; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.repository.AllSharedPreferences; + +import java.text.MessageFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import timber.log.Timber; + +public class AncRegistrationDetailsActivity extends CoreAncMedicalHistoryActivity { + private static MemberObject ancMemberObject; + private Flavor flavor = new AncRegistrationDetailsActivityFlv(); + private ProgressBar progressBar; + private RelativeLayout headerLayout; + private final StyleSpan boldSpan = new StyleSpan(android.graphics.Typeface.BOLD); + + public static void startMe(Activity activity, MemberObject memberObject) { + Intent intent = new Intent(activity, AncRegistrationDetailsActivity.class); + ancMemberObject = memberObject; + activity.startActivity(intent); + } + + @Override + public void initializePresenter() { + presenter = new BaseAncMedicalHistoryPresenter(new AncRegistrationDetailsInteractor(), this, ancMemberObject.getBaseEntityId()); + } + + @Override + public void setUpView() { + findViewById(R.id.collapsing_toolbar).setBackgroundColor(getResources().getColor(R.color.primary)); + + Drawable upArrow = this.getResources().getDrawable(R.drawable.ic_arrow_back_white_24dp); + upArrow.setColorFilter(this.getResources().getColor(android.R.color.white), PorterDuff.Mode.SRC_ATOP); + getSupportActionBar().setHomeAsUpIndicator(upArrow); + + linearLayout = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.linearLayoutMedicalHistory); + progressBar = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.progressBarMedicalHistory); + + + TextView tvTitle = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.tvTitle); + tvTitle.setText(getString(org.smartregister.chw.opensrp_chw_anc.R.string.back_to, ancMemberObject.getFullName())); + tvTitle.setTextColor(getResources().getColor(org.smartregister.ld.R.color.white)); + + TextView medicalHistory = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.medical_history); + medicalHistory.setVisibility(View.GONE); + + TextView facilityName = findViewById(org.smartregister.ld.R.id.facility_name); + TextView clientName = findViewById(org.smartregister.ld.R.id.client_name); + + String facilityNameString = AncLibrary.getInstance().context().allSharedPreferences().getPreference(DEFAULT_LOCALITY_NAME); + + if (StringUtils.isNotBlank(facilityNameString)) { + facilityName.setText(facilityNameString); + } else { + facilityName.setVisibility(View.GONE); + } + + clientName.setText(MessageFormat.format(getString(org.smartregister.ld.R.string.partograph_client_name), ancMemberObject.getFirstName(), ancMemberObject.getMiddleName(), ancMemberObject.getLastName())); + } + + @Override + public View renderView(List visits) { + super.renderView(visits); + View view = flavor.bindViews(AncRegistrationDetailsActivity.this); + displayLoadingState(true); + flavor.processViewData(visits, AncRegistrationDetailsActivity.this); + displayLoadingState(false); + TextView title = view.findViewById(org.smartregister.chw.core.R.id.customFontTextViewHealthFacilityVisitTitle); + TextView edit = view.findViewById(org.smartregister.chw.core.R.id.textview_edit); + title.setText(getString(R.string.ld_registration_details_title)); + + edit.setVisibility(View.GONE); + return view; + } + + @Override + public void displayLoadingState(boolean state) { + progressBar.setVisibility(state ? View.VISIBLE : View.GONE); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(org.smartregister.ld.R.menu.partograph_menu, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() == android.R.id.home) { + finish(); + return true; + } else if (item.getItemId() == org.smartregister.ld.R.id.action_download_partograph) { + downloadHistory(); + return true; + } + return super.onOptionsItemSelected(item); + } + + + private void downloadHistory() { + headerLayout = findViewById(R.id.header_layout); + headerLayout.setVisibility(View.VISIBLE); + + + int age = 0; + try { + age = ancMemberObject.getAge(); + } catch (Exception e) { + Timber.e(e); + } + View mView = findViewById(R.id.main_layout); + PdfGenerator.getBuilder() + .setContext(AncRegistrationDetailsActivity.this) + .fromViewSource() + .fromView(mView) + .setFileName(String.format(Locale.getDefault(), "%s %s %s, %d", + ancMemberObject.getFirstName(), + ancMemberObject.getMiddleName(), + ancMemberObject.getLastName(), + age)) + .setFolderNameOrPath("MyFolder/MyDemoHorizontalText/") + .actionAfterPDFGeneration(PdfGenerator.ActionAfterPDFGeneration.OPEN) + .build(new PdfGeneratorListener() { + @Override + public void onFailure(FailureResponse failureResponse) { + super.onFailure(failureResponse); + } + + @Override + public void showLog(String log) { + super.showLog(log); + } + + @Override + public void onStartPDFGeneration() { + /*When PDF generation begins to start*/ + } + + @Override + public void onFinishPDFGeneration() { + /*When PDF generation is finished*/ + headerLayout.setVisibility(View.GONE); + } + + @Override + public void onSuccess(SuccessResponse response) { + super.onSuccess(response); + } + }); + } + + public void startFormForEdit(Integer title_resource, String formName, MemberObject memberObject, String deletedVisitId) { + try { + JSONObject form = CoreJsonFormUtils.getAncPncForm(title_resource, formName, memberObject, AncRegistrationDetailsActivity.this); + form.put(VISIT_ID, deletedVisitId); + startActivityForResult(getStartEditFormIntent(form, getString(title_resource)), JsonFormUtils.REQUEST_CODE_GET_JSON); + } catch (Exception e) { + Timber.e(e); + } + } + + public Intent getStartEditFormIntent(JSONObject jsonForm, String title) { + Intent intent = FormUtils.getStartFormActivity(jsonForm, null, this); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setName(title); + form.setNavigationBackground(org.smartregister.chw.core.R.color.family_navigation); + + try { + form.setWizard(jsonForm.getInt(COUNT) > 1); + } catch (JSONException e) { + Timber.e(e); + form.setWizard(false); + } + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + return intent; + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == JsonFormUtils.REQUEST_CODE_GET_JSON && resultCode == RESULT_OK) { + AllSharedPreferences allSharedPreferences = org.smartregister.util.Utils.getAllSharedPreferences(); + try { + String jsonString = data.getStringExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON); + JSONObject form = new JSONObject(jsonString); + String encounterType = form.getString(JsonFormUtils.ENCOUNTER_TYPE); + if (encounterType.equals(CoreConstants.EventType.ANC_PREGNANCY_CONFIRMATION) || encounterType.equals(CoreConstants.EventType.ANC_FOLLOWUP_CLIENT_REGISTRATION)) { + if (form.has(VISIT_ID)) { + String deletedVisitId = form.getString(VISIT_ID); + form.remove(VISIT_ID); + PmtctVisitUtils.deleteProcessedVisit(deletedVisitId, ancMemberObject.getBaseEntityId()); + } + + Event baseEvent = org.smartregister.chw.anc.util.JsonFormUtils.processJsonForm(allSharedPreferences, CoreReferralUtils.setEntityId(jsonString, ancMemberObject.getBaseEntityId()), CoreConstants.TABLE_NAME.ANC_MEMBER); + org.smartregister.chw.anc.util.JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(baseEvent))); + finish(); + } + } catch (Exception e) { + Timber.e(e, "AncRegistrationDetailsActivity -- > onActivityResult"); + } + } + } + + class AncRegistrationDetailsActivityFlv extends DefaultAncMedicalHistoryActivityFlv { + + @Override + protected void processAncCard(String has_card, Context context) { + // super.processAncCard(has_card, context); + linearLayoutAncCard.setVisibility(View.GONE); + } + + @Override + protected void processHealthFacilityVisit(List> hf_visits, Context context) { + //super.processHealthFacilityVisit(hf_visits, context); + } + + @Override + public void processViewData(List visits, Context context) { + + if (visits.size() > 0) { + List> hf_visits = new ArrayList<>(); + + int x = 0; + while (x < visits.size()) { + + // the first object in this list is the days difference + + + String[] hf_params = { + "danger_signs", + "type_of_pregnancy_test", + "fundal_palpation", + "upt", + "uss", + "known_last_menstrual_period", + "last_menstrual_period_unknown", + "fundal_height", + "estimated_last_menstrual_period", + "gest_age_note", + "is_transfer_in", + "medical_surgical_history", + "other_medical_surgical_history", + "ctc_number", + "gravida", + "parity", + "no_surv_children", + "height", + "has_the_client_received_ipt_doses_from_previous_facility", + "malaria_preventive_therapy", + "has_the_client_received_deworming_from_previous_facility", + "deworming", + "hiv_status", + "is_test_at_32", + "ctc_number", + "abdominal_scars", + "abdominal_movement_with_respiration", + "abnormal_vaginal_discharge", + "vaginal_sores", + "vaginal_swelling" + }; + + extractHFVisit(visits, hf_params, hf_visits, x, context); + + x++; + } + +// processLastVisit(); + processFacilityVisit(hf_visits, visits, context); + } + } + + private void extractHFVisit(List sourceVisits, String[] hf_params, List> hf_visits, int iteration, Context context) { + // get the hf details + LinkedHashMap map = new LinkedHashMap<>(); + for (String param : hf_params) { + try { + List details = sourceVisits.get(iteration).getVisitDetails().get(param); + map.put(param, getTexts(context, details)); + } catch (Exception e) { + e.printStackTrace(); + } + + } + hf_visits.add(map); + } + + protected void processFacilityVisit(List> hfVisitsDetails, List visits, Context context) { + if (hfVisitsDetails != null && hfVisitsDetails.size() > 0) { + linearLayoutHealthFacilityVisit.setVisibility(View.VISIBLE); + + int x = 0; + for (Map vals : hfVisitsDetails) { + View view = inflater.inflate(R.layout.medical_history_anc_visit, null); + + TextView tvTitle = view.findViewById(R.id.title); + TextView tvEdit = view.findViewById(R.id.textview_edit); + tvEdit.setTag(visits.get(x).getVisitId()); + LinearLayout visitDetailsLayout = view.findViewById(R.id.visit_details_layout); + + + // Updating visibility of EDIT button if the visit is the last visit + if (x == visits.size() - 1) + tvEdit.setVisibility(View.VISIBLE); + else + tvEdit.setVisibility(View.GONE); + + String titleString = ""; + if (visits.get(x).getVisitType().equalsIgnoreCase(CoreConstants.EventType.ANC_PREGNANCY_CONFIRMATION)) + titleString = context.getString(R.string.anc_pregnancy_confirmation_date); + else + titleString = context.getString(R.string.anc_registration_date); + + tvTitle.setText(MessageFormat.format(titleString, new SimpleDateFormat("dd-MM-yyyy HH:mm:ss", Locale.getDefault()).format(visits.get(x).getDate()))); + + final int position = x; + tvEdit.setOnClickListener(view1 -> { + Visit visit = visits.get(position); + if (visit != null && visit.getVisitType().equalsIgnoreCase(CoreConstants.EventType.ANC_PREGNANCY_CONFIRMATION) && visit.getBaseEntityId() != null) + startFormForEdit(R.string.edit_pregnancy_confirmation, CoreConstants.JSON_FORM.ANC_PREGNANCY_CONFIRMATION, ancMemberObject, view1.getTag().toString()); + else if (visit != null && visit.getVisitType().equalsIgnoreCase(CoreConstants.EventType.ANC_FOLLOWUP_CLIENT_REGISTRATION) && visit.getBaseEntityId() != null) + startFormForEdit(R.string.edit_anc_registration, Constants.JSON_FORM.ANC_TRANSFER_IN_REGISTRATION, ancMemberObject, view1.getTag().toString()); + }); + + + for (LinkedHashMap.Entry entry : vals.entrySet()) { + TextView visitDetailTv = new TextView(context); + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams + ((int) LinearLayout.LayoutParams.MATCH_PARENT, (int) LinearLayout.LayoutParams.WRAP_CONTENT); + + visitDetailTv.setLayoutParams(params); + float scale = context.getResources().getDisplayMetrics().density; + int dpAsPixels = (int) (10 * scale + 0.5f); + visitDetailTv.setPadding(dpAsPixels, 0, 0, 0); + visitDetailsLayout.addView(visitDetailTv); + + + try { + int resource = context.getResources().getIdentifier("anc_" + entry.getKey(), "string", context.getPackageName()); + evaluateView(context, vals, visitDetailTv, entry.getKey(), resource, ""); + } catch (Exception e) { + Timber.e(e); + } + } + + + linearLayoutHealthFacilityVisitDetails.addView(view, 0); + + x++; + } + } + } + + private String getMapValue(Map map, String key) { + if (map.containsKey(key)) { + return map.get(key); + } + return ""; + } + + private void evaluateView(Context context, Map vals, TextView tv, String valueKey, int viewTitleStringResource, String valuePrefixInStringResources) { + if (StringUtils.isNotBlank(getMapValue(vals, valueKey))) { + SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(); + spannableStringBuilder.append(context.getString(viewTitleStringResource), boldSpan, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE).append("\n"); + + String stringValue = getMapValue(vals, valueKey); + String[] stringValueArray; + if (stringValue.contains(",")) { + stringValueArray = stringValue.split(","); + for (String value : stringValueArray) { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, value.trim()) + "\n", new BulletSpan(10), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + } + } else { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, stringValue)).append("\n"); + } + tv.setText(spannableStringBuilder); + } else { + tv.setVisibility(View.GONE); + } + } + + private String getStringResource(Context context, String prefix, String resourceName) { + int resourceId = context.getResources(). + getIdentifier(prefix + resourceName.trim(), "string", context.getPackageName()); + try { + return context.getString(resourceId); + } catch (Exception e) { + Timber.e(e); + if (resourceName.contains("_")) { + resourceName = resourceName.replace("_", " "); + resourceName = WordUtils.capitalize(resourceName); + } + return resourceName; + } + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncReportsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncReportsActivity.java new file mode 100644 index 000000000..4317fc630 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncReportsActivity.java @@ -0,0 +1,128 @@ +package org.smartregister.chw.hf.activity; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; +import androidx.constraintlayout.widget.ConstraintLayout; + +import com.google.android.material.appbar.AppBarLayout; +import com.whiteelephant.monthpicker.MonthPickerDialog; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.ReportUtils; +import org.smartregister.view.activity.SecuredActivity; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; + +import timber.log.Timber; + +public class AncReportsActivity extends SecuredActivity implements View.OnClickListener { + + protected ConstraintLayout monthlyReport; + protected AppBarLayout appBarLayout; + Menu menu; + private String reportPeriod = ReportUtils.getDefaultReportPeriod(); + + @Override + protected void onCreation() { + setContentView(R.layout.activity_anc_reports); + setUpToolbar(); + setupViews(); + } + + public void setupViews() { + monthlyReport = findViewById(R.id.anc_monthly_report); + monthlyReport.setOnClickListener(this); + } + + @Override + protected void onResumption() { + // Do nothing + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.reports_menu, menu); + this.menu = menu; + this.menu.findItem(R.id.action_select_month).setTitle(ReportUtils.displayMonthAndYear()); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == R.id.action_select_month) { + showMonthPicker(this, menu); + return true; + } + return super.onOptionsItemSelected(item); + } + + public void setUpToolbar() { + Toolbar toolbar = findViewById(org.smartregister.chw.core.R.id.back_to_nav_toolbar); + setSupportActionBar(toolbar); + + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + final Drawable upArrow = getResources().getDrawable(org.smartregister.chw.core.R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setElevation(0); + } + toolbar.setNavigationOnClickListener(v -> finish()); + appBarLayout = findViewById(org.smartregister.chw.core.R.id.app_bar); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + appBarLayout.setOutlineProvider(null); + } + } + + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.anc_monthly_report) { + AncReportsViewActivity.startMe(this, Constants.ReportConstants.ReportPaths.ANC_REPORT_PATH, reportPeriod); + } + } + + private void showMonthPicker(Context context, Menu menu) { + //shows the month picker and returns selected period and updated the menu + MonthPickerDialog.Builder builder = new MonthPickerDialog.Builder(context, (selectedMonth, selectedYear) -> { + int month = selectedMonth + 1; + String monthString = String.valueOf(month); + if (month < 10) { + monthString = "0" + monthString; + } + String yearString = String.valueOf(selectedYear); + reportPeriod = monthString + "-" + yearString; + menu.findItem(R.id.action_select_month).setTitle(ReportUtils.displayMonthAndYear(selectedMonth, selectedYear)); + + }, Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH)); + try { + Date reportDate = new SimpleDateFormat("MM-yyyy", Locale.getDefault()).parse(reportPeriod); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(reportDate); + builder.setActivatedMonth(calendar.get(Calendar.MONTH)); + builder.setMinYear(2021); + builder.setActivatedYear(calendar.get(Calendar.YEAR)); + builder.setMaxYear(Calendar.getInstance().get(Calendar.YEAR)); + builder.setMinMonth(Calendar.JANUARY); + builder.setMaxMonth(Calendar.DECEMBER); + builder.setTitle(getString(R.string.select_reporting_month_anc)); + builder.build().show(); + } catch (ParseException e) { + Timber.e(e); + } + + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncReportsViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncReportsViewActivity.java new file mode 100644 index 000000000..f9470e97a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/AncReportsViewActivity.java @@ -0,0 +1,18 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; + +public class AncReportsViewActivity extends HfReportsViewActivity { + public static void startMe(Activity activity, String reportPath, String reportDate) { + Intent intent = new Intent(activity, PncReportsViewActivity.class); + intent.putExtra(ARG_REPORT_PATH, reportPath); + intent.putExtra(ARG_REPORT_DATE, reportDate); + intent.putExtra(ARG_REPORT_TITLE, R.string.anc_reports_title); + intent.putExtra(ARG_REPORT_TYPE, Constants.ReportConstants.ReportTypes.ANC_REPORT); + activity.startActivity(intent); + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CbhsReportsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CbhsReportsActivity.java new file mode 100644 index 000000000..ebfe2c073 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CbhsReportsActivity.java @@ -0,0 +1,101 @@ +package org.smartregister.chw.hf.activity; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; + +import com.whiteelephant.monthpicker.MonthPickerDialog; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.ReportUtils; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; + +import timber.log.Timber; + +public class CbhsReportsActivity extends PncReportsActivity { + + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.pnc_monthly_report) { + CbhsReportsViewActivity.startMe(this, Constants.ReportConstants.ReportPaths.CBHS_REPORT_PATH, reportPeriod); + } + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == R.id.action_select_month) { + showMonthPicker(this, menu); + return true; + } + return super.onOptionsItemSelected(item); + } + + @Override + public void setUpToolbar() { + super.setUpToolbar(); + TextView title = findViewById(R.id.toolbar_title); + title.setText(R.string.cbhs_reports_title); + + Toolbar toolbar = findViewById(org.smartregister.chw.core.R.id.back_to_nav_toolbar); + setSupportActionBar(toolbar); + + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + final Drawable upArrow = getResources().getDrawable(org.smartregister.chw.core.R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setElevation(0); + } + toolbar.setNavigationOnClickListener(v -> finish()); + appBarLayout = findViewById(org.smartregister.chw.core.R.id.app_bar); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + appBarLayout.setOutlineProvider(null); + } + } + + private void showMonthPicker(Context context, Menu menu) { + //shows the month picker and returns selected period and updated the menu + MonthPickerDialog.Builder builder = new MonthPickerDialog.Builder(context, (selectedMonth, selectedYear) -> { + int month = selectedMonth + 1; + String monthString = String.valueOf(month); + if (month < 10) { + monthString = "0" + monthString; + } + String yearString = String.valueOf(selectedYear); + reportPeriod = monthString + "-" + yearString; + menu.findItem(R.id.action_select_month).setTitle(ReportUtils.displayMonthAndYear(selectedMonth, selectedYear)); + + }, Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH)); + try { + Date reportDate = new SimpleDateFormat("MM-yyyy", Locale.getDefault()).parse(reportPeriod); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(reportDate); + builder.setActivatedMonth(calendar.get(Calendar.MONTH)); + builder.setMinYear(2021); + builder.setActivatedYear(calendar.get(Calendar.YEAR)); + builder.setMaxYear(Calendar.getInstance().get(Calendar.YEAR)); + builder.setMinMonth(Calendar.JANUARY); + builder.setMaxMonth(Calendar.DECEMBER); + builder.setTitle(getString(R.string.select_reporting_month_anc)); + builder.build().show(); + } catch (ParseException e) { + Timber.e(e); + } + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CbhsReportsViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CbhsReportsViewActivity.java new file mode 100644 index 000000000..df0362c5b --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CbhsReportsViewActivity.java @@ -0,0 +1,18 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; + +public class CbhsReportsViewActivity extends HfReportsViewActivity { + public static void startMe(Activity activity, String reportPath, String reportDate) { + Intent intent = new Intent(activity, CbhsReportsViewActivity.class); + intent.putExtra(ARG_REPORT_PATH, reportPath); + intent.putExtra(ARG_REPORT_DATE, reportDate); + intent.putExtra(ARG_REPORT_TITLE, R.string.cbhs_reports_title); + intent.putExtra(ARG_REPORT_TYPE, Constants.ReportConstants.ReportTypes.CBHS_REPORT); + activity.startActivity(intent); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/Cd4ResultsViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/Cd4ResultsViewActivity.java new file mode 100644 index 000000000..12279a8d7 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/Cd4ResultsViewActivity.java @@ -0,0 +1,149 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.chw.pmtct.util.DBConstants.KEY.FORM_SUBMISSION_ID; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.dao.HomeVisitDao; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.fragment.Cd4ResultsFragment; +import org.smartregister.chw.hf.utils.PmtctVisitUtils; +import org.smartregister.chw.pmtct.activity.BaseHvlResultsViewActivity; +import org.smartregister.chw.pmtct.fragment.BaseHvlResultsFragment; +import org.smartregister.chw.pmtct.util.Constants; +import org.smartregister.chw.pmtct.util.DBConstants; +import org.smartregister.chw.pmtct.util.NCUtils; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.clientandeventmodel.Obs; +import org.smartregister.family.util.Utils; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.ArrayList; + +import timber.log.Timber; + +public class Cd4ResultsViewActivity extends BaseHvlResultsViewActivity implements View.OnClickListener { + + private String baseEntityId; + private String parentFormSubmissionId; + + public static void startResultsForm(Context context, String jsonString, String baseEntityId, String parentFormSubmissionId) { + Intent intent = new Intent(context, Cd4ResultsViewActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.PMTCT_FORM, jsonString); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.PARENT_FORM_ENTITY_ID, parentFormSubmissionId); + context.startActivity(intent); + } + + @Override + public BaseHvlResultsFragment getBaseFragment() { + return Cd4ResultsFragment.newInstance(baseEntityId); + } + + @Override + protected void onCreation() { + String jsonString = getIntent().getStringExtra(Constants.ACTIVITY_PAYLOAD.PMTCT_FORM); + String baseEntityId = getIntent().getStringExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID); + String parentFormSubmissionId = getIntent().getStringExtra(Constants.ACTIVITY_PAYLOAD.PARENT_FORM_ENTITY_ID); + + this.baseEntityId = baseEntityId; + this.parentFormSubmissionId = parentFormSubmissionId; + + if (StringUtils.isBlank(jsonString)) { + super.onCreation(); + ImageView backImageView = findViewById(R.id.back); + backImageView.setOnClickListener(this); + + TextView titleView = findViewById(R.id.textview_title); + titleView.setText(getString(R.string.Cd4_results)); + } else { + try { + JSONObject form = new JSONObject(jsonString); + startFormActivity(form); + } catch (JSONException e) { + e.printStackTrace(); + } + } + } + + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.back) { + finish(); + } + } + + @Override + public void startFormActivity(JSONObject jsonObject) { + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(Constants.JSON_FORM_EXTRA.JSON, jsonObject.toString()); + + Form form = new Form(); + form.setName(getString(R.string.Cd4_results)); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setNavigationBackground(org.smartregister.chw.core.R.color.family_navigation); + form.setHomeAsUpIndicator(org.smartregister.chw.core.R.mipmap.ic_cross_white); + form.setPreviousLabel(getResources().getString(org.smartregister.chw.core.R.string.back)); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + + startActivityForResult(intent, Constants.REQUEST_CODE_GET_JSON); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == Constants.REQUEST_CODE_GET_JSON && resultCode == Activity.RESULT_CANCELED) { + //handle form close + finish(); + } + + if (requestCode == Constants.REQUEST_CODE_GET_JSON && resultCode == Activity.RESULT_OK) { + //handle form saving + String jsonString = data.getStringExtra(Constants.JSON_FORM_EXTRA.JSON); + try { + AllSharedPreferences allSharedPreferences = org.smartregister.util.Utils.getAllSharedPreferences(); + Event baseEvent = org.smartregister.chw.pmtct.util.JsonFormUtils.processJsonForm(allSharedPreferences, jsonString, Constants.TABLES.PMTCT_CD4_RESULTS); + org.smartregister.chw.pmtct.util.JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + baseEvent.setBaseEntityId(baseEntityId); + baseEvent.addObs( + (new Obs()) + .withFormSubmissionField(DBConstants.KEY.CD4_FOLLOWUP_FORM_SUBMISSION_ID) + .withValue(parentFormSubmissionId) + .withFieldCode(DBConstants.KEY.CD4_FOLLOWUP_FORM_SUBMISSION_ID) + .withFieldType("formsubmissionField") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + + JSONObject jsonObject = new JSONObject(jsonString); + if (jsonObject.has(FORM_SUBMISSION_ID)) { + Event processedEvent = HomeVisitDao.getEventByFormSubmissionId(jsonObject.getString(FORM_SUBMISSION_ID)); + baseEvent.setEventDate(processedEvent.getEventDate()); + PmtctVisitUtils.deleteSavedEvent(allSharedPreferences, processedEvent.getBaseEntityId(), processedEvent.getEventId(), processedEvent.getFormSubmissionId(), "event"); + } + + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.pmtct.util.JsonFormUtils.gson.toJson(baseEvent))); + + } catch (JSONException e) { + Timber.e(e); + } catch (Exception e) { + Timber.e(e); + } + //handles going back to activity after save + finish(); + } + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CdpRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CdpRegisterActivity.java new file mode 100644 index 000000000..3745c0e67 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CdpRegisterActivity.java @@ -0,0 +1,92 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.util.Utils.getAllSharedPreferences; + +import android.util.TypedValue; +import android.view.Gravity; +import android.widget.TextView; + +import androidx.fragment.app.Fragment; + +import com.google.android.material.bottomnavigation.BottomNavigationItemView; +import com.google.android.material.bottomnavigation.BottomNavigationMenuView; +import com.google.android.material.bottomnavigation.LabelVisibilityMode; + +import org.smartregister.chw.core.activity.CoreCdpRegisterActivity; +import org.smartregister.chw.core.custom_views.NavigationMenu; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.fragment.CdpReceiveFromOrganizationsRegisterFragment; +import org.smartregister.chw.hf.fragment.OrdersRegisterFragment; +import org.smartregister.chw.hf.fragment.RequestOrdersRegisterFragment; +import org.smartregister.chw.hf.listener.CdpBottomNavigationListener; +import org.smartregister.helper.BottomNavigationHelper; +import org.smartregister.listener.BottomNavigationListener; +import org.smartregister.view.fragment.BaseRegisterFragment; + +public class CdpRegisterActivity extends CoreCdpRegisterActivity { + private final String userLocationTag = getAllSharedPreferences().fetchUserLocationTag(); + + @Override + protected BaseRegisterFragment getRegisterFragment() { + return new RequestOrdersRegisterFragment(); + } + + @Override + protected Fragment[] getOtherFragments() { + return new Fragment[]{ + new OrdersRegisterFragment(), + new CdpReceiveFromOrganizationsRegisterFragment() + }; + } + + @Override + protected void onResumption() { + super.onResumption(); + NavigationMenu menu = NavigationMenu.getInstance(this, null, null); + if (menu != null) { + menu.getNavigationAdapter().setSelectedView(CoreConstants.DrawerMenu.CDP_HF); + } + } + + @Override + protected void registerBottomNavigation() { + bottomNavigationHelper = new BottomNavigationHelper(); + bottomNavigationView = findViewById(org.smartregister.R.id.bottom_navigation); + + if (bottomNavigationView != null) { + bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_clients); + bottomNavigationView.getMenu().removeItem(org.smartregister.cdp.R.id.action_register); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_search); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_library); + bottomNavigationView.inflateMenu(getMenuResource()); + bottomNavigationHelper.disableShiftMode(bottomNavigationView); + bottomNavigationView.getMenu().removeItem(org.smartregister.cdp.R.id.action_add_outlet); + BottomNavigationListener familyBottomNavigationListener = new CdpBottomNavigationListener(this); + bottomNavigationView.setOnNavigationItemSelectedListener(familyBottomNavigationListener); + + + BottomNavigationMenuView menuView = (BottomNavigationMenuView) bottomNavigationView.getChildAt(0); + + for (int i = 2; i < menuView.getChildCount(); i++) { + BottomNavigationItemView item = (BottomNavigationItemView) menuView.getChildAt(i); + + TextView smallLabel = item.findViewById(R.id.smallLabel); + TextView largeLabel = item.findViewById(R.id.largeLabel); + + smallLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 10); + largeLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 10); + + smallLabel.setGravity(Gravity.CENTER); + largeLabel.setGravity(Gravity.CENTER); + + smallLabel.setMaxLines(2); + largeLabel.setMaxLines(2); + + } + bottomNavigationView.invalidate(); + bottomNavigationView.requestLayout(); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CdpReportsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CdpReportsActivity.java new file mode 100644 index 000000000..f25bfc34c --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CdpReportsActivity.java @@ -0,0 +1,165 @@ +package org.smartregister.chw.hf.activity; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.widget.Toolbar; +import androidx.constraintlayout.widget.ConstraintLayout; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.DialogInterface; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; + +import com.google.android.material.appbar.AppBarLayout; +import com.whiteelephant.monthpicker.MonthPickerDialog; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.ReportUtils; +import org.smartregister.view.activity.SecuredActivity; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; + +import timber.log.Timber; + +public class CdpReportsActivity extends SecuredActivity implements View.OnClickListener { + protected ConstraintLayout cdpIssuingReport; + protected ConstraintLayout cdpReceivingReport; + protected AppBarLayout appBarLayout; + Menu menu; + private String reportPeriod = ReportUtils.getDefaultReportPeriod(); + + @Override + protected void onCreation() { + setContentView(R.layout.activity_cdp_reports); + setUpToolbar(); + setupViews(); + } + + public void setupViews() { + cdpIssuingReport = findViewById(R.id.cdp_issuing_report); + cdpReceivingReport = findViewById(R.id.cdp_receiving_report); + + + cdpIssuingReport.setOnClickListener(this); + cdpReceivingReport.setOnClickListener(this); + } + + public void setUpToolbar() { + Toolbar toolbar = findViewById(org.smartregister.chw.core.R.id.back_to_nav_toolbar); + setSupportActionBar(toolbar); + + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + final Drawable upArrow = getResources().getDrawable(org.smartregister.chw.core.R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setElevation(0); + } + toolbar.setNavigationOnClickListener(v -> finish()); + appBarLayout = findViewById(org.smartregister.chw.core.R.id.app_bar); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + appBarLayout.setOutlineProvider(null); + } + } + + @Override + protected void onResumption() { + //overridden + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.reports_menu, menu); + this.menu = menu; + this.menu.findItem(R.id.action_select_month).setTitle(ReportUtils.displayMonthAndYear()); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == R.id.action_select_month) { + showMonthPicker(this, menu); + return true; + } + return super.onOptionsItemSelected(item); + } + + @SuppressLint("NonConstantResourceId") + @Override + public void onClick(View v) { + int id = v.getId(); + switch (id) { + case R.id.cdp_issuing_report: + cdpIssuingSelector(); + break; + case R.id.cdp_receiving_report: + CdpReportsViewActivity.startMe(this, Constants.ReportConstants.ReportPaths.CONDOM_DISTRIBUTION_RECEIVING_REPORT_PATH, R.string.cdp_receiving_report, reportPeriod); + break; + default: + break; + } + } + + private void cdpIssuingSelector() { + final String[] Options = + {getResources().getString(R.string.cdp_issuing_at_the_facility_report), + getResources().getString(R.string.cdp_issuing_from_the_facility_report)}; + AlertDialog.Builder window; + window = new AlertDialog.Builder(this); + window.setTitle(getResources().getString(R.string.select_issued_condoms)); + window.setItems(Options, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + if(which == 0){ + CdpReportsViewActivity.startMe(CdpReportsActivity.this, Constants.ReportConstants.ReportPaths.CONDOM_DISTRIBUTION_ISSUING_AT_THE_FACILITY_REPORT_PATH, R.string.cdp_issuing_at_the_facility_report, reportPeriod); + }else if(which == 1){ + CdpReportsViewActivity.startMe(CdpReportsActivity.this, Constants.ReportConstants.ReportPaths.CONDOM_DISTRIBUTION_ISSUING_FROM_THE_FACILITY_REPORT_PATH, R.string.cdp_issuing_from_the_facility_report, reportPeriod); + }else{ + // cancel a simple window here + } + } + }); + + window.show(); + } + + private void showMonthPicker(Context context, Menu menu) { + //shows the month picker and returns selected period and updated the menu + MonthPickerDialog.Builder builder = new MonthPickerDialog.Builder(context, (selectedMonth, selectedYear) -> { + int month = selectedMonth + 1; + String monthString = String.valueOf(month); + if (month < 10) { + monthString = "0" + monthString; + } + String yearString = String.valueOf(selectedYear); + reportPeriod = monthString + "-" + yearString; + menu.findItem(R.id.action_select_month).setTitle(ReportUtils.displayMonthAndYear(selectedMonth, selectedYear)); + + }, Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH)); + try { + Date reportDate = new SimpleDateFormat("MM-yyyy", Locale.getDefault()).parse(reportPeriod); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(reportDate); + builder.setActivatedMonth(calendar.get(Calendar.MONTH)); + builder.setMinYear(2021); + builder.setActivatedYear(calendar.get(Calendar.YEAR)); + builder.setMaxYear(Calendar.getInstance().get(Calendar.YEAR)); + builder.setMinMonth(Calendar.JANUARY); + builder.setMaxMonth(Calendar.DECEMBER); + builder.setTitle("Select Month 0"); + builder.build().show(); + } catch (ParseException e) { + Timber.e(e); + } + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CdpReportsViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CdpReportsViewActivity.java new file mode 100644 index 000000000..42844965f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CdpReportsViewActivity.java @@ -0,0 +1,17 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.hf.utils.Constants; + +public class CdpReportsViewActivity extends HfReportsViewActivity{ + public static void startMe(Activity activity, String reportPath, int reportTitle, String reportDate) { + Intent intent = new Intent(activity, CdpReportsViewActivity.class); + intent.putExtra(ARG_REPORT_PATH, reportPath); + intent.putExtra(ARG_REPORT_TITLE, reportTitle); + intent.putExtra(ARG_REPORT_DATE, reportDate); + intent.putExtra(ARG_REPORT_TYPE, Constants.ReportConstants.ReportTypes.CONDOM_DISTRIBUTION_REPORT); + activity.startActivity(intent); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ChildProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ChildProfileActivity.java index 4ac34f581..907aa9709 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ChildProfileActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ChildProfileActivity.java @@ -20,11 +20,11 @@ import org.smartregister.chw.core.custom_views.CoreFamilyMemberFloatingMenu; import org.smartregister.chw.core.fragment.FamilyCallDialogFragment; import org.smartregister.chw.core.listener.OnClickFloatingMenu; +import org.smartregister.chw.core.model.CoreChildProfileModel; import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.chw.hf.R; import org.smartregister.chw.hf.adapter.ReferralCardViewAdapter; import org.smartregister.chw.hf.custom_view.FamilyMemberFloatingMenu; -import org.smartregister.chw.hf.model.ChildProfileModel; import org.smartregister.chw.hf.presenter.HfChildProfilePresenter; import org.smartregister.chw.malaria.dao.MalariaDao; import org.smartregister.domain.Task; @@ -70,7 +70,7 @@ protected void initializePresenter() { familyName = ""; } - presenter = new HfChildProfilePresenter(this, new ChildProfileModel(familyName), childBaseEntityId); + presenter = new HfChildProfilePresenter(this, new CoreChildProfileModel(familyName), childBaseEntityId); } @Override @@ -133,7 +133,7 @@ public boolean onOptionsItemSelected(@NotNull MenuItem item) { } return true; case R.id.action_malaria_diagnosis: - // displayShortToast(R.string.clicked_malaria_diagnosis); + // displayShortToast(R.string.clicked_malaria_diagnosis); startHfMalariaFollowupForm(); return true; default: diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CommunityFollowupFeedbackViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CommunityFollowupFeedbackViewActivity.java new file mode 100644 index 000000000..c070afe99 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CommunityFollowupFeedbackViewActivity.java @@ -0,0 +1,252 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; +import static org.smartregister.chw.hiv.util.Constants.Tables.HIV_COMMUNITY_FEEDBACK; +import static org.smartregister.chw.tb.util.Constants.Tables.TB_COMMUNITY_FEEDBACK; + +import android.app.Activity; +import android.app.AlertDialog; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; + +import androidx.annotation.NonNull; + +import org.json.JSONObject; +import org.smartregister.chw.core.activity.BaseReferralTaskViewActivity; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.BuildConfig; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.model.ChwFollowupFeedbackDetailsModel; +import org.smartregister.chw.hf.utils.AllClientsUtils; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.clientandeventmodel.Obs; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.family.FamilyLibrary; +import org.smartregister.family.util.DBConstants; +import org.smartregister.family.util.Utils; +import org.smartregister.opd.utils.OpdDbConstants; +import org.smartregister.repository.AllSharedPreferences; +import org.smartregister.repository.BaseRepository; +import org.smartregister.sync.helper.ECSyncHelper; +import org.smartregister.util.JsonFormUtils; +import org.smartregister.view.customcontrols.CustomFontTextView; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; + +import timber.log.Timber; + +/** + * Created by cozej4 on 6/21/20. + * + * @author cozej4 https://github.com/cozej4 + */ +public class CommunityFollowupFeedbackViewActivity extends BaseReferralTaskViewActivity implements View.OnClickListener { + public ChwFollowupFeedbackDetailsModel followupFeedbackDetailsModel; + + public static void startCommunityFollowupFeedbackViewActivity(Activity activity, CommonPersonObjectClient personObjectClient, ChwFollowupFeedbackDetailsModel followupFeedbackDetailsModel, String startingActivity) { + Intent intent = new Intent(activity, CommunityFollowupFeedbackViewActivity.class); + CommunityFollowupFeedbackViewActivity.personObjectClient = personObjectClient; + intent.putExtra(CoreConstants.INTENT_KEY.USERS_TASKS, followupFeedbackDetailsModel); + intent.putExtra(CoreConstants.INTENT_KEY.STARTING_ACTIVITY, startingActivity); + passToolbarTitle(activity, intent); + activity.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.referrals_tasks_view_layout); + if (getIntent().getExtras() != null) { + extraFollowupFeedback(); + extraDetails(); + setStartingActivity((String) getIntent().getSerializableExtra(CoreConstants.INTENT_KEY.STARTING_ACTIVITY)); + inflateToolbar(); + setUpViews(); + } + } + + protected void extraFollowupFeedback() { + followupFeedbackDetailsModel = (ChwFollowupFeedbackDetailsModel) getIntent().getSerializableExtra(CoreConstants.INTENT_KEY.USERS_TASKS); + if (followupFeedbackDetailsModel == null) { + Timber.e("CommunityFollowupFeedbackViewActivity --> The followup feedback object is null"); + finish(); + } + } + + @Override + protected void extraDetails() { + setClientName(); + baseEntityId = getPersonObjectClient().getCaseId(); + setFamilyHeadName((String) getIntent().getSerializableExtra(CoreConstants.INTENT_KEY.FAMILY_HEAD_NAME)); + setFamilyHeadPhoneNumber((String) getIntent().getSerializableExtra(CoreConstants.INTENT_KEY.FAMILY_HEAD_PHONE_NUMBER)); + } + + + @Override + protected void onCreation() { + //overridden + } + + @Override + protected void onResumption() { + //Overridden + } + + public void setUpViews() { + clientName = findViewById(R.id.client_name); + careGiverName = findViewById(R.id.care_giver_name); + childName = findViewById(R.id.child_name); + careGiverPhone = findViewById(R.id.care_giver_phone); + clientReferralProblem = findViewById(R.id.client_referral_problem); + chwDetailsNames = findViewById(R.id.chw_details_names); + referralDate = findViewById(R.id.referral_date); + + womanGaLayout = findViewById(R.id.woman_ga_layout); + careGiverLayout = findViewById(R.id.care_giver_name_layout); + childNameLayout = findViewById(R.id.child_name_layout); + + CustomFontTextView referralProblemLabel = findViewById(R.id.cclient_referral_problem_label); + referralProblemLabel.setText(getString(R.string.followup_feedback)); + + CustomFontTextView referralDateLabel = findViewById(R.id.referral_date_label); + referralDateLabel.setText(getString(R.string.followup_date)); + + womanGa = findViewById(R.id.woman_ga); + CustomFontTextView viewProfile = findViewById(R.id.view_profile); + + CustomFontTextView markAskDone = findViewById(R.id.mark_ask_done); + markAskDone.setOnClickListener(this); + + if (getStartingActivity().equals(CoreConstants.REGISTERED_ACTIVITIES.REFERRALS_REGISTER_ACTIVITY)) { + viewProfile.setOnClickListener(this); + } else { + viewProfile.setVisibility(View.INVISIBLE); + } + getReferralDetails(); + } + + @Override + protected void getReferralDetails() { + if (getPersonObjectClient() != null) { + String clientAge = (Utils.getTranslatedDate(Utils.getDuration(Utils.getValue(getPersonObjectClient().getColumnmaps(), DBConstants.KEY.DOB, false)), getBaseContext())); + clientName.setText(getString(org.smartregister.chw.core.R.string.client_name_age_suffix, name, clientAge)); + referralDate.setText(org.smartregister.chw.core.utils.Utils.dd_MMM_yyyy.format(new Date(new BigDecimal(followupFeedbackDetailsModel.getFollowupFeedbackDate()).longValue()))); + clientReferralProblem.setText(followupFeedbackDetailsModel.getFollowupFeedback()); + String familyMemberContacts = getFamilyMemberContacts(); + careGiverPhone.setText(familyMemberContacts.isEmpty() ? getString(org.smartregister.chw.core.R.string.phone_not_provided) : familyMemberContacts); + chwDetailsNames.setText(followupFeedbackDetailsModel.getChwName()); + } + } + + public void setStartingActivity(String startingActivity) { + this.startingActivity = startingActivity; + } + + public void closeReferral() { + closeReferralDialog(); + } + + private void closeReferralDialog() { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(getString(R.string.mark_as_done_title)); + builder.setMessage(getString(R.string.mark_feedback_as_done_message)); + builder.setCancelable(true); + + builder.setPositiveButton(this.getString(R.string.mark_done), (dialog, id) -> { + try { + saveCloseReferralEvent(); + finish(); + } catch (Exception e) { + Timber.e(e, "CommunityFollowupFeedbackViewActivity --> closeFeedbackDialog"); + } + }); + builder.setNegativeButton(this.getString(R.string.cancel), ((dialog, id) -> dialog.cancel())); + + AlertDialog alertDialog = builder.create(); + alertDialog.show(); + } + + private void saveCloseReferralEvent() { + try { + AllSharedPreferences sharedPreferences = Utils.getAllSharedPreferences(); + ECSyncHelper syncHelper = FamilyLibrary.getInstance().getEcSyncHelper(); + Event baseEvent = (Event) new Event() + .withBaseEntityId(getBaseEntityId()) + .withEventDate(new Date()) + .withFormSubmissionId(followupFeedbackDetailsModel.getFeedbackFormSubmissionId()) + .withProviderId(sharedPreferences.fetchRegisteredANM()) + .withTeamId(sharedPreferences.fetchDefaultTeamId(sharedPreferences.fetchRegisteredANM())) + .withTeam(sharedPreferences.fetchDefaultTeam(sharedPreferences.fetchRegisteredANM())) + .withClientDatabaseVersion(BuildConfig.DATABASE_VERSION) + .withClientApplicationVersion(BuildConfig.VERSION_CODE) + .withDateCreated(new Date()); + + if (followupFeedbackDetailsModel.getFeedbackType().equals("HIV")) { + baseEvent.setEventType(CoreConstants.EventType.CLOSE_HIV_FEEDBACK); + baseEvent.setEntityType(HIV_COMMUNITY_FEEDBACK); + }else if (followupFeedbackDetailsModel.getFeedbackType().equals("PMTCT")) { + baseEvent.setEventType(CoreConstants.EventType.CLOSE_PMTCT_FEEDBACK); + baseEvent.setEntityType(CoreConstants.TABLE_NAME.PMTCT_COMMUNITY_FEEDBACK); + } else { + baseEvent.setEventType(CoreConstants.EventType.CLOSE_TB_FEEDBACK); + baseEvent.setEntityType(TB_COMMUNITY_FEEDBACK); + } + + baseEvent.addObs((new Obs()).withFormSubmissionField("community_feedback_id").withValue(followupFeedbackDetailsModel.getFeedbackFormSubmissionId()) + .withFieldCode("community_feedback_id").withFieldType("formsubmissionField").withFieldDataType("text").withParentCode("").withHumanReadableValues(new ArrayList<>())); + + + baseEvent.addObs((new Obs()).withFormSubmissionField("mark_as_done").withValue("1") + .withFieldCode("mark_as_done").withFieldType("formsubmissionField").withFieldDataType("text").withParentCode("").withHumanReadableValues(new ArrayList<>())); + + org.smartregister.chw.hf.utils.JsonFormUtils.tagSyncMetadata(Utils.context().allSharedPreferences(), baseEvent);// tag docs + + + JSONObject eventJson = new JSONObject(JsonFormUtils.gson.toJson(baseEvent)); + syncHelper.addEvent(getBaseEntityId(), eventJson); + long lastSyncTimeStamp = HealthFacilityApplication.getInstance().getContext().allSharedPreferences().fetchLastUpdatedAtDate(0); + Date lastSyncDate = new Date(lastSyncTimeStamp); + HealthFacilityApplication.getClientProcessor(HealthFacilityApplication.getInstance().getContext().applicationContext()).processClient(syncHelper.getEvents(lastSyncDate, BaseRepository.TYPE_Unprocessed)); + HealthFacilityApplication.getInstance().getContext().allSharedPreferences().saveLastUpdatedAtDate(lastSyncDate.getTime()); + } catch (Exception e) { + Timber.e(e, "CommunityFollowupFeedbackViewActivity --> saveCloseFeedbackEvent"); + } + + } + + public String getBaseEntityId() { + return baseEntityId; + } + + @Override + public void onClick(View view) { + if (view.getId() == R.id.view_profile) { + personObjectClient.getDetails().put(OpdDbConstants.KEY.REGISTER_TYPE, mapTaskFocusToRegisterType()); + AllClientsUtils.goToClientProfile(this, personObjectClient); + } else if (view.getId() == R.id.mark_ask_done) { + closeReferral(); + } + } + + @NonNull + private String mapTaskFocusToRegisterType() { + switch (task.getFocus()) { + case CoreConstants.TASKS_FOCUS.SICK_CHILD: + return CoreConstants.REGISTER_TYPE.CHILD; + case CoreConstants.TASKS_FOCUS.SUSPECTED_MALARIA: + return CoreConstants.REGISTER_TYPE.MALARIA; + case CoreConstants.TASKS_FOCUS.ANC_DANGER_SIGNS: + return CoreConstants.REGISTER_TYPE.ANC; + case CoreConstants.TASKS_FOCUS.PNC_DANGER_SIGNS: + return CoreConstants.REGISTER_TYPE.PNC; + case CoreConstants.TASKS_FOCUS.FP_SIDE_EFFECTS: + return CoreConstants.REGISTER_TYPE.FAMILY_PLANNING; + default: + return ""; + } + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CommunityIndexFollowupFeedbackViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CommunityIndexFollowupFeedbackViewActivity.java new file mode 100644 index 000000000..5ede0bf5d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/CommunityIndexFollowupFeedbackViewActivity.java @@ -0,0 +1,142 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; +import android.widget.LinearLayout; + +import org.smartregister.chw.core.activity.BaseReferralTaskViewActivity; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.model.HivIndexFollowupFeedbackDetailsModel; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.family.util.DBConstants; +import org.smartregister.family.util.Utils; +import org.smartregister.view.customcontrols.CustomFontTextView; + +import timber.log.Timber; + +public class CommunityIndexFollowupFeedbackViewActivity extends BaseReferralTaskViewActivity { + public HivIndexFollowupFeedbackDetailsModel followupFeedbackDetailsModel; + + private LinearLayout testLocationLayout; + private LinearLayout chwClientFoundLayout; + private LinearLayout chwClientAgreeTestingLayout; + + private CustomFontTextView testLocation; + + private CustomFontTextView chwClientFound; + + private CustomFontTextView chwClientAgreeTesting; + + + public static void startCommunityIndexFollowupFeedbackViewActivity(Activity activity, CommonPersonObjectClient personObjectClient, String startingActivity, HivIndexFollowupFeedbackDetailsModel followupFeedbackDetailsModel) { + Intent intent = new Intent(activity, CommunityIndexFollowupFeedbackViewActivity.class); + CommunityIndexFollowupFeedbackViewActivity.personObjectClient = personObjectClient; + intent.putExtra(CoreConstants.INTENT_KEY.USERS_TASKS, followupFeedbackDetailsModel); + intent.putExtra(CoreConstants.INTENT_KEY.STARTING_ACTIVITY, startingActivity); + passToolbarTitle(activity, intent); + activity.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.referrals_tasks_view_layout); + if (getIntent().getExtras() != null) { + extraDetails(); + extraFollowupFeedback(); + setStartingActivity((String) getIntent().getSerializableExtra(CoreConstants.INTENT_KEY.STARTING_ACTIVITY)); + inflateToolbar(); + setUpViews(); + } + } + + + private void setUpViews() { + clientName = findViewById(R.id.client_name); + careGiverPhone = findViewById(R.id.care_giver_phone); + + chwClientFound = findViewById(R.id.woman_ga); + chwClientFoundLayout = findViewById(R.id.woman_ga_layout); + CustomFontTextView chwClientFoundLabel = findViewById(R.id.woman_ga_label); + + testLocationLayout = findViewById(R.id.referral_date_layout); + CustomFontTextView testLocationLabel = findViewById(R.id.referral_date_label); + testLocation = findViewById(R.id.referral_date); + + chwClientAgreeTestingLayout = findViewById(R.id.client_referral_problem_layout); + chwClientAgreeTesting = findViewById(R.id.client_referral_problem); + CustomFontTextView chwClientAgreeTestingLabel = findViewById(R.id.cclient_referral_problem_label); + + chwClientAgreeTestingLabel.setText(getString(R.string.chw_agreed_to_be_tested)); + testLocationLabel.setText(getString(R.string.chw_test_location)); + chwClientFoundLabel.setText(R.string.chw_client_found); + + findViewById(R.id.view_profile).setVisibility(View.GONE); + findViewById(R.id.mark_ask_done).setVisibility(View.GONE); + findViewById(R.id.chw_details_bottom_layout).setVisibility(View.GONE); + getReferralDetails(); + } + + private void setStartingActivity(String startingActivity) { + this.startingActivity = startingActivity; + } + + protected void extraFollowupFeedback() { + followupFeedbackDetailsModel = (HivIndexFollowupFeedbackDetailsModel) getIntent().getSerializableExtra(CoreConstants.INTENT_KEY.USERS_TASKS); + if (followupFeedbackDetailsModel == null) { + Timber.e("CommunityFollowupFeedbackViewActivity --> The followup feedback object is null"); + finish(); + } + } + + @Override + protected void extraDetails() { + setClientName(); + baseEntityId = getPersonObjectClient().getCaseId(); + setFamilyHeadName((String) getIntent().getSerializableExtra(CoreConstants.INTENT_KEY.FAMILY_HEAD_NAME)); + setFamilyHeadPhoneNumber((String) getIntent().getSerializableExtra(CoreConstants.INTENT_KEY.FAMILY_HEAD_PHONE_NUMBER)); + } + + @Override + protected void getReferralDetails() { + if (getPersonObjectClient() != null) { + String clientAge = (Utils.getTranslatedDate(Utils.getDuration(Utils.getValue(getPersonObjectClient().getColumnmaps(), DBConstants.KEY.DOB, false)), getBaseContext())); + clientName.setText(getString(org.smartregister.chw.core.R.string.client_name_age_suffix, name, clientAge)); + + if(followupFeedbackDetailsModel.getFollowedByChw().equalsIgnoreCase("true")){ + chwClientFoundLayout.setVisibility(View.VISIBLE); + chwClientFound.setText(followupFeedbackDetailsModel.getClientFound()); + if(followupFeedbackDetailsModel.getClientFound().equalsIgnoreCase("Yes")){ + chwClientAgreeTesting.setText(followupFeedbackDetailsModel.getAgreedToBeTested()); + if(followupFeedbackDetailsModel.getAgreedToBeTested().equalsIgnoreCase("yes")){ + testLocation.setText(followupFeedbackDetailsModel.getTestLocation()); + }else{ + testLocationLayout.setVisibility(View.GONE); + } + }else{ + chwClientAgreeTestingLayout.setVisibility(View.GONE); + } + }else{ + chwClientFoundLayout.setVisibility(View.GONE); + } + + String familyMemberContacts = getFamilyMemberContacts(); + careGiverPhone.setText(familyMemberContacts.isEmpty() ? getString(org.smartregister.chw.core.R.string.phone_not_provided) : familyMemberContacts); + } + } + + @Override + protected void onCreation() { + //overridden + } + + @Override + protected void onResumption() { + //overridden + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyOtherMemberProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyOtherMemberProfileActivity.java index 6240c1dd0..cc424ea35 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyOtherMemberProfileActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyOtherMemberProfileActivity.java @@ -1,10 +1,20 @@ package org.smartregister.chw.hf.activity; +import static org.smartregister.chw.core.utils.Utils.updateToolbarTitle; +import static org.smartregister.chw.hf.utils.Constants.JsonForm.HIV_REGISTRATION; + import android.content.Context; +import android.os.Build; import android.view.Menu; +import android.view.MenuItem; import android.view.View; import android.widget.RelativeLayout; +import android.widget.TextView; + +import com.vijay.jsonwizard.utils.FormUtils; +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; import org.json.JSONObject; import org.smartregister.chw.core.activity.CoreFamilyOtherMemberProfileActivity; import org.smartregister.chw.core.activity.CoreFamilyProfileActivity; @@ -14,13 +24,20 @@ import org.smartregister.chw.core.utils.BAJsonFormUtils; import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.chw.core.utils.Utils; -import org.smartregister.chw.fp.dao.FpDao; import org.smartregister.chw.fp.util.FamilyPlanningConstants; +import org.smartregister.chw.hf.BuildConfig; import org.smartregister.chw.hf.HealthFacilityApplication; import org.smartregister.chw.hf.R; import org.smartregister.chw.hf.custom_view.FamilyMemberFloatingMenu; +import org.smartregister.chw.hf.dao.HfHivDao; import org.smartregister.chw.hf.fragment.FamilyOtherMemberProfileFragment; import org.smartregister.chw.hf.presenter.FamilyOtherMemberActivityPresenter; +import org.smartregister.chw.hf.utils.AllClientsUtils; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.LFTUFormUtils; +import org.smartregister.chw.hiv.dao.HivIndexDao; +import org.smartregister.chw.hivst.dao.HivstDao; +import org.smartregister.chw.kvp.dao.KvpDao; import org.smartregister.chw.malaria.dao.MalariaDao; import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.family.fragment.BaseFamilyOtherMemberProfileFragment; @@ -30,8 +47,6 @@ import timber.log.Timber; -import static org.smartregister.chw.core.utils.Utils.updateToolbarTitle; - public class FamilyOtherMemberProfileActivity extends CoreFamilyOtherMemberProfileActivity { private FamilyMemberFloatingMenu familyFloatingMenu; private BAJsonFormUtils baJsonFormUtils; @@ -46,7 +61,13 @@ protected void onCreation() { dob = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false); gender = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.GENDER, false); setIndependentClient(false); - updateToolbarTitle(this, R.id.toolbar_title, familyName); + String passedTitle = getIntent().getStringExtra(CoreConstants.INTENT_KEY.TOOLBAR_TITLE); + if (!StringUtils.isBlank(passedTitle)) { + TextView toolbarTitle = findViewById(R.id.toolbar_title); + toolbarTitle.setText(passedTitle); + } else { + updateToolbarTitle(this, R.id.toolbar_title, familyName); + } } @Override @@ -61,6 +82,12 @@ protected void startAncRegister() { //TODO implement start anc register for HF } + @Override + protected void startPncRegister() { + PncRegisterActivity.startPncRegistrationActivity(FamilyOtherMemberProfileActivity.this, baseEntityId, PhoneNumber, + CoreConstants.JSON_FORM.getPregnancyOutcome(), null, familyBaseEntityId, familyName, null, false); + } + @Override protected void startFpRegister() { FpRegisterActivity.startFpRegistrationActivity(this, baseEntityId, dob, CoreConstants.JSON_FORM.getFpRegistrationForm(gender), FamilyPlanningConstants.ActivityPayload.REGISTRATION_PAYLOAD_TYPE); @@ -76,6 +103,24 @@ protected void startMalariaRegister() { //TODO implement start malaria register for HF } + @Override + protected void startHivRegister() { + try { + HivRegisterActivity.startHIVFormActivity(this, baseEntityId, HIV_REGISTRATION, (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, HIV_REGISTRATION).toString()); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + protected void startTbRegister() { + try { + TbRegisterActivity.startTbFormActivity(this, baseEntityId, CoreConstants.JSON_FORM.getTbRegistration(), (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, CoreConstants.JSON_FORM.getTbRegistration()).toString()); + } catch (JSONException e) { + Timber.e(e); + } + } + @Override protected void startMalariaFollowUpVisit() { // TODO -> Implement for HF @@ -86,9 +131,60 @@ protected void startHfMalariaFollowupForm() { MalariaFollowUpVisitActivityHelper.startMalariaFollowUpActivity(this, baseEntityId); } + @Override + protected void startPmtctRegisration() { + //Do nothing - not required here + } + + @Override + protected void startLDRegistration() { + try { + LDRegisterActivity.startLDRegistrationActivity(FamilyOtherMemberProfileActivity.this, baseEntityId); + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + protected void startHivstRegistration() { + String gender = Utils.getValue(commonPersonObject.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.GENDER, false); + HivstRegisterActivity.startHivstRegistrationActivity(FamilyOtherMemberProfileActivity.this, baseEntityId, gender); + } + + @Override + protected void startKvpPrEPRegistration() { + //do nothing--> this is for chw + } + + @Override + protected void startKvpRegistration() { + String gender = AllClientsUtils.getClientGender(baseEntityId); + String dob = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false); + int age = Utils.getAgeFromDate(dob); + if (gender.equalsIgnoreCase(Constants.GENDER.MALE)) { + KvpRegisterActivity.startKvpScreeningMale(FamilyOtherMemberProfileActivity.this, baseEntityId, gender, age); + } + if (gender.equalsIgnoreCase(Constants.GENDER.FEMALE)) { + KvpRegisterActivity.startKvpScreeningFemale(FamilyOtherMemberProfileActivity.this, baseEntityId, gender, age); + } + } + + @Override + protected void startPrEPRegistration() { + String gender = AllClientsUtils.getClientGender(baseEntityId); + String dob = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false); + int age = Utils.getAgeFromDate(dob); + PrEPRegisterActivity.startMe(this, baseEntityId, gender, age); + } + + @Override + protected void startAgywScreening() { + //do nothing + } + @Override protected void setIndependentClient(boolean b) { - this.isIndependent = false; + this.isIndependent = false; } @Override @@ -153,10 +249,6 @@ protected Class getFamilyProfileActivity() @Override public void updateHasPhone(boolean hasPhone) { super.updateHasPhone(hasPhone); - if (!hasPhone) { - familyFloatingMenu.hideFab(); - } - } @Override @@ -166,6 +258,12 @@ protected void initializePresenter() { if (viewId == R.id.call_layout) { FamilyCallDialogFragment.launchDialog(this, familyBaseEntityId); } + if (viewId == R.id.refer_to_facility_layout) { + String gender = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.GENDER, false); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { + LFTUFormUtils.startLTFUReferral(this, baseEntityId, gender, Utils.getAgeFromDate(dob)); + } + } }; } @@ -176,7 +274,6 @@ protected BaseFamilyOtherMemberProfileFragment getFamilyOtherMemberProfileFragme private void prepareFab() { familyFloatingMenu = new FamilyMemberFloatingMenu(this); - familyFloatingMenu.fab.setOnClickListener(v -> FamilyCallDialogFragment.launchDialog(this, familyBaseEntityId)); } private void setupMenuOptions(Menu menu) { @@ -186,27 +283,56 @@ private void setupMenuOptions(Menu menu) { menu.findItem(R.id.action_sick_child_follow_up).setVisible(false); menu.findItem(R.id.action_anc_registration).setVisible(false); menu.findItem(R.id.action_remove_member).setVisible(false); + menu.findItem(R.id.action_tb_registration).setVisible(false); + menu.findItem(R.id.action_pregnancy_out_come).setVisible(false); - if (MalariaDao.isRegisteredForMalaria(baseEntityId)) { - menu.findItem(R.id.action_malaria_followup_visit).setTitle(R.string.hf_malaria_follow_up); - menu.findItem(R.id.action_malaria_followup_visit).setVisible(true); - menu.findItem(R.id.action_malaria_diagnosis).setVisible(false); - } else { - menu.findItem(R.id.action_malaria_diagnosis).setVisible(true); - } + if (HealthFacilityApplication.getApplicationFlavor().hasMalaria()) + menu.findItem(R.id.action_malaria_diagnosis).setVisible(!MalariaDao.isRegisteredForMalaria(baseEntityId)); if (isOfReproductiveAge(commonPersonObject, gender)) { if (gender.equalsIgnoreCase("female") && !AncDao.isANCMember(baseEntityId)) { menu.findItem(R.id.action_pregnancy_confirmation).setVisible(true); + menu.findItem(R.id.action_pregnancy_out_come).setVisible(true); + menu.findItem(R.id.action_pmtct_register).setVisible(true); } - if (FpDao.isRegisteredForFp(baseEntityId)) { - menu.findItem(R.id.action_fp_change).setVisible(true); - menu.findItem(R.id.action_fp_initiation).setVisible(false); - } else { - menu.findItem(R.id.action_fp_change).setVisible(false); - menu.findItem(R.id.action_fp_initiation).setVisible(true); - } + menu.findItem(R.id.action_fp_change).setVisible(false); + menu.findItem(R.id.action_fp_initiation).setVisible(false); } + + if (HealthFacilityApplication.getApplicationFlavor().hasHivst()) { + String dob = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false); + int age = Utils.getAgeFromDate(dob); + menu.findItem(R.id.action_hivst_registration).setVisible(!HivstDao.isRegisteredForHivst(baseEntityId) && age >= 15); + } + + if (HealthFacilityApplication.getApplicationFlavor().hasKvpPrEP()) { + String dob = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false); + int age = Utils.getAgeFromDate(dob); + menu.findItem(R.id.action_kvp_registration).setVisible(!KvpDao.isRegisteredForKvp(baseEntityId) && age >= 15); + } + + if (BuildConfig.BUILD_FOR_BORESHA_AFYA_SOUTH) { + menu.findItem(R.id.action_hiv_registration).setVisible(!(HfHivDao.isHivMember(baseEntityId) || HivIndexDao.isRegisteredIndex(baseEntityId))); + } + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int i = item.getItemId(); + if (i == org.smartregister.chw.core.R.id.action_pregnancy_confirmation) { + startPregnancyConfirmation(); + return true; + } else if (i == org.smartregister.chw.core.R.id.action_malaria_diagnosis) { + startHfMalariaFollowupForm(); + return true; + } + return super.onOptionsItemSelected(item); + } + + + protected void startPregnancyConfirmation() { + AncRegisterActivity.startAncRegistrationActivity(FamilyOtherMemberProfileActivity.this, baseEntityId, PhoneNumber, + CoreConstants.JSON_FORM.ANC_PREGNANCY_CONFIRMATION, null, familyBaseEntityId, familyName); } private boolean isOfReproductiveAge(CommonPersonObjectClient commonPersonObject, String gender) { diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyPlanningMemberProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyPlanningMemberProfileActivity.java index 1a098186f..a0aeeb3e5 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyPlanningMemberProfileActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyPlanningMemberProfileActivity.java @@ -1,5 +1,7 @@ package org.smartregister.chw.hf.activity; +import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; + import android.app.Activity; import android.content.Intent; import android.view.Menu; @@ -28,8 +30,6 @@ import timber.log.Timber; -import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; - public class FamilyPlanningMemberProfileActivity extends CoreFamilyPlanningMemberProfileActivity implements FamilyPlanningMemberProfileContract.View { private CommonPersonObjectClient commonPersonObjectClient; diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyProfileActivity.java index 1ffd7734a..bb643a12b 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyProfileActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyProfileActivity.java @@ -1,6 +1,7 @@ package org.smartregister.chw.hf.activity; import android.app.Activity; +import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; @@ -21,8 +22,11 @@ import org.smartregister.chw.hf.fragment.FamilyProfileMemberFragment; import org.smartregister.chw.hf.model.FamilyProfileModel; import org.smartregister.chw.hf.presenter.FamilyProfilePresenter; +import org.smartregister.chw.hiv.dao.HivDao; import org.smartregister.chw.pnc.activity.BasePncMemberProfileActivity; +import org.smartregister.chw.tb.dao.TbDao; import org.smartregister.commonregistry.CommonPersonObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.family.adapter.ViewPagerAdapter; import org.smartregister.family.util.Constants; @@ -54,6 +58,7 @@ protected void refreshList(Fragment fragment) { } } } + @Override protected void setupViews() { super.setupViews(); @@ -131,6 +136,20 @@ protected void goToFpProfile(String baseEntityId, Activity activity) { FamilyPlanningMemberProfileActivity.startFpMemberProfileActivity(activity, FpDao.getMember(baseEntityId)); } + @Override + protected void goToHivProfile(String baseEntityId, Activity activity) { + HivProfileActivity.startHivProfileActivity(activity, HivDao.getMember(baseEntityId)); + } + + @Override + protected void goToTbProfile(String baseEntityId, Activity activity) { + TbProfileActivity.startTbProfileActivity(activity, TbDao.getMember(baseEntityId)); + } + @Override + public void goToAncProfileActivity(CommonPersonObjectClient patient, Bundle bundle) { + AncMemberProfileActivity.startMe(this,patient.getCaseId()); + } + @Override protected boolean isAncMember(String baseEntityId) { return getFamilyProfilePresenter().isAncMember(baseEntityId); diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyRegisterActivity.java index f6e72640a..9acc33ca4 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyRegisterActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FamilyRegisterActivity.java @@ -7,12 +7,12 @@ import com.google.android.material.bottomnavigation.LabelVisibilityMode; import org.smartregister.chw.core.activity.CoreFamilyRegisterActivity; -import org.smartregister.chw.core.custom_views.NavigationMenu; import org.smartregister.chw.core.listener.CoreBottomNavigationListener; import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.chw.hf.BuildConfig; import org.smartregister.chw.hf.HealthFacilityApplication; import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.custom_view.FacilityMenu; import org.smartregister.chw.hf.fragment.FamilyRegisterFragment; import org.smartregister.chw.hf.listener.HfFamilyBottomNavListener; import org.smartregister.chw.hf.model.FamilyRegisterModel; @@ -57,7 +57,7 @@ protected void registerBottomNavigation() { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - NavigationMenu.getInstance(this, null, null); + FacilityMenu.getInstance(this, null, null); HealthFacilityApplication.getInstance().notifyAppContextChange(); // initialize the language (bug in translation) action = getIntent().getStringExtra(CoreConstants.ACTIVITY_PAYLOAD.ACTION); diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FpRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FpRegisterActivity.java index 7381939c2..7e2abbd6e 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FpRegisterActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/FpRegisterActivity.java @@ -8,24 +8,16 @@ import org.smartregister.chw.core.activity.CoreFpRegisterActivity; import org.smartregister.chw.core.dataloader.FPDataLoader; import org.smartregister.chw.core.form_data.NativeFormsDataBinder; -import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.fp.model.BaseFpRegisterModel; import org.smartregister.chw.fp.util.FamilyPlanningConstants; import org.smartregister.chw.hf.R; import org.smartregister.chw.hf.fragment.FpRegisterFragment; import org.smartregister.chw.hf.interactor.HFFamilyPlanningRegisterInteractor; -import org.smartregister.chw.hf.model.FpRegisterModel; import org.smartregister.chw.hf.presenter.FpRegisterPresenter; -import org.smartregister.dao.LocationsDao; import org.smartregister.family.util.JsonFormUtils; import org.smartregister.helper.BottomNavigationHelper; import org.smartregister.view.fragment.BaseRegisterFragment; -import java.util.Collections; - -import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; -import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; -import static org.smartregister.util.JsonFormUtils.STEP1; - public class FpRegisterActivity extends CoreFpRegisterActivity { private static String baseEntityId; @@ -51,9 +43,6 @@ public JSONObject getFpFormForEdit() { JSONObject form = binder.getPrePopulatedForm(fpFormName); try { form.put(JsonFormUtils.ENCOUNTER_TYPE, FamilyPlanningConstants.EventType.UPDATE_FAMILY_PLANNING_REGISTRATION); - JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(form, STEP1, SYNC_LOCATION_ID); - CoreJsonFormUtils.addLocationsToDropdownField(LocationsDao.getLocationsByTags( - Collections.singleton(SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS)), syncLocationField); } catch (JSONException e) { e.printStackTrace(); } @@ -69,7 +58,7 @@ public void onFormSaved() { @Override protected void initializePresenter() { - presenter = new FpRegisterPresenter(this, new FpRegisterModel(), new HFFamilyPlanningRegisterInteractor()); + presenter = new FpRegisterPresenter(this, new BaseFpRegisterModel(), new HFFamilyPlanningRegisterInteractor()); } @Override diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiFollowupVisitActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiFollowupVisitActivity.java new file mode 100644 index 000000000..2d9f8f807 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiFollowupVisitActivity.java @@ -0,0 +1,104 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.chw.core.utils.Utils.getCommonPersonObjectClient; +import static org.smartregister.chw.core.utils.Utils.getDuration; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.json.JSONObject; +import org.smartregister.chw.core.task.RunnableTask; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.HeiFollowupVisitInteractor; +import org.smartregister.chw.hf.schedulers.HfScheduleTaskExecutor; +import org.smartregister.chw.pmtct.activity.BasePmtctHomeVisitActivity; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; +import org.smartregister.chw.pmtct.presenter.BasePmtctHomeVisitPresenter; +import org.smartregister.chw.pmtct.util.Constants; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.family.util.DBConstants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.util.LangUtils; + +import java.text.MessageFormat; +import java.util.Date; +import java.util.LinkedHashMap; + +import timber.log.Timber; + +public class HeiFollowupVisitActivity extends BasePmtctHomeVisitActivity { + public static void startHeiFollowUpActivity(Activity activity, String baseEntityID, Boolean editMode) { + Intent intent = new Intent(activity, HeiFollowupVisitActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.EDIT_MODE, editMode); + activity.startActivity(intent); + } + + @Override + protected void registerPresenter() { + presenter = new BasePmtctHomeVisitPresenter(memberObject, this, new HeiFollowupVisitInteractor()); + } + + @Override + public void submittedAndClose() { + Runnable runnable = () -> HfScheduleTaskExecutor.getInstance().execute(memberObject.getBaseEntityId(), org.smartregister.chw.hf.utils.Constants.Events.HEI_FOLLOWUP, new Date()); + Utils.startAsyncTask(new RunnableTask(runnable), null); + super.submittedAndClose(); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(false); + + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + intent.putExtra(org.smartregister.family.util.Constants.WizardFormActivity.EnableOnCloseDialog, false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + protected void attachBaseContext(Context base) { + // get language from prefs + String lang = LangUtils.getLanguage(base.getApplicationContext()); + super.attachBaseContext(LangUtils.setAppLocale(base, lang)); + } + + @Override + public void redrawHeader(MemberObject memberObject) { + CommonPersonObjectClient client = getCommonPersonObjectClient(memberObject.getBaseEntityId()); + String age = Utils.getTranslatedDate(getDuration(Utils.getValue(client.getColumnmaps(), DBConstants.KEY.DOB, false)), this); + + tvTitle.setText(MessageFormat.format("{0}, {1} \u00B7 {2}", memberObject.getFullName(), age, getString(R.string.hei_visit))); + } + + @Override + public void initializeActions(LinkedHashMap map) { + actionList.clear(); + super.initializeActions(map); + } + + @Override + public void onDestroy() { + try { + super.onDestroy(); + } catch (Exception e) { + Timber.e(e); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiHivResultsViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiHivResultsViewActivity.java new file mode 100644 index 000000000..b51265f7a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiHivResultsViewActivity.java @@ -0,0 +1,214 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.HeiDao; +import org.smartregister.chw.hf.fragment.HeiHivResultsFragment; +import org.smartregister.chw.hiv.util.DBConstants; +import org.smartregister.chw.pmtct.activity.BaseHvlResultsViewActivity; +import org.smartregister.chw.pmtct.fragment.BaseHvlResultsFragment; +import org.smartregister.chw.pmtct.util.Constants; +import org.smartregister.chw.pmtct.util.JsonFormUtils; +import org.smartregister.chw.pmtct.util.NCUtils; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.clientandeventmodel.Obs; +import org.smartregister.family.util.Utils; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.ArrayList; + +import timber.log.Timber; + +public class HeiHivResultsViewActivity extends BaseHvlResultsViewActivity implements View.OnClickListener { + + private String baseEntityId; + private String parentFormSubmissionId; + + public static void startResultsForm(Context context, String jsonString, String baseEntityId, String parentFormSubmissionId) { + Intent intent = new Intent(context, HeiHivResultsViewActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.PMTCT_FORM, jsonString); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.PARENT_FORM_ENTITY_ID, parentFormSubmissionId); + context.startActivity(intent); + } + + @Override + public BaseHvlResultsFragment getBaseFragment() { + return HeiHivResultsFragment.newInstance(baseEntityId); + } + + @Override + protected void onCreation() { + String jsonString = getIntent().getStringExtra(Constants.ACTIVITY_PAYLOAD.PMTCT_FORM); + String baseEntityId = getIntent().getStringExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID); + String parentFormSubmissionId = getIntent().getStringExtra(Constants.ACTIVITY_PAYLOAD.PARENT_FORM_ENTITY_ID); + + this.baseEntityId = baseEntityId; + this.parentFormSubmissionId = parentFormSubmissionId; + + if (StringUtils.isBlank(jsonString)) { + super.onCreation(); + ImageView backImageView = findViewById(R.id.back); + backImageView.setOnClickListener(this); + + TextView titleView = findViewById(R.id.textview_title); + titleView.setText(R.string.hiv_results_title); + } else { + try { + JSONObject form = new JSONObject(jsonString); + startFormActivity(form); + } catch (JSONException e) { + e.printStackTrace(); + } + } + } + + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.back) { + finish(); + } + } + + @Override + public void startFormActivity(JSONObject jsonObject) { + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(Constants.JSON_FORM_EXTRA.JSON, jsonObject.toString()); + + Form form = new Form(); + form.setName(getString(R.string.hiv_test_results_title)); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setNavigationBackground(org.smartregister.chw.core.R.color.family_navigation); + form.setHomeAsUpIndicator(org.smartregister.chw.core.R.mipmap.ic_cross_white); + form.setPreviousLabel(getResources().getString(org.smartregister.chw.core.R.string.back)); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + + startActivityForResult(intent, Constants.REQUEST_CODE_GET_JSON); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == Constants.REQUEST_CODE_GET_JSON && resultCode == Activity.RESULT_CANCELED) { + //handle form close + finish(); + } + + if (requestCode == Constants.REQUEST_CODE_GET_JSON && resultCode == Activity.RESULT_OK) { + //handle form saving + String jsonString = data.getStringExtra(Constants.JSON_FORM_EXTRA.JSON); + try { + + String testAtAge = HeiDao.getTestAtAgeForFollowupVisit(parentFormSubmissionId); + + AllSharedPreferences allSharedPreferences = org.smartregister.util.Utils.getAllSharedPreferences(); + Event baseEvent = JsonFormUtils.processJsonForm(allSharedPreferences, jsonString, org.smartregister.chw.hf.utils.Constants.TableName.HEI_HIV_RESULTS); + JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + baseEvent.setBaseEntityId(baseEntityId); + baseEvent.addObs( + (new Obs()) + .withFormSubmissionField(org.smartregister.chw.hf.utils.Constants.DBConstants.HEI_FOLLOWUP_FORM_SUBMISSION_ID) + .withValue(parentFormSubmissionId) + .withFieldCode(org.smartregister.chw.hf.utils.Constants.DBConstants.HEI_FOLLOWUP_FORM_SUBMISSION_ID) + .withFieldType("formsubmissionField") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.pmtct.util.JsonFormUtils.gson.toJson(baseEvent))); + + JSONObject jsonForm = new JSONObject(jsonString); + JSONArray fields = jsonForm.getJSONObject(org.smartregister.chw.hf.utils.Constants.JsonFormConstants.STEP1).getJSONArray(org.smartregister.chw.referral.util.JsonFormConstants.FIELDS); + + JSONObject hivTestResultObj = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "hiv_test_result"); + JSONObject confirmatoryTestResultObj = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "confirmation_hiv_test_result"); + String hivTestResult = hivTestResultObj.optString(JsonFormUtils.VALUE); + String confirmatoryTestResult = confirmatoryTestResultObj.optString(JsonFormUtils.VALUE); + Event closePmtctEvent = JsonFormUtils.processJsonForm(allSharedPreferences, jsonString, Constants.TABLES.PMTCT_REGISTRATION); + JsonFormUtils.tagEvent(allSharedPreferences, closePmtctEvent); + closePmtctEvent.setEventType(org.smartregister.chw.hf.utils.Constants.Events.PMTCT_CLOSE_VISITS); + closePmtctEvent.setBaseEntityId(HeiDao.getMotherBaseEntityId(baseEntityId)); + + if (hivTestResult.equalsIgnoreCase("positive") && confirmatoryTestResult.equalsIgnoreCase("yes")) { + Event closeHeiEvent = getCloseEventForPositive(allSharedPreferences, jsonString); + //process the events + NCUtils.processEvent(closePmtctEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.pmtct.util.JsonFormUtils.gson.toJson(closePmtctEvent))); + NCUtils.processEvent(closeHeiEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.pmtct.util.JsonFormUtils.gson.toJson(closeHeiEvent))); + } + //processes closing negative client if test results are for month 18 + if (hivTestResult.equalsIgnoreCase("negative") && (testAtAge.equalsIgnoreCase(org.smartregister.chw.hf.utils.Constants.HeiHIVTestAtAge.AT_18_MONTHS))) { + Event closeHeiEvent = getCloseEventForNegative(allSharedPreferences, jsonString); + //process the events + NCUtils.processEvent(closePmtctEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.pmtct.util.JsonFormUtils.gson.toJson(closePmtctEvent))); + NCUtils.processEvent(closeHeiEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.pmtct.util.JsonFormUtils.gson.toJson(closeHeiEvent))); + } + } catch (JSONException e) { + Timber.e(e); + } catch (Exception e) { + Timber.e(e); + } + //handles going back to activity after save + finish(); + } + + } + + protected Event getCloseEventForPositive(AllSharedPreferences allSharedPreferences, String jsonString) { + Event closeHeiEvent = JsonFormUtils.processJsonForm(allSharedPreferences, jsonString, org.smartregister.chw.hf.utils.Constants.TableName.HEI_HIV_RESULTS); + JsonFormUtils.tagEvent(allSharedPreferences, closeHeiEvent); + closeHeiEvent.setEventType(org.smartregister.chw.hf.utils.Constants.Events.HEI_POSITIVE_INFANT); + closeHeiEvent.setBaseEntityId(baseEntityId); + closeHeiEvent.addObs( + (new Obs()) + .withFormSubmissionField(org.smartregister.chw.hf.utils.Constants.DBConstants.HIV_REGISTRATION_DATE) + .withValue(System.currentTimeMillis()) + .withFieldCode(org.smartregister.chw.hf.utils.Constants.DBConstants.HIV_REGISTRATION_DATE) + .withFieldType("formsubmissionField") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + closeHeiEvent.addObs( + (new Obs()) + .withFormSubmissionField(DBConstants.Key.CLIENT_HIV_STATUS_DURING_REGISTRATION) + .withValue("positive") + .withFieldCode(DBConstants.Key.CLIENT_HIV_STATUS_DURING_REGISTRATION) + .withFieldType("formsubmissionField") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + closeHeiEvent.addObs( + (new Obs()) + .withFieldCode(DBConstants.Key.CLIENT_HIV_STATUS_AFTER_TESTING) + .withFormSubmissionField(DBConstants.Key.TEST_RESULTS) + .withValue("positive") + .withFieldType("formsubmissionField") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + + return closeHeiEvent; + } + + protected Event getCloseEventForNegative(AllSharedPreferences allSharedPreferences, String jsonString) { + Event closeHeiEvent = JsonFormUtils.processJsonForm(allSharedPreferences, jsonString, org.smartregister.chw.hf.utils.Constants.TableName.HEI_HIV_RESULTS); + JsonFormUtils.tagEvent(allSharedPreferences, closeHeiEvent); + closeHeiEvent.setEventType(org.smartregister.chw.hf.utils.Constants.Events.HEI_NEGATIVE_INFANT); + closeHeiEvent.setBaseEntityId(baseEntityId); + + return closeHeiEvent; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiMedicalHistoryActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiMedicalHistoryActivity.java new file mode 100644 index 000000000..fdc93cdb6 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiMedicalHistoryActivity.java @@ -0,0 +1,59 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; +import android.view.View; +import android.widget.ProgressBar; +import android.widget.TextView; + +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.presenter.BaseAncMedicalHistoryPresenter; +import org.smartregister.chw.core.activity.CoreAncMedicalHistoryActivity; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.HeiMedicalHistoryInteractor; +import org.smartregister.chw.pmtct.domain.MemberObject; + +import java.util.List; + +public class HeiMedicalHistoryActivity extends CoreAncMedicalHistoryActivity { + private static MemberObject heiMemberObject; + private Flavor flavor = new HeiMedicalHistoryActivityFlv(); + private ProgressBar progressBar; + + public static void startMe(Activity activity, MemberObject memberObject) { + Intent intent = new Intent(activity, HeiMedicalHistoryActivity.class); + heiMemberObject = memberObject; + activity.startActivity(intent); + } + + @Override + public void initializePresenter() { + presenter = new BaseAncMedicalHistoryPresenter(new HeiMedicalHistoryInteractor(), this, heiMemberObject.getBaseEntityId()); + } + + @Override + public void setUpView() { + linearLayout = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.linearLayoutMedicalHistory); + progressBar = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.progressBarMedicalHistory); + + TextView tvTitle = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.tvTitle); + tvTitle.setText(getString(org.smartregister.chw.opensrp_chw_anc.R.string.back_to, heiMemberObject.getFullName())); + } + + @Override + public View renderView(List visits) { + super.renderView(visits); + View view = flavor.bindViews(this); + displayLoadingState(true); + flavor.processViewData(visits, this); + displayLoadingState(false); + TextView heiVisitTitle = view.findViewById(org.smartregister.chw.core.R.id.customFontTextViewHealthFacilityVisitTitle); + heiVisitTitle.setText(R.string.hei_visit); + return view; + } + + @Override + public void displayLoadingState(boolean state) { + progressBar.setVisibility(state ? View.VISIBLE : View.GONE); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiMedicalHistoryActivityFlv.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiMedicalHistoryActivityFlv.java new file mode 100644 index 000000000..026b8eae7 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiMedicalHistoryActivityFlv.java @@ -0,0 +1,244 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.view.View; +import android.widget.TextView; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.Days; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.core.activity.DefaultAncMedicalHistoryActivityFlv; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class HeiMedicalHistoryActivityFlv extends DefaultAncMedicalHistoryActivityFlv { + + @Override + protected void processAncCard(String has_card, Context context) { + // super.processAncCard(has_card, context); + linearLayoutAncCard.setVisibility(View.GONE); + } + + @Override + protected void processHealthFacilityVisit(List> hf_visits, Context context) { + //super.processHealthFacilityVisit(hf_visits, context); + } + + @Override + public void processViewData(List visits, Context context) { + + if (visits.size() > 0) { + int days = 0; + List> hf_visits = new ArrayList<>(); + + int x = 0; + while (x < visits.size()) { + + // the first object in this list is the days difference + if (x == 0) { + days = Days.daysBetween(new DateTime(visits.get(visits.size() - 1).getDate()), new DateTime()).getDays(); + } + + + String[] hf_params = {"pmtct_visit_date", "actual_age", "followup_status", "weight", "number_of_ctx_days_dispensed", "number_of_nvp_days_dispensed", "number_of_azt_nvp_days_dispensed", "infant_feeding_practice", "sample_id", "next_facility_visit_date"}; + extractHFVisit(visits, hf_params, hf_visits, x, context); + + x++; + } + + processLastVisit(days, context); + processFacilityVisit(hf_visits, visits, context); + } + } + + private void extractHFVisit(List sourceVisits, String[] hf_params, List> hf_visits, int iteration, Context context) { + // get the hf details + Map map = new HashMap<>(); + for (String param : hf_params) { + try { + List details = sourceVisits.get(iteration).getVisitDetails().get(param); + map.put(param, getTexts(context, details)); + } catch (Exception e) { + e.printStackTrace(); + } + + } + hf_visits.add(map); + } + + + private void processLastVisit(int days, Context context) { + linearLayoutLastVisit.setVisibility(View.VISIBLE); + if (days < 1) { + customFontTextViewLastVisit.setText(org.smartregister.chw.core.R.string.less_than_twenty_four); + } else { + customFontTextViewLastVisit.setText(StringUtils.capitalize(MessageFormat.format(context.getString(org.smartregister.chw.core.R.string.days_ago), String.valueOf(days)))); + } + } + + + protected void processFacilityVisit(List> hf_visits, List visits, Context context) { + if (hf_visits != null && hf_visits.size() > 0) { + linearLayoutHealthFacilityVisit.setVisibility(View.VISIBLE); + + int x = 0; + for (Map vals : hf_visits) { + View view = inflater.inflate(R.layout.medical_history_hei_visit, null); + TextView tvTitle = view.findViewById(R.id.title); + TextView tvTypeOfVisit = view.findViewById(R.id.type_of_visit); + TextView tvWeight = view.findViewById(R.id.weight); + TextView tvCtx = view.findViewById(R.id.ctx); + TextView tvNvp = view.findViewById(R.id.nvp); + TextView tvFeedingPractice = view.findViewById(R.id.feeding_practice); + TextView tvDnaPcr = view.findViewById(R.id.dna_pcr); + TextView tvEdit = view.findViewById(R.id.textview_edit); + + // Updating visibility of EDIT button if the visit is the last visit + if (x == visits.size() - 1) + tvEdit.setVisibility(View.VISIBLE); + else + tvEdit.setVisibility(View.GONE); + + tvEdit.setOnClickListener(view1 -> { + ((Activity) context).finish(); + Visit visit = visits.get(0); + if (visit != null && visit.getVisitType().equalsIgnoreCase(Constants.Events.HEI_FOLLOWUP) && visit.getBaseEntityId() != null) + HeiFollowupVisitActivity.startHeiFollowUpActivity((Activity) context, visit.getBaseEntityId(), true); + }); + + + evaluateTitle(context, x, vals, tvTitle); + evaluateFollowupStatus(context, vals, tvTypeOfVisit); + evaluateWeight(context, vals, tvWeight); + evaluateCtxDaysDispensed(context, vals, tvCtx); + evaluateNvpNumberOfDays(context, vals, tvNvp); + evaluateFeedingPractice(context, vals, tvFeedingPractice); + evaluateDnaPcr(context, vals, tvDnaPcr); + evaluateNextVisitDate(context, vals, view); + linearLayoutHealthFacilityVisitDetails.addView(view, 0); + + x++; + } + } + } + + private void evaluateNextVisitDate(Context context, Map vals, View view) { + if (StringUtils.isBlank(getMapValue(vals, "next_facility_visit_date"))) { + view.findViewById(R.id.next_facility_visit_date).setVisibility(View.GONE); + } else { + ((TextView) view.findViewById(R.id.next_facility_visit_date)).setText(MessageFormat.format(context.getString(R.string.next_facility_visit_date), getMapValue(vals, "next_facility_visit_date"))); + } + } + + private void evaluateTitle(Context context, int x, Map vals, TextView tvTitle) { + if (StringUtils.isBlank(vals.get("pmtct_visit_date"))) { + tvTitle.setVisibility(View.GONE); + } else { + tvTitle.setText(MessageFormat.format(context.getString(R.string.hei_visit_title), x + 1, getMapValue(vals, "pmtct_visit_date"), getMapValue(vals, "actual_age"))); + } + } + + private void evaluateFollowupStatus(Context context, Map vals, TextView tvTypeOfVisit) { + if (StringUtils.isNotBlank(getMapValue(vals, "followup_status"))) { + String followupStatus = getMapValue(vals, "followup_status"); + switch (followupStatus) { + case "infant_and_mother": + tvTypeOfVisit.setText(MessageFormat.format(context.getString(R.string.hei_type_of_visit), "IM")); + break; + case "infant_with_other_caregiver": + tvTypeOfVisit.setText(MessageFormat.format(context.getString(R.string.hei_type_of_visit), "IC")); + break; + case "transfer_out": + tvTypeOfVisit.setText(MessageFormat.format(context.getString(R.string.hei_type_of_visit), "TO")); + break; + default: + tvTypeOfVisit.setText(MessageFormat.format(context.getString(R.string.hei_type_of_visit), followupStatus)); + break; + } + } + } + + private void evaluateWeight(Context context, Map vals, TextView tvWeight) { + if (StringUtils.isNotBlank(getMapValue(vals, "weight"))) { + tvWeight.setText(MessageFormat.format(context.getString(R.string.weight_in_kgs), getMapValue(vals, "weight"))); + } else { + tvWeight.setVisibility(View.GONE); + } + } + + private void evaluateCtxDaysDispensed(Context context, Map vals, TextView tvCtx) { + if (StringUtils.isBlank(getMapValue(vals, "number_of_ctx_days_dispensed"))) { + tvCtx.setVisibility(View.GONE); + } else { + tvCtx.setText(MessageFormat.format(context.getString(R.string.ctx_days_dispensed), getMapValue(vals, "number_of_ctx_days_dispensed"))); + } + } + + private void evaluateNvpNumberOfDays(Context context, Map vals, TextView tvNvp) { + if (StringUtils.isBlank(getMapValue(vals, "number_of_nvp_days_dispensed")) && StringUtils.isBlank(getMapValue(vals, "number_of_azt_nvp_days_dispensed"))) { + tvNvp.setVisibility(View.GONE); + } else { + String message = StringUtils.isBlank(getMapValue(vals, "number_of_azt_nvp_days_dispensed")) ? + MessageFormat.format(context.getString(R.string.nvp_days_dispensed), getMapValue(vals, "number_of_nvp_days_dispensed")) : MessageFormat.format(context.getString(R.string.nvp_days_dispensed), getMapValue(vals, "number_of_azt_nvp_days_dispensed")); + tvNvp.setText(message); + } + } + + private void evaluateDnaPcr(Context context, Map vals, TextView tvDnaPcr) { + if (StringUtils.isBlank(getMapValue(vals, "sample_id"))) { + tvDnaPcr.setVisibility(View.GONE); + } else { + tvDnaPcr.setText(MessageFormat.format(context.getString(R.string.dna_pcr_sample), getMapValue(vals, "sample_id"))); + } + } + + private void evaluateFeedingPractice(Context context, Map vals, TextView tvFeedingPractice) { + if (StringUtils.isBlank(getMapValue(vals, "infant_feeding_practice"))) { + tvFeedingPractice.setVisibility(View.GONE); + } else { + String feedingPractice = getMapValue(vals, "infant_feeding_practice"); + switch (feedingPractice) { + case "ebf": + tvFeedingPractice.setText(MessageFormat.format(context.getString(R.string.infant_feeding_practice), context.getString(R.string.feeding_practice_ebf))); + break; + case "rf": + tvFeedingPractice.setText(MessageFormat.format(context.getString(R.string.infant_feeding_practice), context.getString(R.string.feeding_practice_rf))); + break; + case "mf": + tvFeedingPractice.setText(MessageFormat.format(context.getString(R.string.infant_feeding_practice), context.getString(R.string.feeding_practice_mf))); + break; + case "bf+": + tvFeedingPractice.setText(MessageFormat.format(context.getString(R.string.infant_feeding_practice), context.getString(R.string.feeding_practice_bf_plus))); + break; + case "rf+": + tvFeedingPractice.setText(MessageFormat.format(context.getString(R.string.infant_feeding_practice), context.getString(R.string.feeding_practice_rf_plus))); + break; + case "sbf": + tvFeedingPractice.setText(MessageFormat.format(context.getString(R.string.infant_feeding_practice), context.getString(R.string.feeding_practice_sbf))); + break; + default: + tvFeedingPractice.setText(MessageFormat.format(context.getString(R.string.infant_feeding_practice), feedingPractice)); + break; + } + } + } + + private String getMapValue(Map map, String key) { + if (map.containsKey(key)) { + if (map.get(key) != null && map.get(key).length() > 1) { + return map.get(key).split(",")[0]; + } + return map.get(key); + } + return ""; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiProfileActivity.java new file mode 100644 index 000000000..b9a736591 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiProfileActivity.java @@ -0,0 +1,545 @@ +package org.smartregister.chw.hf.activity; + +import static com.vijay.jsonwizard.constants.JsonFormConstants.VALUE; +import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; +import static org.smartregister.chw.core.utils.Utils.getCommonPersonObjectClient; +import static org.smartregister.chw.core.utils.Utils.getDuration; +import static org.smartregister.chw.core.utils.Utils.updateToolbarTitle; +import static org.smartregister.chw.hf.utils.Constants.JsonForm.getHeiNumberRegistration; +import static org.smartregister.client.utils.constants.JsonFormConstants.FIELDS; +import static org.smartregister.client.utils.constants.JsonFormConstants.STEP1; +import static org.smartregister.util.Utils.getName; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.content.Intent; +import android.os.Build; +import android.view.Gravity; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.RequiresApi; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.Period; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.custom_views.CorePmtctFloatingMenu; +import org.smartregister.chw.core.interactor.CoreChildProfileInteractor; +import org.smartregister.chw.core.listener.OnClickFloatingMenu; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.custom_view.PmtctFloatingMenu; +import org.smartregister.chw.hf.dao.HeiDao; +import org.smartregister.chw.hf.interactor.HeiProfileInteractor; +import org.smartregister.chw.hf.model.FamilyProfileModel; +import org.smartregister.chw.hf.presenter.HeiProfilePresenter; +import org.smartregister.chw.hf.rule.HfHeiFollowupRule; +import org.smartregister.chw.hf.utils.HeiVisitUtils; +import org.smartregister.chw.hf.utils.HfChildUtils; +import org.smartregister.chw.hiv.dao.HivDao; +import org.smartregister.chw.hiv.domain.HivMemberObject; +import org.smartregister.chw.pmtct.PmtctLibrary; +import org.smartregister.chw.pmtct.activity.BasePmtctProfileActivity; +import org.smartregister.chw.pmtct.dao.PmtctDao; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.Visit; +import org.smartregister.chw.pmtct.util.Constants; +import org.smartregister.chw.pmtct.util.PmtctUtil; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.dao.LocationsDao; +import org.smartregister.domain.AlertStatus; +import org.smartregister.family.contract.FamilyProfileContract; +import org.smartregister.family.domain.FamilyEventClient; +import org.smartregister.family.interactor.FamilyProfileInteractor; +import org.smartregister.family.util.DBConstants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.repository.AllSharedPreferences; + +import java.text.SimpleDateFormat; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +import javax.annotation.Nullable; + +import timber.log.Timber; + +public class HeiProfileActivity extends BasePmtctProfileActivity { + + private static String baseEntityId; + protected TextView textViewRecordHeiNumber; + private SimpleDateFormat dayMonthYear = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + private Date registerDate = HeiDao.getHeiRegisterDate(baseEntityId); + private Date followUpVisitDate = HeiDao.getHeiFollowUpVisitDate(baseEntityId); + private HfHeiFollowupRule heiFollowupRule = new HfHeiFollowupRule(registerDate, followUpVisitDate, baseEntityId); + + public static void startProfile(Activity activity, String baseEntityId) { + HeiProfileActivity.baseEntityId = baseEntityId; + Intent intent = new Intent(activity, HeiProfileActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + activity.startActivity(intent); + } + + protected static CommonPersonObjectClient getClientDetailsByBaseEntityID(@NonNull String baseEntityId) { + return getCommonPersonObjectClient(baseEntityId); + } + + + @Override + protected void onCreation() { + super.onCreation(); + updateToolbarTitle(this, org.smartregister.chw.core.R.id.toolbar_title, memberObject.getFamilyName()); + } + + @Override + protected void onResumption() { + super.onResumption(); + setupViews(); + showHeiNumberOrRegistration(baseEntityId); + } + + @Override + protected void initializePresenter() { + showProgressBar(true); + String baseEntityId = getIntent().getStringExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID); + memberObject = HeiDao.getMember(baseEntityId); + profilePresenter = new HeiProfilePresenter(this, new HeiProfileInteractor(), memberObject); + fetchProfileData(); + profilePresenter.refreshProfileBottom(); + } + + @Override + protected void setupViews() { + super.setupViews(); + try { + HeiVisitUtils.processVisits(); + } catch (Exception e) { + Timber.e(e); + } + int defaultImage = org.smartregister.chw.core.R.drawable.rowavatar_child; + ImageView imageViewProfile = findViewById(org.smartregister.chw.core.R.id.imageview_profile); + imageViewProfile.setImageDrawable(getResources().getDrawable(defaultImage)); + TextView toolbarTitle = findViewById(R.id.toolbar_title); + toolbarTitle.setText(R.string.hei_toolbar_title); + + showHeiNumberOrRegistration(baseEntityId); + + textViewRecordPmtct.setText(R.string.record_followup); + textViewRecordPmtct.setOnClickListener(this); + + view_hvl_results_row.setVisibility(View.VISIBLE); + if (HeiDao.hasHivResults(baseEntityId)) + rlHvlResults.setVisibility(View.VISIBLE); + + TextView tvHeiResultsTitle = findViewById(R.id.textview_hvl_results); + TextView tvHeiResultsSubTitle = findViewById(R.id.tv_view_hvl_results); + + tvHeiResultsTitle.setText(R.string.hiv_test_results); + tvHeiResultsSubTitle.setText(R.string.view_child_hiv_results); + + rlHvlResults.setOnClickListener(this); + if (!HeiDao.hasTheChildTransferedOut(baseEntityId)) { + showRiskLabel(HeiDao.getRiskLevel(baseEntityId)); + } else if (HeiDao.hasTheChildTransferedOut(baseEntityId)) { + showStatusLabel(R.string.transfer_out, org.smartregister.pmtct.R.drawable.medium_risk_label, org.smartregister.pmtct.R.color.medium_risk_text_orange); + } else if (HeiDao.isTheChildLostToFollowup(baseEntityId)) { + showStatusLabel(R.string.lost_to_followup, org.smartregister.pmtct.R.drawable.high_risk_label, org.smartregister.pmtct.R.color.high_risk_text_red); + } + + if (shouldShowRecordFollowupVisitButton()) { + textViewRecordPmtct.setVisibility(View.VISIBLE); + visitDone.setVisibility(View.GONE); + } else { + textViewRecordPmtct.setVisibility(View.GONE); + visitDone.setVisibility(View.VISIBLE); + } + + Visit lastFollowupVisit = getVisit(org.smartregister.chw.hf.utils.Constants.Events.HEI_FOLLOWUP); + if (lastFollowupVisit != null && !lastFollowupVisit.getProcessed()) { + showVisitInProgress(); + setUpEditButton(); + } + + Map motherDetails = getMotherDetails(); + if (motherDetails != null) { + showMotherDetails(motherDetails); + } + } + + private void showMotherDetails(Map motherDetails) { + String firstName = getName( + Utils.getValue(motherDetails, DBConstants.KEY.FIRST_NAME, true), + Utils.getValue(motherDetails, DBConstants.KEY.MIDDLE_NAME, true)); + String fullName = getName(firstName, Utils.getValue(motherDetails, DBConstants.KEY.LAST_NAME, true)); + String dobString = Utils.getValue(motherDetails, DBConstants.KEY.DOB, false); + int age = new Period(new DateTime(dobString), new DateTime()).getYears(); + textViewMotherName.setVisibility(View.VISIBLE); + textViewMotherName.setText(String.format(Locale.getDefault(), "%s, %d", fullName, age)); + } + + private Map getMotherDetails() { + String motherBaseEntityId = HeiDao.getMotherBaseEntityId(baseEntityId); + if (StringUtils.isNotBlank(motherBaseEntityId)) { + CommonPersonObjectClient motherClient = getCommonPersonObjectClient(motherBaseEntityId); + if (motherClient.getColumnmaps() != null) { + return motherClient.getColumnmaps(); + } + } + return null; + } + + private void showHeiNumberOrRegistration(String baseEntityId) { + textViewRecordHeiNumber = findViewById(R.id.textview_record_hei_number); + if (!HeiDao.hasHeiNumber(baseEntityId)) { + textViewRecordHeiNumber.setVisibility(View.VISIBLE); + textViewRecordHeiNumber.setText(getString(R.string.record_hei_number)); + textViewRecordHeiNumber.setOnClickListener(this); + textViewRecordPmtct.setVisibility(View.GONE); + } else { + String heiNumber = HeiDao.getHeiNumber(baseEntityId); + textViewRecordHeiNumber.setVisibility(View.GONE); + textViewRecordPmtct.setVisibility(View.VISIBLE); + if (heiNumber != null) { + textViewClientRegNumber.setVisibility(View.VISIBLE); + textViewClientRegNumber.setText(this.getString(R.string.hei_number, heiNumber)); + } + } + + } + + @Override + public void onClick(View view) { + super.onClick(view); + int id = view.getId(); + if (id == R.id.textview_record_pmtct) { + HeiFollowupVisitActivity.startHeiFollowUpActivity(this, baseEntityId, false); + } + if (id == R.id.rlHvlResults) { + Intent intent = new Intent(this, HeiHivResultsViewActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + startActivity(intent); + } + if (id == R.id.textview_record_hei_number) { + JSONObject jsonForm = org.smartregister.chw.core.utils.FormUtils.getFormUtils().getFormJson(getHeiNumberRegistration()); + + try { + JSONArray fields = jsonForm.getJSONObject(STEP1).getJSONArray(FIELDS); + JSONObject heiNumber = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "hei_number"); + String motherBaseEntityId = HeiDao.getMotherBaseEntityId(baseEntityId); + + HivMemberObject hivMemberObject = HivDao.getMember(motherBaseEntityId); + if (hivMemberObject != null && StringUtils.isNotBlank(hivMemberObject.getCtcNumber())) { + String motherCtcNumber = hivMemberObject.getCtcNumber(); + String heiNumberMask = motherCtcNumber + "-C##"; + heiNumber.put("mask", heiNumberMask); + } + + } catch (JSONException e) { + e.printStackTrace(); + } + + startFormActivity(jsonForm); + } + } + + public @Nullable + Visit getVisit(String eventType) { + return PmtctLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), eventType); + } + + private boolean shouldShowRecordFollowupVisitButton() { + return HeiDao.isEligibleForDnaCprHivTest(memberObject.getBaseEntityId()) || + HeiDao.isEligibleForAntiBodiesHivTest(memberObject.getBaseEntityId()) || + HeiDao.isEligibleForCtx(memberObject.getBaseEntityId()) || + HeiDao.isEligibleForArvPrescriptionForHighRisk(memberObject.getBaseEntityId()) || + HeiDao.isEligibleForArvPrescriptionForHighAndLowRisk(memberObject.getBaseEntityId()); + } + + private void showStatusLabel(int stringResource, int backgroundResource, int textColorResource) { + if (riskLabel != null) { + riskLabel.setVisibility(View.VISIBLE); + riskLabel.setTextSize(14); + riskLabel.setText(stringResource); + riskLabel.setBackgroundResource(backgroundResource); + riskLabel.setTextColor(context().getColorResource(textColorResource)); + } + } + + private void showVisitInProgress() { + recordVisits.setVisibility(View.GONE); + textViewRecordPmtct.setVisibility(View.GONE); + textViewVisitDoneEdit.setVisibility(View.VISIBLE); + visitDone.setVisibility(View.VISIBLE); + textViewVisitDone.setText(this.getString(R.string.visit_in_progress, org.smartregister.chw.hf.utils.Constants.Visits.HEI_VISIT)); + textViewVisitDone.setTextColor(getResources().getColor(R.color.black_text_color)); + imageViewCross.setImageResource(org.smartregister.chw.core.R.drawable.activityrow_notvisited); + } + + private void setUpEditButton() { + textViewVisitDoneEdit.setOnClickListener(v -> { + HeiFollowupVisitActivity.startHeiFollowUpActivity(this, baseEntityId, true); + }); + } + + @SuppressLint("DefaultLocale") + @Override + public void setProfileViewWithData() { + CommonPersonObjectClient client = getCommonPersonObjectClient(baseEntityId); + String age = Utils.getTranslatedDate(getDuration(Utils.getValue(client.getColumnmaps(), DBConstants.KEY.DOB, false)), this); + textViewName.setText(String.format("%s %s %s, %s", memberObject.getFirstName(), + memberObject.getMiddleName(), memberObject.getLastName(), age)); + textViewGender.setText(PmtctUtil.getGenderTranslated(this, memberObject.getGender())); + textViewLocation.setText(memberObject.getAddress()); + textViewUniqueID.setText(memberObject.getUniqueId()); + } + + @Override + public void initializeFloatingMenu() { + MemberObject motherMemberObject = PmtctDao.getMember(HeiDao.getMotherBaseEntityId(baseEntityId)); + if (motherMemberObject != null) { + basePmtctFloatingMenu = new PmtctFloatingMenu(this, motherMemberObject); + checkPhoneNumberProvided(StringUtils.isNotBlank(motherMemberObject.getPhoneNumber())); + } else { + basePmtctFloatingMenu = new PmtctFloatingMenu(this, memberObject); + checkPhoneNumberProvided(StringUtils.isNotBlank(memberObject.getPhoneNumber())); + } + + OnClickFloatingMenu onClickFloatingMenu = viewId -> { + switch (viewId) { + case R.id.hiv_fab: + ((CorePmtctFloatingMenu) basePmtctFloatingMenu).animateFAB(); + break; + case R.id.call_layout: + ((CorePmtctFloatingMenu) basePmtctFloatingMenu).launchCallWidget(); + ((CorePmtctFloatingMenu) basePmtctFloatingMenu).animateFAB(); + break; + default: + Timber.d("Unknown fab action"); + break; + } + + }; + + ((CorePmtctFloatingMenu) basePmtctFloatingMenu).setFloatMenuClickListener(onClickFloatingMenu); + basePmtctFloatingMenu.setGravity(Gravity.BOTTOM | Gravity.END); + LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, + LinearLayout.LayoutParams.MATCH_PARENT); + addContentView(basePmtctFloatingMenu, linearLayoutParams); + } + + private void checkPhoneNumberProvided(boolean hasPhoneNumber) { + ((CorePmtctFloatingMenu) basePmtctFloatingMenu).redraw(hasPhoneNumber); + } + + @RequiresApi(api = Build.VERSION_CODES.KITKAT) + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == android.R.id.home) { + onBackPressed(); + return true; + } else if (itemId == org.smartregister.chw.core.R.id.action_registration) { + startFormForEdit(org.smartregister.chw.core.R.string.registration_info, + CoreConstants.JSON_FORM.getChildRegister()); + return true; + } else if (itemId == org.smartregister.chw.core.R.id.action_remove_member) { + removeMember(); + return true; + } else if (itemId == R.id.action_issue_pmtct_followup_referral) { + try { + JSONObject form = (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, org.smartregister.chw.hf.utils.Constants.JsonForm.getHeiCommunityFollowupReferral()); + + //adds the chw locations under the current facility + JSONObject motherChampionLocationField = CoreJsonFormUtils.getJsonField(form, org.smartregister.util.JsonFormUtils.STEP1, "mother_champion_location"); + CoreJsonFormUtils.addLocationsToDropdownField(LocationsDao.getLocationsByTags( + Collections.singleton(SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS)), motherChampionLocationField); + + JSONObject reasonsForIssuingCommunityReferral = CoreJsonFormUtils.getJsonField(form, STEP1, "reasons_for_issuing_community_referral"); + + Date lastVisitDate; + if (followUpVisitDate != null) { + lastVisitDate = followUpVisitDate; + } else { + lastVisitDate = registerDate; + } + form.getJSONObject(STEP1).getJSONArray(FIELDS).getJSONObject(getJsonArrayIndex(form.getJSONObject(STEP1).getJSONArray(FIELDS), "last_client_visit_date")).put(VALUE, dayMonthYear.format(lastVisitDate)); + form.put(org.smartregister.util.JsonFormUtils.ENTITY_ID, HeiDao.getMotherBaseEntityId(baseEntityId)); + form.getJSONObject(STEP1).getJSONArray(FIELDS).getJSONObject(getJsonArrayIndex(form.getJSONObject(STEP1).getJSONArray(FIELDS), "child_name")).put(VALUE, memberObject.getFirstName() + " " + memberObject.getMiddleName() + " " + memberObject.getLastName()); + + if (heiFollowupRule.getDatesDiff() >= 3 && heiFollowupRule.getDatesDiff() < 28) + reasonsForIssuingCommunityReferral.getJSONArray("options").remove(getJsonArrayIndex(reasonsForIssuingCommunityReferral.getJSONArray("options"), "lost_to_followup")); + else if (heiFollowupRule.getDatesDiff() >= 28) + reasonsForIssuingCommunityReferral.getJSONArray("options").remove(getJsonArrayIndex(reasonsForIssuingCommunityReferral.getJSONArray("options"), "missed_appointment")); + + startFormActivity(form); + + } catch (JSONException e) { + Timber.e(e); + } + return true; + } + return super.onOptionsItemSelected(item); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(org.smartregister.chw.core.R.menu.hei_profile_menu, menu); + + if (StringUtils.isNotBlank(HeiDao.getMotherBaseEntityId(baseEntityId)) && (heiFollowupRule.getButtonStatus().equals(CoreConstants.VISIT_STATE.DUE) || heiFollowupRule.getButtonStatus().equals(CoreConstants.VISIT_STATE.OVERDUE)) && heiFollowupRule.getDatesDiff() >= 3 && !HeiDao.hasTheChildTransferedOut(baseEntityId)) { + menu.findItem(R.id.action_issue_pmtct_followup_referral).setVisible(true); + menu.findItem(R.id.action_issue_pmtct_followup_referral).setTitle(R.string.issue_hei_community_referal); + } + + menu.findItem(R.id.action_remove_member).setVisible(true); + return true; + } + + @Override + public void openMedicalHistory() { + HeiMedicalHistoryActivity.startMe(this, memberObject); + } + + @SuppressLint("MissingSuperCall") + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + + if (requestCode == Constants.REQUEST_CODE_GET_JSON && resultCode == RESULT_OK) { + try { + String jsonString = data.getStringExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON); + JSONObject form = new JSONObject(jsonString); + String encounterType = form.getString(JsonFormUtils.ENCOUNTER_TYPE); + if (encounterType.equals(org.smartregister.chw.hf.utils.Constants.Events.HEI_COMMUNITY_FOLLOWUP)) { + AllSharedPreferences allSharedPreferences = org.smartregister.util.Utils.getAllSharedPreferences(); + ((HeiProfilePresenter) profilePresenter).createHeiCommunityFollowupReferralEvent(allSharedPreferences, data.getStringExtra(Constants.JSON_FORM_EXTRA.JSON), HeiDao.getMotherBaseEntityId(baseEntityId)); + } + if (encounterType.equals(org.smartregister.chw.hf.utils.Constants.Events.HEI_NUMBER_REGISTRATION)) { + AllSharedPreferences allSharedPreferences = org.smartregister.util.Utils.getAllSharedPreferences(); + ((HeiProfilePresenter) profilePresenter).createHeiNumberRegistrationEvent(allSharedPreferences, data.getStringExtra(Constants.JSON_FORM_EXTRA.JSON), baseEntityId); + } + if (encounterType.equalsIgnoreCase(CoreConstants.EventType.UPDATE_CHILD_REGISTRATION)) { + String childBaseEntityId = memberObject.getBaseEntityId(); + FamilyEventClient familyEventClient = + new FamilyProfileModel(memberObject.getFamilyName()).processUpdateMemberRegistration(jsonString, childBaseEntityId); + familyEventClient.getEvent().setEventType(CoreConstants.EventType.UPDATE_CHILD_REGISTRATION); + new FamilyProfileInteractor().saveRegistration(familyEventClient, jsonString, true, (FamilyProfileContract.InteractorCallBack) profilePresenter); + + } + } catch (Exception e) { + Timber.e(e, "HeiProfileActivity -- > onActivityResult"); + } + } + } + + protected void removeMember() { + IndividualProfileRemoveActivity.startIndividualProfileActivity(this, + getClientDetailsByBaseEntityID(memberObject.getBaseEntityId()), + memberObject.getFamilyBaseEntityId(), memberObject.getFamilyHead(), + memberObject.getPrimaryCareGiver(), FpRegisterActivity.class.getCanonicalName()); + } + + public void startFormForEdit(Integer title_resource, String formName) { + + JSONObject childEnrollmentForm = null; + CommonPersonObjectClient client = HfChildUtils.getChildClientByBaseEntityId(memberObject.getBaseEntityId()); + + if (client == null) { + return; + } + if (formName.equals(CoreConstants.JSON_FORM.getChildRegister())) { + CoreChildProfileInteractor childProfileInteractor = new CoreChildProfileInteractor(); + childEnrollmentForm = childProfileInteractor.getAutoPopulatedJsonEditFormString(CoreConstants.JSON_FORM.getChildRegister(), (title_resource != null) ? getResources().getString(title_resource) : null, this, client); + String motherBaseEntityId = HeiDao.getMotherBaseEntityId(baseEntityId); + if (StringUtils.isNotBlank(motherBaseEntityId)) { + CommonPersonObjectClient mother = getCommonPersonObjectClient(HeiDao.getMotherBaseEntityId(baseEntityId)); + try { + Map details = mother.getColumnmaps(); + String famName = details.get(DBConstants.KEY.LAST_NAME); + JSONObject stepOne = childEnrollmentForm.getJSONObject(JsonFormUtils.STEP1); + JSONArray jsonArray = stepOne.getJSONArray(JsonFormUtils.FIELDS); + + Map values = new HashMap<>(); + + assert famName != null; + values.put(CoreConstants.JsonAssets.FAM_NAME, famName); + org.smartregister.chw.core.utils.FormUtils.updateFormField(jsonArray, values); + } catch (Exception e) { + Timber.e(e); + } + } else { + try { + JSONObject stepOne = childEnrollmentForm.getJSONObject(JsonFormUtils.STEP1); + JSONArray fields = stepOne.getJSONArray(JsonFormUtils.FIELDS); + JSONObject sameAsFamName = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "same_as_fam_name"); + sameAsFamName.put("type", "hidden"); + } catch (Exception e) { + Timber.e(e); + } + } + + + } + try { + assert childEnrollmentForm != null; + startFormActivity(childEnrollmentForm); + } catch (Exception e) { + Timber.e(e); + } + } + + public void startFormActivity(JSONObject jsonForm) { + Intent intent = org.smartregister.chw.core.utils.Utils.formActivityIntent(this, jsonForm.toString()); + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + public void refreshFamilyStatus(AlertStatus status) { + super.refreshFamilyStatus(status); + rlFamilyServicesDue.setVisibility(View.GONE); + } + + @Override + public void refreshMedicalHistory(boolean hasHistory) { + Visit lastFollowupVisit = getVisit(org.smartregister.chw.hf.utils.Constants.Events.HEI_FOLLOWUP); + if (lastFollowupVisit != null) { + rlLastVisit.setVisibility(View.VISIBLE); + TextView medicalHistoryTitle = findViewById(R.id.ivViewHistoryArrow); + medicalHistoryTitle.setTextColor(getResources().getColor(R.color.black)); + } else { + rlLastVisit.setVisibility(View.GONE); + } + } + + @Override + public void refreshUpComingServicesStatus(String service, AlertStatus status, Date date) { + super.refreshUpComingServicesStatus(service, status, date); + rlUpcomingServices.setVisibility(View.GONE); + } + + private int getJsonArrayIndex(JSONArray options, String key) { + for (int i = 0; i < options.length(); ++i) { + try { + if (options.getJSONObject(i).getString("key").equals(key)) { + return i; + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + return -1; + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiRegisterActivity.java new file mode 100644 index 000000000..d18820f5f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HeiRegisterActivity.java @@ -0,0 +1,68 @@ +package org.smartregister.chw.hf.activity; + +import android.os.Bundle; + +import com.google.android.material.bottomnavigation.LabelVisibilityMode; + +import org.smartregister.chw.core.custom_views.NavigationMenu; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.custom_view.FacilityMenu; +import org.smartregister.chw.hf.fragment.HeiRegisterFragment; +import org.smartregister.chw.hf.listener.HfFamilyBottomNavListener; +import org.smartregister.chw.hf.presenter.HeiRegisterPresenter; +import org.smartregister.chw.pmtct.activity.BasePmtctRegisterActivity; +import org.smartregister.chw.pmtct.interactor.BasePmtctRegisterInteractor; +import org.smartregister.chw.pmtct.model.BasePmtctRegisterModel; +import org.smartregister.helper.BottomNavigationHelper; +import org.smartregister.view.fragment.BaseRegisterFragment; + +public class HeiRegisterActivity extends BasePmtctRegisterActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + FacilityMenu.getInstance(this, null, null); + } + + @Override + protected void initializePresenter() { + presenter = new HeiRegisterPresenter(this, new BasePmtctRegisterModel(), new BasePmtctRegisterInteractor()); + } + + @Override + protected BaseRegisterFragment getRegisterFragment() { + return new HeiRegisterFragment(); + } + + @Override + protected void registerBottomNavigation() { + bottomNavigationHelper = new BottomNavigationHelper(); + bottomNavigationView = findViewById(R.id.bottom_navigation); + + if (bottomNavigationView != null) { + bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED); + bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED); + + bottomNavigationView.getMenu().clear(); + bottomNavigationView.inflateMenu(R.menu.bottom_nav_family_menu); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_clients); + bottomNavigationView.getMenu().removeItem(org.smartregister.chw.tb.R.id.action_register); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_search); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_library); + bottomNavigationView.getMenu().removeItem(org.smartregister.family.R.id.action_job_aids); + bottomNavigationView.setOnNavigationItemSelectedListener(new HfFamilyBottomNavListener(this, bottomNavigationView)); + + } + + } + + @Override + protected void onResumption() { + super.onResumption(); + NavigationMenu menu = FacilityMenu.getInstance(this, null, null); + if (menu != null) { + menu.getNavigationAdapter().setSelectedView(CoreConstants.DrawerMenu.HEI); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HfJsonWizardFormActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HfJsonWizardFormActivity.java new file mode 100644 index 000000000..5f191880b --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HfJsonWizardFormActivity.java @@ -0,0 +1,57 @@ +package org.smartregister.chw.hf.activity; + +import android.os.Bundle; +import android.os.Parcel; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.utils.NativeFormLangUtils; + +import org.json.JSONObject; +import org.smartregister.chw.hf.domain.JSONObjectHolder; +import org.smartregister.chw.hf.fragment.HfJsonFormFragment; +import org.smartregister.family.activity.FamilyWizardFormActivity; + +public class HfJsonWizardFormActivity extends FamilyWizardFormActivity { + //Implementation that handles passing of large data between activities that sometimes caused TransactionTooLarge exceptions + public final int MAX_BUNDLE_SIZE = 300; + + @Override + protected String getJsonForm() { + // Retrieve the large JSONObject from JSONObjectHolder + JSONObject largeJSONObject = JSONObjectHolder.getInstance().getLargeJSONObject(); + String jsonForm = largeJSONObject.toString(); + if (translateForm) { + jsonForm = NativeFormLangUtils.getTranslatedStringWithDBResourceBundle(this, jsonForm, null); + } + return jsonForm; + } + + @Override + public synchronized void initializeFormFragment() { + isFormFragmentInitialized = true; + HfJsonFormFragment formFragment = HfJsonFormFragment.getFormFragment(JsonFormConstants.FIRST_STEP_NAME); + getSupportFragmentManager().beginTransaction() + .add(com.vijay.jsonwizard.R.id.container, formFragment).commitAllowingStateLoss(); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + long bundleSize = getBundleSize(outState); + if (bundleSize > MAX_BUNDLE_SIZE * 1024) { + outState.clear(); + } + } + + private long getBundleSize(Bundle bundle) { + long dataSize; + Parcel obtain = Parcel.obtain(); + try { + obtain.writeBundle(bundle); + dataSize = obtain.dataSize(); + } finally { + obtain.recycle(); + } + return dataSize; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HfReportsViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HfReportsViewActivity.java new file mode 100644 index 000000000..72bcd1176 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HfReportsViewActivity.java @@ -0,0 +1,98 @@ +package org.smartregister.chw.hf.activity; + +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.os.Bundle; +import android.view.Menu; +import android.view.MenuItem; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.widget.Toast; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; + +import com.google.android.material.appbar.AppBarLayout; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.ReportUtils; +import org.smartregister.view.customcontrols.CustomFontTextView; + +public class HfReportsViewActivity extends AppCompatActivity { + protected static final String ARG_REPORT_PATH = "ARG_REPORT_PATH"; + protected static final String ARG_REPORT_TITLE = "ARG_REPORT_TITLE"; + protected static final String ARG_REPORT_DATE = "ARG_REPORT_DATE"; + protected static final String ARG_REPORT_TYPE = "ARG_REPORT_TYPE"; + public static WebView printWebView; + protected CustomFontTextView toolBarTextView; + protected AppBarLayout appBarLayout; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_reports_view); + String reportPath = getIntent().getStringExtra(ARG_REPORT_PATH); + String reportDate = getIntent().getStringExtra(ARG_REPORT_DATE); + String reportType = getIntent().getStringExtra(ARG_REPORT_TYPE); + int reportTitle = getIntent().getIntExtra(ARG_REPORT_TITLE, 0); + setUpToolbar(reportTitle); + WebView webView = findViewById(R.id.webview); + + WebSettings webSettings = webView.getSettings(); + webSettings.setJavaScriptEnabled(true); + ReportUtils.setReportPeriod(reportDate); + ReportUtils.loadReportView(reportPath, webView, this, reportType); + } + + public void setUpToolbar(int reportTitle) { + Toolbar toolbar = findViewById(org.smartregister.chw.core.R.id.back_to_nav_toolbar); + toolBarTextView = toolbar.findViewById(org.smartregister.chw.core.R.id.toolbar_title); + setSupportActionBar(toolbar); + + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + final Drawable upArrow = getResources().getDrawable(org.smartregister.chw.core.R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setElevation(0); + } + toolbar.setNavigationOnClickListener(v -> finish()); + if (StringUtils.isNotBlank(getString(reportTitle))) { + toolBarTextView.setText(getString(reportTitle)); + } else { + toolBarTextView.setText(R.string.reports_title); + } + toolBarTextView.setOnClickListener(v -> finish()); + appBarLayout = findViewById(org.smartregister.chw.core.R.id.app_bar); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + appBarLayout.setOutlineProvider(null); + } + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.reports_view_menu, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == R.id.action_print) { + if (printWebView != null) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + ReportUtils.printTheWebPage(printWebView, this); + } else { + Toast.makeText(this, "Not available for device below Android LOLLIPOP", Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(this, "WebPage not fully loaded", Toast.LENGTH_SHORT).show(); + } + return true; + } + return super.onOptionsItemSelected(item); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivFormsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivFormsActivity.java new file mode 100644 index 000000000..616e67e45 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivFormsActivity.java @@ -0,0 +1,45 @@ +package org.smartregister.chw.hf.activity; + +import android.content.Intent; + +import com.nerdstone.neatformcore.domain.model.NFormViewData; + +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.interactor.HivFormsInteractor; +import org.smartregister.chw.hf.presenter.HivFormActivityActivityPresenter; +import org.smartregister.chw.hiv.activity.BaseHivFormsActivity; +import org.smartregister.chw.hiv.presenter.BaseHivFormsActivityPresenter; +import org.smartregister.chw.hiv.util.Constants; +import org.smartregister.chw.hiv.util.DBConstants; +import org.smartregister.chw.hiv.util.JsonFormConstants; + +import java.util.HashMap; + +public class HivFormsActivity extends BaseHivFormsActivity { + @NotNull + @Override + public BaseHivFormsActivityPresenter presenter() { + return new HivFormActivityActivityPresenter(getBaseEntityId(), this, new HivFormsInteractor()); + } + + @Override + public void setDataToBePassedBackToCallingActivityAsResults(@NotNull Intent intent, @NotNull JSONObject jsonForm, @NotNull HashMap formData) { + try { + if (jsonForm.getString(JsonFormConstants.ENCOUNTER_TYPE).equals(Constants.EventType.HIV_INDEX_CONTACT_TESTING_FOLLOWUP)) { + boolean registered_to_hiv_registry = formData.containsKey(DBConstants.Key.TEST_RESULTS) + && StringUtils.containsIgnoreCase(String.valueOf(formData.get(DBConstants.Key.TEST_RESULTS).getValue()), "positive") + && StringUtils.containsIgnoreCase(String.valueOf(formData.get(DBConstants.Key.ENROLLED_TO_CLINIC).getValue()), "yes"); + intent.putExtra(HivIndexContactProfileActivity.REGISTERED_TO_HIV_REGISTRY, registered_to_hiv_registry); + } + if (jsonForm.getString(JsonFormConstants.ENCOUNTER_TYPE).equals(org.smartregister.chw.hf.utils.Constants.Events.UPDATE_HIV_INDEX_TESTING_FOLLOWUP)) { + intent.putExtra(HivIndexContactProfileActivity.REGISTERED_TO_HIV_REGISTRY, true); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } +} + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivIndexContactProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivIndexContactProfileActivity.java new file mode 100644 index 000000000..75c5e86c7 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivIndexContactProfileActivity.java @@ -0,0 +1,386 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; +import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; +import static org.smartregister.chw.hf.utils.JsonFormUtils.getAutoPopulatedJsonEditFormString; +import static org.smartregister.chw.hiv.util.Constants.ActivityPayload.HIV_MEMBER_OBJECT; +import static org.smartregister.util.JsonFormUtils.STEP1; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.view.Gravity; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.recyclerview.widget.RecyclerView; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.activity.CoreHivIndexContactProfileActivity; +import org.smartregister.chw.core.listener.OnClickFloatingMenu; +import org.smartregister.chw.core.model.CoreAllClientsMemberModel; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.UpdateDetailsUtil; +import org.smartregister.chw.core.utils.Utils; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.adapter.HivIndexFollowupCardViewAdapter; +import org.smartregister.chw.hf.contract.HivIndexContactProfileContract; +import org.smartregister.chw.hf.custom_view.HivIndexContactFloatingMenu; +import org.smartregister.chw.hf.interactor.HfHivIndexContactProfileInteractor; +import org.smartregister.chw.hf.model.HivIndexFollowupFeedbackDetailsModel; +import org.smartregister.chw.hf.presenter.HivIndexContactProfilePresenter; +import org.smartregister.chw.hiv.dao.HivDao; +import org.smartregister.chw.hiv.dao.HivIndexDao; +import org.smartregister.chw.hiv.domain.HivIndexContactObject; +import org.smartregister.chw.hiv.util.DBConstants; +import org.smartregister.chw.hivst.dao.HivstDao; +import org.smartregister.chw.tb.util.Constants; +import org.smartregister.commonregistry.CommonPersonObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.commonregistry.CommonRepository; +import org.smartregister.dao.LocationsDao; +import org.smartregister.domain.Location; +import org.smartregister.family.contract.FamilyProfileContract; +import org.smartregister.family.domain.FamilyEventClient; +import org.smartregister.family.interactor.FamilyProfileInteractor; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.opd.utils.OpdConstants; + +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +import timber.log.Timber; + +public class HivIndexContactProfileActivity extends CoreHivIndexContactProfileActivity implements HivIndexContactProfileContract.View { + + public final static String REGISTERED_TO_HIV_REGISTRY = "registered_to_hiv_registry"; + public static final String NAME = "name"; + public static final String PROPERTIES = "properties"; + public static final String TEXT = "text"; + public static final String SELECTION = "selection"; + private CommonPersonObjectClient commonPersonObjectClient; + + public static void startHivIndexContactProfileActivity(Activity activity, HivIndexContactObject hivIndexContactObject) { + Intent intent = new Intent(activity, HivIndexContactProfileActivity.class); + intent.putExtra(HIV_MEMBER_OBJECT, hivIndexContactObject); + activity.startActivity(intent); + } + + public static void startHivIndexContactFollowupActivity(Activity activity, String baseEntityID) throws JSONException { + + Intent intent = new Intent(activity, HivFormsActivity.class); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.BASE_ENTITY_ID, baseEntityID); + + HivIndexContactObject hivIndexContactObject = HivIndexDao.getMember(baseEntityID); + + if (hivIndexContactObject.getRelationship().equals("sexual_partner")) { //Changing the rule file to the rule file for index contacts who are sex partners + JSONObject form = (new FormUtils()).getFormJsonFromRepositoryOrAssets(activity, CoreConstants.JSON_FORM.getHivIndexContactFollowupVisit()); + if (form != null) + form.put("rules_file", "rule/hiv_index_contact_followup_for_sex_partner_rules.yml"); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.JSON_FORM, form.toString()); + } else { //Leaving the default rule files for non sex partners index contacts + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.JSON_FORM, (new FormUtils()).getFormJsonFromRepositoryOrAssets(activity, CoreConstants.JSON_FORM.getHivIndexContactFollowupVisit()).toString()); + } + + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.ACTION, Constants.ActivityPayloadType.FOLLOW_UP_VISIT); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.USE_DEFAULT_NEAT_FORM_LAYOUT, false); + + activity.startActivityForResult(intent, org.smartregister.chw.anc.util.Constants.REQUEST_CODE_HOME_VISIT); + } + + public void setReferralAndFollowupFeedback(List followupFeedbackDetailsModel) { + if (notificationAndReferralRecyclerView != null && followupFeedbackDetailsModel.size() > 0) { + RecyclerView.Adapter mAdapter = new HivIndexFollowupCardViewAdapter(followupFeedbackDetailsModel, this, getCommonPersonObjectClient(), CoreConstants.REGISTERED_ACTIVITIES.HIV_INDEX_REGISTER_ACTIVITY); + notificationAndReferralRecyclerView.setAdapter(mAdapter); + notificationAndReferralLayout.setVisibility(View.VISIBLE); + findViewById(R.id.view_notification_and_referral_row).setVisibility(View.VISIBLE); + } + } + + @Override + protected void onCreation() { + super.onCreation(); + setCommonPersonObjectClient(getClientDetailsByBaseEntityID(getHivIndexContactObject().getBaseEntityId())); + } + + @Override + protected void onResume() { + super.onResume(); + ((HivIndexContactProfilePresenter) getHivContactProfilePresenter()).fetchReferralTasks(); + if (notificationAndReferralRecyclerView != null && notificationAndReferralRecyclerView.getAdapter() != null) { + notificationAndReferralRecyclerView.getAdapter().notifyDataSetChanged(); + } + } + + public CommonPersonObjectClient getCommonPersonObjectClient() { + return commonPersonObjectClient; + } + + public void setCommonPersonObjectClient(CommonPersonObjectClient commonPersonObjectClient) { + this.commonPersonObjectClient = commonPersonObjectClient; + } + + @Override + protected void initializePresenter() { + showProgressBar(true); + setHivContactProfilePresenter(new HivIndexContactProfilePresenter(this, new HfHivIndexContactProfileInteractor(this), getHivIndexContactObject())); + fetchProfileData(); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + try { + if (itemId == R.id.action_issue_hiv_community_followup_referral) { + JSONObject formJsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, CoreConstants.JSON_FORM.getHivIndexContactCommunityFollowupReferral()); + initializeHealthFacilitiesList(formJsonObject); + HivIndexContactsContactsRegisterActivity.startHIVFormActivity(this, getHivIndexContactObject().getBaseEntityId(), CoreConstants.JSON_FORM.getHivIndexContactCommunityFollowupReferral(), formJsonObject.toString()); + return true; + } else if (itemId == R.id.action_location_info) { + //use this method in hf to get the chw_location instead of encounter_location for chw + JSONObject preFilledForm = getAutoPopulatedJsonEditFormString( + CoreConstants.JSON_FORM.getFamilyDetailsRegister(), this, + UpdateDetailsUtil.getFamilyRegistrationDetails(getHivIndexContactObject().getFamilyBaseEntityId()), Utils.metadata().familyRegister.updateEventType); + if (preFilledForm != null) + UpdateDetailsUtil.startUpdateClientDetailsActivity(preFilledForm, this); + return true; + } else if (itemId == R.id.action_hivst_registration){ + startHivstRegistration(); + return true; + } + } catch (JSONException e) { + Timber.e(e); + } + return super.onOptionsItemSelected(item); + } + + public void initializeHealthFacilitiesList(JSONObject form) { + //overrides and loads the list of chw under that facility + JSONArray steps; + List locationList = LocationsDao.getLocationsByTags(Collections.singleton(SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS)); + try { + JSONArray options = new JSONArray(); + for (Location location : locationList) { + JSONObject option = new JSONObject(); + option.put("name", StringUtils.capitalize(location.getProperties().getName())); + option.put("text", StringUtils.capitalize(location.getProperties().getName())); + JSONObject metaData = new JSONObject(); + metaData.put("openmrs_entity", "location_uuid"); + metaData.put("openmrs_entity_id", location.getProperties().getUid()); + option.put("meta_data", metaData); + + options.put(option); + } + + steps = form.getJSONArray("steps"); + JSONObject step = steps.getJSONObject(0); + JSONArray fields = step.getJSONArray("fields"); + int i = 0; + int j = 0; + int fieldCount = fields.length(); + int optionCount = options.length(); + while (i < fieldCount) { + JSONObject field = fields.getJSONObject(i); + if (field.getString("name").equals("chw_referral_hf")) { + JSONArray optionsArr = field.getJSONArray("options"); + while (j < optionCount) { + optionsArr.put(options.get(j)); + j++; + } + break; + } + i++; + } + } catch (JSONException e) { + Timber.e(e); + } + } + + private void startHivstRegistration(){ + CommonRepository commonRepository = org.smartregister.family.util.Utils.context().commonrepository(org.smartregister.family.util.Utils.metadata().familyMemberRegister.tableName); + + final CommonPersonObject commonPersonObject = commonRepository.findByBaseEntityId(getHivIndexContactObject().getBaseEntityId()); + final CommonPersonObjectClient client = new CommonPersonObjectClient(commonPersonObject.getCaseId(), commonPersonObject.getDetails(), ""); + client.setColumnmaps(commonPersonObject.getColumnmaps()); + String gender = org.smartregister.family.util.Utils.getValue(commonPersonObject.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.GENDER, false); + + HivstRegisterActivity.startHivstRegistrationActivity(this, getHivIndexContactObject().getBaseEntityId(), gender); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(org.smartregister.chw.core.R.menu.hiv_profile_menu, menu); + menu.findItem(R.id.action_issue_hiv_community_followup_referral).setVisible(true); + CommonPersonObjectClient commonPersonObject = getCommonPersonObjectClient(); + if(HealthFacilityApplication.getApplicationFlavor().hasHivst()) { + String dob = Utils.getValue(commonPersonObject.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.DOB, false); + int age = Utils.getAgeFromDate(dob); + menu.findItem(R.id.action_hivst_registration).setVisible(HivstDao.isRegisteredForHivst(getHivIndexContactObject().getBaseEntityId()) && age >= 15); + } + menu.findItem(org.smartregister.chw.core.R.id.action_location_info).setVisible(UpdateDetailsUtil.isIndependentClient(getHivIndexContactObject().getBaseEntityId())); + return true; + } + + @Override + public void openFollowUpVisitForm(boolean isEdit) { + if (!isEdit) { + try { + startHivIndexContactFollowupActivity(this, getHivIndexContactObject().getBaseEntityId()); + } catch (JSONException e) { + Timber.e(e); + } + } + } + + @Override + protected void removeMember() { + // Not required for HF (as seen in other profile activities)? + } + + @Override + public void onClick(View view) { + super.onClick(view); + int id = view.getId(); + if (id == R.id.record_hiv_followup_visit) { + openFollowUpVisitForm(false); + } + } + + @Override + public void initializeCallFAB() { + setHivFloatingMenu(new HivIndexContactFloatingMenu(this, getHivIndexContactObject())); + + OnClickFloatingMenu onClickFloatingMenu = viewId -> { + switch (viewId) { + case R.id.hiv_fab: + checkPhoneNumberProvided(); + ((HivIndexContactFloatingMenu) getHivFloatingMenu()).animateFAB(); + break; + case R.id.call_layout: + ((HivIndexContactFloatingMenu) getHivFloatingMenu()).launchCallWidget(); + ((HivIndexContactFloatingMenu) getHivFloatingMenu()).animateFAB(); + break; + default: + Timber.d("Unknown fab action"); + break; + } + }; + + ((HivIndexContactFloatingMenu) getHivFloatingMenu()).setFloatMenuClickListener(onClickFloatingMenu); + getHivFloatingMenu().setGravity(Gravity.BOTTOM | Gravity.END); + LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, + LinearLayout.LayoutParams.MATCH_PARENT); + addContentView(getHivFloatingMenu(), linearLayoutParams); + } + + private void checkPhoneNumberProvided() { + boolean phoneNumberAvailable = (StringUtils.isNotBlank(getHivIndexContactObject().getPhoneNumber())); + ((HivIndexContactFloatingMenu) getHivFloatingMenu()).redraw(phoneNumberAvailable); + } + + @Override + public Context getContext() { + return HivIndexContactProfileActivity.this; + } + + @Override + public void verifyHasPhone() { + // TODO -> Implement for HF + } + + @Override + public void notifyHasPhone(boolean b) { + // TODO -> Implement for HF + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (resultCode != Activity.RESULT_OK) return; + try { + String jsonString = data.getStringExtra(OpdConstants.JSON_FORM_EXTRA.JSON); + Timber.d("JSONResult : %s", jsonString); + + if (jsonString == null) + finish(); + JSONObject form = new JSONObject(jsonString); + if (form.getString(JsonFormUtils.ENCOUNTER_TYPE).equals(Utils.metadata().familyRegister.updateEventType)) { + FamilyEventClient familyEventClient = new CoreAllClientsMemberModel().processJsonForm(jsonString, getHivIndexContactObject().getFamilyBaseEntityId()); + JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), STEP1, SYNC_LOCATION_ID); + familyEventClient.getEvent().setLocationId(CoreJsonFormUtils.getSyncLocationUUIDFromDropdown(syncLocationField)); + familyEventClient.getEvent().setEntityType(CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT); + new FamilyProfileInteractor().saveRegistration(familyEventClient, jsonString, true, (FamilyProfileContract.InteractorCallBack) getHivContactProfilePresenter()); + } else { + boolean savedToHivRegistry = data.getBooleanExtra(REGISTERED_TO_HIV_REGISTRY, false); + if (savedToHivRegistry) { + HivProfileActivity.startHivProfileActivity(this, Objects.requireNonNull(HivDao.getMember(getHivIndexContactObject().getBaseEntityId()))); + finish(); + } else { + setHivIndexContactObject(HivIndexDao.getMember(getHivIndexContactObject().getBaseEntityId())); + initializePresenter(); + fetchProfileData(); + } + } + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + public void setFollowUpButtonDue() { + super.setFollowUpButtonDue(); + showFollowUpVisitButton(!getHivIndexContactObject().getContactClientNotificationMethod().equals("na")); + } + + @Override + public void setupViews() { + super.setupViews(); + TextView tvRecordHivFollowup = findViewById(R.id.textview_record_reccuring_visit); + if (!(getHivIndexContactObject().getEnrolledToClinic() || getHivIndexContactObject().getHasTheContactClientBeenTested().equals("")) && getHivIndexContactObject().getTestResults().equalsIgnoreCase("Positive")) { + tvRecordHivFollowup.setText(R.string.record_ctc_number); + tvRecordHivFollowup.setOnClickListener(v -> { + try { + startUpdateFollowup(HivIndexContactProfileActivity.this, getHivIndexContactObject().getBaseEntityId()); + } catch (JSONException e) { + Timber.e(e); + } + }); + } + } + + protected void startUpdateFollowup(Activity activity, String baseEntityID) throws JSONException { + Intent intent = new Intent(activity, HivFormsActivity.class); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.BASE_ENTITY_ID, baseEntityID); + HivIndexContactObject hivIndexContactObject = getHivIndexContactObject(); + JSONObject form = (new FormUtils()).getFormJsonFromRepositoryOrAssets(activity, org.smartregister.chw.hf.utils.Constants.JsonForm.getHivIndexContactCtcEnrollment()); + if (form != null) { + JSONArray fields = form.getJSONArray("steps").getJSONObject(0).getJSONArray("fields"); + for (int i = 0; i < fields.length(); i++) { + JSONObject field = fields.getJSONObject(i); + if (field.getString(NAME).equals(DBConstants.Key.PLACE_WHERE_TEST_WAS_CONDUCTED)) { + field.getJSONObject(PROPERTIES).put(TEXT, hivIndexContactObject.getPlaceWhereTestWasConducted()); + } else if (field.getString(NAME).equals(DBConstants.Key.TEST_RESULTS)) { + field.getJSONObject(PROPERTIES).put(TEXT, hivIndexContactObject.getTestResults()); + } + + } + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.JSON_FORM, form.toString()); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.ACTION, Constants.ActivityPayloadType.FOLLOW_UP_VISIT); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.USE_DEFAULT_NEAT_FORM_LAYOUT, false); + } + + activity.startActivityForResult(intent, org.smartregister.chw.anc.util.Constants.REQUEST_CODE_HOME_VISIT); + } +} + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivIndexContactsContactsRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivIndexContactsContactsRegisterActivity.java new file mode 100644 index 000000000..6cf0ca94b --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivIndexContactsContactsRegisterActivity.java @@ -0,0 +1,77 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import com.google.android.material.bottomnavigation.LabelVisibilityMode; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.activity.CoreHivIndexContactsRegisterActivity; +import org.smartregister.chw.core.custom_views.NavigationMenu; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.custom_view.FacilityMenu; +import org.smartregister.chw.hf.fragment.HivIndexContactsRegisterFragment; +import org.smartregister.chw.hiv.fragment.BaseHivIndexContactsRegisterFragment; +import org.smartregister.helper.BottomNavigationHelper; + +public class HivIndexContactsContactsRegisterActivity extends CoreHivIndexContactsRegisterActivity { + + public static void startHIVFormActivity(Activity activity, String baseEntityID, String formName, String payloadType) { + Intent intent = new Intent(activity, HivIndexContactsContactsRegisterActivity.class); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.ACTION, payloadType); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.HIV_REGISTRATION_FORM_NAME, formName); + activity.startActivity(intent); + } + + @NotNull + @Override + protected BaseHivIndexContactsRegisterFragment getRegisterFragment() { + return new HivIndexContactsRegisterFragment(); + } + + @NotNull + @Override + protected Fragment[] getOtherFragments() { + return new Fragment[0]; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Override + protected void registerBottomNavigation() { + bottomNavigationHelper = new BottomNavigationHelper(); + bottomNavigationView = findViewById(org.smartregister.R.id.bottom_navigation); + + if (bottomNavigationView != null) { + bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_clients); + bottomNavigationView.getMenu().removeItem(org.smartregister.chw.hiv.R.id.action_register); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_search); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_library); + bottomNavigationView.getMenu().removeItem(org.smartregister.chw.hiv.R.id.action_received_referrals); + + bottomNavigationView.inflateMenu(getMenuResource()); + bottomNavigationView.getMenu().removeItem(org.smartregister.chw.hiv.R.id.action_received_referrals); + bottomNavigationHelper.disableShiftMode(bottomNavigationView); + } + } + + @Override + protected void onResumption() { + super.onResumption(); + NavigationMenu menu = FacilityMenu.getInstance(this, null, null); + if (menu != null) { + menu.getNavigationAdapter().setSelectedView(CoreConstants.DrawerMenu.HIV_INDEX_CLIENTS_HF); + } + } + + +} + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivProfileActivity.java new file mode 100644 index 000000000..92520c091 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivProfileActivity.java @@ -0,0 +1,492 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.chw.hf.utils.Constants.JsonForm.HIV_REGISTRATION; +import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; +import static org.smartregister.chw.hf.utils.JsonFormUtils.getAutoPopulatedJsonEditFormString; +import static org.smartregister.chw.hiv.util.Constants.ActivityPayload.HIV_MEMBER_OBJECT; +import static org.smartregister.util.JsonFormUtils.STEP1; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.AsyncTask; +import android.view.Gravity; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.recyclerview.widget.RecyclerView; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.AllConstants; +import org.smartregister.chw.core.activity.CoreHivProfileActivity; +import org.smartregister.chw.core.activity.CoreHivUpcomingServicesActivity; +import org.smartregister.chw.core.dao.AncDao; +import org.smartregister.chw.core.listener.OnClickFloatingMenu; +import org.smartregister.chw.core.model.CoreAllClientsMemberModel; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.UpdateDetailsUtil; +import org.smartregister.chw.core.utils.Utils; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.adapter.HivAndTbReferralCardViewAdapter; +import org.smartregister.chw.hf.contract.HivProfileContract; +import org.smartregister.chw.hf.custom_view.HivFloatingMenu; +import org.smartregister.chw.hf.interactor.HfHivProfileInteractor; +import org.smartregister.chw.hf.model.HivTbReferralTasksAndFollowupFeedbackModel; +import org.smartregister.chw.hf.presenter.HivProfilePresenter; +import org.smartregister.chw.hf.utils.LFTUFormUtils; +import org.smartregister.chw.hiv.activity.BaseHivFormsActivity; +import org.smartregister.chw.hiv.dao.HivIndexDao; +import org.smartregister.chw.hiv.domain.HivIndexContactObject; +import org.smartregister.chw.hiv.domain.HivMemberObject; +import org.smartregister.chw.hiv.util.HivUtil; +import org.smartregister.chw.hivst.dao.HivstDao; +import org.smartregister.chw.malaria.dao.MalariaDao; +import org.smartregister.chw.tb.util.Constants; +import org.smartregister.commonregistry.CommonPersonObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.commonregistry.CommonRepository; +import org.smartregister.family.contract.FamilyProfileContract; +import org.smartregister.family.domain.FamilyEventClient; +import org.smartregister.family.interactor.FamilyProfileInteractor; +import org.smartregister.family.util.DBConstants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.opd.pojo.RegisterParams; +import org.smartregister.opd.utils.OpdConstants; +import org.smartregister.opd.utils.OpdJsonFormUtils; +import org.smartregister.opd.utils.OpdUtils; + +import java.util.Date; +import java.util.List; +import java.util.Objects; + +import timber.log.Timber; + +public class HivProfileActivity extends CoreHivProfileActivity implements HivProfileContract.View { + private static final String TITLE = "title"; + private CommonPersonObjectClient commonPersonObjectClient; + + public static void startHivProfileActivity(Activity activity, HivMemberObject memberObject) { + Intent intent = new Intent(activity, HivProfileActivity.class); + intent.putExtra(HIV_MEMBER_OBJECT, memberObject); + activity.startActivity(intent); + } + + public static void startHivProfileActivity(Activity activity, HivMemberObject memberObject, int title) { + Intent intent = new Intent(activity, HivProfileActivity.class); + intent.putExtra(HIV_MEMBER_OBJECT, memberObject); + intent.putExtra(TITLE, title); + activity.startActivity(intent); + } + + public static void startHivFollowupActivity(Activity activity, String baseEntityID) throws JSONException { + Intent intent = new Intent(activity, BaseHivFormsActivity.class); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.JSON_FORM, (new FormUtils()).getFormJsonFromRepositoryOrAssets(activity, HIV_REGISTRATION).toString()); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.ACTION, Constants.ActivityPayloadType.FOLLOW_UP_VISIT); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.USE_DEFAULT_NEAT_FORM_LAYOUT, false); + + activity.startActivityForResult(intent, org.smartregister.chw.anc.util.Constants.REQUEST_CODE_HOME_VISIT); + } + + public void setReferralTasksAndFollowupFeedback(List tasksAndFollowupFeedbackModels) { + if (notificationAndReferralRecyclerView != null && tasksAndFollowupFeedbackModels.size() > 0) { + RecyclerView.Adapter mAdapter = new HivAndTbReferralCardViewAdapter(tasksAndFollowupFeedbackModels, this, getCommonPersonObjectClient(), CoreConstants.REGISTERED_ACTIVITIES.HIV_REGISTER_ACTIVITY); + notificationAndReferralRecyclerView.setAdapter(mAdapter); + notificationAndReferralLayout.setVisibility(View.VISIBLE); + findViewById(R.id.view_notification_and_referral_row).setVisibility(View.VISIBLE); + } + } + + @Override + public void setupViews() { + super.setupViews(); + int titleStringResource = getIntent().getIntExtra(TITLE, -1); + if (titleStringResource != -1) { + ((TextView) findViewById(R.id.toolbar_title)).setText(titleStringResource); + } + new SetIndexClientsTask(getHivMemberObject()).execute(); + } + + public static void startUpdateCtcNumber(Activity activity, String baseEntityID) throws JSONException { + Intent intent = new Intent(activity, HivFormsActivity.class); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.BASE_ENTITY_ID, baseEntityID); + JSONObject form = (new FormUtils()).getFormJsonFromRepositoryOrAssets(activity, org.smartregister.chw.hf.utils.Constants.JsonForm.getHivClientUpdateCtcNumber()); + if (form != null) { + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.JSON_FORM, form.toString()); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.ACTION, Constants.ActivityPayloadType.FOLLOW_UP_VISIT); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.USE_DEFAULT_NEAT_FORM_LAYOUT, false); + } + + activity.startActivityForResult(intent, org.smartregister.chw.anc.util.Constants.REQUEST_CODE_HOME_VISIT); + } + + + @Override + public void setProfileViewDetails(@androidx.annotation.Nullable HivMemberObject hivMemberObject) { + super.setProfileViewDetails(hivMemberObject); + hideFollowUpVisitButton(); + } + + @Override + protected void onCreation() { + super.onCreation(); + setCommonPersonObjectClient(getClientDetailsByBaseEntityID(getHivMemberObject().getBaseEntityId())); + + TextView tvRecordCtcNumber = findViewById(R.id.textview_record_index_contact_visit); + if (getHivMemberObject().getCtcNumber() == null || getHivMemberObject().getCtcNumber().equals("") && getHivMemberObject().getClientHivStatusAfterTesting().equalsIgnoreCase("positive")) { + getRecordIndexContactLayout().setVisibility(View.VISIBLE); + tvRecordCtcNumber.setText(R.string.record_ctc_number); + tvRecordCtcNumber.setOnClickListener(v -> { + try { + startUpdateCtcNumber(HivProfileActivity.this, getHivMemberObject().getBaseEntityId()); + } catch (JSONException e) { + Timber.e(e); + } + }); + } else if (!getHivMemberObject().getCtcNumber().isEmpty()) { + getRecordIndexContactLayout().setVisibility(View.VISIBLE); + } else { + getRecordIndexContactLayout().setVisibility(View.VISIBLE); + tvRecordCtcNumber.setText(getString(R.string.hiv_testing_outcome)); + } + } + + @Override + protected void onResume() { + super.onResume(); + ((HivProfileContract.Presenter) getHivProfilePresenter()).fetchReferralTasks(); + if (notificationAndReferralRecyclerView != null && notificationAndReferralRecyclerView.getAdapter() != null) { + notificationAndReferralRecyclerView.getAdapter().notifyDataSetChanged(); + } + } + + public CommonPersonObjectClient getCommonPersonObjectClient() { + return commonPersonObjectClient; + } + + public void setCommonPersonObjectClient(CommonPersonObjectClient commonPersonObjectClient) { + this.commonPersonObjectClient = commonPersonObjectClient; + } + + @Override + protected void initializePresenter() { + showProgressBar(true); + setHivProfilePresenter(new HivProfilePresenter(this, new HfHivProfileInteractor(this), getHivMemberObject())); + fetchProfileData(); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + try { + if (itemId == R.id.action_hiv_outcome) { + HivRegisterActivity.startHIVFormActivity(this, getHivMemberObject().getBaseEntityId(), CoreConstants.JSON_FORM.getHivOutcome(), (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, CoreConstants.JSON_FORM.getHivOutcome()).toString()); + return true; + } else if (itemId == R.id.action_pregnancy_confirmation) { + startPregnancyConfirmation(Objects.requireNonNull(getHivMemberObject())); + return true; + } else if (itemId == R.id.action_pregnancy_out_come) { + startPregnancyOutcome(Objects.requireNonNull(getHivMemberObject())); + return true; + } else if (itemId == R.id.action_location_info) { + //use this method in hf to get the chw_location instead of encounter_location for chw + JSONObject preFilledForm = getAutoPopulatedJsonEditFormString( + CoreConstants.JSON_FORM.getFamilyDetailsRegister(), this, + UpdateDetailsUtil.getFamilyRegistrationDetails(getHivMemberObject().getFamilyBaseEntityId()), Utils.metadata().familyRegister.updateEventType); + if (preFilledForm != null) + UpdateDetailsUtil.startUpdateClientDetailsActivity(preFilledForm, this); + return true; + } else if (itemId == R.id.action_hivst_registration) { + startHivstRegistration(); + return true; + } else if (itemId == org.smartregister.chw.core.R.id.action_malaria_diagnosis) { + startHfMalariaFollowupForm(); + return true; + } + } catch (JSONException e) { + Timber.e(e); + } + return super.onOptionsItemSelected(item); + } + + protected void startHfMalariaFollowupForm() { + MalariaFollowUpVisitActivityHelper.startMalariaFollowUpActivity(this, getHivMemberObject().getFamilyBaseEntityId()); + } + + private void startHivstRegistration() { + CommonRepository commonRepository = org.smartregister.family.util.Utils.context().commonrepository(org.smartregister.family.util.Utils.metadata().familyMemberRegister.tableName); + + final CommonPersonObject commonPersonObject = commonRepository.findByBaseEntityId(getHivMemberObject().getBaseEntityId()); + final CommonPersonObjectClient client = new CommonPersonObjectClient(commonPersonObject.getCaseId(), commonPersonObject.getDetails(), ""); + client.setColumnmaps(commonPersonObject.getColumnmaps()); + String gender = org.smartregister.family.util.Utils.getValue(commonPersonObject.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.GENDER, false); + + HivstRegisterActivity.startHivstRegistrationActivity(this, getHivMemberObject().getBaseEntityId(), gender); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(org.smartregister.chw.core.R.menu.hiv_profile_menu, menu); + menu.findItem(org.smartregister.chw.core.R.id.action_location_info).setVisible(UpdateDetailsUtil.isIndependentClient(getHivMemberObject().getBaseEntityId())); + //Only showing the hiv outcome menu for positive HIV clients + if (getHivMemberObject().getCtcNumber().isEmpty()) { + menu.findItem(R.id.action_hiv_outcome).setVisible(true); + } + CommonPersonObjectClient commonPersonObject = getCommonPersonObjectClient(); + String gender = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.GENDER, false); + if (isOfReproductiveAge(commonPersonObject, gender) && gender.equalsIgnoreCase("female") && !AncDao.isANCMember(getHivMemberObject().getBaseEntityId())) { + menu.findItem(R.id.action_pregnancy_confirmation).setVisible(true); + menu.findItem(R.id.action_pregnancy_out_come).setVisible(true); + } + if (HealthFacilityApplication.getApplicationFlavor().hasHivst()) { + String dob = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.DOB, false); + int age = Utils.getAgeFromDate(dob); + menu.findItem(R.id.action_hivst_registration).setVisible(!HivstDao.isRegisteredForHivst(getHivMemberObject().getBaseEntityId()) && age >= 15); + } + menu.findItem(R.id.action_malaria_diagnosis).setVisible(!MalariaDao.isRegisteredForMalaria(getHivMemberObject().getBaseEntityId())); + return true; + } + + + @Override + public void updateLastVisitRow(Date lastVisitDate) { + //overriding showing of last visit row + } + + @Override + public void setupFollowupVisitEditViews(boolean isWithin24Hours) { + //overriding setupFollowupVisitEditViews row + } + + + @Override + public void openHivRegistrationForm() { + try { + HivRegisterActivity.startHIVFormActivity(this, getHivMemberObject().getBaseEntityId(), HIV_REGISTRATION, (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, HIV_REGISTRATION).toString()); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public void openUpcomingServices() { + CoreHivUpcomingServicesActivity.startMe(this, HivUtil.toMember(getHivMemberObject())); + } + + @Override + public void openIndexClientsList(HivMemberObject hivMemberObject) { + IndexContactsListActivity.startHivClientIndexListActivity(this, Objects.requireNonNull(hivMemberObject)); + } + + @Override + public void openFamilyDueServices() { + Intent intent = new Intent(this, FamilyProfileActivity.class); + + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_BASE_ENTITY_ID, getHivMemberObject().getFamilyBaseEntityId()); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_HEAD, getHivMemberObject().getFamilyHead()); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.PRIMARY_CAREGIVER, getHivMemberObject().getPrimaryCareGiver()); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_NAME, getHivMemberObject().getFamilyName()); + + intent.putExtra(CoreConstants.INTENT_KEY.SERVICE_DUE, true); + startActivity(intent); + } + + @Override + public void openFollowUpVisitForm(boolean isEdit) { + if (!isEdit) { + try { + startHivFollowupActivity(this, getHivMemberObject().getBaseEntityId()); + } catch (JSONException e) { + Timber.e(e); + } + } + } + + @Override + protected void removeMember() { + // Not required for HF (as seen in other profile activities)? + } + + @Override + public void onClick(View view) { + int id = view.getId(); + if (id == R.id.record_hiv_followup_visit) { + openFollowUpVisitForm(false); + } else if (id == R.id.textview_record_index_contact_visit && getHivMemberObject().getCtcNumber().isEmpty() && getHivMemberObject().getClientHivStatusAfterTesting().equalsIgnoreCase("positive")) { + try { + startUpdateCtcNumber(HivProfileActivity.this, getHivMemberObject().getBaseEntityId()); + } catch (JSONException e) { + Timber.e(e); + } + } else if (id == R.id.textview_record_index_contact_visit && getHivMemberObject().getCtcNumber().isEmpty() && StringUtils.isBlank(getHivMemberObject().getClientHivStatusAfterTesting())) { + try { + HivRegisterActivity.startHIVFormActivity(this, getHivMemberObject().getBaseEntityId(), CoreConstants.JSON_FORM.getHivOutcome(), (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, CoreConstants.JSON_FORM.getHivOutcome()).toString()); + } catch (JSONException e) { + e.printStackTrace(); + } + } else { + super.onClick(view); + } + } + + @Override + public void initializeCallFAB() { + setHivFloatingMenu(new HivFloatingMenu(this, getHivMemberObject())); + + int age = Utils.getAgeFromDate(getHivMemberObject().getAge()); + + OnClickFloatingMenu onClickFloatingMenu = viewId -> { + switch (viewId) { + case R.id.hiv_fab: + checkPhoneNumberProvided(); + ((HivFloatingMenu) getHivFloatingMenu()).animateFAB(); + break; + case R.id.call_layout: + ((HivFloatingMenu) getHivFloatingMenu()).launchCallWidget(); + ((HivFloatingMenu) getHivFloatingMenu()).animateFAB(); + break; + case R.id.refer_to_facility_layout: + LFTUFormUtils.startLTFUReferral(this, getHivMemberObject().getBaseEntityId(), getHivMemberObject().getGender(), age); + break; + default: + Timber.d("Unknown fab action"); + break; + } + }; + + ((HivFloatingMenu) getHivFloatingMenu()).setFloatMenuClickListener(onClickFloatingMenu); + getHivFloatingMenu().setGravity(Gravity.BOTTOM | Gravity.END); + LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, + LinearLayout.LayoutParams.MATCH_PARENT); + addContentView(getHivFloatingMenu(), linearLayoutParams); + } + + private void checkPhoneNumberProvided() { + boolean phoneNumberAvailable = (StringUtils.isNotBlank(getHivMemberObject().getPhoneNumber()) + || StringUtils.isNotBlank(getHivMemberObject().getPrimaryCareGiverPhoneNumber())); + + ((HivFloatingMenu) getHivFloatingMenu()).redraw(phoneNumberAvailable); + } + + @Override + public Context getContext() { + return HivProfileActivity.this; + } + + @Override + public void verifyHasPhone() { + // TODO -> Implement for HF + } + + @Override + public void notifyHasPhone(boolean b) { + // TODO -> Implement for HF + } + + @Override + public void openMedicalHistory() { + //TODO implement + } + + @Override + public void openIndexContactRegistration() { + startHivIndexClientsRegistration(); + } + + private void startHivIndexClientsRegistration() { + try { + String locationId = org.smartregister.family.util.Utils.context().allSharedPreferences().getPreference(AllConstants.CURRENT_LOCATION_ID); + + ((HivProfilePresenter) getHivProfilePresenter()).startForm(CoreConstants.JSON_FORM.getHivIndexClientsContactsRegistrationForm(), null, null, locationId); + } catch (Exception e) { + Timber.e(e); + displayToast(org.smartregister.family.R.string.error_unable_to_start_form); + } + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (resultCode != Activity.RESULT_OK) return; + try { + String jsonString = data.getStringExtra(OpdConstants.JSON_FORM_EXTRA.JSON); + Timber.d("JSONResult : %s", jsonString); + + if (jsonString == null) + finish(); + + JSONObject form = new JSONObject(jsonString); + String encounterType = form.getString(OpdJsonFormUtils.ENCOUNTER_TYPE); + if (encounterType.equals(CoreConstants.EventType.FAMILY_REGISTRATION)) { + RegisterParams registerParam = new RegisterParams(); + registerParam.setEditMode(false); + registerParam.setFormTag(OpdJsonFormUtils.formTag(OpdUtils.context().allSharedPreferences())); + showProgressDialog(org.smartregister.chw.core.R.string.saving_dialog_title); + ((HivProfilePresenter) getHivProfilePresenter()).saveForm(jsonString, registerParam); + } + if (form.getString(JsonFormUtils.ENCOUNTER_TYPE).equals(Utils.metadata().familyRegister.updateEventType)) { + FamilyEventClient familyEventClient = new CoreAllClientsMemberModel().processJsonForm(jsonString, getHivMemberObject().getFamilyBaseEntityId()); + JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), STEP1, SYNC_LOCATION_ID); + familyEventClient.getEvent().setLocationId(CoreJsonFormUtils.getSyncLocationUUIDFromDropdown(syncLocationField)); + familyEventClient.getEvent().setEntityType(CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT); + new FamilyProfileInteractor().saveRegistration(familyEventClient, jsonString, true, (FamilyProfileContract.InteractorCallBack) getHivProfilePresenter()); + } + } catch (Exception e) { + Timber.e(e); + } + } + + protected void startPregnancyConfirmation(HivMemberObject hivMemberObject) { + + AncRegisterActivity.startAncRegistrationActivity(HivProfileActivity.this, hivMemberObject.getBaseEntityId(), hivMemberObject.getPhoneNumber(), + CoreConstants.JSON_FORM.ANC_PREGNANCY_CONFIRMATION, null, hivMemberObject.getFamilyBaseEntityId(), hivMemberObject.getFamilyName()); + } + + protected void startPregnancyOutcome(HivMemberObject hivMemberObject) { + + PncRegisterActivity.startPncRegistrationActivity(HivProfileActivity.this, hivMemberObject.getBaseEntityId(), hivMemberObject.getPhoneNumber(), + CoreConstants.JSON_FORM.getPregnancyOutcome(), null, hivMemberObject.getFamilyBaseEntityId(), hivMemberObject.getFamilyName(), null, true); + } + + private boolean isOfReproductiveAge(CommonPersonObjectClient commonPersonObject, String gender) { + if (gender.equalsIgnoreCase("Female")) { + return Utils.isMemberOfReproductiveAge(commonPersonObject, 10, 49); + } else if (gender.equalsIgnoreCase("Male")) { + return Utils.isMemberOfReproductiveAge(commonPersonObject, 15, 49); + } else { + return false; + } + } + + private class SetIndexClientsTask extends AsyncTask { + private HivMemberObject hivMemberObject; + + public SetIndexClientsTask(HivMemberObject hivMemberObject) { + this.hivMemberObject = hivMemberObject; + } + + @Override + protected Integer doInBackground(Void... voids) { + List indexContactObjectList = HivIndexDao.getIndexContacts(hivMemberObject.getBaseEntityId()); + if (indexContactObjectList != null) + return indexContactObjectList.size(); + else + return 0; + } + + @Override + protected void onPostExecute(Integer param) { + setIndexClientsStatus(param > 0); + } + } +} + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivRegisterActivity.java new file mode 100644 index 000000000..59e4d1555 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivRegisterActivity.java @@ -0,0 +1,85 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import com.google.android.material.bottomnavigation.LabelVisibilityMode; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.smartregister.chw.core.activity.CoreHivRegisterActivity; +import org.smartregister.chw.hf.fragment.HivRegisterFragment; +import org.smartregister.chw.hiv.fragment.BaseHivCommunityFollowupRegisterFragment; +import org.smartregister.chw.hiv.fragment.BaseHivRegisterFragment; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.helper.BottomNavigationHelper; +import org.smartregister.listener.BottomNavigationListener; + +/** + * HIV Register. + * This is the register for HIV Positive Clients. + * HIV Positive clients will elicit their contact clients for HIV Testing + */ +public class HivRegisterActivity extends CoreHivRegisterActivity { + + public static void startHIVFormActivity(Activity activity, String baseEntityID, String formName, String payloadType) { + Intent intent = new Intent(activity, HivRegisterActivity.class); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.ACTION, payloadType); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.HIV_REGISTRATION_FORM_NAME, formName); + activity.startActivity(intent); + } + + @NotNull + @Override + protected BaseHivRegisterFragment getRegisterFragment() { + return new HivRegisterFragment(); + } + + @NotNull + @Override + protected BaseHivCommunityFollowupRegisterFragment[] getOtherFragments() { + return new BaseHivCommunityFollowupRegisterFragment[0]; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Override + protected void registerBottomNavigation() { + bottomNavigationHelper = new BottomNavigationHelper(); + bottomNavigationView = findViewById(org.smartregister.R.id.bottom_navigation); + + if (bottomNavigationView != null) { + bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_clients); + bottomNavigationView.getMenu().removeItem(org.smartregister.chw.hiv.R.id.action_register); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_search); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_library); + bottomNavigationView.getMenu().removeItem(org.smartregister.chw.hiv.R.id.action_received_referrals); + + bottomNavigationView.inflateMenu(getMenuResource()); + bottomNavigationView.getMenu().removeItem(org.smartregister.chw.hiv.R.id.action_received_referrals); + bottomNavigationHelper.disableShiftMode(bottomNavigationView); + + BottomNavigationListener hivBottomNavigationListener = getBottomNavigation(this); + bottomNavigationView.setOnNavigationItemSelectedListener(hivBottomNavigationListener); + + } + } + + @Override + public void startFormActivity(@Nullable String formName, @Nullable String entityId, @Nullable String metaData) { + Intent intent = new Intent(this, HivFormsActivity.class); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.BASE_ENTITY_ID, entityId); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.JSON_FORM, metaData); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.USE_DEFAULT_NEAT_FORM_LAYOUT, false); + + this.startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + +} + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivstProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivstProfileActivity.java new file mode 100644 index 000000000..d63a2e030 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivstProfileActivity.java @@ -0,0 +1,169 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.view.Menu; +import android.view.View; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.activity.CoreFamilyProfileActivity; +import org.smartregister.chw.core.activity.CoreHivstProfileActivity; +import org.smartregister.chw.core.interactor.CoreHivstProfileInteractor; +import org.smartregister.chw.core.presenter.CoreFamilyOtherMemberActivityPresenter; +import org.smartregister.chw.core.presenter.CoreHivstMemberProfilePresenter; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hiv.dao.HivDao; +import org.smartregister.chw.hivst.dao.HivstDao; +import org.smartregister.chw.hivst.util.Constants; +import org.smartregister.domain.AlertStatus; + +import androidx.annotation.NonNull; +import timber.log.Timber; + +import static org.smartregister.chw.hf.utils.Constants.JsonForm.HIV_REGISTRATION; + +public class HivstProfileActivity extends CoreHivstProfileActivity { + + public static void startProfile(Activity activity, String baseEntityId) { + Intent intent = new Intent(activity, HivstProfileActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + activity.startActivity(intent); + } + + @Override + protected void initializePresenter() { + showProgressBar(true); + String baseEntityId = getIntent().getStringExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID); + memberObject = HivstDao.getMember(baseEntityId); + profilePresenter = new CoreHivstMemberProfilePresenter(this, new CoreHivstProfileInteractor(), memberObject); + fetchProfileData(); + profilePresenter.refreshProfileBottom(); + } + + @Override + protected void startHivServicesRegistration() { + try { + HivRegisterActivity.startHIVFormActivity(this, memberObject.getBaseEntityId(), HIV_REGISTRATION, (new com.vijay.jsonwizard.utils.FormUtils()).getFormJsonFromRepositoryOrAssets(this, HIV_REGISTRATION).toString()); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + protected Class getFamilyProfileActivityClass() { + return null; + } + + @Override + public void startIssueSelfTestingKitsForm(String baseEntityId) { + JSONObject form = FormUtils.getFormUtils().getFormJson(Constants.FORMS.HIVST_ISSUE_KITS); + try { + form.put(org.smartregister.util.JsonFormUtils.ENTITY_ID, baseEntityId); + JSONObject global = form.getJSONObject("global"); + boolean knownPositiveFromHIV = HivDao.isRegisteredForHiv(baseEntityId) && StringUtils.isNotBlank(HivDao.getMember(baseEntityId).getCtcNumber()); + global.put("known_positive", HivstDao.isTheClientKnownPositiveAtReg(baseEntityId) || knownPositiveFromHIV); + } catch (JSONException e) { + Timber.e(e); + } + startFormActivity(form); + } + + @Override + public void startResultViewActivity(Context context, String baseEntityId) { + HivstResultViewActivity.startResultViewActivity(context, baseEntityId); + } + + @Override + public void onClick(View view) { + int id = view.getId(); + if (id == R.id.rlSelfTestingResults) { + startResultViewActivity(this, memberObject.getBaseEntityId()); + } else { + super.onClick(view); + } + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + super.onCreateOptionsMenu(menu); + menu.findItem(org.smartregister.chw.core.R.id.action_hiv_registration).setVisible(!HivDao.isRegisteredForHiv(memberObject.getBaseEntityId())); + return true; + } + + @Override + public void showReferralView() { + baseHivstFloatingMenu.findViewById(R.id.refer_to_facility_layout).setVisibility(View.GONE); + } + + @Override + protected void removeMember() { + //implement + } + + + @NonNull + @Override + public CoreFamilyOtherMemberActivityPresenter presenter() { + return null; + } + + @Override + public void setProfileImage(String s, String s1) { + //implement + } + + @Override + public void setProfileDetailThree(String s) { + //implement + } + + @Override + public void toggleFamilyHead(boolean b) { + //implement + } + + @Override + public void togglePrimaryCaregiver(boolean b) { + //implement + } + + @Override + public void refreshList() { + //implement + } + + @Override + public void updateHasPhone(boolean b) { + //implement + } + + @Override + public void setFamilyServiceStatus(String s) { + //implement + } + + @Override + public void verifyHasPhone() { + //implement + } + + @Override + public void notifyHasPhone(boolean b) { + //implement + } + + @Override + public void refreshMedicalHistory(boolean hasHistory) { + rlLastVisit.setVisibility(View.GONE); + } + + @Override + public void refreshFamilyStatus(AlertStatus status) { + super.refreshFamilyStatus(status); + rlFamilyServicesDue.setVisibility(View.GONE); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivstRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivstRegisterActivity.java new file mode 100644 index 000000000..d214292ca --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivstRegisterActivity.java @@ -0,0 +1,49 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.core.activity.CoreHivstRegisterActivity; +import org.smartregister.chw.hf.fragment.HivstMobilizationFragment; +import org.smartregister.chw.hf.fragment.HivstRegisterFragment; +import org.smartregister.chw.hivst.util.Constants; +import org.smartregister.view.fragment.BaseRegisterFragment; + +import androidx.fragment.app.Fragment; + +public class HivstRegisterActivity extends CoreHivstRegisterActivity { + + + public static void startHivstRegistrationActivity(Activity activity, String memberBaseEntityID, String gender) { + Intent intent = new Intent(activity, HivstRegisterActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, memberBaseEntityID); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.ACTION, Constants.ACTIVITY_PAYLOAD_TYPE.REGISTRATION); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.HIVST_FORM_NAME, Constants.FORMS.HIVST_REGISTRATION); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.GENDER, gender); + activity.startActivity(intent); + } + + //overloaded function for age global only in all member (hivst registration) + public static void startHivstRegistrationActivity(Activity activity, String memberBaseEntityID, String gender, int age) { + Intent intent = new Intent(activity, HivstRegisterActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, memberBaseEntityID); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.ACTION, Constants.ACTIVITY_PAYLOAD_TYPE.REGISTRATION); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.HIVST_FORM_NAME, Constants.FORMS.HIVST_REGISTRATION); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.GENDER, gender); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.AGE, age); + activity.startActivity(intent); + } + + @Override + protected BaseRegisterFragment getRegisterFragment() { + return new HivstRegisterFragment(); + } + + @Override + protected Fragment[] getOtherFragments() { + return new Fragment[]{ + new HivstMobilizationFragment() + }; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivstResultViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivstResultViewActivity.java new file mode 100644 index 000000000..4c93f46d0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HivstResultViewActivity.java @@ -0,0 +1,55 @@ +package org.smartregister.chw.hf.activity; + +import android.content.Context; +import android.content.Intent; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.fragment.HivstResultsViewFragment; +import org.smartregister.chw.hivst.activity.BaseHivstResultViewActivity; +import org.smartregister.chw.hivst.fragment.BaseHivstResultViewFragment; +import org.smartregister.chw.hivst.util.Constants; +import org.smartregister.family.util.Utils; + +public class HivstResultViewActivity extends BaseHivstResultViewActivity { + private static String baseEntityId; + + public static void startResultViewActivity(Context context, String baseEntityId) { + Intent intent = new Intent(context, HivstResultViewActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + HivstResultViewActivity.baseEntityId = baseEntityId; + context.startActivity(intent); + } + + public static void startResultsForm(Context context, String jsonString, String baseEntityId, String entityId) { + Intent intent = new Intent(context, HivstResultViewActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.HIVST_FORM_NAME, jsonString); + intent.putExtra(Constants.JSON_FORM_EXTRA.ENTITY_ID, entityId); + context.startActivity(intent); + } + + @Override + public void startFormActivity(String jsonString) { + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(Constants.JSON_FORM_EXTRA.JSON, jsonString); + + Form form = new Form(); + form.setName(getString(R.string.hivst_result)); + form.setActionBarBackground(R.color.family_actionbar); + form.setNavigationBackground(R.color.family_navigation); + form.setHomeAsUpIndicator(R.mipmap.ic_cross_white); + form.setPreviousLabel(getResources().getString(R.string.back)); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + + startActivityForResult(intent, Constants.REQUEST_CODE_GET_JSON); + } + + + @Override + public BaseHivstResultViewFragment getBaseFragment() { + return HivstResultsViewFragment.newInstance(baseEntityId); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HtsRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HtsRegisterActivity.java new file mode 100644 index 000000000..b416a91d8 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HtsRegisterActivity.java @@ -0,0 +1,89 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import com.google.android.material.bottomnavigation.LabelVisibilityMode; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.activity.CoreHivRegisterActivity; +import org.smartregister.chw.core.custom_views.NavigationMenu; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.custom_view.FacilityMenu; +import org.smartregister.chw.hf.fragment.HtsRegisterFragment; +import org.smartregister.chw.hiv.fragment.BaseHivCommunityFollowupRegisterFragment; +import org.smartregister.chw.hiv.fragment.BaseHivRegisterFragment; +import org.smartregister.helper.BottomNavigationHelper; +import org.smartregister.listener.BottomNavigationListener; + +/** + * HIV Testing Services Register. + * + * + * This is the register used for HIV Testing. + * This register will contain clients referred from CHWs to health facility for testing. + * HIV Positive clients will be moved to the HIV Registry which contains HIV Positive Clients So that they can elicite contact clients + */ +public class HtsRegisterActivity extends CoreHivRegisterActivity { + + public static void startHIVFormActivity(Activity activity, String baseEntityID, String formName, String payloadType) { + Intent intent = new Intent(activity, HtsRegisterActivity.class); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.ACTION, payloadType); + intent.putExtra(org.smartregister.chw.hiv.util.Constants.ActivityPayload.HIV_REGISTRATION_FORM_NAME, formName); + activity.startActivity(intent); + } + + @NotNull + @Override + protected BaseHivRegisterFragment getRegisterFragment() { + return new HtsRegisterFragment(); + } + + @NotNull + @Override + protected BaseHivCommunityFollowupRegisterFragment[] getOtherFragments() { + return new BaseHivCommunityFollowupRegisterFragment[0]; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Override + protected void registerBottomNavigation() { + bottomNavigationHelper = new BottomNavigationHelper(); + bottomNavigationView = findViewById(org.smartregister.R.id.bottom_navigation); + + if (bottomNavigationView != null) { + bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_clients); + bottomNavigationView.getMenu().removeItem(org.smartregister.chw.hiv.R.id.action_register); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_search); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_library); + bottomNavigationView.getMenu().removeItem(org.smartregister.chw.hiv.R.id.action_received_referrals); + + bottomNavigationView.inflateMenu(getMenuResource()); + bottomNavigationView.getMenu().removeItem(org.smartregister.chw.hiv.R.id.action_received_referrals); + + bottomNavigationHelper.disableShiftMode(bottomNavigationView); + + BottomNavigationListener hivBottomNavigationListener = getBottomNavigation(this); + bottomNavigationView.setOnNavigationItemSelectedListener(hivBottomNavigationListener); + + } + } + + @Override + protected void onResumption() { + super.onResumption(); + NavigationMenu menu = FacilityMenu.getInstance(this, null, null); + if (menu != null) { + menu.getNavigationAdapter().setSelectedView(CoreConstants.DrawerMenu.HTS_CLIENTS); + } + } + +} + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HvlResultsViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HvlResultsViewActivity.java new file mode 100644 index 000000000..717c7480c --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/HvlResultsViewActivity.java @@ -0,0 +1,143 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.chw.pmtct.util.DBConstants.KEY.FORM_SUBMISSION_ID; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.view.View; +import android.widget.ImageView; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.dao.HomeVisitDao; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.fragment.HvlResultsFragment; +import org.smartregister.chw.hf.utils.PmtctVisitUtils; +import org.smartregister.chw.pmtct.activity.BaseHvlResultsViewActivity; +import org.smartregister.chw.pmtct.fragment.BaseHvlResultsFragment; +import org.smartregister.chw.pmtct.util.Constants; +import org.smartregister.chw.pmtct.util.DBConstants; +import org.smartregister.chw.pmtct.util.NCUtils; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.clientandeventmodel.Obs; +import org.smartregister.family.util.Utils; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.ArrayList; + +import timber.log.Timber; + +public class HvlResultsViewActivity extends BaseHvlResultsViewActivity implements View.OnClickListener { + + private String baseEntityId; + private String parentFormSubmissionId; + + public static void startResultsForm(Context context, String jsonString, String baseEntityId, String parentFormSubmissionId) { + Intent intent = new Intent(context, HvlResultsViewActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.PMTCT_FORM, jsonString); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.PARENT_FORM_ENTITY_ID, parentFormSubmissionId); + context.startActivity(intent); + } + + @Override + public BaseHvlResultsFragment getBaseFragment() { + return HvlResultsFragment.newInstance(baseEntityId); + } + + @Override + protected void onCreation() { + String jsonString = getIntent().getStringExtra(Constants.ACTIVITY_PAYLOAD.PMTCT_FORM); + String baseEntityId = getIntent().getStringExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID); + String parentFormSubmissionId = getIntent().getStringExtra(Constants.ACTIVITY_PAYLOAD.PARENT_FORM_ENTITY_ID); + + this.baseEntityId = baseEntityId; + this.parentFormSubmissionId = parentFormSubmissionId; + + if (StringUtils.isBlank(jsonString)) { + super.onCreation(); + ImageView backImageView = findViewById(R.id.back); + backImageView.setOnClickListener(this); + } else { + try { + JSONObject form = new JSONObject(jsonString); + startFormActivity(form); + } catch (JSONException e) { + e.printStackTrace(); + } + } + } + + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.back) { + finish(); + } + } + + @Override + public void startFormActivity(JSONObject jsonObject) { + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(Constants.JSON_FORM_EXTRA.JSON, jsonObject.toString()); + + Form form = new Form(); + form.setName(getString(org.smartregister.pmtct.R.string.hvl_results)); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setNavigationBackground(org.smartregister.chw.core.R.color.family_navigation); + form.setHomeAsUpIndicator(org.smartregister.chw.core.R.mipmap.ic_cross_white); + form.setPreviousLabel(getResources().getString(org.smartregister.chw.core.R.string.back)); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + + startActivityForResult(intent, Constants.REQUEST_CODE_GET_JSON); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == Constants.REQUEST_CODE_GET_JSON && resultCode == Activity.RESULT_CANCELED) { + //handle form close + finish(); + } + + if (requestCode == Constants.REQUEST_CODE_GET_JSON && resultCode == Activity.RESULT_OK) { + //handle form saving + String jsonString = data.getStringExtra(Constants.JSON_FORM_EXTRA.JSON); + try { + AllSharedPreferences allSharedPreferences = org.smartregister.util.Utils.getAllSharedPreferences(); + Event baseEvent = org.smartregister.chw.pmtct.util.JsonFormUtils.processJsonForm(allSharedPreferences, jsonString, Constants.TABLES.PMTCT_HVL_RESULTS); + org.smartregister.chw.pmtct.util.JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + baseEvent.setBaseEntityId(baseEntityId); + baseEvent.addObs( + (new Obs()) + .withFormSubmissionField(DBConstants.KEY.HVL_FOLLOWUP_FORM_SUBMISSION_ID) + .withValue(parentFormSubmissionId) + .withFieldCode(DBConstants.KEY.HVL_FOLLOWUP_FORM_SUBMISSION_ID) + .withFieldType("formsubmissionField") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + + JSONObject jsonObject = new JSONObject(jsonString); + if (jsonObject.has(FORM_SUBMISSION_ID)) { + Event processedEvent = HomeVisitDao.getEventByFormSubmissionId(jsonObject.getString(FORM_SUBMISSION_ID)); + baseEvent.setEventDate(processedEvent.getEventDate()); + PmtctVisitUtils.deleteSavedEvent(allSharedPreferences, processedEvent.getBaseEntityId(), processedEvent.getEventId(), processedEvent.getFormSubmissionId(), "event"); + } + + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.pmtct.util.JsonFormUtils.gson.toJson(baseEvent))); + + } catch (Exception e) { + Timber.e(e); + } + //handles going back to activity after save + finish(); + } + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/IndexContactsListActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/IndexContactsListActivity.java new file mode 100644 index 000000000..94d9509fc --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/IndexContactsListActivity.java @@ -0,0 +1,35 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.chw.hiv.util.Constants.ActivityPayload.HIV_MEMBER_OBJECT; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import org.smartregister.chw.anc.util.AppExecutors; +import org.smartregister.chw.hf.presenter.IndexContactsListActivityPresenter; +import org.smartregister.chw.hiv.activity.BaseIndexContactsListActivity; +import org.smartregister.chw.hiv.domain.HivMemberObject; +import org.smartregister.chw.hiv.interactor.BaseHivIndexContactsListInteractor; + +public class IndexContactsListActivity extends BaseIndexContactsListActivity { + + public static void startHivClientIndexListActivity(Activity activity, HivMemberObject memberObject) { + Intent intent = new Intent(activity, IndexContactsListActivity.class); + intent.putExtra(HIV_MEMBER_OBJECT, memberObject); + activity.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Override + public void initializePresenter() { + setPresenter(new IndexContactsListActivityPresenter(getMemberObject().getBaseEntityId(), new BaseHivIndexContactsListInteractor(new AppExecutors()), this)); + } + + +} + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/IndividualProfileRemoveActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/IndividualProfileRemoveActivity.java new file mode 100644 index 000000000..def8cc269 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/IndividualProfileRemoveActivity.java @@ -0,0 +1,27 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.core.activity.CoreIndividualProfileRemoveActivity; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.fragment.IndividualProfileRemoveFragment; +import org.smartregister.commonregistry.CommonPersonObjectClient; + +public class IndividualProfileRemoveActivity extends CoreIndividualProfileRemoveActivity { + + public static void startIndividualProfileActivity(Activity activity, CommonPersonObjectClient commonPersonObjectClient, String familyBaseEntityId, String familyHead, String primaryCareGiver, String viewRegisterClass) { + Intent intent = new Intent(activity, IndividualProfileRemoveActivity.class); + intent.putExtra(CoreConstants.INTENT_KEY.CHILD_COMMON_PERSON, commonPersonObjectClient); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_BASE_ENTITY_ID, familyBaseEntityId); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_HEAD, familyHead); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.PRIMARY_CAREGIVER, primaryCareGiver); + intent.putExtra(CoreConstants.INTENT_KEY.VIEW_REGISTER_CLASS, viewRegisterClass); + activity.startActivityForResult(intent, CoreConstants.ProfileActivityResults.CHANGE_COMPLETED); + } + + @Override + protected void setRemoveMemberFragment() { + this.individualProfileRemoveFragment = IndividualProfileRemoveFragment.newInstance(getIntent().getExtras()); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpBehavioralServiceActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpBehavioralServiceActivity.java new file mode 100644 index 000000000..d8a863943 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpBehavioralServiceActivity.java @@ -0,0 +1,71 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.json.JSONObject; +import org.smartregister.chw.core.task.RunnableTask; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.KvpBehavioralServiceInteractor; +import org.smartregister.chw.hf.schedulers.HfScheduleTaskExecutor; +import org.smartregister.chw.kvp.activity.BaseKvpVisitActivity; +import org.smartregister.chw.kvp.domain.MemberObject; +import org.smartregister.chw.kvp.presenter.BaseKvpVisitPresenter; +import org.smartregister.chw.kvp.util.Constants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.util.LangUtils; + +import java.util.Date; + +public class KvpBehavioralServiceActivity extends BaseKvpVisitActivity { + + public static void startKvpBehavioralServiceActivity(Activity activity, String baseEntityId, Boolean editMode) { + Intent intent = new Intent(activity, KvpBehavioralServiceActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.EDIT_MODE, editMode); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.PROFILE_TYPE, Constants.PROFILE_TYPES.KVP_PROFILE); + activity.startActivity(intent); + } + + @Override + protected void registerPresenter() { + presenter = new BaseKvpVisitPresenter(memberObject, this, new KvpBehavioralServiceInteractor(Constants.EVENT_TYPE.KVP_BEHAVIORAL_SERVICE_VISIT)); + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(false); + + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + intent.putExtra(org.smartregister.family.util.Constants.WizardFormActivity.EnableOnCloseDialog, false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + public void submittedAndClose() { + Runnable runnable = () -> HfScheduleTaskExecutor.getInstance().execute(memberObject.getBaseEntityId(), Constants.EVENT_TYPE.KVP_BEHAVIORAL_SERVICE_VISIT, new Date()); + Utils.startAsyncTask(new RunnableTask(runnable), null); + super.submittedAndClose(); + } + + @Override + protected void attachBaseContext(Context base) { + // get language from prefs + String lang = LangUtils.getLanguage(base.getApplicationContext()); + super.attachBaseContext(LangUtils.setAppLocale(base, lang)); + } + + @Override + public void redrawHeader(MemberObject memberObject) { + tvTitle.setText(R.string.behavioral_services); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpBioMedicalServiceActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpBioMedicalServiceActivity.java new file mode 100644 index 000000000..211aa194e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpBioMedicalServiceActivity.java @@ -0,0 +1,112 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.json.JSONObject; +import org.smartregister.chw.core.task.RunnableTask; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.KvpBioMedicalServiceInteractor; +import org.smartregister.chw.hf.schedulers.HfScheduleTaskExecutor; +import org.smartregister.chw.kvp.activity.BaseKvpVisitActivity; +import org.smartregister.chw.kvp.domain.MemberObject; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; +import org.smartregister.chw.kvp.presenter.BaseKvpVisitPresenter; +import org.smartregister.chw.kvp.util.Constants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.util.LangUtils; + +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.Map; + +public class KvpBioMedicalServiceActivity extends BaseKvpVisitActivity { + + public static void startKvpBioMedicalServiceActivity(Activity activity, String baseEntityId, Boolean editMode) { + Intent intent = new Intent(activity, KvpBioMedicalServiceActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.EDIT_MODE, editMode); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.PROFILE_TYPE, Constants.PROFILE_TYPES.KVP_PROFILE); + activity.startActivity(intent); + } + + @Override + protected void registerPresenter() { + presenter = new BaseKvpVisitPresenter(memberObject, this, new KvpBioMedicalServiceInteractor(Constants.EVENT_TYPE.KVP_BIO_MEDICAL_SERVICE_VISIT)); + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(false); + + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + intent.putExtra(org.smartregister.family.util.Constants.WizardFormActivity.EnableOnCloseDialog, false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + public void submittedAndClose() { + Runnable runnable = () -> HfScheduleTaskExecutor.getInstance().execute(memberObject.getBaseEntityId(), Constants.EVENT_TYPE.KVP_BIO_MEDICAL_SERVICE_VISIT, new Date()); + Utils.startAsyncTask(new RunnableTask(runnable), null); + super.submittedAndClose(); + } + + @Override + protected void attachBaseContext(Context base) { + // get language from prefs + String lang = LangUtils.getLanguage(base.getApplicationContext()); + super.attachBaseContext(LangUtils.setAppLocale(base, lang)); + } + + @Override + public void redrawHeader(MemberObject memberObject) { + tvTitle.setText(R.string.bio_medical_services); + } + + @Override + public void initializeActions(LinkedHashMap map) { + actionList.clear(); + + //Necessary evil to rearrange the actions according to a specific arrangement + //assuming the list will have client_status, then hts, then the third action is prep_pep + + //TODO: fix this if the case of client_status action would be moved from biomedical + if (map.containsKey(getString(R.string.kvp_client_status))) { + BaseKvpVisitAction clientStatusAction = map.get(getString(R.string.kvp_client_status)); + actionList.put(getString(R.string.kvp_client_status), clientStatusAction); + } + + if (map.containsKey(getString(R.string.kvp_hts))) { + BaseKvpVisitAction htsAction = map.get(getString(R.string.kvp_hts)); + actionList.put(getString(R.string.kvp_hts), htsAction); + } + + if (map.containsKey(getString(R.string.kvp_pep_assesment))) { + BaseKvpVisitAction PrEPPepAction = map.get(getString(R.string.kvp_pep_assesment)); + actionList.put(getString(R.string.kvp_pep_assesment), PrEPPepAction); + } + for (Map.Entry entry : map.entrySet()) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + actionList.putIfAbsent(entry.getKey(), entry.getValue()); + } else { + actionList.put(entry.getKey(), entry.getValue()); + } + } + //====================End of Necessary evil ==================================== + + if (mAdapter != null) { + mAdapter.notifyDataSetChanged(); + } + displayProgressBar(false); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpMedicalHistoryActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpMedicalHistoryActivity.java new file mode 100644 index 000000000..9e3d7fa96 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpMedicalHistoryActivity.java @@ -0,0 +1,265 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.style.BulletSpan; +import android.text.style.StyleSpan; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.Days; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.presenter.BaseAncMedicalHistoryPresenter; +import org.smartregister.chw.core.activity.CoreAncMedicalHistoryActivity; +import org.smartregister.chw.core.activity.DefaultAncMedicalHistoryActivityFlv; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.KvpMedicalHistoryInteractor; +import org.smartregister.chw.kvp.domain.MemberObject; + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class KvpMedicalHistoryActivity extends CoreAncMedicalHistoryActivity { + private static MemberObject kvpMemberObject; + private final Flavor flavor = new KvpPrEPMedicalHistoryActivityFlv(); + private ProgressBar progressBar; + + public static void startMe(Activity activity, MemberObject memberObject) { + Intent intent = new Intent(activity, KvpMedicalHistoryActivity.class); + kvpMemberObject = memberObject; + activity.startActivity(intent); + } + + @Override + public void initializePresenter() { + presenter = new BaseAncMedicalHistoryPresenter(new KvpMedicalHistoryInteractor(), this, kvpMemberObject.getBaseEntityId()); + } + + @Override + public void setUpView() { + linearLayout = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.linearLayoutMedicalHistory); + progressBar = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.progressBarMedicalHistory); + + TextView tvTitle = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.tvTitle); + tvTitle.setText(getString(org.smartregister.chw.opensrp_chw_anc.R.string.back_to, kvpMemberObject.getFullName())); + + ((TextView) findViewById(R.id.medical_history)).setText(getString(R.string.visits_history)); + } + + @Override + public View renderView(List visits) { + super.renderView(visits); + View view = flavor.bindViews(this); + displayLoadingState(true); + flavor.processViewData(visits, this); + displayLoadingState(false); + TextView agywVisitTitle = view.findViewById(org.smartregister.chw.core.R.id.customFontTextViewHealthFacilityVisitTitle); + agywVisitTitle.setText(R.string.visits_history); + return view; + } + + @Override + public void displayLoadingState(boolean state) { + progressBar.setVisibility(state ? View.VISIBLE : View.GONE); + } + + private static class KvpPrEPMedicalHistoryActivityFlv extends DefaultAncMedicalHistoryActivityFlv { + private final StyleSpan boldSpan = new StyleSpan(android.graphics.Typeface.BOLD); + + @Override + protected void processAncCard(String has_card, Context context) { + // super.processAncCard(has_card, context); + linearLayoutAncCard.setVisibility(View.GONE); + } + + @Override + protected void processHealthFacilityVisit(List> hf_visits, Context context) { + //super.processHealthFacilityVisit(hf_visits, context); + } + + @Override + public void processViewData(List visits, Context context) { + + if (visits.size() > 0) { + int days = 0; + List> hf_visits = new ArrayList<>(); + + int x = 0; + while (x < visits.size()) { + LinkedHashMap visitDetails = new LinkedHashMap<>(); + + // the first object in this list is the days difference + if (x == 0) { + days = Days.daysBetween(new DateTime(visits.get(visits.size() - 1).getDate()), new DateTime()).getDays(); + } + + String[] htsParams = {"previous_hiv_testing_method", "other_previous_hiv_testing_method", "testing_site", "testing_approach", "tested_hiv", "hiv_status", "ctc_services", "ctc_number", "kits_distributed"}; + extractVisitDetails(visits, htsParams, visitDetails, x, context); + + String[] matServicesParams = {"mat_provided"}; + extractVisitDetails(visits, matServicesParams, visitDetails, x, context); + + String[] otherServicesParams = {"other_services_referrals_provided", "other_other_services_referrals_provided"}; + extractVisitDetails(visits, otherServicesParams, visitDetails, x, context); + + String[] prepPepServicesParams = {"enrolled_to_prep", "pep_provision"}; + extractVisitDetails(visits, prepPepServicesParams, visitDetails, x, context); + + String[] stiScreeningServicesParams = {"sti_screening", "treatment_provided"}; + extractVisitDetails(visits, stiScreeningServicesParams, visitDetails, x, context); + + String[] tbScreeningServicesParams = {"tb_screening"}; + extractVisitDetails(visits, tbScreeningServicesParams, visitDetails, x, context); + + String[] vmmcServicesParams = {"vmcc_provided"}; + extractVisitDetails(visits, vmmcServicesParams, visitDetails, x, context); + + String[] cervicalCancerScreeningServicesParams = {"cervical_cancer_screening"}; + extractVisitDetails(visits, cervicalCancerScreeningServicesParams, visitDetails, x, context); + + String[] clientStatusServicesParams = {"client_status", "other_kvp_category"}; + extractVisitDetails(visits, clientStatusServicesParams, visitDetails, x, context); + + String[] condomProvisionParams = {"condoms_given", "type_of_issued_condoms", "number_of_male_condoms_issued", "number_of_female_condoms_issued"}; + extractVisitDetails(visits, condomProvisionParams, visitDetails, x, context); + + String[] familyPlanningServiceParams = {"family_planning_service"}; + extractVisitDetails(visits, familyPlanningServiceParams, visitDetails, x, context); + + String[] eicServiceParams = {"iec_sbcc_materials"}; + extractVisitDetails(visits, eicServiceParams, visitDetails, x, context); + + String[] gbvServiceParams = {"gbv_screening"}; + extractVisitDetails(visits, gbvServiceParams, visitDetails, x, context); + + hf_visits.add(visitDetails); + + x++; + } + + processLastVisit(days, context); + processVisit(hf_visits, context, visits); + } + } + + private void extractVisitDetails(List sourceVisits, String[] hf_params, LinkedHashMap visitDetailsMap, int iteration, Context context) { + // get the hf details + Map map = new HashMap<>(); + for (String param : hf_params) { + try { + List details = sourceVisits.get(iteration).getVisitDetails().get(param); + map.put(param, getTexts(context, details)); + } catch (Exception e) { + e.printStackTrace(); + } + + } + visitDetailsMap.putAll(map); + } + + + private void processLastVisit(int days, Context context) { + linearLayoutLastVisit.setVisibility(View.VISIBLE); + if (days < 1) { + customFontTextViewLastVisit.setText(org.smartregister.chw.core.R.string.less_than_twenty_four); + } else { + customFontTextViewLastVisit.setText(StringUtils.capitalize(MessageFormat.format(context.getString(org.smartregister.chw.core.R.string.days_ago), String.valueOf(days)))); + } + } + + + protected void processVisit(List> community_visits, Context context, List visits) { + if (community_visits != null && community_visits.size() > 0) { + linearLayoutHealthFacilityVisit.setVisibility(View.VISIBLE); + + int x = 0; + for (LinkedHashMap vals : community_visits) { + View view = inflater.inflate(R.layout.medical_history_visit, null); + TextView tvTitle = view.findViewById(R.id.title); + LinearLayout visitDetailsLayout = view.findViewById(R.id.visit_details_layout); + + tvTitle.setText(visits.get(x).getVisitType() + " " + visits.get(x).getDate()); + + + for (LinkedHashMap.Entry entry : vals.entrySet()) { + TextView visitDetailTv = new TextView(context); + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams + ((int) LinearLayout.LayoutParams.MATCH_PARENT, (int) LinearLayout.LayoutParams.WRAP_CONTENT); + + visitDetailTv.setLayoutParams(params); + float scale = context.getResources().getDisplayMetrics().density; + int dpAsPixels = (int) (10 * scale + 0.5f); + visitDetailTv.setPadding(dpAsPixels, 0, 0, 0); + visitDetailsLayout.addView(visitDetailTv); + + + try { + int resource = context.getResources().getIdentifier("kvp_" + entry.getKey(), "string", context.getPackageName()); + evaluateView(context, vals, visitDetailTv, entry.getKey(), resource, ""); + } catch (Exception e) { + Timber.e(e); + } + } + linearLayoutHealthFacilityVisitDetails.addView(view, 0); + + x++; + } + } + } + + private void evaluateView(Context context, Map vals, TextView tv, String valueKey, int viewTitleStringResource, String valuePrefixInStringResources) { + if (StringUtils.isNotBlank(getMapValue(vals, valueKey))) { + SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(); + spannableStringBuilder.append(context.getString(viewTitleStringResource), boldSpan, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE).append("\n"); + + String stringValue = getMapValue(vals, valueKey); + String[] stringValueArray; + if (stringValue.contains(",")) { + stringValueArray = stringValue.split(","); + for (String value : stringValueArray) { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, value.trim()) + "\n", new BulletSpan(10), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + } + } else { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, stringValue)).append("\n"); + } + tv.setText(spannableStringBuilder); + } else { + tv.setVisibility(View.GONE); + } + } + + + private String getMapValue(Map map, String key) { + if (map.containsKey(key)) { + return map.get(key); + } + return ""; + } + + private String getStringResource(Context context, String prefix, String resourceName) { + int resourceId = context.getResources(). + getIdentifier(prefix + resourceName.trim(), "string", context.getPackageName()); + try { + return context.getString(resourceId); + } catch (Exception e) { + Timber.e(e); + return prefix + resourceName; + } + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpOtherServiceActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpOtherServiceActivity.java new file mode 100644 index 000000000..950862b56 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpOtherServiceActivity.java @@ -0,0 +1,72 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.json.JSONObject; +import org.smartregister.chw.core.task.RunnableTask; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.KvpOtherServiceInteractor; +import org.smartregister.chw.hf.schedulers.HfScheduleTaskExecutor; +import org.smartregister.chw.kvp.activity.BaseKvpVisitActivity; +import org.smartregister.chw.kvp.domain.MemberObject; +import org.smartregister.chw.kvp.presenter.BaseKvpVisitPresenter; +import org.smartregister.chw.kvp.util.Constants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.util.LangUtils; + +import java.util.Date; + +public class KvpOtherServiceActivity extends BaseKvpVisitActivity { + + public static void startKvpOtherServiceActivity(Activity activity, String baseEntityId, Boolean editMode) { + Intent intent = new Intent(activity, KvpOtherServiceActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.EDIT_MODE, editMode); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.PROFILE_TYPE, Constants.PROFILE_TYPES.KVP_PROFILE); + activity.startActivity(intent); + } + + @Override + protected void registerPresenter() { + presenter = new BaseKvpVisitPresenter(memberObject, this, new KvpOtherServiceInteractor(Constants.EVENT_TYPE.KVP_OTHER_SERVICE_VISIT)); + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(false); + + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + intent.putExtra(org.smartregister.family.util.Constants.WizardFormActivity.EnableOnCloseDialog, false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + public void submittedAndClose() { + Runnable runnable = () -> HfScheduleTaskExecutor.getInstance().execute(memberObject.getBaseEntityId(), Constants.EVENT_TYPE.KVP_OTHER_SERVICE_VISIT, new Date()); + Utils.startAsyncTask(new RunnableTask(runnable), null); + super.submittedAndClose(); + } + + @Override + protected void attachBaseContext(Context base) { + // get language from prefs + String lang = LangUtils.getLanguage(base.getApplicationContext()); + super.attachBaseContext(LangUtils.setAppLocale(base, lang)); + } + + @Override + public void redrawHeader(MemberObject memberObject) { + tvTitle.setText(R.string.other_services); + } +} + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpProfileActivity.java new file mode 100644 index 000000000..60be235da --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpProfileActivity.java @@ -0,0 +1,92 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; +import android.view.Menu; +import android.view.View; +import android.widget.TextView; + +import org.smartregister.chw.core.activity.CoreKvpProfileActivity; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hivst.dao.HivstDao; +import org.smartregister.chw.kvp.KvpLibrary; +import org.smartregister.chw.kvp.domain.Visit; +import org.smartregister.chw.kvp.util.Constants; +import org.smartregister.chw.kvp.util.DBConstants; +import org.smartregister.commonregistry.CommonPersonObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.commonregistry.CommonRepository; +import org.smartregister.family.util.Utils; + +public class KvpProfileActivity extends CoreKvpProfileActivity { + + public static void startProfile(Activity activity, String baseEntityId) { + Intent intent = new Intent(activity, KvpProfileActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.PROFILE_TYPE, Constants.PROFILE_TYPES.KVP_PROFILE); + activity.startActivity(intent); + } + + @Override + public void openFollowupVisit() { + KvpServiceActivity.startMe(this, memberObject.getBaseEntityId()); + } + + @Override + protected void startPrEPRegistration() { + PrEPRegisterActivity.startMe(this, memberObject.getBaseEntityId(), memberObject.getGender(), memberObject.getAge()); + } + + + @Override + public void refreshMedicalHistory(boolean hasHistory) { + Visit kvpBehavioralServices = getVisit(org.smartregister.chw.kvp.util.Constants.EVENT_TYPE.KVP_BEHAVIORAL_SERVICE_VISIT); + Visit kvpBioMedicalServices = getVisit(org.smartregister.chw.kvp.util.Constants.EVENT_TYPE.KVP_BIO_MEDICAL_SERVICE_VISIT); + Visit kvpStructuralServices = getVisit(org.smartregister.chw.kvp.util.Constants.EVENT_TYPE.KVP_STRUCTURAL_SERVICE_VISIT); + Visit kvpOtherServicesVisit = getVisit(org.smartregister.chw.kvp.util.Constants.EVENT_TYPE.KVP_OTHER_SERVICE_VISIT); + + + if (kvpBehavioralServices != null || kvpBioMedicalServices != null || kvpOtherServicesVisit != null || kvpStructuralServices != null) { + rlLastVisit.setVisibility(View.VISIBLE); + findViewById(R.id.view_notification_and_referral_row).setVisibility(View.VISIBLE); + ((TextView) findViewById(R.id.vViewHistory)).setText(R.string.visits_history); + ((TextView) findViewById(R.id.ivViewHistoryArrow)).setText(getString(R.string.view_visits_history)); + } else { + rlLastVisit.setVisibility(View.GONE); + } + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + super.onCreateOptionsMenu(menu); + + if (HealthFacilityApplication.getApplicationFlavor().hasHivst()) { + int age = memberObject.getAge(); + menu.findItem(R.id.action_hivst_registration).setVisible(!HivstDao.isRegisteredForHivst(memberObject.getBaseEntityId()) && age >= 15); + } + + return true; + } + + @Override + public void startHivstRegistration() { + CommonRepository commonRepository = Utils.context().commonrepository(Utils.metadata().familyMemberRegister.tableName); + + final CommonPersonObject commonPersonObject = commonRepository.findByBaseEntityId(memberObject.getBaseEntityId()); + final CommonPersonObjectClient client = + new CommonPersonObjectClient(commonPersonObject.getCaseId(), commonPersonObject.getDetails(), ""); + client.setColumnmaps(commonPersonObject.getColumnmaps()); + String gender = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.GENDER, false); + HivstRegisterActivity.startHivstRegistrationActivity(this, memberObject.getBaseEntityId(), gender); + } + + @Override + public void openMedicalHistory() { + KvpMedicalHistoryActivity.startMe(this, memberObject); + } + + private Visit getVisit(String eventType) { + return KvpLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), eventType); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpRegisterActivity.java new file mode 100644 index 000000000..f42f3b95d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpRegisterActivity.java @@ -0,0 +1,66 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import com.vijay.jsonwizard.domain.Form; + +import org.smartregister.chw.core.activity.CoreKvpRegisterActivity; +import org.smartregister.chw.core.custom_views.NavigationMenu; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.fragment.KvpRegisterFragment; +import org.smartregister.chw.kvp.util.Constants; +import org.smartregister.view.fragment.BaseRegisterFragment; + +public class KvpRegisterActivity extends CoreKvpRegisterActivity { + + public static void startKvpScreeningMale(Activity activity, String memberBaseEntityId, String gender, int age) { + Intent intent = new Intent(activity, KvpRegisterActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, memberBaseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.ACTION, Constants.ACTIVITY_PAYLOAD_TYPE.REGISTRATION); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.KVP_FORM_NAME, Constants.FORMS.KVP_SCREENING_MALE); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.GENDER, gender); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.AGE, age); + + activity.startActivity(intent); + } + + public static void startKvpScreeningFemale(Activity activity, String memberBaseEntityId, String gender, int age) { + + Intent intent = new Intent(activity, KvpRegisterActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, memberBaseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.ACTION, Constants.ACTIVITY_PAYLOAD_TYPE.REGISTRATION); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.KVP_FORM_NAME, Constants.FORMS.KVP_SCREENING_FEMALE); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.GENDER, gender); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.AGE, age); + activity.startActivity(intent); + } + + @Override + public Form getFormConfig() { + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(true); + form.setName(getString(R.string.kvp_screening)); + form.setNavigationBackground(org.smartregister.chw.core.R.color.family_navigation); + form.setNextLabel(this.getResources().getString(org.smartregister.chw.core.R.string.next)); + form.setPreviousLabel(this.getResources().getString(org.smartregister.chw.core.R.string.back)); + form.setSaveLabel(this.getResources().getString(org.smartregister.chw.core.R.string.save)); + return form; + } + + @Override + protected BaseRegisterFragment getRegisterFragment() { + return new KvpRegisterFragment(); + } + + @Override + protected void onResumption() { + super.onResumption(); + NavigationMenu menu = NavigationMenu.getInstance(this, null, null); + if (menu != null) { + menu.getNavigationAdapter().setSelectedView(CoreConstants.DrawerMenu.KVP); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpReportsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpReportsActivity.java new file mode 100644 index 000000000..adc2fe01a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpReportsActivity.java @@ -0,0 +1,102 @@ +package org.smartregister.chw.hf.activity; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; + +import com.whiteelephant.monthpicker.MonthPickerDialog; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.ReportUtils; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; + +import timber.log.Timber; + + +public class KvpReportsActivity extends PncReportsActivity{ + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.pnc_monthly_report) { + KvpReportsViewActivity.startMe(this, Constants.ReportConstants.ReportPaths.KVP_REPORT_PATH, reportPeriod); + } + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == R.id.action_select_month) { + showMonthPicker(this, menu); + return true; + } + return super.onOptionsItemSelected(item); + } + + @Override + public void setUpToolbar() { + super.setUpToolbar(); + TextView title = findViewById(R.id.toolbar_title); + title.setText(R.string.kvp_reports); + + Toolbar toolbar = findViewById(org.smartregister.chw.core.R.id.back_to_nav_toolbar); + setSupportActionBar(toolbar); + + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + final Drawable upArrow = getResources().getDrawable(org.smartregister.chw.core.R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setElevation(0); + } + toolbar.setNavigationOnClickListener(v -> finish()); + appBarLayout = findViewById(org.smartregister.chw.core.R.id.app_bar); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + appBarLayout.setOutlineProvider(null); + } + } + + private void showMonthPicker(Context context, Menu menu) { + //shows the month picker and returns selected period and updated the menu + MonthPickerDialog.Builder builder = new MonthPickerDialog.Builder(context, (selectedMonth, selectedYear) -> { + int month = selectedMonth + 1; + String monthString = String.valueOf(month); + if (month < 10) { + monthString = "0" + monthString; + } + String yearString = String.valueOf(selectedYear); + reportPeriod = monthString + "-" + yearString; + menu.findItem(R.id.action_select_month).setTitle(ReportUtils.displayMonthAndYear(selectedMonth, selectedYear)); + + }, Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH)); + try { + Date reportDate = new SimpleDateFormat("MM-yyyy", Locale.getDefault()).parse(reportPeriod); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(reportDate); + builder.setActivatedMonth(calendar.get(Calendar.MONTH)); + builder.setMinYear(2021); + builder.setActivatedYear(calendar.get(Calendar.YEAR)); + builder.setMaxYear(Calendar.getInstance().get(Calendar.YEAR)); + builder.setMinMonth(Calendar.JANUARY); + builder.setMaxMonth(Calendar.DECEMBER); + builder.setTitle(getString(R.string.select_reporting_month_anc)); + builder.build().show(); + } catch (ParseException e) { + Timber.e(e); + } + + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpReportsViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpReportsViewActivity.java new file mode 100644 index 000000000..af8a6e27c --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpReportsViewActivity.java @@ -0,0 +1,19 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; + + +public class KvpReportsViewActivity extends HfReportsViewActivity{ + public static void startMe(Activity activity, String reportPath, String reportDate) { + Intent intent = new Intent(activity, KvpReportsViewActivity.class); + intent.putExtra(ARG_REPORT_PATH, reportPath); + intent.putExtra(ARG_REPORT_DATE, reportDate); + intent.putExtra(ARG_REPORT_TITLE, R.string.kvp_reports_subtitle); + intent.putExtra(ARG_REPORT_TYPE, Constants.ReportConstants.ReportTypes.KVP_REPORT); + activity.startActivity(intent); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpServiceActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpServiceActivity.java new file mode 100644 index 000000000..52614f075 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpServiceActivity.java @@ -0,0 +1,22 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.hf.listener.KvpServiceActionHandler; +import org.smartregister.chw.kvp.activity.BaseKvpServicesActivity; +import org.smartregister.chw.kvp.handlers.BaseServiceActionHandler; +import org.smartregister.chw.kvp.util.Constants; + +public class KvpServiceActivity extends BaseKvpServicesActivity { + public static void startMe(Activity activity, String baseEntityID) { + Intent intent = new Intent(activity, KvpServiceActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityID); + activity.startActivity(intent); + } + + @Override + public BaseServiceActionHandler getServiceHandler() { + return new KvpServiceActionHandler(); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpStructuralServiceActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpStructuralServiceActivity.java new file mode 100644 index 000000000..beb859b2a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/KvpStructuralServiceActivity.java @@ -0,0 +1,71 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.json.JSONObject; +import org.smartregister.chw.core.task.RunnableTask; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.KvpStructuralServiceInteractor; +import org.smartregister.chw.hf.schedulers.HfScheduleTaskExecutor; +import org.smartregister.chw.kvp.activity.BaseKvpVisitActivity; +import org.smartregister.chw.kvp.domain.MemberObject; +import org.smartregister.chw.kvp.presenter.BaseKvpVisitPresenter; +import org.smartregister.chw.kvp.util.Constants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.util.LangUtils; + +import java.util.Date; + +public class KvpStructuralServiceActivity extends BaseKvpVisitActivity { + + public static void startKvpStructuralServiceActivity(Activity activity, String baseEntityId, Boolean editMode) { + Intent intent = new Intent(activity, KvpStructuralServiceActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.EDIT_MODE, editMode); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.PROFILE_TYPE, Constants.PROFILE_TYPES.KVP_PROFILE); + activity.startActivity(intent); + } + + @Override + protected void registerPresenter() { + presenter = new BaseKvpVisitPresenter(memberObject, this, new KvpStructuralServiceInteractor(Constants.EVENT_TYPE.KVP_STRUCTURAL_SERVICE_VISIT)); + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(false); + + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + intent.putExtra(org.smartregister.family.util.Constants.WizardFormActivity.EnableOnCloseDialog, false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + public void submittedAndClose() { + Runnable runnable = () -> HfScheduleTaskExecutor.getInstance().execute(memberObject.getBaseEntityId(), Constants.EVENT_TYPE.KVP_STRUCTURAL_SERVICE_VISIT, new Date()); + Utils.startAsyncTask(new RunnableTask(runnable), null); + super.submittedAndClose(); + } + + @Override + protected void attachBaseContext(Context base) { + // get language from prefs + String lang = LangUtils.getLanguage(base.getApplicationContext()); + super.attachBaseContext(LangUtils.setAppLocale(base, lang)); + } + + @Override + public void redrawHeader(MemberObject memberObject) { + tvTitle.setText(R.string.structural_services); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDActiveManagementStageActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDActiveManagementStageActivity.java new file mode 100644 index 000000000..0251780ce --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDActiveManagementStageActivity.java @@ -0,0 +1,49 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.json.JSONObject; +import org.smartregister.chw.hf.interactor.LDActiveManagementStageActivityInteractor; +import org.smartregister.chw.ld.activity.BaseLDVisitActivity; +import org.smartregister.chw.ld.presenter.BaseLDVisitPresenter; +import org.smartregister.chw.pmtct.util.Constants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; + +/** + * Created by Kassim Sheghembe on 2022-05-13 + */ +public class LDActiveManagementStageActivity extends BaseLDVisitActivity { + + public static void startActiveManagementActivity(Activity activity, String baseEntityID, Boolean editMode) { + + Intent intent = new Intent(activity, LDActiveManagementStageActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.EDIT_MODE, editMode); + + activity.startActivityForResult(intent, org.smartregister.chw.anc.util.Constants.REQUEST_CODE_HOME_VISIT); + + } + + @Override + protected void registerPresenter() { + presenter = new BaseLDVisitPresenter(memberObject, this, new LDActiveManagementStageActivityInteractor()); + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(false); + + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + intent.putExtra(org.smartregister.family.util.Constants.WizardFormActivity.EnableOnCloseDialog, false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDGeneralExaminationVisitActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDGeneralExaminationVisitActivity.java new file mode 100644 index 000000000..0f1b00197 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDGeneralExaminationVisitActivity.java @@ -0,0 +1,57 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.json.JSONObject; +import org.smartregister.chw.hf.interactor.LDVisitInteractor; +import org.smartregister.chw.ld.activity.BaseLDVisitActivity; +import org.smartregister.chw.ld.presenter.BaseLDVisitPresenter; +import org.smartregister.chw.pmtct.util.Constants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.util.LangUtils; + +/** + * Created by Kassim Sheghembe on 2022-05-06 + */ +public class LDGeneralExaminationVisitActivity extends BaseLDVisitActivity { + + public static void startLDGeneralExaminationVisitActivity(Activity activity, String baseEntityID, Boolean editMode) { + + Intent intent = new Intent(activity, LDGeneralExaminationVisitActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.EDIT_MODE, editMode); + + activity.startActivityForResult(intent, org.smartregister.chw.anc.util.Constants.REQUEST_CODE_HOME_VISIT); + + } + + @Override + protected void registerPresenter() { + presenter = new BaseLDVisitPresenter(memberObject, this, new LDVisitInteractor()); + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(false); + + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + intent.putExtra(org.smartregister.family.util.Constants.WizardFormActivity.EnableOnCloseDialog, false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + protected void attachBaseContext(Context base) { + String lang = LangUtils.getLanguage(base.getApplicationContext()); + super.attachBaseContext(LangUtils.setAppLocale(base, lang)); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDPartographActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDPartographActivity.java new file mode 100644 index 000000000..f3a46eb24 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDPartographActivity.java @@ -0,0 +1,121 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.json.JSONObject; +import org.smartregister.chw.core.task.RunnableTask; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.LDPartographInteractor; +import org.smartregister.chw.hf.schedulers.HfScheduleTaskExecutor; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.ld.activity.BaseLDVisitActivity; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.chw.ld.presenter.BaseLDVisitPresenter; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.util.LangUtils; + +import java.text.MessageFormat; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author issyzac 5/7/22 + */ +public class LDPartographActivity extends BaseLDVisitActivity { + + public static void startMe(Activity activity, String baseEntityID, Boolean isEditMode, String fullName, String age) { + Intent intent = new Intent(activity, LDPartographActivity.class); + intent.putExtra(org.smartregister.chw.ld.util.Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(org.smartregister.chw.ld.util.Constants.ACTIVITY_PAYLOAD.EDIT_MODE, isEditMode); + intent.putExtra("FULL_NAME", fullName); + intent.putExtra("AGE", age); + activity.startActivityForResult(intent, org.smartregister.chw.anc.util.Constants.REQUEST_CODE_HOME_VISIT); + } + + @Override + protected void registerPresenter() { + presenter = new BaseLDVisitPresenter(memberObject, this, new LDPartographInteractor(baseEntityID)); + } + + @Override + public void submittedAndClose() { + Runnable runnable = () -> HfScheduleTaskExecutor.getInstance().execute(memberObject.getBaseEntityId(), Constants.Events.LD_PARTOGRAPHY, new Date()); + Utils.startAsyncTask(new RunnableTask(runnable), null); + super.submittedAndClose(); + } + + + @Override + public void startFormActivity(JSONObject jsonForm) { + + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(false); + + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + intent.putExtra(org.smartregister.family.util.Constants.WizardFormActivity.EnableOnCloseDialog, false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + protected void attachBaseContext(Context base) { + // get language from prefs + String lang = LangUtils.getLanguage(base.getApplicationContext()); + super.attachBaseContext(LangUtils.setAppLocale(base, lang)); + } + + @Override + public void redrawHeader(MemberObject memberObject) { + tvTitle.setText(MessageFormat.format("{0}, {1} \u00B7 {2}", getIntent().getStringExtra("FULL_NAME"), getIntent().getStringExtra("AGE"), getString(R.string.ld_partograph))); + } + + @Override + public void onDestroy() { + try { + super.onDestroy(); + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + public void initializeActions(LinkedHashMap map) { + + //Clearing action list before recreating + actionList.clear(); + + if (map.containsKey(getString(R.string.ld_partograph_time))){ + BaseLDVisitAction partographTimeAction = map.get(getString(R.string.ld_partograph_time)); + assert partographTimeAction != null; + actionList.put(getString(R.string.ld_partograph_time), partographTimeAction); + } + + for (Map.Entry entry : map.entrySet()) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + actionList.putIfAbsent(entry.getKey(), entry.getValue()); + } else { + actionList.put(entry.getKey(), entry.getValue()); + } + } + + if (mAdapter != null) { + mAdapter.notifyDataSetChanged(); + } + + displayProgressBar(false); + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDPartographDetailsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDPartographDetailsActivity.java new file mode 100644 index 000000000..d7ff7d873 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDPartographDetailsActivity.java @@ -0,0 +1,182 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.AllConstants.DEFAULT_LOCALITY_NAME; + +import android.app.Activity; +import android.content.Intent; +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import com.gkemon.XMLtoPDF.PdfGenerator; +import com.gkemon.XMLtoPDF.PdfGeneratorListener; +import com.gkemon.XMLtoPDF.model.FailureResponse; +import com.gkemon.XMLtoPDF.model.SuccessResponse; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.presenter.BaseAncMedicalHistoryPresenter; +import org.smartregister.chw.core.activity.CoreAncMedicalHistoryActivity; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.LDPartographDetailsInteractor; +import org.smartregister.chw.ld.LDLibrary; +import org.smartregister.chw.ld.dao.LDDao; +import org.smartregister.chw.ld.domain.MemberObject; + +import java.text.MessageFormat; +import java.util.List; +import java.util.Locale; + +import timber.log.Timber; + +public class LDPartographDetailsActivity extends CoreAncMedicalHistoryActivity { + private static MemberObject ldMemberObject; + private Flavor flavor = new LDPartographDetailsActivityFlv(); + private ProgressBar progressBar; + private RelativeLayout headerLayout; + + public static void startMe(Activity activity, MemberObject memberObject) { + Intent intent = new Intent(activity, LDPartographDetailsActivity.class); + ldMemberObject = memberObject; + activity.startActivity(intent); + } + + @Override + public void initializePresenter() { + presenter = new BaseAncMedicalHistoryPresenter(new LDPartographDetailsInteractor(), this, ldMemberObject.getBaseEntityId()); + } + + @Override + public void setUpView() { + findViewById(R.id.collapsing_toolbar).setBackgroundColor(getResources().getColor(R.color.primary)); + + Drawable upArrow = this.getResources().getDrawable(R.drawable.ic_arrow_back_white_24dp); + upArrow.setColorFilter(this.getResources().getColor(android.R.color.white), PorterDuff.Mode.SRC_ATOP); + getSupportActionBar().setHomeAsUpIndicator(upArrow); + + linearLayout = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.linearLayoutMedicalHistory); + progressBar = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.progressBarMedicalHistory); + + + TextView tvTitle = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.tvTitle); + tvTitle.setText(getString(org.smartregister.chw.opensrp_chw_anc.R.string.back_to, ldMemberObject.getFullName())); + tvTitle.setTextColor(getResources().getColor(org.smartregister.ld.R.color.white)); + + TextView medicalHistory = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.medical_history); + medicalHistory.setVisibility(View.GONE); + + TextView facilityName = findViewById(org.smartregister.ld.R.id.facility_name); + TextView clientName = findViewById(org.smartregister.ld.R.id.client_name); + TextView gravida = findViewById(org.smartregister.ld.R.id.gravida); + TextView para = findViewById(org.smartregister.ld.R.id.para); + TextView admissionDate = findViewById(org.smartregister.ld.R.id.admission_date); + TextView admissionTime = findViewById(org.smartregister.ld.R.id.admission_time); + + String facilityNameString = LDLibrary.getInstance().context().allSharedPreferences().getPreference(DEFAULT_LOCALITY_NAME); + + if (StringUtils.isNotBlank(facilityNameString)) { + facilityName.setText(facilityNameString); + } else { + facilityName.setVisibility(View.GONE); + } + + clientName.setText(MessageFormat.format(getString(org.smartregister.ld.R.string.partograph_client_name), ldMemberObject.getFirstName(), ldMemberObject.getMiddleName(), ldMemberObject.getLastName())); + gravida.setText(MessageFormat.format(getString(org.smartregister.ld.R.string.partograph_gravida), LDDao.getGravida(ldMemberObject.getBaseEntityId()))); + para.setText(MessageFormat.format(getString(org.smartregister.ld.R.string.partograph_para), LDDao.getPara(ldMemberObject.getBaseEntityId()))); + admissionDate.setText(MessageFormat.format(getString(org.smartregister.ld.R.string.partograph_admission_date), LDDao.getAdmissionDate(ldMemberObject.getBaseEntityId()))); + admissionTime.setText(MessageFormat.format(getString(org.smartregister.ld.R.string.partograph_admission_time), LDDao.getAdmissionTime(ldMemberObject.getBaseEntityId()))); + } + + @Override + public View renderView(List visits) { + super.renderView(visits); + View view = flavor.bindViews(this); + displayLoadingState(true); + flavor.processViewData(visits, this); + displayLoadingState(false); + TextView ldPartographDetailsTitle = view.findViewById(org.smartregister.chw.core.R.id.customFontTextViewHealthFacilityVisitTitle); + ldPartographDetailsTitle.setText(getString(R.string.partograph_details_title)); + return view; + } + + @Override + public void displayLoadingState(boolean state) { + progressBar.setVisibility(state ? View.VISIBLE : View.GONE); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(org.smartregister.ld.R.menu.partograph_menu, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() == android.R.id.home) { + finish(); + return true; + } else if (item.getItemId() == org.smartregister.ld.R.id.action_download_partograph) { + downloadPartograph(); + return true; + } + return super.onOptionsItemSelected(item); + } + + + private void downloadPartograph() { + headerLayout = findViewById(R.id.header_layout); + headerLayout.setVisibility(View.VISIBLE); + + + int age = 0; + try { + age = Integer.parseInt(ldMemberObject.getAge()); + } catch (Exception e) { + Timber.e(e); + } + View mView = findViewById(R.id.main_layout); + PdfGenerator.getBuilder() + .setContext(LDPartographDetailsActivity.this) + .fromViewSource() + .fromView(mView) + .setFileName(String.format(Locale.getDefault(), "%s %s %s, %d", + ldMemberObject.getFirstName(), + ldMemberObject.getMiddleName(), + ldMemberObject.getLastName(), + age)) + .setFolderNameOrPath("MyFolder/MyDemoHorizontalText/") + .actionAfterPDFGeneration(PdfGenerator.ActionAfterPDFGeneration.OPEN) + .build(new PdfGeneratorListener() { + @Override + public void onFailure(FailureResponse failureResponse) { + super.onFailure(failureResponse); + } + + @Override + public void showLog(String log) { + super.showLog(log); + } + + @Override + public void onStartPDFGeneration() { + /*When PDF generation begins to start*/ + } + + @Override + public void onFinishPDFGeneration() { + /*When PDF generation is finished*/ + headerLayout.setVisibility(View.GONE); + } + + @Override + public void onSuccess(SuccessResponse response) { + super.onSuccess(response); + } + }); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDPartographDetailsActivityFlv.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDPartographDetailsActivityFlv.java new file mode 100644 index 000000000..7c7c8e789 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDPartographDetailsActivityFlv.java @@ -0,0 +1,319 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.view.View; +import android.widget.TextView; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.Period; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.core.activity.DefaultAncMedicalHistoryActivityFlv; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.LDDao; +import org.smartregister.chw.ld.domain.MemberObject; + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class LDPartographDetailsActivityFlv extends DefaultAncMedicalHistoryActivityFlv { + + @Override + protected void processAncCard(String has_card, Context context) { + // super.processAncCard(has_card, context); + linearLayoutAncCard.setVisibility(View.GONE); + } + + @Override + protected void processHealthFacilityVisit(List> hf_visits, Context context) { + //super.processHealthFacilityVisit(hf_visits, context); + } + + @Override + public void processViewData(List visits, Context context) { + + if (visits.size() > 0) { + List> hf_visits = new ArrayList<>(); + + int x = 0; + while (x < visits.size()) { + + // the first object in this list is the days difference + + + String[] hf_params = { + "name_of_the_health_care_provider", + "partograph_date", + "partograph_time", + "fetal_heart_rate", + "moulding", + "moulding_options", + "amniotic_fluid", + "pulse_rate", + "respiratory_rate", + "temperature", + "systolic", + "diastolic", + "urine_protein", + "urine_acetone", + "urine_volume", + "cervix_dilation", + "descent_presenting_part", + "contraction_every_half_hour_frequency", + "contraction_every_half_hour_time" + }; + + extractHFVisit(visits, hf_params, hf_visits, x, context); + + x++; + } + + processLastVisit(); + processFacilityVisit(hf_visits, visits, context); + } + } + + private void extractHFVisit(List sourceVisits, String[] hf_params, List> hf_visits, int iteration, Context context) { + // get the hf details + Map map = new HashMap<>(); + for (String param : hf_params) { + try { + List details = sourceVisits.get(iteration).getVisitDetails().get(param); + map.put(param, getTexts(context, details)); + } catch (Exception e) { + e.printStackTrace(); + } + + } + hf_visits.add(map); + } + + + private void processLastVisit() { + linearLayoutLastVisit.setVisibility(View.GONE); + } + + + protected void processFacilityVisit(List> hf_visits, List visits, Context context) { + if (hf_visits != null && hf_visits.size() > 0) { + linearLayoutHealthFacilityVisit.setVisibility(View.VISIBLE); + + int x = 0; + for (Map vals : hf_visits) { + View view = inflater.inflate(R.layout.ld_patograph_details, null); + TextView tvPartographDateTime = view.findViewById(R.id.partograph_date_time); + TextView tvFetalHeartRate = view.findViewById(R.id.fetal_heart_rate); + TextView tvFetalMoulding = view.findViewById(R.id.fetal_moulding); + TextView tvAmnioticFluid = view.findViewById(R.id.amniotic_fluid); + TextView tvPulseRate = view.findViewById(R.id.pulse_rate); + TextView tvRespiratoryRate = view.findViewById(R.id.respiratory_rate); + TextView tvTemperature = view.findViewById(R.id.temperature); + TextView tvBloodPressure = view.findViewById(R.id.blood_pressure); + TextView tvUrineProtein = view.findViewById(R.id.urine_protein); + TextView tvUrineAcetone = view.findViewById(R.id.urine_acetone); + TextView tvUrineVolume = view.findViewById(R.id.urine_volume); + TextView tvCervixDilation = view.findViewById(R.id.cervix_dilation); + TextView tvDescentPresentingPart = view.findViewById(R.id.descent_presenting_part); + TextView tvContraction = view.findViewById(R.id.contraction); + TextView tvEdit = view.findViewById(R.id.textview_edit); + + // Updating visibility of EDIT button if the visit is the last visit + if ((x == visits.size() - 1) && !LDDao.isClosed(visits.get(x).getBaseEntityId())) + tvEdit.setVisibility(View.VISIBLE); + else + tvEdit.setVisibility(View.GONE); + + tvEdit.setOnClickListener(view1 -> { + ((Activity) context).finish(); + Visit visit = visits.get(0); + MemberObject memberObject = LDDao.getLDMember(visit.getBaseEntityId()); + + if (memberObject != null && visit.getBaseEntityId() != null) { + ((Activity) context).finish(); + LDPartographActivity.startMe((Activity) context, memberObject.getBaseEntityId(), true, + memberObject.getFirstName() + " " + memberObject.getMiddleName(), String.valueOf(new Period(new DateTime(memberObject.getAge()), new DateTime()).getYears())); + } + }); + + evaluatePartographDateTime(context, vals, tvPartographDateTime); + evaluateFetalHeartRate(context, vals, tvFetalHeartRate); + evaluateFetalMoulding(context, vals, tvFetalMoulding); + evaluateAmnioticFluid(context, vals, tvAmnioticFluid); + evaluatePulseRate(context, vals, tvPulseRate); + evaluateRespiratoryRate(context, vals, tvRespiratoryRate); + evaluateTemperature(context, vals, tvTemperature); + evaluateBloodPressure(context, vals, tvBloodPressure); + evaluateUrineProtein(context, vals, tvUrineProtein); + evaluateUrineAcetone(context, vals, tvUrineAcetone); + evaluateUrineVolume(context, vals, tvUrineVolume); + evaluateCervixDilation(context, vals, tvCervixDilation); + evaluateDescentPresentingPart(context, vals, tvDescentPresentingPart); + evaluateContraction(context, vals, tvContraction); + + if (tvFetalHeartRate.getVisibility() == View.GONE && + tvFetalMoulding.getVisibility() == View.GONE && + tvAmnioticFluid.getVisibility() == View.GONE) { + view.findViewById(R.id.fetal_well_being).setVisibility(View.GONE); + } + + if (tvPulseRate.getVisibility() == View.GONE && + tvRespiratoryRate.getVisibility() == View.GONE && + tvTemperature.getVisibility() == View.GONE && + tvBloodPressure.getVisibility() == View.GONE && + tvUrineProtein.getVisibility() == View.GONE && + tvUrineAcetone.getVisibility() == View.GONE && + tvUrineVolume.getVisibility() == View.GONE) { + view.findViewById(R.id.mother_well_being).setVisibility(View.GONE); + } + + if (tvCervixDilation.getVisibility() == View.GONE && + tvDescentPresentingPart.getVisibility() == View.GONE && + tvContraction.getVisibility() == View.GONE) { + view.findViewById(R.id.fetal_progress_of_labour).setVisibility(View.GONE); + } + + linearLayoutHealthFacilityVisitDetails.addView(view, 0); + x++; + + } + } + } + + + private void evaluatePartographDateTime(Context context, Map vals, TextView tvPartographDateTime) { + if (StringUtils.isBlank(vals.get("partograph_date"))) { + tvPartographDateTime.setVisibility(View.GONE); + } else { + tvPartographDateTime.setText(MessageFormat.format(context.getString(R.string.partograph_date_time), getMapValue(vals, "partograph_date"), getMapValue(vals, "partograph_time"), getMapValue(vals, "name_of_the_health_care_provider"))); + } + } + + + private void evaluateFetalHeartRate(Context context, Map vals, TextView tvFetalHeartRate) { + if (StringUtils.isBlank(vals.get("fetal_heart_rate"))) { + tvFetalHeartRate.setVisibility(View.GONE); + } else { + tvFetalHeartRate.setText(MessageFormat.format(context.getString(R.string.fetal_heart_rate), getMapValue(vals, "fetal_heart_rate"))); + } + } + + private void evaluateFetalMoulding(Context context, Map vals, TextView tvFetalMoulding) { + if (StringUtils.isBlank(vals.get("moulding"))) { + tvFetalMoulding.setVisibility(View.GONE); + } else { + tvFetalMoulding.setText(MessageFormat.format(context.getString(R.string.fetal_moulding), getMapValue(vals, "moulding"))); + } + } + + private void evaluateAmnioticFluid(Context context, Map vals, TextView tvAmnioticFluid) { + if (StringUtils.isBlank(vals.get("amniotic_fluid"))) { + tvAmnioticFluid.setVisibility(View.GONE); + } else { + + String value = getMapValue(vals, "amniotic_fluid"); + int resourceId = context.getResources(). + getIdentifier("amniotic_fluid_" + value, "string", context.getPackageName()); + + tvAmnioticFluid.setText(MessageFormat.format(context.getString(R.string.amniotic_fluid), context.getString(resourceId))); + } + } + + private void evaluatePulseRate(Context context, Map vals, TextView tvPulseRate) { + if (StringUtils.isBlank(vals.get("pulse_rate"))) { + tvPulseRate.setVisibility(View.GONE); + } else { + tvPulseRate.setText(MessageFormat.format(context.getString(R.string.pulse_rate), getMapValue(vals, "pulse_rate"))); + } + } + + private void evaluateRespiratoryRate(Context context, Map vals, TextView tvRespiratoryRate) { + if (StringUtils.isBlank(vals.get("respiratory_rate"))) { + tvRespiratoryRate.setVisibility(View.GONE); + } else { + tvRespiratoryRate.setText(MessageFormat.format(context.getString(R.string.respiratory_rate), getMapValue(vals, "respiratory_rate"))); + } + } + + private void evaluateTemperature(Context context, Map vals, TextView tvTemperature) { + if (StringUtils.isBlank(vals.get("temperature"))) { + tvTemperature.setVisibility(View.GONE); + } else { + tvTemperature.setText(MessageFormat.format(context.getString(R.string.temperature), getMapValue(vals, "temperature"))); + } + } + + private void evaluateBloodPressure(Context context, Map vals, TextView tvBloodPressure) { + if (StringUtils.isBlank(vals.get("systolic"))) { + tvBloodPressure.setVisibility(View.GONE); + } else { + tvBloodPressure.setText(MessageFormat.format(context.getString(R.string.blood_pressure), getMapValue(vals, "systolic"), getMapValue(vals, "diastolic"))); + } + } + + private void evaluateUrineProtein(Context context, Map vals, TextView tvUrineProtein) { + if (StringUtils.isBlank(vals.get("urine_protein"))) { + tvUrineProtein.setVisibility(View.GONE); + } else { + tvUrineProtein.setText(MessageFormat.format(context.getString(R.string.urine_protein), getMapValue(vals, "urine_protein"))); + } + } + + private void evaluateUrineAcetone(Context context, Map vals, TextView tvUrineAcetone) { + if (StringUtils.isBlank(vals.get("urine_acetone"))) { + tvUrineAcetone.setVisibility(View.GONE); + } else { + tvUrineAcetone.setText(MessageFormat.format(context.getString(R.string.urine_acetone), getMapValue(vals, "urine_acetone"))); + } + } + + private void evaluateUrineVolume(Context context, Map vals, TextView tvUrineVolume) { + if (StringUtils.isBlank(vals.get("urine_volume"))) { + tvUrineVolume.setVisibility(View.GONE); + } else { + tvUrineVolume.setText(MessageFormat.format(context.getString(R.string.urine_volume), getMapValue(vals, "urine_volume"))); + } + } + + private void evaluateCervixDilation(Context context, Map vals, TextView tvCervixDilation) { + if (StringUtils.isBlank(vals.get("cervix_dilation"))) { + tvCervixDilation.setVisibility(View.GONE); + } else { + tvCervixDilation.setText(MessageFormat.format(context.getString(R.string.cervix_dilation), getMapValue(vals, "cervix_dilation"))); + } + } + + private void evaluateDescentPresentingPart(Context context, Map vals, TextView tvDescentPresentingPart) { + if (StringUtils.isBlank(vals.get("descent_presenting_part"))) { + tvDescentPresentingPart.setVisibility(View.GONE); + } else { + tvDescentPresentingPart.setText(MessageFormat.format(context.getString(R.string.descent_presenting_part), getMapValue(vals, "descent_presenting_part"))); + } + } + + private void evaluateContraction(Context context, Map vals, TextView tvContraction) { + if (StringUtils.isBlank(vals.get("contraction_every_half_hour_frequency")) || StringUtils.isBlank(vals.get("contraction_every_half_hour_time"))) { + tvContraction.setVisibility(View.GONE); + } else { + String contractionsTimeValue = getMapValue(vals, "contraction_every_half_hour_time"); + int resourceId = context.getResources(). + getIdentifier("contraction_every_half_hour_time_" + contractionsTimeValue, "string", context.getPackageName()); + tvContraction.setText(MessageFormat.format(context.getString(R.string.contraction), getMapValue(vals, "contraction_every_half_hour_frequency"), context.getString(resourceId))); + } + } + + + private String getMapValue(Map map, String key) { + if (map.containsKey(key)) { + if (map.get(key) != null && map.get(key).length() > 1) { + return map.get(key).split(",")[0]; + } + return map.get(key); + } + return ""; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDPostDeliveryManagementMotherActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDPostDeliveryManagementMotherActivity.java new file mode 100644 index 000000000..78e02bda2 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDPostDeliveryManagementMotherActivity.java @@ -0,0 +1,96 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; +import android.os.Build; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.json.JSONObject; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.LDPostDeliveryManagementMotherActivityInteractor; +import org.smartregister.chw.ld.activity.BaseLDVisitActivity; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.chw.ld.presenter.BaseLDVisitPresenter; +import org.smartregister.chw.ld.util.Constants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Created by Kassim Sheghembe on 2022-05-16 + */ +public class LDPostDeliveryManagementMotherActivity extends BaseLDVisitActivity { + + public static void startPostDeliveryMotherManagementActivity(Activity activity, String baseEntityId, Boolean editMode) { + Intent intent = new Intent(activity, LDPostDeliveryManagementMotherActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.EDIT_MODE, editMode); + + activity.startActivityForResult(intent, org.smartregister.chw.anc.util.Constants.REQUEST_CODE_HOME_VISIT); + } + + @Override + protected void registerPresenter() { + presenter = new BaseLDVisitPresenter(memberObject, this,new LDPostDeliveryManagementMotherActivityInteractor()); + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(false); + + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + intent.putExtra(org.smartregister.family.util.Constants.WizardFormActivity.EnableOnCloseDialog, false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + public void initializeActions(LinkedHashMap map) { + //Clearing the action List before recreation + actionList.clear(); + + //Rearranging the actions according to a specific arrangement + if (map.containsKey(getString(R.string.ld_mother_status_action_title))) { + BaseLDVisitAction mothersStatusAction = map.get(getString(R.string.ld_mother_status_action_title)); + actionList.put(getString(R.string.ld_mother_status_action_title), mothersStatusAction); + } + if (map.containsKey(getString(R.string.ld_post_delivery_observation_action_title))) { + BaseLDVisitAction postDeliveryObservationsAction = map.get(getString(R.string.ld_post_delivery_observation_action_title)); + actionList.put(getString(R.string.ld_post_delivery_observation_action_title), postDeliveryObservationsAction); + } + + if (map.containsKey(getString(R.string.ld_maternal_complication_action_title))) { + BaseLDVisitAction martenalComplicationsAction = map.get(getString(R.string.ld_maternal_complication_action_title)); + actionList.put(getString(R.string.ld_maternal_complication_action_title), martenalComplicationsAction); + } + if (map.containsKey(getString(R.string.ld_post_delivery_family_planning))) { + BaseLDVisitAction familyPlanningAction = map.get(getString(R.string.ld_post_delivery_family_planning)); + actionList.put(getString(R.string.ld_post_delivery_family_planning), familyPlanningAction); + } + //====================End of Necessary evil ==================================== + + + for (Map.Entry entry : map.entrySet()) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + actionList.putIfAbsent(entry.getKey(), entry.getValue()); + } else { + actionList.put(entry.getKey(), entry.getValue()); + } + } + + if (mAdapter != null) { + mAdapter.notifyDataSetChanged(); + } + displayProgressBar(false); + + + super.initializeActions(map); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDProfileActivity.java new file mode 100644 index 000000000..a251e27b4 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDProfileActivity.java @@ -0,0 +1,566 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.chw.core.utils.Utils.getCommonPersonObjectClient; +import static org.smartregister.chw.hf.activity.HeiProfileActivity.getClientDetailsByBaseEntityID; +import static org.smartregister.chw.hf.dao.LDDao.isTheClientReferred; +import static org.smartregister.chw.hf.utils.Constants.Events.LD_ACTIVE_MANAGEMENT_OF_3RD_STAGE_OF_LABOUR; +import static org.smartregister.chw.hf.utils.Constants.Events.LD_PARTOGRAPHY; +import static org.smartregister.chw.hf.utils.Constants.Events.LD_POST_DELIVERY_MOTHER_MANAGEMENT; +import static org.smartregister.chw.hf.utils.Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryCervixDilationMonitoring; +import static org.smartregister.chw.hf.utils.Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryLabourStage; +import static org.smartregister.chw.hf.utils.Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryModeOfDelivery; +import static org.smartregister.chw.hf.utils.LDVisitUtils.shouldProcessPartographVisit; +import static org.smartregister.util.Utils.getAllSharedPreferences; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import org.joda.time.DateTime; +import org.joda.time.Period; +import org.json.JSONObject; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.core.dao.ChwNotificationDao; +import org.smartregister.chw.core.dataloader.CoreFamilyMemberDataLoader; +import org.smartregister.chw.core.form_data.NativeFormsDataBinder; +import org.smartregister.chw.core.model.ChildModel; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.UpdateDetailsUtil; +import org.smartregister.chw.hf.BuildConfig; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.adapter.ReferralCardViewAdapter; +import org.smartregister.chw.hf.contract.HfLDProfileContract; +import org.smartregister.chw.hf.dao.HfAncDao; +import org.smartregister.chw.hf.dao.HfPncDao; +import org.smartregister.chw.hf.dao.LDDao; +import org.smartregister.chw.hf.interactor.LDProfileInteractor; +import org.smartregister.chw.hf.interactor.PncMemberProfileInteractor; +import org.smartregister.chw.hf.presenter.LDProfilePresenter; +import org.smartregister.chw.hf.utils.LDReferralFormUtils; +import org.smartregister.chw.hf.utils.LDVisitUtils; +import org.smartregister.chw.hiv.dao.HivDao; +import org.smartregister.chw.ld.LDLibrary; +import org.smartregister.chw.ld.activity.BaseLDProfileActivity; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.Visit; +import org.smartregister.chw.ld.util.Constants; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.domain.AlertStatus; +import org.smartregister.domain.Task; +import org.smartregister.family.util.DBConstants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.opd.utils.OpdDbConstants; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import timber.log.Timber; + +public class LDProfileActivity extends BaseLDProfileActivity implements HfLDProfileContract.View { + protected RecyclerView notificationAndReferralRecyclerView; + protected RelativeLayout notificationAndReferralLayout; + public static final String LD_PROFILE_ACTION = "LD_PROFILE_ACTION"; + private String partographVisitTitle; + private String currentVisitItemTitle = ""; + + private TextView processPartograph; + private Visit lastLDVisit; + protected HashMap menuItemEditNames = new HashMap<>(); + + public static void startProfileActivity(Activity activity, String baseEntityId) { + Intent intent = new Intent(activity, LDProfileActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + activity.startActivity(intent); + } + + public static void startLDForm(Activity activity, String baseEntityID, String formName) { + Intent intent = new Intent(activity, LDRegisterActivity.class); + intent.putExtra(org.smartregister.chw.ld.util.Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.LD_FORM_NAME, formName); + intent.putExtra(org.smartregister.chw.ld.util.Constants.ACTIVITY_PAYLOAD.ACTION, LD_PROFILE_ACTION); + activity.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + initializeNotificationReferralRecyclerView(); + } + + @Override + protected void onCreation() { + super.onCreation(); + partographVisitTitle = getString(R.string.labour_and_delivery_partograph_button_title); + setTextViewRecordLDText(); + } + + @Override + protected void onResume() { + super.onResume(); + setupViews(); + setTextViewRecordLDText(); + refreshMedicalHistory(true); + invalidateOptionsMenu(); + ((LDProfilePresenter) profilePresenter).fetchTasks(); + + + if (LDDao.isClosed(memberObject.getBaseEntityId())) { + textViewRecordLD.setVisibility(View.GONE); + TextView forecastSvdTitle = findViewById(R.id.forecast_svd_title); + forecastSvdTitle.setText("Discharged Date"); + vaginalExamDate.setText(LDDao.getLastInteractedWith(memberObject.getBaseEntityId())); + forecastSVDTime.setVisibility(View.GONE); + } + } + + protected void setupViews() { + super.setupViews(); + processPartograph = findViewById(R.id.textview_process_partograph); + processPartograph.setOnClickListener(this); + + processVisits(false); + + lastLDVisit = getLastVisit(); + if (lastLDVisit != null && !lastLDVisit.getProcessed()) { + showVisitInProgress(); + setUpEditButton(); + } else { + textViewRecordLD.setVisibility(View.VISIBLE); + textViewVisitDoneEdit.setVisibility(View.GONE); + visitDone.setVisibility(View.GONE); + processPartograph.setVisibility(View.GONE); + } + + showLabourProgress(LDDao.getPartographStartTime(memberObject.getBaseEntityId()) != null); + findViewById(org.smartregister.ld.R.id.primary_ld_caregiver).setVisibility(View.GONE); + findViewById(org.smartregister.ld.R.id.family_ld_head).setVisibility(View.GONE); + + Boolean theClientReferred = isTheClientReferred(memberObject.getBaseEntityId()); + if (theClientReferred != null && theClientReferred) { + referredLabel.setVisibility(View.VISIBLE); + referredLabel.setText(getString(R.string.referred_for_ld_emergency)); + } else { + referredLabel.setVisibility(View.GONE); + } + + if (!(LDDao.getLabourStage(memberObject.getBaseEntityId()) == null && (LDDao.getReasonsForAdmission(memberObject.getBaseEntityId()) == null || !LDDao.getReasonsForAdmission(memberObject.getBaseEntityId()).equalsIgnoreCase("elective_cesarean_section")))) { + rlLdDetails.setVisibility(View.VISIBLE); + } else { + rlLdDetails.setVisibility(View.GONE); + } + + } + + @Override + protected void initializePresenter() { + showProgressBar(true); + profilePresenter = new LDProfilePresenter(this, new LDProfileInteractor(), memberObject); + fetchProfileData(); + profilePresenter.refreshProfileBottom(); + } + + private void processVisits(boolean partograph) { + try { + LDVisitUtils.processVisits(memberObject.getBaseEntityId(), partograph); + } catch (Exception e) { + Timber.e(e); + } + } + + private void showVisitInProgress() { + textViewRecordLD.setVisibility(View.GONE); + textViewVisitDoneEdit.setVisibility(View.VISIBLE); + visitDone.setVisibility(View.VISIBLE); + textViewVisitDone.setTextColor(getResources().getColor(R.color.black_text_color)); + imageViewCross.setImageResource(R.drawable.activityrow_visit_in_progress); + if (currentVisitItemTitle.equalsIgnoreCase(partographVisitTitle)) { + textViewVisitDone.setText(this.getString(R.string.visit_in_progress, org.smartregister.chw.hf.utils.Constants.Visits.LD_PARTOGRAPH_VISIT)); + try { + if (shouldProcessPartographVisit(lastLDVisit)) + processPartograph.setVisibility(View.VISIBLE); + } catch (Exception e) { + Timber.e(e); + } + } else if (currentVisitItemTitle.equalsIgnoreCase(getString(R.string.labour_and_delivery_examination_and_consultation_button_tittle))) { + textViewVisitDone.setText(this.getString(R.string.visit_in_progress, org.smartregister.chw.hf.utils.Constants.Visits.LD_GENERAL_VISIT)); + } else if (currentVisitItemTitle.equalsIgnoreCase(getString(R.string.ld_mother_post_delivery_management))) { + textViewVisitDone.setText(this.getString(R.string.visit_in_progress, org.smartregister.chw.hf.utils.Constants.Visits.LD_IMMEDIATE_POSTPARTUM_CARE)); + } else { + textViewVisitDone.setText(this.getString(R.string.visit_in_progress, org.smartregister.chw.hf.utils.Constants.Visits.LD_MANAGEMENT_OF_3rd_STAGE_OF_LABOUR_VISIT)); + } + } + + private Visit getLastVisit() { + if (currentVisitItemTitle.equalsIgnoreCase(partographVisitTitle)) + return LDLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), LD_PARTOGRAPHY); + else if (currentVisitItemTitle.equalsIgnoreCase(getString(R.string.labour_and_delivery_examination_and_consultation_button_tittle))) + return LDLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), Constants.EVENT_TYPE.LD_GENERAL_EXAMINATION); + else if (currentVisitItemTitle.equalsIgnoreCase(getString(R.string.ld_mother_post_delivery_management))) + return LDLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), LD_POST_DELIVERY_MOTHER_MANAGEMENT); + else if (currentVisitItemTitle.equalsIgnoreCase(getString(R.string.ld_active_management_3rd_stage))) + return LDLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), LD_ACTIVE_MANAGEMENT_OF_3RD_STAGE_OF_LABOUR); + else + return LDLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), LD_POST_DELIVERY_MOTHER_MANAGEMENT); + } + + private void setUpEditButton() { + textViewVisitDoneEdit.setOnClickListener(v -> { + if (currentVisitItemTitle.equalsIgnoreCase(partographVisitTitle)) { + LDPartographActivity.startMe(this, memberObject.getBaseEntityId(), true, + getName(memberObject), String.valueOf(new Period(new DateTime(this.memberObject.getAge()), new DateTime()).getYears())); + } else if (currentVisitItemTitle.equalsIgnoreCase(getString(R.string.labour_and_delivery_examination_and_consultation_button_tittle))) { + LDGeneralExaminationVisitActivity.startLDGeneralExaminationVisitActivity(this, memberObject.getBaseEntityId(), true); + } else if (currentVisitItemTitle.equalsIgnoreCase(getString(R.string.ld_mother_post_delivery_management))) { + openPostDeliveryManagementMother(true); + } else { + LDActiveManagementStageActivity.startActiveManagementActivity(this, memberObject.getBaseEntityId(), true); + } + }); + } + + @Override + public void onClick(View view) { + int id = view.getId(); + if (id == R.id.textview_record_ld) { + if (((TextView) view).getText().equals(getString(R.string.labour_and_delivery_labour_stage_title))) { + startLDForm(this, memberObject.getBaseEntityId(), getLabourAndDeliveryLabourStage()); + } else if (((TextView) view).getText().equals(getString(R.string.labour_and_delivery_examination_and_consultation_button_tittle))) { + openExaminationConsultation(); + } else if (((TextView) view).getText().equals(getString(R.string.labour_and_delivery_cervix_dilation_monitoring_button_tittle))) { + startLDForm(this, memberObject.getBaseEntityId(), getLabourAndDeliveryCervixDilationMonitoring()); + } else if (((TextView) view).getText().equals(getString(R.string.labour_and_delivery_partograph_button_title))) { + LDPartographActivity.startMe(this, memberObject.getBaseEntityId(), false, + getName(memberObject), String.valueOf(new Period(new DateTime(this.memberObject.getAge()), new DateTime()).getYears())); + } else if (((TextView) view).getText().equals(getString(R.string.lb_mode_of_delivery))) { + startLDForm(this, memberObject.getBaseEntityId(), getLabourAndDeliveryModeOfDelivery()); + } else if (((TextView) view).getText().equals(getString(R.string.ld_active_management_3rd_stage))) { + openActiveManagementStage(); + } else if (((TextView) view).getText().equals(getString(R.string.ld_mother_post_delivery_management))) { + openPostDeliveryManagementMother(false); + } else if (((TextView) view).getText().equals(getString(R.string.ld_discharge_client))) { + closeLDVisit(memberObject.getBaseEntityId(), LDProfileActivity.this); + } else if (((TextView) view).getText().equals(getString(R.string.pregnancy_outcome_title))) { + CommonPersonObjectClient client = getCommonPersonObjectClient(memberObject.getBaseEntityId()); + String familyBaseEntityId = org.smartregister.util.Utils.getValue(client.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.RELATIONAL_ID, false); + boolean motherHivStatus = LDDao.getHivStatus(memberObject.getBaseEntityId()).equalsIgnoreCase("positive") || HivDao.isRegisteredForHiv(memberObject.getBaseEntityId()) || HfAncDao.isClientKnownOnArt(memberObject.getBaseEntityId()) || HfAncDao.getHivStatus(memberObject.getBaseEntityId()).equalsIgnoreCase("positive"); + PncRegisterActivity.startPncRegistrationActivity(LDProfileActivity.this, memberObject.getBaseEntityId(), null, CoreConstants.JSON_FORM.getPregnancyOutcome(), AncLibrary.getInstance().getUniqueIdRepository().getNextUniqueId().getOpenmrsId(), familyBaseEntityId, memberObject.getFamilyName(), null, motherHivStatus); + } + } else if (id == R.id.textview_process_partograph) { + processPartographEvent(); + } else if (id == R.id.rlRegistrationDetails) { + LDRegistrationDetailsActivity.startMe(this, memberObject); + } else if (id == R.id.rlLdDetails) { + LdSummaryDetailsActivity.startMe(this, memberObject); + } else { + super.onClick(view); + } + } + + private void processPartographEvent() { + processVisits(true); + onResume(); + } + + private String getName(MemberObject memberObject) { + return getName(getName(memberObject.getFirstName(), memberObject.getMiddleName()), memberObject.getLastName()); + } + + private String getName(String nameOne, String nameTwo) { + return nameOne + " " + nameTwo; + } + + private void setTextViewRecordLDText() { + Boolean theClientReferred = isTheClientReferred(memberObject.getBaseEntityId()); + if (theClientReferred != null && theClientReferred) { + textViewRecordLD.setText(R.string.pregnancy_outcome_title); + } else if (LDDao.getLabourStage(memberObject.getBaseEntityId()) == null && (LDDao.getReasonsForAdmission(memberObject.getBaseEntityId()) == null || !LDDao.getReasonsForAdmission(memberObject.getBaseEntityId()).equalsIgnoreCase("elective_cesarean_section"))) { + currentVisitItemTitle = getString(R.string.labour_and_delivery_labour_stage_title); + textViewRecordLD.setText(R.string.labour_and_delivery_labour_stage_title); + } else if ((LDDao.getReasonsForAdmission(memberObject.getBaseEntityId()) != null && LDDao.getReasonsForAdmission(memberObject.getBaseEntityId()).equalsIgnoreCase("elective_cesarean_section")) && (LDDao.getLabourStage(memberObject.getBaseEntityId()) == null || (!LDDao.getLabourStage(memberObject.getBaseEntityId()).equals("complete") && !LDDao.getLabourStage(memberObject.getBaseEntityId()).equals("3")))) { + textViewRecordLD.setText(R.string.lb_mode_of_delivery); + currentVisitItemTitle = getString(R.string.lb_mode_of_delivery); + } else if (LDDao.getLabourStage(memberObject.getBaseEntityId()).equals("1") || LDDao.getLabourStage(memberObject.getBaseEntityId()).equals("2")) { + if (LDDao.getCervixDilation(memberObject.getBaseEntityId()) == null || Integer.parseInt(LDDao.getCervixDilation(memberObject.getBaseEntityId())) < 3) { + textViewRecordLD.setText(R.string.labour_and_delivery_examination_and_consultation_button_tittle); + currentVisitItemTitle = getString(R.string.labour_and_delivery_examination_and_consultation_button_tittle); + } else if (Integer.parseInt(LDDao.getCervixDilation(memberObject.getBaseEntityId())) >= 3 && Integer.parseInt(LDDao.getCervixDilation(memberObject.getBaseEntityId())) < 10) { + textViewRecordLD.setText(R.string.labour_and_delivery_partograph_button_title); + currentVisitItemTitle = getString(R.string.labour_and_delivery_partograph_button_title); + } else if (Integer.parseInt(LDDao.getCervixDilation(memberObject.getBaseEntityId())) == 10) { + textViewRecordLD.setText(R.string.lb_mode_of_delivery); + currentVisitItemTitle = getString(R.string.lb_mode_of_delivery); + } + } else if (LDDao.getLabourStage(memberObject.getBaseEntityId()).equals("3") && (LDDao.getModeOfDelivery(memberObject.getBaseEntityId()) == null || (LDDao.getModeOfDelivery(memberObject.getBaseEntityId()) != null && !LDDao.getModeOfDelivery(memberObject.getBaseEntityId()).equals("cesarean")))) { + textViewRecordLD.setText(R.string.ld_active_management_3rd_stage); + } else if (LDDao.getLabourStage(memberObject.getBaseEntityId()).equals("complete")) { + textViewRecordLD.setText(R.string.ld_discharge_client); + currentVisitItemTitle = getString(R.string.ld_discharge_client); + } else if (LDDao.getLabourStage(memberObject.getBaseEntityId()).equals("4") || (LDDao.getLabourStage(memberObject.getBaseEntityId()).equals("3") && (LDDao.getModeOfDelivery(memberObject.getBaseEntityId()) != null && LDDao.getModeOfDelivery(memberObject.getBaseEntityId()).equals("cesarean")))) { + textViewRecordLD.setText(R.string.ld_mother_post_delivery_management); + currentVisitItemTitle = getString(R.string.ld_mother_post_delivery_management); + } + } + + private void openExaminationConsultation() { + String baseEntityId = null; + Bundle extras = getIntent().getExtras(); + + if (extras != null) { + baseEntityId = extras.getString(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID); + } + + LDGeneralExaminationVisitActivity.startLDGeneralExaminationVisitActivity(this, baseEntityId, false); + } + + + private void openActiveManagementStage() { + LDActiveManagementStageActivity.startActiveManagementActivity(this, memberObject.getBaseEntityId(), false); + } + + + private void openPostDeliveryManagementMother(boolean editMode) { + LDPostDeliveryManagementMotherActivity.startPostDeliveryMotherManagementActivity(this, memberObject.getBaseEntityId(), editMode); + } + + @Override + public void refreshMedicalHistory(boolean hasHistory) { + showProgressBar(false); + Visit lastVisit = LDLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), LD_PARTOGRAPHY); + + if (lastVisit != null) { + rlLastVisit.setVisibility(View.VISIBLE); + TextView ivViewHistoryArrow = findViewById(R.id.ivViewHistoryArrow); + ivViewHistoryArrow.setText(R.string.partograph_details_title); + ivViewHistoryArrow.setTextColor(getResources().getColor(R.color.black)); + } else { + rlLastVisit.setVisibility(View.GONE); + } + } + + @Override + public void openMedicalHistory() { + LDPartographDetailsActivity.startMe(this, memberObject); + } + + @Override + public void refreshUpComingServicesStatus(String service, AlertStatus status, Date date) { + showProgressBar(false); + rlUpcomingServices.setVisibility(View.GONE); + } + + @Override + public void refreshFamilyStatus(AlertStatus status) { + showProgressBar(false); + view_family_row.setVisibility(View.GONE); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.ld_member_profile_menu, menu); + if (LDDao.getLabourStage(memberObject.getBaseEntityId()) != null) { + int labourStage = 1; + try { + if (LDDao.getLabourStage(memberObject.getBaseEntityId()).equals("complete")) { + labourStage = 4; + } else + labourStage = Integer.parseInt(LDDao.getLabourStage(memberObject.getBaseEntityId())); + } catch (Exception e) { + Timber.e(e); + } + menu.findItem(R.id.action_mode_of_delivery).setVisible(labourStage <= 2); + } + + List childModels = HfPncDao.childrenForPncWoman(memberObject.getBaseEntityId()); + for (int i = 0; i < childModels.size(); i++) { + String nameOfMenuItem = getString(R.string.refer_child_for_emergency, childModels.get(i).getFirstName()); + menu.add(0, R.id.action_child_emergency_registration, 100 + i, nameOfMenuItem); + menuItemEditNames.put(nameOfMenuItem, childModels.get(i).getBaseEntityId()); + } + + for (int i = 0; i < childModels.size(); i++) { + String nameOfMenuItem = getString(R.string.mark_newborn_as_deceased, childModels.get(i).getFirstName()); + menu.add(0, R.id.action_mark_newborn_as_deceased, 200 + i, nameOfMenuItem); + menuItemEditNames.put(nameOfMenuItem, childModels.get(i).getBaseEntityId()); + } + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + try { + if (itemId == R.id.action_mode_of_delivery) { + startLDForm(this, memberObject.getBaseEntityId(), getLabourAndDeliveryModeOfDelivery()); + return true; + } else if (itemId == R.id.action_ld_emergency_referral) { + LDReferralFormUtils.startLDEmergencyReferral(this, memberObject.getBaseEntityId()); + return true; + } else if (itemId == R.id.action_child_emergency_registration) { + getChildEmergencyReferralMenuItem(item); + } else if (itemId == R.id.action_mark_newborn_as_deceased) { + getDeceasedChildMenuItem(item); + } else if (itemId == R.id.action_member_registration) { + if (UpdateDetailsUtil.isIndependentClient(memberObject.getBaseEntityId())) { + startFormForEdit(org.smartregister.chw.core.R.string.registration_info, + CoreConstants.JSON_FORM.getAllClientUpdateRegistrationInfoForm()); + } else { + startFormForEdit(org.smartregister.chw.core.R.string.edit_member_form_title, + CoreConstants.JSON_FORM.getFamilyMemberRegister()); + } + return true; + } + } catch (Exception e) { + Timber.e(e); + } + return super.onOptionsItemSelected(item); + } + + public static void closeLDVisit(String baseEntityId, Context context) { + AllSharedPreferences sharedPreferences = getAllSharedPreferences(); + Event baseEvent = (Event) new Event() + .withBaseEntityId(baseEntityId) + .withEventDate(new Date()) + .withEventType(org.smartregister.chw.hf.utils.Constants.Events.CLOSE_LD) + .withFormSubmissionId(org.smartregister.util.JsonFormUtils.generateRandomUUIDString()) + .withEntityType(CoreConstants.TABLE_NAME.LABOUR_AND_DELIVERY) + .withProviderId(sharedPreferences.fetchRegisteredANM()) + .withLocationId(ChwNotificationDao.getSyncLocationId(baseEntityId)) + .withTeamId(sharedPreferences.fetchDefaultTeamId(sharedPreferences.fetchRegisteredANM())) + .withTeam(sharedPreferences.fetchDefaultTeam(sharedPreferences.fetchRegisteredANM())) + .withClientDatabaseVersion(BuildConfig.DATABASE_VERSION) + .withClientApplicationVersion(BuildConfig.VERSION_CODE) + .withDateCreated(new Date()); + org.smartregister.chw.hf.utils.JsonFormUtils.tagSyncMetadata(Utils.context().allSharedPreferences(), baseEvent); + try { + org.smartregister.chw.anc.util.NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(baseEvent))); + } catch (Exception e) { + Timber.e(e); + } + Intent intent = new Intent(context, PncRegisterActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); + context.startActivity(intent); + ((LDProfileActivity) context).finish(); + } + + private boolean getChildEmergencyReferralMenuItem(MenuItem item) { + if (getChildren(memberObject).size() > 0) { + for (CommonPersonObjectClient child : getChildren(memberObject)) { + for (Map.Entry entry : menuItemEditNames.entrySet()) { + if (entry.getKey().equalsIgnoreCase(item.getTitle().toString()) && entry.getValue().equalsIgnoreCase(child.entityId())) { + LDReferralFormUtils.startLDChildEmergencyReferral(this, child.entityId()); + } + } + } + } + return true; + } + + private boolean getDeceasedChildMenuItem(MenuItem item) { + if (getChildren(memberObject).size() > 0) { + for (CommonPersonObjectClient child : getChildren(memberObject)) { + for (Map.Entry entry : menuItemEditNames.entrySet()) { + if (entry.getKey().equalsIgnoreCase(item.getTitle().toString()) && entry.getValue().equalsIgnoreCase(child.entityId())) { + + CommonPersonObjectClient commonPersonObjectClient = getClientDetailsByBaseEntityID(child.entityId()); + if (commonPersonObjectClient.getColumnmaps().get("entity_type").toString().equals(CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT)) { + commonPersonObjectClient.getColumnmaps().put(OpdDbConstants.KEY.REGISTER_TYPE, CoreConstants.REGISTER_TYPE.INDEPENDENT); + } + + IndividualProfileRemoveActivity.startIndividualProfileActivity(this, + commonPersonObjectClient, + memberObject.getFamilyBaseEntityId(), memberObject.getFamilyHead(), + memberObject.getPrimaryCareGiver(), LDProfileActivity.class.getCanonicalName()); + } + } + } + } + return true; + } + + protected List getChildren(MemberObject memberObject) { + return new PncMemberProfileInteractor().pncChildrenUnder29Days(memberObject.getBaseEntityId()); + } + + public void startFormForEdit(Integer title_resource, String formName) { + + JSONObject form = null; + CommonPersonObjectClient client = org.smartregister.chw.core.utils.Utils.clientForEdit(memberObject.getBaseEntityId()); + + if (formName.equals(CoreConstants.JSON_FORM.getFamilyMemberRegister())) { + form = CoreJsonFormUtils.getAutoPopulatedJsonEditMemberFormString( + (title_resource != null) ? getResources().getString(title_resource) : null, + CoreConstants.JSON_FORM.getFamilyMemberRegister(), + this, client, + Utils.metadata().familyMemberRegister.updateEventType, memberObject.getLastName(), false); + } else if (formName.equals(CoreConstants.JSON_FORM.getAncRegistration())) { + form = CoreJsonFormUtils.getAutoJsonEditAncFormString( + memberObject.getBaseEntityId(), this, formName, CoreConstants.EventType.UPDATE_ANC_REGISTRATION, getResources().getString(title_resource)); + } else if (formName.equalsIgnoreCase(CoreConstants.JSON_FORM.getAllClientUpdateRegistrationInfoForm())) { + String titleString = title_resource != null ? getResources().getString(title_resource) : null; + CommonPersonObjectClient commonPersonObjectClient = UpdateDetailsUtil.getFamilyRegistrationDetails(memberObject.getFamilyBaseEntityId()); + String uniqueID = commonPersonObjectClient.getColumnmaps().get(DBConstants.KEY.UNIQUE_ID); + boolean isPrimaryCareGiver = commonPersonObjectClient.getCaseId().equalsIgnoreCase(memberObject.getFamilyBaseEntityId()); + + NativeFormsDataBinder binder = new NativeFormsDataBinder(getContext(), memberObject.getBaseEntityId()); + binder.setDataLoader(new CoreFamilyMemberDataLoader(memberObject.getFamilyName(), isPrimaryCareGiver, titleString, + org.smartregister.chw.core.utils.Utils.metadata().familyMemberRegister.updateEventType, uniqueID)); + JSONObject jsonObject = binder.getPrePopulatedForm(CoreConstants.JSON_FORM.getAllClientUpdateRegistrationInfoForm()); + + try { + if (jsonObject != null) { + UpdateDetailsUtil.startUpdateClientDetailsActivity(jsonObject, this); + } + } catch (Exception e) { + Timber.e(e); + } + } + + try { + assert form != null; + startFormActivity(form); + } catch (Exception e) { + Timber.e(e); + } + } + + public void startFormActivity(JSONObject jsonForm) { + Intent intent = org.smartregister.chw.core.utils.Utils.formActivityIntent(this, jsonForm.toString()); + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + public Context getContext() { + return this; + } + + protected void initializeNotificationReferralRecyclerView() { + notificationAndReferralLayout = findViewById(org.smartregister.chw.core.R.id.notification_and_referral_row); + notificationAndReferralRecyclerView = findViewById(org.smartregister.chw.core.R.id.notification_and_referral_recycler_view); + notificationAndReferralRecyclerView.setLayoutManager(new LinearLayoutManager(this)); + } + + public void setClientTasks(Set taskList) { + if (notificationAndReferralRecyclerView != null && taskList.size() > 0) { + RecyclerView.Adapter mAdapter = new ReferralCardViewAdapter(taskList, this, getCommonPersonObjectClient(memberObject.getBaseEntityId()), CoreConstants.REGISTERED_ACTIVITIES.ANC_REGISTER_ACTIVITY); + notificationAndReferralRecyclerView.setAdapter(mAdapter); + notificationAndReferralLayout.setVisibility(View.VISIBLE); + findViewById(R.id.view_notification_and_referral_row).setVisibility(View.VISIBLE); + } + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDRegisterActivity.java new file mode 100644 index 000000000..a76ecd6e4 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDRegisterActivity.java @@ -0,0 +1,52 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.chw.hf.utils.Constants.JsonForm.getLdRegistration; + +import android.app.Activity; +import android.content.Intent; + +import androidx.fragment.app.Fragment; + +import org.smartregister.chw.core.activity.CoreLDRegisterActivity; +import org.smartregister.chw.hf.fragment.LDDischargedRegisterFragment; +import org.smartregister.chw.hf.fragment.LDRegisterFragment; +import org.smartregister.chw.hf.presenter.LDRegisterPresenter; +import org.smartregister.chw.ld.interactor.BaseLDRegisterInteractor; +import org.smartregister.chw.ld.model.BaseLDRegisterModel; +import org.smartregister.chw.ld.util.Constants; +import org.smartregister.view.fragment.BaseRegisterFragment; + +public class LDRegisterActivity extends CoreLDRegisterActivity { + @Override + protected BaseRegisterFragment getRegisterFragment() { + return new LDRegisterFragment(); + } + + public static void startLDRegistrationActivity(Activity activity, String baseEntityID) { + Intent intent = new Intent(activity, LDRegisterActivity.class); + intent.putExtra(org.smartregister.chw.ld.util.Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.LD_FORM_NAME, getLdRegistration()); + intent.putExtra(org.smartregister.chw.ld.util.Constants.ACTIVITY_PAYLOAD.ACTION, org.smartregister.chw.ld.util.Constants.ACTIVITY_PAYLOAD_TYPE.REGISTRATION); + activity.startActivity(intent); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + //Closing the register activity to return to profile activity if the launched form was Labour and Delivery Labour Stage Form + if (ACTION.equals(LDProfileActivity.LD_PROFILE_ACTION)) + finish(); + } + + @Override + protected void initializePresenter() { + presenter = new LDRegisterPresenter(this, new BaseLDRegisterModel(), new BaseLDRegisterInteractor()); + } + + @Override + protected Fragment[] getOtherFragments() { + Fragment[] otherFragments = new Fragment[1]; + otherFragments[0] = new LDDischargedRegisterFragment(); + return otherFragments; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDRegistrationAdmissionInformationJsonWizardFormActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDRegistrationAdmissionInformationJsonWizardFormActivity.java new file mode 100644 index 000000000..5ce111027 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDRegistrationAdmissionInformationJsonWizardFormActivity.java @@ -0,0 +1,27 @@ +package org.smartregister.chw.hf.activity; + +import com.vijay.jsonwizard.activities.JsonWizardFormActivity; +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.utils.NativeFormLangUtils; + +import org.smartregister.chw.hf.fragment.HfJsonFormFragment; + +public class LDRegistrationAdmissionInformationJsonWizardFormActivity extends JsonWizardFormActivity { + @Override + protected String getJsonForm() { + String jsonForm = LDRegistrationFormActivity.LABOUR_AND_DELIVERY_REGISTRATION_ADMISSION_INFORMATION; + + if (translateForm) { + jsonForm = NativeFormLangUtils.getTranslatedStringWithDBResourceBundle(this, jsonForm, null); + } + return jsonForm; + } + + @Override + public synchronized void initializeFormFragment() { + isFormFragmentInitialized = true; + HfJsonFormFragment formFragment = HfJsonFormFragment.getFormFragment(JsonFormConstants.FIRST_STEP_NAME); + getSupportFragmentManager().beginTransaction() + .add(com.vijay.jsonwizard.R.id.container, formFragment).commitAllowingStateLoss(); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDRegistrationDetailsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDRegistrationDetailsActivity.java new file mode 100644 index 000000000..279680fd0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDRegistrationDetailsActivity.java @@ -0,0 +1,454 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.AllConstants.DEFAULT_LOCALITY_NAME; +import static org.smartregister.util.Utils.getName; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.style.BulletSpan; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import com.gkemon.XMLtoPDF.PdfGenerator; +import com.gkemon.XMLtoPDF.PdfGeneratorListener; +import com.gkemon.XMLtoPDF.model.FailureResponse; +import com.gkemon.XMLtoPDF.model.SuccessResponse; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.WordUtils; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.presenter.BaseAncMedicalHistoryPresenter; +import org.smartregister.chw.core.activity.CoreAncMedicalHistoryActivity; +import org.smartregister.chw.core.activity.DefaultAncMedicalHistoryActivityFlv; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.LDRegistrationDetailsInteractor; +import org.smartregister.chw.ld.LDLibrary; +import org.smartregister.chw.ld.dao.LDDao; +import org.smartregister.chw.ld.domain.MemberObject; + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import timber.log.Timber; + +public class LDRegistrationDetailsActivity extends CoreAncMedicalHistoryActivity { + private static MemberObject ldMemberObject; + private Flavor flavor = new LDRegistrationDetailsActivityFlv(); + private ProgressBar progressBar; + private RelativeLayout headerLayout; + + public static void startMe(Activity activity, MemberObject memberObject) { + Intent intent = new Intent(activity, LDRegistrationDetailsActivity.class); + ldMemberObject = memberObject; + activity.startActivity(intent); + } + + @Override + public void initializePresenter() { + presenter = new BaseAncMedicalHistoryPresenter(new LDRegistrationDetailsInteractor(), this, ldMemberObject.getBaseEntityId()); + } + + @Override + public void setUpView() { + findViewById(R.id.collapsing_toolbar).setBackgroundColor(getResources().getColor(R.color.primary)); + + Drawable upArrow = this.getResources().getDrawable(R.drawable.ic_arrow_back_white_24dp); + upArrow.setColorFilter(this.getResources().getColor(android.R.color.white), PorterDuff.Mode.SRC_ATOP); + getSupportActionBar().setHomeAsUpIndicator(upArrow); + + linearLayout = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.linearLayoutMedicalHistory); + progressBar = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.progressBarMedicalHistory); + + + TextView tvTitle = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.tvTitle); + tvTitle.setText(getString(org.smartregister.chw.opensrp_chw_anc.R.string.back_to, ldMemberObject.getFullName())); + tvTitle.setTextColor(getResources().getColor(org.smartregister.ld.R.color.white)); + + TextView medicalHistory = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.medical_history); + medicalHistory.setVisibility(View.GONE); + + TextView facilityName = findViewById(org.smartregister.ld.R.id.facility_name); + TextView clientName = findViewById(org.smartregister.ld.R.id.client_name); + TextView gravida = findViewById(org.smartregister.ld.R.id.gravida); + TextView para = findViewById(org.smartregister.ld.R.id.para); + TextView admissionDate = findViewById(org.smartregister.ld.R.id.admission_date); + TextView admissionTime = findViewById(org.smartregister.ld.R.id.admission_time); + + String facilityNameString = LDLibrary.getInstance().context().allSharedPreferences().getPreference(DEFAULT_LOCALITY_NAME); + + if (StringUtils.isNotBlank(facilityNameString)) { + facilityName.setText(facilityNameString); + } else { + facilityName.setVisibility(View.GONE); + } + + clientName.setText(MessageFormat.format(getString(org.smartregister.ld.R.string.partograph_client_name), ldMemberObject.getFirstName(), ldMemberObject.getMiddleName(), ldMemberObject.getLastName())); + gravida.setText(MessageFormat.format(getString(org.smartregister.ld.R.string.partograph_gravida), LDDao.getGravida(ldMemberObject.getBaseEntityId()))); + para.setText(MessageFormat.format(getString(org.smartregister.ld.R.string.partograph_para), LDDao.getPara(ldMemberObject.getBaseEntityId()))); + admissionDate.setText(MessageFormat.format(getString(org.smartregister.ld.R.string.partograph_admission_date), LDDao.getAdmissionDate(ldMemberObject.getBaseEntityId()))); + admissionTime.setText(MessageFormat.format(getString(org.smartregister.ld.R.string.partograph_admission_time), LDDao.getAdmissionTime(ldMemberObject.getBaseEntityId()))); + } + + @Override + public View renderView(List visits) { + super.renderView(visits); + View view = flavor.bindViews(this); + displayLoadingState(true); + flavor.processViewData(visits, this); + displayLoadingState(false); + TextView title = view.findViewById(org.smartregister.chw.core.R.id.customFontTextViewHealthFacilityVisitTitle); + TextView edit = view.findViewById(org.smartregister.chw.core.R.id.textview_edit); + title.setText(getString(R.string.ld_registration_details_title)); + + edit.setVisibility(View.VISIBLE); + edit.setOnClickListener(view1 -> LDRegistrationFormActivity.startMe(LDRegistrationDetailsActivity.this, ldMemberObject.getBaseEntityId(), true, getName(getName(ldMemberObject.getFirstName(), ldMemberObject.getMiddleName()), ldMemberObject.getLastName()), String.valueOf(ldMemberObject.getAge()))); + + return view; + } + + @Override + public void displayLoadingState(boolean state) { + progressBar.setVisibility(state ? View.VISIBLE : View.GONE); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(org.smartregister.ld.R.menu.partograph_menu, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() == android.R.id.home) { + finish(); + return true; + } else if (item.getItemId() == org.smartregister.ld.R.id.action_download_partograph) { + downloadPartograph(); + return true; + } + return super.onOptionsItemSelected(item); + } + + + private void downloadPartograph() { + headerLayout = findViewById(R.id.header_layout); + headerLayout.setVisibility(View.VISIBLE); + + + int age = 0; + try { + age = Integer.parseInt(ldMemberObject.getAge()); + } catch (Exception e) { + Timber.e(e); + } + View mView = findViewById(R.id.main_layout); + PdfGenerator.getBuilder() + .setContext(LDRegistrationDetailsActivity.this) + .fromViewSource() + .fromView(mView) + .setFileName(String.format(Locale.getDefault(), "%s %s %s, %d", + ldMemberObject.getFirstName(), + ldMemberObject.getMiddleName(), + ldMemberObject.getLastName(), + age)) + .setFolderNameOrPath("MyFolder/MyDemoHorizontalText/") + .actionAfterPDFGeneration(PdfGenerator.ActionAfterPDFGeneration.OPEN) + .build(new PdfGeneratorListener() { + @Override + public void onFailure(FailureResponse failureResponse) { + super.onFailure(failureResponse); + } + + @Override + public void showLog(String log) { + super.showLog(log); + } + + @Override + public void onStartPDFGeneration() { + /*When PDF generation begins to start*/ + } + + @Override + public void onFinishPDFGeneration() { + /*When PDF generation is finished*/ + headerLayout.setVisibility(View.GONE); + } + + @Override + public void onSuccess(SuccessResponse response) { + super.onSuccess(response); + } + }); + } + + class LDRegistrationDetailsActivityFlv extends DefaultAncMedicalHistoryActivityFlv { + + @Override + protected void processAncCard(String has_card, Context context) { + // super.processAncCard(has_card, context); + linearLayoutAncCard.setVisibility(View.GONE); + } + + @Override + protected void processHealthFacilityVisit(List> hf_visits, Context context) { + //super.processHealthFacilityVisit(hf_visits, context); + } + + @Override + public void processViewData(List visits, Context context) { + + if (visits.size() > 0) { + List> hf_visits = new ArrayList<>(); + + int x = 0; + while (x < visits.size()) { + + // the first object in this list is the days difference + + + String[] hf_params = { + "systolic", + "diastolic", + "pulse_rate", + "respiratory_rate", + "oxygen_saturation", + "fetal_heart_rate", + "temperature", + "weight", + "height", + "gravida", + "para", + "number_of_abortion", + "children_alive", + "gest_age", + "past_medical_surgical_history", + "admission_date", + "admission_time", + "admitting_person_name", + "admission_from", + "name_of_hf", + "reason_for_referral", + "reasons_for_admission", + "other_reason_for_admission", + "danger_signs", + "other_danger_signs", + "number_of_visits", + "ipt_doses", + "tt_doses", + "llin_used", + "hb_test", + "hb_level", + "management_provided_for_severe_anaemia", + "management_provided_for_mild_anaemia", + "hb_test_date", + "anc_hiv_status", + "hiv", + "pmtct_test_date", + "management_provided_for_pmtct", + "art_prescription", + "prompt_for_art_management", + "syphilis", + "management_provided_for_syphilis", + "malaria", + "management_provided_for_malaria", + "blood_group", + "rh_factor", + "true_labour", + "management_provided_for_rh", + "labour_onset_date", + "labour_onset_time", + "membrane", + "membrane_ruptured_date", + "membrane_ruptured_time", + "fetal_movement", + "movement_status" + }; + + extractHFVisit(visits, hf_params, hf_visits, x, context); + + x++; + } + + processLastVisit(); + processFacilityVisit(hf_visits, context); + } + } + + private void extractHFVisit(List sourceVisits, String[] hf_params, List> hf_visits, int iteration, Context context) { + // get the hf details + Map map = new HashMap<>(); + for (String param : hf_params) { + try { + List details = sourceVisits.get(iteration).getVisitDetails().get(param); + map.put(param, getTexts(context, details)); + } catch (Exception e) { + e.printStackTrace(); + } + + } + hf_visits.add(map); + } + + + private void processLastVisit() { + linearLayoutLastVisit.setVisibility(View.GONE); + } + + + protected void processFacilityVisit(List> hf_visits, Context context) { + if (hf_visits != null && hf_visits.size() > 0) { + linearLayoutHealthFacilityVisit.setVisibility(View.VISIBLE); + + for (Map vals : hf_visits) { + View rootView = inflater.inflate(R.layout.fragment_labour_and_delivery_registration_summary, null); + + TextView para = rootView.findViewById(R.id.para); + TextView pmtct = rootView.findViewById(R.id.pmtct); + TextView weight = rootView.findViewById(R.id.weight); + TextView height = rootView.findViewById(R.id.height); + TextView gravida = rootView.findViewById(R.id.gravida); + TextView systolic = rootView.findViewById(R.id.systolic); + TextView gest_age = rootView.findViewById(R.id.gest_age); + TextView tt_doses = rootView.findViewById(R.id.tt_doses); + TextView hb_level = rootView.findViewById(R.id.hb_level); + TextView syphilis = rootView.findViewById(R.id.syphilis); + TextView diastolic = rootView.findViewById(R.id.diastolic); + TextView ipt_doses = rootView.findViewById(R.id.ipt_doses); + TextView rh_factor = rootView.findViewById(R.id.rh_factor); + TextView pulse_rate = rootView.findViewById(R.id.pulse_rate); + TextView temperature = rootView.findViewById(R.id.temperature); + TextView true_labour = rootView.findViewById(R.id.true_labour); + TextView blood_group = rootView.findViewById(R.id.blood_group); + TextView danger_signs = rootView.findViewById(R.id.danger_signs); + TextView visit_number = rootView.findViewById(R.id.visit_number); + TextView hb_test_date = rootView.findViewById(R.id.hb_test_date); + TextView itn_llin_used = rootView.findViewById(R.id.itn_llin_used); + TextView malaria = rootView.findViewById(R.id.malaria); + TextView admission_date = rootView.findViewById(R.id.admission_date); + TextView admission_time = rootView.findViewById(R.id.admission_time); + TextView children_alive = rootView.findViewById(R.id.children_alive); + TextView fetal_movement = rootView.findViewById(R.id.fetal_movement); + TextView admission_place = rootView.findViewById(R.id.admission_place); + TextView pmtct_test_date = rootView.findViewById(R.id.pmtct_test_date); + TextView respiratory_rate = rootView.findViewById(R.id.respiratory_rate); + TextView fetal_heart_rate = rootView.findViewById(R.id.fetal_heart_rate); + TextView admission_reason = rootView.findViewById(R.id.admission_reason); + TextView art_prescription = rootView.findViewById(R.id.art_prescription); + TextView labour_onset_date = rootView.findViewById(R.id.labour_onset_date); + TextView labour_onset_time = rootView.findViewById(R.id.labour_onset_time); + TextView ruptured_membrane = rootView.findViewById(R.id.ruptured_membrane); + TextView number_of_abortion = rootView.findViewById(R.id.number_of_abortion); + TextView admitting_person_name = rootView.findViewById(R.id.admitting_person_name); + TextView membrane_ruptured_date = rootView.findViewById(R.id.membrane_ruptured_date); + TextView membrane_ruptured_time = rootView.findViewById(R.id.membrane_ruptured_time); + TextView past_medical_surgical_history = rootView.findViewById(R.id.past_medical_history); + + evaluateView(context, vals, true_labour, "true_labour", "ld_"); + evaluateView(context, vals, systolic, "systolic", "ld_"); + evaluateView(context, vals, diastolic, "diastolic", "ld_"); + evaluateView(context, vals, pulse_rate, "pulse_rate", "ld_"); + evaluateView(context, vals, respiratory_rate, "respiratory_rate", "ld_"); + evaluateView(context, vals, fetal_heart_rate, "fetal_heart_rate", "ld_"); + evaluateView(context, vals, temperature, "temperature", "ld_"); + evaluateView(context, vals, weight, "weight", "ld_"); + evaluateView(context, vals, height, "height", "ld_"); + evaluateView(context, vals, gravida, "gravida", "ld_"); + evaluateView(context, vals, para, "para", "ld_"); + evaluateView(context, vals, number_of_abortion, "number_of_abortion", "ld_"); + evaluateView(context, vals, children_alive, "children_alive", "ld_"); + evaluateView(context, vals, past_medical_surgical_history, "past_medical_surgical_history", "ld_"); + evaluateView(context, vals, gest_age, "gest_age", "ld_"); + evaluateView(context, vals, admission_date, "admission_date", "ld_"); + evaluateView(context, vals, admission_time, "admission_time", "ld_"); + evaluateView(context, vals, admitting_person_name, "admitting_person_name", "ld_"); + evaluateView(context, vals, admission_place, "admission_from", "ld_"); + evaluateView(context, vals, admission_reason, "reasons_for_admission", "ld_"); + evaluateView(context, vals, danger_signs, "danger_signs", "ld_"); + evaluateView(context, vals, visit_number, "number_of_visits", "ld_"); + evaluateView(context, vals, ipt_doses, "ipt_doses", "ld_"); + evaluateView(context, vals, tt_doses, "tt_doses", "ld_"); + evaluateView(context, vals, itn_llin_used, "llin_used", ""); + evaluateView(context, vals, hb_level, "hb_level", "ld_"); + evaluateView(context, vals, hb_test_date, "hb_test_date", "ld_"); + evaluateView(context, vals, pmtct, "anc_hiv_status", "ld_"); + evaluateView(context, vals, pmtct_test_date, "pmtct_test_date", "ld_"); + evaluateView(context, vals, art_prescription, "art_prescription", "ld_"); + evaluateView(context, vals, syphilis, "syphilis", "ld_"); + evaluateView(context, vals, malaria, "malaria", "ld_"); + evaluateView(context, vals, blood_group, "blood_group", "ld_"); + evaluateView(context, vals, rh_factor, "rh_factor", ""); + evaluateView(context, vals, labour_onset_date, "labour_onset_date", "ld_"); + evaluateView(context, vals, labour_onset_time, "labour_onset_time", "ld_"); + evaluateView(context, vals, ruptured_membrane, "membrane", "ld_"); + evaluateView(context, vals, membrane_ruptured_date, "membrane_ruptured_date", "ld_"); + evaluateView(context, vals, membrane_ruptured_time, "membrane_ruptured_time", "ld_"); + evaluateView(context, vals, fetal_movement, "fetal_movement", "ld_"); + + + linearLayoutHealthFacilityVisitDetails.addView(rootView, 0); + + } + } + } + + + private void evaluateView(Context context, Map vals, TextView tv, String valueKey, String valuePrefixInStringResources) { + if (StringUtils.isNotBlank(getMapValue(vals, valueKey))) { + SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(); + + String stringValue = getMapValue(vals, valueKey); + String[] stringValueArray; + if (stringValue.contains(",")) { + stringValueArray = stringValue.split(","); + for (String value : stringValueArray) { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, value.trim()) + "\n", new BulletSpan(10), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + } + } else { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, stringValue)).append("\n"); + } + tv.setVisibility(View.VISIBLE); + tv.setText(spannableStringBuilder); + } else { + tv.setVisibility(View.GONE); + } + } + + + private String getMapValue(Map map, String key) { + if (map.containsKey(key)) { + return map.get(key); + } + return ""; + } + + private String getStringResource(Context context, String prefix, String resourceName) { + int resourceId = context.getResources(). + getIdentifier(prefix + resourceName.trim(), "string", context.getPackageName()); + try { + return context.getString(resourceId); + } catch (Exception e) { + Timber.e(e); + if (resourceName.contains("_")) { + resourceName = resourceName.replace("_", " "); + resourceName = WordUtils.capitalize(resourceName); + } + return resourceName; + } + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDRegistrationFormActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDRegistrationFormActivity.java new file mode 100644 index 000000000..6ba284179 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LDRegistrationFormActivity.java @@ -0,0 +1,184 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.R; +import org.smartregister.chw.core.task.RunnableTask; +import org.smartregister.chw.hf.interactor.LDRegistrationInteractor; +import org.smartregister.chw.hf.schedulers.HfScheduleTaskExecutor; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.ld.activity.BaseLDVisitActivity; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.chw.ld.presenter.BaseLDVisitPresenter; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.util.LangUtils; + +import java.text.MessageFormat; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author ilakozejumanne@gmail.com + * 06/05/2022 + */ +public class LDRegistrationFormActivity extends BaseLDVisitActivity { + public static String LABOUR_AND_DELIVERY_REGISTRATION_ADMISSION_INFORMATION; + + public static void startMe(Activity activity, String baseEntityID, Boolean isEditMode, String fullName, String age) { + Intent intent = new Intent(activity, LDRegistrationFormActivity.class); + intent.putExtra(org.smartregister.chw.ld.util.Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(org.smartregister.chw.ld.util.Constants.ACTIVITY_PAYLOAD.EDIT_MODE, isEditMode); + intent.putExtra("FULL_NAME", fullName); + intent.putExtra("AGE", age); + activity.startActivityForResult(intent, org.smartregister.chw.anc.util.Constants.REQUEST_CODE_HOME_VISIT); + } + + @Override + protected void registerPresenter() { + presenter = new BaseLDVisitPresenter(memberObject, this, new LDRegistrationInteractor(baseEntityID)); + } + + @Override + public void submittedAndClose() { + Runnable runnable = () -> HfScheduleTaskExecutor.getInstance().execute(memberObject.getBaseEntityId(), Constants.Events.LD_REGISTRATION, new Date()); + Utils.startAsyncTask(new RunnableTask(runnable), null); + + Intent intent = new Intent(this, LDRegisterActivity.class); + this.startActivity(intent); + finish(); + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + + Form form = new Form(); + form.setActionBarBackground(R.color.family_actionbar); + form.setWizard(false); + + Intent intent; + + try { + if (jsonForm.getString("encounter_type").equals("Labour and Delivery Registration Admission Information")) { + LABOUR_AND_DELIVERY_REGISTRATION_ADMISSION_INFORMATION = jsonForm.toString(); + intent = new Intent(this, LDRegistrationAdmissionInformationJsonWizardFormActivity.class); + } else { + intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + } + } catch (JSONException e) { + e.printStackTrace(); + intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + } + + intent.putExtra(org.smartregister.family.util.Constants.WizardFormActivity.EnableOnCloseDialog, false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + protected void attachBaseContext(Context base) { + // get language from prefs + String lang = LangUtils.getLanguage(base.getApplicationContext()); + super.attachBaseContext(LangUtils.setAppLocale(base, lang)); + } + + @Override + public void redrawHeader(MemberObject memberObject) { + tvTitle.setText(MessageFormat.format("{0}, {1} \u00B7 {2}", getIntent().getStringExtra("FULL_NAME"), getIntent().getStringExtra("AGE"), getString(org.smartregister.chw.hf.R.string.ld_registration))); + } + + @Override + public void onDestroy() { + try { + super.onDestroy(); + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + public void initializeActions(LinkedHashMap map) { + //Clearing the action List before recreation + actionList.clear(); + + //Necessary evil to rearrange the actions according to a specific arrangement + if (map.containsKey(getString(org.smartregister.chw.hf.R.string.ld_registration_triage_title))) { + BaseLDVisitAction triageAction = map.get(getString(org.smartregister.chw.hf.R.string.ld_registration_triage_title)); + actionList.put(getString(org.smartregister.chw.hf.R.string.ld_registration_triage_title), triageAction); + } + if (map.containsKey(getString(org.smartregister.chw.hf.R.string.ld_registration_true_labour_title))) { + BaseLDVisitAction ldRegistrationTrueLabourConfirmation = map.get(getString(org.smartregister.chw.hf.R.string.ld_registration_true_labour_title)); + actionList.put(getString(org.smartregister.chw.hf.R.string.ld_registration_true_labour_title), ldRegistrationTrueLabourConfirmation); + } + if (map.containsKey(getString(org.smartregister.chw.hf.R.string.ld_registration_true_labour_title))) { + BaseLDVisitAction ldRegistrationTrueLabourConfirmation = map.get(getString(org.smartregister.chw.hf.R.string.ld_registration_true_labour_title)); + actionList.put(getString(org.smartregister.chw.hf.R.string.ld_registration_true_labour_title), ldRegistrationTrueLabourConfirmation); + } + if (map.containsKey(getString(org.smartregister.chw.hf.R.string.ld_registration_admission_information_title))) { + BaseLDVisitAction ldRegistrationAdmissionInformation = map.get(getString(org.smartregister.chw.hf.R.string.ld_registration_admission_information_title)); + actionList.put(getString(org.smartregister.chw.hf.R.string.ld_registration_admission_information_title), ldRegistrationAdmissionInformation); + } + if (map.containsKey(getString(org.smartregister.chw.hf.R.string.ld_registration_obstetric_history_title))) { + BaseLDVisitAction ldRegistrationObstetricHistory = map.get(getString(org.smartregister.chw.hf.R.string.ld_registration_obstetric_history_title)); + actionList.put(getString(org.smartregister.chw.hf.R.string.ld_registration_obstetric_history_title), ldRegistrationObstetricHistory); + } + if (map.containsKey(getString(org.smartregister.chw.hf.R.string.ld_registration_past_obstetric_history_title))) { + BaseLDVisitAction labourAndDeliveryPastObstetricHistory = map.get(getString(org.smartregister.chw.hf.R.string.ld_registration_past_obstetric_history_title)); + actionList.put(getString(org.smartregister.chw.hf.R.string.ld_registration_past_obstetric_history_title), labourAndDeliveryPastObstetricHistory); + } + //====================End of Necessary evil ==================================== + + + for (Map.Entry entry : map.entrySet()) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + actionList.putIfAbsent(entry.getKey(), entry.getValue()); + } else { + actionList.put(entry.getKey(), entry.getValue()); + } + } + + if (mAdapter != null) { + mAdapter.notifyDataSetChanged(); + } + redrawVisitUI(); + displayProgressBar(false); + } + + @Override + public void redrawVisitUI() { + boolean valid = actionList.size() > 0; + for (Map.Entry entry : actionList.entrySet()) { + BaseLDVisitAction action = entry.getValue(); + if ( + //Updated the condition to only allow submission if the action is not completed in the L&D Registration + (!action.isOptional() && (action.getActionStatus() != BaseLDVisitAction.Status.COMPLETED && action.isValid())) + || !action.isEnabled() + ) { + valid = false; + break; + } + } + + int res_color = valid ? org.smartregister.ld.R.color.white : org.smartregister.ld.R.color.light_grey; + tvSubmit.setTextColor(getResources().getColor(res_color)); + tvSubmit.setOnClickListener(valid ? this : null); + + mAdapter.notifyDataSetChanged(); + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LTFURegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LTFURegisterActivity.java new file mode 100644 index 000000000..ac11b03ee --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LTFURegisterActivity.java @@ -0,0 +1,58 @@ +package org.smartregister.chw.hf.activity; + +import android.view.MenuItem; + +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; + +import com.google.android.material.bottomnavigation.BottomNavigationView; + +import org.smartregister.chw.core.activity.BaseReferralRegister; +import org.smartregister.chw.core.presenter.BaseReferralPresenter; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.fragment.LTFUReferralsRegisterFragment; +import org.smartregister.chw.hf.fragment.SuccessfulReferralsRegisterFragment; +import org.smartregister.helper.BottomNavigationHelper; +import org.smartregister.view.fragment.BaseRegisterFragment; + +public class LTFURegisterActivity extends BaseReferralRegister implements BottomNavigationView.OnNavigationItemSelectedListener { + + + @Override + protected void initializePresenter() { + presenter = new BaseReferralPresenter(); + } + + @Override + protected BaseRegisterFragment getRegisterFragment() { + return new LTFUReferralsRegisterFragment(); + } + + @Override + protected Fragment[] getOtherFragments() { + return new SuccessfulReferralsRegisterFragment[]{new SuccessfulReferralsRegisterFragment()}; + } + + @Override + protected void registerBottomNavigation() { + bottomNavigationHelper = new BottomNavigationHelper(); + bottomNavigationView = findViewById(org.smartregister.R.id.bottom_navigation); + bottomNavigationView.getMenu().clear(); + + bottomNavigationView.inflateMenu(R.menu.referrals_bottom_nav_menu); + bottomNavigationView.getMenu().removeItem(R.id.action_issued_referrals); + bottomNavigationView.setOnNavigationItemSelectedListener(this); + } + + @Override + public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) { + if (menuItem.getItemId() == R.id.action_home) { + switchToFragment(0); + return true; + } else if (menuItem.getItemId() == R.id.action_completed_referrals) { + switchToFragment(1); + return true; + } else + return false; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LdEmergencyReferralRegistrationActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LdEmergencyReferralRegistrationActivity.java new file mode 100644 index 000000000..1ec0e0463 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LdEmergencyReferralRegistrationActivity.java @@ -0,0 +1,98 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import com.google.common.collect.Sets; + +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.custom_views.NavigationMenu; +import org.smartregister.chw.hf.presenter.IssueReferralActivityPresenter; +import org.smartregister.chw.referral.activity.BaseIssueReferralActivity; +import org.smartregister.chw.referral.contract.BaseIssueReferralContract; +import org.smartregister.chw.referral.interactor.BaseIssueReferralInteractor; +import org.smartregister.chw.referral.model.BaseIssueReferralModel; +import org.smartregister.chw.referral.presenter.BaseIssueReferralPresenter; +import org.smartregister.chw.referral.util.Constants; +import org.smartregister.dao.LocationsDao; +import org.smartregister.domain.Location; +import org.smartregister.family.util.JsonFormUtils; + +import java.util.List; + +import timber.log.Timber; + +public class LdEmergencyReferralRegistrationActivity extends BaseIssueReferralActivity { + private static String BASE_ENTITY_ID; + + public static void startGeneralReferralFormActivityForResults(Activity activity, String baseEntityID, JSONObject formJsonObject, boolean useCustomLayout) { + BASE_ENTITY_ID = baseEntityID; + Intent intent = new Intent(activity, LdEmergencyReferralRegistrationActivity.class); + intent.putExtra(Constants.ActivityPayload.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(Constants.ActivityPayload.JSON_FORM, formJsonObject.toString()); + intent.putExtra(Constants.ActivityPayload.ACTION, Constants.ActivityPayloadType.REGISTRATION); + intent.putExtra(Constants.ActivityPayload.USE_CUSTOM_LAYOUT, useCustomLayout); + activity.startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + NavigationMenu.getInstance(this, null, null); + } + + // @Override + public void initializeHealthFacilitiesList(JSONObject form) { + JSONArray steps; + List locationList = LocationsDao.getLocationsByTags(Sets.newHashSet("health_facility", "Facility")); + try { + JSONArray options = new JSONArray(); + for (Location location : locationList) { + JSONObject option = new JSONObject(); + option.put("name", StringUtils.capitalize(location.getProperties().getName())); + option.put("text", StringUtils.capitalize(location.getProperties().getName())); + JSONObject metaData = new JSONObject(); + metaData.put("openmrs_entity", "location_uuid"); + metaData.put("openmrs_entity_id", location.getProperties().getUid()); + option.put("meta_data", metaData); + + options.put(option); + } + + steps = form.getJSONArray("steps"); + JSONObject step = steps.getJSONObject(0); + JSONArray fields = step.getJSONArray("fields"); + int i = 0; + int j = 0; + int fieldCount = fields.length(); + int optionCount = options.length(); + while (i < fieldCount) { + JSONObject field = fields.getJSONObject(i); + if (field.getString("name").equals("chw_referral_hf")) { + JSONArray optionsArr = field.getJSONArray("options"); + while (j < optionCount) { + optionsArr.put(options.get(j)); + j++; + } + break; + } + i++; + } + } catch (JSONException e) { + Timber.e(e); + } + } + + @NotNull + @Override + public BaseIssueReferralPresenter presenter() { + return new IssueReferralActivityPresenter(BASE_ENTITY_ID, (BaseIssueReferralContract.View) this, + BaseIssueReferralModel.class, (BaseIssueReferralContract.Interactor) new BaseIssueReferralInteractor()); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LdReportsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LdReportsActivity.java new file mode 100644 index 000000000..de21928ec --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LdReportsActivity.java @@ -0,0 +1,24 @@ +package org.smartregister.chw.hf.activity; + +import android.view.View; +import android.widget.TextView; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; + +public class LdReportsActivity extends PncReportsActivity { + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.pnc_monthly_report) { + LdReportsViewActivity.startMe(this, Constants.ReportConstants.ReportPaths.LD_REPORT_PATH, reportPeriod); + } + } + + @Override + public void setUpToolbar() { + super.setUpToolbar(); + TextView title = findViewById(R.id.toolbar_title); + title.setText(R.string.ld_report_title); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LdReportsViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LdReportsViewActivity.java new file mode 100644 index 000000000..6940d73ee --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LdReportsViewActivity.java @@ -0,0 +1,18 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; + +public class LdReportsViewActivity extends HfReportsViewActivity { + public static void startMe(Activity activity, String reportPath, String reportDate) { + Intent intent = new Intent(activity, LdReportsViewActivity.class); + intent.putExtra(ARG_REPORT_PATH, reportPath); + intent.putExtra(ARG_REPORT_DATE, reportDate); + intent.putExtra(ARG_REPORT_TITLE, R.string.ld_report_title); + intent.putExtra(ARG_REPORT_TYPE, Constants.ReportConstants.ReportTypes.LD_REPORT); + activity.startActivity(intent); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LdSummaryDetailsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LdSummaryDetailsActivity.java new file mode 100644 index 000000000..708290b5f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LdSummaryDetailsActivity.java @@ -0,0 +1,295 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.style.BulletSpan; +import android.text.style.StyleSpan; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.text.WordUtils; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.presenter.BaseAncMedicalHistoryPresenter; +import org.smartregister.chw.core.activity.CoreAncMedicalHistoryActivity; +import org.smartregister.chw.core.activity.DefaultAncMedicalHistoryActivityFlv; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.LDSummaryDetailsInteractor; +import org.smartregister.chw.ld.domain.MemberObject; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class LdSummaryDetailsActivity extends CoreAncMedicalHistoryActivity { + private static MemberObject ldMemberObject; + private final Flavor flavor = new LdExaminationDetailsActivityFlv(); + private ProgressBar progressBar; + + public static void startMe(Activity activity, MemberObject memberObject) { + Intent intent = new Intent(activity, LdSummaryDetailsActivity.class); + ldMemberObject = memberObject; + activity.startActivity(intent); + } + + @Override + public void initializePresenter() { + presenter = new BaseAncMedicalHistoryPresenter(new LDSummaryDetailsInteractor(), this, ldMemberObject.getBaseEntityId()); + } + + @Override + public void setUpView() { + linearLayout = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.linearLayoutMedicalHistory); + progressBar = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.progressBarMedicalHistory); + + TextView tvTitle = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.tvTitle); + tvTitle.setText(getString(org.smartregister.chw.opensrp_chw_anc.R.string.back_to, ldMemberObject.getFullName())); + + ((TextView) findViewById(R.id.medical_history)).setText(getString(R.string.ld_details_title)); + } + + @Override + public View renderView(List visits) { + super.renderView(visits); + View view = flavor.bindViews(this); + displayLoadingState(true); + flavor.processViewData(visits, this); + displayLoadingState(false); + TextView visitTitle = view.findViewById(org.smartregister.chw.core.R.id.customFontTextViewHealthFacilityVisitTitle); + visitTitle.setText(R.string.visits_history); + return view; + } + + @Override + public void displayLoadingState(boolean state) { + progressBar.setVisibility(state ? View.VISIBLE : View.GONE); + } + + private static class LdExaminationDetailsActivityFlv extends DefaultAncMedicalHistoryActivityFlv { + private final StyleSpan boldSpan = new StyleSpan(android.graphics.Typeface.BOLD); + + @Override + protected void processAncCard(String has_card, Context context) { + // super.processAncCard(has_card, context); + linearLayoutAncCard.setVisibility(View.GONE); + } + + @Override + protected void processHealthFacilityVisit(List> hf_visits, Context context) { + //super.processHealthFacilityVisit(hf_visits, context); + } + + @Override + public void processViewData(List visits, Context context) { + + if (visits.size() > 0) { + List> hf_visits = new ArrayList<>(); + + int x = 0; + while (x < visits.size()) { + LinkedHashMap visitDetails = new LinkedHashMap<>(); + + String[] generalExamination = {"general_condition", "pulse_rate", "respiratory_rate", "temperature", "systolic", "diastolic", "urine_protein", "urine_acetone", "fundal_height", "lie", "presentation", "contraction_frequency", "contraction_in_ten_minutes", "fetal_heart_rate", "level"}; + extractVisitDetails(visits, generalExamination, visitDetails, x, context); + + String[] vaginalExamination = {"vaginal_exam_date", "vaginal_exam_time", "cervix_state", "cervix_dilation", "presenting_part", "occiput_position", "mento_position", "sacro_position", "dorso_position", "moulding", "moulding_options", "station", "amniotic_fluid", "decision", "forecasted_svd_time"}; + extractVisitDetails(visits, vaginalExamination, visitDetails, x, context); + + String[] hivTest = {"hiv_test_conducted", "reason_for_no_hiv_test", "hiv_counselling_before_testing", "hiv_counselling_after_testing"}; + extractVisitDetails(visits, hivTest, visitDetails, x, context); + + String[] bloodGroupTest = {"blood_group", "rh_factor", "management_provided_for_rh", "reason_for_not_conducting_blood_group_test"}; + extractVisitDetails(visits, bloodGroupTest, visitDetails, x, context); + + String[] hbTest = {"hb_test_conducted", "reason_for_not_conducting_hb_test", "other_reason_hb_test_not_conducted", "hb_level", "management_provided_for_hb_level"}; + extractVisitDetails(visits, hbTest, visitDetails, x, context); + + String[] syphilisTest = {"syphilis", "management_provided_for_syphilis"}; + extractVisitDetails(visits, syphilisTest, visitDetails, x, context); + + String[] malariaTest = {"malaria", "management_provided_for_malaria", "reason_for_not_conducting_malaria_test", "other_reason_for_not_conducting_malaria_test"}; + extractVisitDetails(visits, malariaTest, visitDetails, x, context); + + + String[] uterotonic = {"uterotonic"}; + extractVisitDetails(visits, uterotonic, visitDetails, x, context); + + String[] placentaAndMembrane = {"method_used_to_remove_the_placenta", "placenta_and_membrane_expulsion", "type_of_incomplete_placenta", "placenta_removed_by_hand", "conducted_mva", "administered_antibiotics", "removal_date", "removal_duration", "estimated_blood_loss", "provided_blood_transfusion", "name_of_the_provider_who_removed_the_placenta"}; + extractVisitDetails(visits, placentaAndMembrane, visitDetails, x, context); + + String[] uterusMassage = {"uterus_massage_after_delivery", "reason_for_not_massaging_uterus_after_delivery"}; + extractVisitDetails(visits, uterusMassage, visitDetails, x, context); + + String[] eclampsiaManagement = {"has_signs_of_eclampsia", "administered_magnesium_sulphate", "reason_for_not_administering_magnesium_sulphate", "other_reason_for_for_not_administering_magnesium_sulphate"}; + extractVisitDetails(visits, eclampsiaManagement, visitDetails, x, context); + + String[] motherStatus = {"status", "cause_of_death", "time_of_death", "mode_of_delivery", "delivery_place", "designation_of_delivery_personnel", "name_of_delivery_person", "supervised_by_occupation", "name_of_supervising_person", "number_of_children_born", "delivery_date", "delivery_time"}; + extractVisitDetails(visits, motherStatus, visitDetails, x, context); + + String[] motherObservation = {"vagina_observation", "vaginal_bleeding_observation", "perineum_observation", "degree_of_perineum_tear", "perineum_repair_person_name", "perineum_repair_occupation", "cervix_observation", "systolic", "diastolic", "pulse_rate", "temperature", "uterus_contraction", "urination", "observation_date", "observation_time"}; + extractVisitDetails(visits, motherObservation, visitDetails, x, context); + + String[] maternalComplications = {"maternal_complications_before_delivery", "maternal_complications_before_delivery_other", "maternal_complications_during_and_after_delivery", "maternal_complications_during_and_after_delivery_other"}; + extractVisitDetails(visits, maternalComplications, visitDetails, x, context); + + String[] familyPlanning = {"family_planning_counselling_after_delivery", "family_planning_methods_selected", "other_family_planning_methods_selected"}; + extractVisitDetails(visits, familyPlanning, visitDetails, x, context); + + String[] immediateNewBornCare = {"newborn_status", "still_birth_choice", "child_delivery_date", "child_delivery_time", "sex"}; + extractVisitDetails(visits, immediateNewBornCare, visitDetails, x, context); + + String[] totalApgarScoreAt1Minutes = {"apgar_score_at_1_minute"}; + extractVisitDetails(visits, totalApgarScoreAt1Minutes, visitDetails, x, context); + + String[] immediateNewBornCareAgparScoreAt1Minute = {"apgar_activity_score_at_1_minute", "apgar_pulse_score_at_1_minute", "apgar_grimace_on_stimulation_score_at_1_minute", "apgar_appearance_score_at_1_minute", "apgar_respiration_score_at_1_minute", "apgar_score_at_1_minute"}; + extractVisitDetails(visits, immediateNewBornCareAgparScoreAt1Minute, visitDetails, x, context); + + String[] totalApgarScoreAt5Minutes = {"apgar_score_at_5_minutes"}; + extractVisitDetails(visits, totalApgarScoreAt5Minutes, visitDetails, x, context); + + String[] immediateNewBornCareAgparScoreAt5Minutes = {"apgar_score_activity_label_at_5_mins", "apgar_activity_score_at_5_minutes", "apgar_pulse_score_at_5_minutes", "apgar_grimace_on_stimulation_score_at_5_minutes", "apgar_appearance_score_at_5_minutes", "apgar_respiration_score_at_5_minutes", "apgar_score_at_5_minutes"}; + extractVisitDetails(visits, immediateNewBornCareAgparScoreAt5Minutes, visitDetails, x, context); + + + String[] newBornCare = {"resuscitation_question", "keep_warm", "cord_bleeding", "early_bf_1hr", "reason_for_not_breast_feeding_within_one_hour", "other_reason_for_not_breast_feeding_within_one_hour", "eye_care", "reason_for_not_giving_eye_care", "other_reason_for_not_giving_eye_care"}; + extractVisitDetails(visits, newBornCare, visitDetails, x, context); + + String[] immediateNewBornCareVaccinations = {"child_bcg_vaccination", "reason_for_not_providing_bcg_vacc", "other_reason_for_not_providing_bcg_vacc", "child_opv0_vaccination", "reason_for_not_providing_opv0_vacc", "other_reason_for_not_providing_opv0_vacc", "child_hepatitis_b_vaccination", "reason_for_not_providing_hepatitis_b_vacc", "other_reason_for_not_providing_hepatitis_b_injection", "child_vitamin_k_injection", "reason_for_not_providing_vitamin_k_injection", "other_reason_for_not_providing_vitamin_k_injection"}; + extractVisitDetails(visits, immediateNewBornCareVaccinations, visitDetails, x, context); + + String[] immediateNewBornCareHei = {"risk_category", "provided_azt_nvp_syrup", "provided_other_combinations", "specify_the_combinations", "number_of_azt_nvp_days_dispensed", "reason_for_not_providing_other_combination", "other_reason_for_not_providing_other_combination", "collect_dbs", "reason_not_collecting_dbs", "sample_collection_date", "dna_pcr_collection_time", "sample_id", "provided_nvp_syrup", "number_of_nvp_days_dispensed", "reason_for_not_providing_nvp_syrup", "other_reason_for_not_providing_nvp_syrup"}; + extractVisitDetails(visits, immediateNewBornCareHei, visitDetails, x, context); + + hf_visits.add(visitDetails); + + x++; + } + + updateLastVisitView(); + processVisit(hf_visits, context, visits); + } + } + + private void extractVisitDetails(List sourceVisits, String[] hf_params, LinkedHashMap visitDetailsMap, int iteration, Context context) { + // get the hf details + LinkedHashMap map = new LinkedHashMap<>(); + for (String param : hf_params) { + try { + List details = sourceVisits.get(iteration).getVisitDetails().get(param); + map.put(param, getTexts(context, details)); + } catch (Exception e) { + e.printStackTrace(); + } + + } + visitDetailsMap.putAll(map); + } + + + private void updateLastVisitView() { + linearLayoutLastVisit.setVisibility(View.GONE); + } + + + protected void processVisit(List> community_visits, Context context, List visits) { + if (community_visits != null && community_visits.size() > 0) { + linearLayoutHealthFacilityVisit.setVisibility(View.VISIBLE); + + int x = 0; + for (LinkedHashMap vals : community_visits) { + View view = inflater.inflate(R.layout.medical_history_visit, null); + TextView tvTitle = view.findViewById(R.id.title); + LinearLayout visitDetailsLayout = view.findViewById(R.id.visit_details_layout); + + tvTitle.setText(visits.get(x).getVisitType() + " " + visits.get(x).getDate()); + + + for (LinkedHashMap.Entry entry : vals.entrySet()) { + TextView visitDetailTv = new TextView(context); + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams + ((int) LinearLayout.LayoutParams.MATCH_PARENT, (int) LinearLayout.LayoutParams.WRAP_CONTENT); + + visitDetailTv.setLayoutParams(params); + float scale = context.getResources().getDisplayMetrics().density; + int dpAsPixels = (int) (10 * scale + 0.5f); + visitDetailTv.setPadding(dpAsPixels, 0, 0, 0); + visitDetailsLayout.addView(visitDetailTv); + + + try { + if (entry.getKey().equalsIgnoreCase("cervix_observation")) { + int resource = context.getResources().getIdentifier("ld_" + entry.getKey(), "string", context.getPackageName()); + evaluateView(context, vals, visitDetailTv, entry.getKey(), resource, "ld_cervix_observation_"); + } else if (entry.getKey().equalsIgnoreCase("vaginal_bleeding_observation")) { + int resource = context.getResources().getIdentifier("ld_" + entry.getKey(), "string", context.getPackageName()); + evaluateView(context, vals, visitDetailTv, entry.getKey(), resource, "ld_vaginal_bleeding_observation_"); + } else { + int resource = context.getResources().getIdentifier("ld_" + entry.getKey(), "string", context.getPackageName()); + evaluateView(context, vals, visitDetailTv, entry.getKey(), resource, ""); + } + } catch (Exception e) { + Timber.e(e); + } + } + linearLayoutHealthFacilityVisitDetails.addView(view, 0); + + x++; + } + } + } + + private void evaluateView(Context context, Map vals, TextView tv, String valueKey, int viewTitleStringResource, String valuePrefixInStringResources) { + if (StringUtils.isNotBlank(getMapValue(vals, valueKey))) { + SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(); + spannableStringBuilder.append(context.getString(viewTitleStringResource), boldSpan, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE).append("\n"); + + String stringValue = getMapValue(vals, valueKey); + String[] stringValueArray; + if (stringValue.contains(",")) { + stringValueArray = stringValue.split(","); + for (String value : stringValueArray) { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, value.trim()) + "\n", new BulletSpan(10), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + } + } else { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, stringValue)).append("\n"); + } + tv.setText(spannableStringBuilder); + } else { + tv.setVisibility(View.GONE); + } + } + + + private String getMapValue(Map map, String key) { + if (map.containsKey(key)) { + return map.get(key); + } + return ""; + } + + private String getStringResource(Context context, String prefix, String resourceName) { + int resourceId = context.getResources(). + getIdentifier(prefix + resourceName.trim(), "string", context.getPackageName()); + try { + return context.getString(resourceId); + } catch (Exception e) { + Timber.e(e); + if (resourceName.contains("_")) { + resourceName = resourceName.replace("_", " "); + resourceName = WordUtils.capitalize(resourceName); + } + return resourceName; + } + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LoginActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LoginActivity.java index d2e2e8183..d4fd52317 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LoginActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LoginActivity.java @@ -2,7 +2,11 @@ import android.content.Intent; import android.os.Bundle; +import android.widget.ImageView; +import androidx.core.content.ContextCompat; + +import org.smartregister.chw.hf.BuildConfig; import org.smartregister.chw.hf.R; import org.smartregister.chw.hf.presenter.LoginPresenter; import org.smartregister.family.util.Constants; @@ -18,6 +22,12 @@ public class LoginActivity extends BaseLoginActivity implements BaseLoginContrac @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + ImageView imageView = findViewById(R.id.login_logo); + if (BuildConfig.BUILD_FOR_BORESHA_AFYA_SOUTH) { + imageView.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_logo)); + } else { + imageView.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_logo_ba)); + } } @Override @@ -51,7 +61,12 @@ public void goToHome(boolean remote) { } private void getToFamilyList(boolean remote) { - Intent intent = new Intent(this, FamilyRegisterActivity.class); + Intent intent; + if (BuildConfig.BUILD_FOR_BORESHA_AFYA_SOUTH) + intent = new Intent(this, AllClientsRegisterActivity.class); + else + intent = new Intent(this, FamilyRegisterActivity.class); + intent.putExtra(Constants.INTENT_KEY.IS_REMOTE_LOGIN, remote); startActivity(intent); } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LtfuSummaryActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LtfuSummaryActivity.java new file mode 100644 index 000000000..8908d8906 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LtfuSummaryActivity.java @@ -0,0 +1,101 @@ +package org.smartregister.chw.hf.activity; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; + +import com.whiteelephant.monthpicker.MonthPickerDialog; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.ReportUtils; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; + +import timber.log.Timber; + +public class LtfuSummaryActivity extends PncReportsActivity { + + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.pnc_monthly_report) { + LtfuSummaryViewActivity.startMe(this, Constants.ReportConstants.ReportPaths.LTFU_REPORT_PATH, reportPeriod); + } + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == R.id.action_select_month) { + showMonthPicker(this, menu); + return true; + } + return super.onOptionsItemSelected(item); + } + + @Override + public void setUpToolbar() { + super.setUpToolbar(); + TextView title = findViewById(R.id.toolbar_title); + title.setText(R.string.community_ltfu_summary); + + Toolbar toolbar = findViewById(org.smartregister.chw.core.R.id.back_to_nav_toolbar); + setSupportActionBar(toolbar); + + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + final Drawable upArrow = getResources().getDrawable(org.smartregister.chw.core.R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setElevation(0); + } + toolbar.setNavigationOnClickListener(v -> finish()); + appBarLayout = findViewById(org.smartregister.chw.core.R.id.app_bar); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + appBarLayout.setOutlineProvider(null); + } + } + + private void showMonthPicker(Context context, Menu menu) { + //shows the month picker and returns selected period and updated the menu + MonthPickerDialog.Builder builder = new MonthPickerDialog.Builder(context, (selectedMonth, selectedYear) -> { + int month = selectedMonth + 1; + String monthString = String.valueOf(month); + if (month < 10) { + monthString = "0" + monthString; + } + String yearString = String.valueOf(selectedYear); + reportPeriod = monthString + "-" + yearString; + menu.findItem(R.id.action_select_month).setTitle(ReportUtils.displayMonthAndYear(selectedMonth, selectedYear)); + + }, Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH)); + try { + Date reportDate = new SimpleDateFormat("MM-yyyy", Locale.getDefault()).parse(reportPeriod); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(reportDate); + builder.setActivatedMonth(calendar.get(Calendar.MONTH)); + builder.setMinYear(2021); + builder.setActivatedYear(calendar.get(Calendar.YEAR)); + builder.setMaxYear(Calendar.getInstance().get(Calendar.YEAR)); + builder.setMinMonth(Calendar.JANUARY); + builder.setMaxMonth(Calendar.DECEMBER); + builder.setTitle(getString(R.string.select_reporting_month_anc)); + builder.build().show(); + } catch (ParseException e) { + Timber.e(e); + } + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LtfuSummaryViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LtfuSummaryViewActivity.java new file mode 100644 index 000000000..212e5651f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/LtfuSummaryViewActivity.java @@ -0,0 +1,18 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; + +public class LtfuSummaryViewActivity extends HfReportsViewActivity { + public static void startMe(Activity activity, String reportPath, String reportDate) { + Intent intent = new Intent(activity, LtfuSummaryViewActivity.class); + intent.putExtra(ARG_REPORT_PATH, reportPath); + intent.putExtra(ARG_REPORT_DATE, reportDate); + intent.putExtra(ARG_REPORT_TITLE, R.string.community_ltfu_summary); + intent.putExtra(ARG_REPORT_TYPE, Constants.ReportConstants.ReportTypes.LTFU_SUMMARY); + activity.startActivity(intent); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MalariaFollowUpVisitActivityHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MalariaFollowUpVisitActivityHelper.java index e98b83c45..416a2221d 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MalariaFollowUpVisitActivityHelper.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MalariaFollowUpVisitActivityHelper.java @@ -1,10 +1,10 @@ package org.smartregister.chw.hf.activity; +import static org.smartregister.chw.core.utils.CoreConstants.JSON_FORM.getMalariaFollowUpHfForm; + import android.app.Activity; import android.content.Intent; -import static org.smartregister.chw.core.utils.CoreConstants.JSON_FORM.getMalariaFollowUpHfForm; - public class MalariaFollowUpVisitActivityHelper { public static void startMalariaFollowUpActivity(Activity activity, String baseEntityID) { diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MalariaProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MalariaProfileActivity.java index fe01a74f0..46198f359 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MalariaProfileActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MalariaProfileActivity.java @@ -1,5 +1,8 @@ package org.smartregister.chw.hf.activity; +import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; +import static org.smartregister.chw.malaria.util.Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID; + import android.app.Activity; import android.content.Intent; import android.os.Bundle; @@ -29,9 +32,6 @@ import timber.log.Timber; -import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; -import static org.smartregister.chw.malaria.util.Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID; - public class MalariaProfileActivity extends CoreMalariaProfileActivity implements MalariaProfileContract.InteractorCallback { private static String baseEntityId; diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MalariaRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MalariaRegisterActivity.java index 3c7c00d11..9ba8f6e9f 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MalariaRegisterActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MalariaRegisterActivity.java @@ -1,5 +1,7 @@ package org.smartregister.chw.hf.activity; +import static org.smartregister.chw.core.utils.CoreConstants.JSON_FORM.getMalariaConfirmation; + import android.app.Activity; import android.content.Intent; @@ -8,8 +10,6 @@ import org.smartregister.helper.BottomNavigationHelper; import org.smartregister.view.fragment.BaseRegisterFragment; -import static org.smartregister.chw.core.utils.CoreConstants.JSON_FORM.getMalariaConfirmation; - public class MalariaRegisterActivity extends CoreMalariaRegisterActivity { public static void startMalariaRegistrationActivity(Activity activity, String baseEntityID) { diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MotherChampionReportsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MotherChampionReportsActivity.java new file mode 100644 index 000000000..a2ab44ff8 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MotherChampionReportsActivity.java @@ -0,0 +1,26 @@ +package org.smartregister.chw.hf.activity; + +import android.view.View; +import android.widget.TextView; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; + +public class MotherChampionReportsActivity extends PncReportsActivity { + + + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.pnc_monthly_report) { + MotherChampionReportsViewActivity.startMe(this, Constants.ReportConstants.ReportPaths.MOTHER_CHAMPION_REPORT_PATH, reportPeriod); + } + } + + @Override + public void setUpToolbar() { + super.setUpToolbar(); + TextView title = findViewById(R.id.toolbar_title); + title.setText(R.string.mother_champion_reports); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MotherChampionReportsViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MotherChampionReportsViewActivity.java new file mode 100644 index 000000000..bf9950c3e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/MotherChampionReportsViewActivity.java @@ -0,0 +1,18 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; + +public class MotherChampionReportsViewActivity extends HfReportsViewActivity{ + public static void startMe(Activity activity, String reportPath, String reportDate) { + Intent intent = new Intent(activity, MotherChampionReportsViewActivity.class); + intent.putExtra(ARG_REPORT_PATH, reportPath); + intent.putExtra(ARG_REPORT_DATE, reportDate); + intent.putExtra(ARG_REPORT_TITLE, R.string.mother_champion_reports); + intent.putExtra(ARG_REPORT_TYPE, Constants.ReportConstants.ReportTypes.MOTHER_CHAMPION_REPORT); + activity.startActivity(intent); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/OrderDetailsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/OrderDetailsActivity.java new file mode 100644 index 000000000..f82b17c9d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/OrderDetailsActivity.java @@ -0,0 +1,24 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.json.JSONObject; +import org.smartregister.chw.cdp.activity.BaseOrderDetailsActivity; +import org.smartregister.chw.cdp.util.Constants; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.family.util.JsonFormUtils; + +public class OrderDetailsActivity extends BaseOrderDetailsActivity { + public static void startMe(Activity activity, CommonPersonObjectClient pc) { + Intent intent = new Intent(activity, OrderDetailsActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.CLIENT, pc); + activity.startActivity(intent); + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + startActivityForResult(FormUtils.getStartFormActivity(jsonForm, null, this), JsonFormUtils.REQUEST_CODE_GET_JSON); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/OrderRequestDetailsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/OrderRequestDetailsActivity.java new file mode 100644 index 000000000..63fe3d3b2 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/OrderRequestDetailsActivity.java @@ -0,0 +1,39 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; +import android.view.View; + +import org.json.JSONObject; +import org.smartregister.chw.cdp.activity.BaseOrderDetailsActivity; +import org.smartregister.chw.cdp.dao.CdpStockingDao; +import org.smartregister.chw.cdp.util.Constants; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.family.util.JsonFormUtils; + +public class OrderRequestDetailsActivity extends BaseOrderDetailsActivity { + public static void startMe(Activity activity, CommonPersonObjectClient pc) { + Intent intent = new Intent(activity, OrderRequestDetailsActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.CLIENT, pc); + activity.startActivity(intent); + } + + @Override + protected void setupViews() { + super.setupViews(); + String providerId = org.smartregister.Context.getInstance().allSharedPreferences().fetchRegisteredANM(); + String userLocationId = org.smartregister.Context.getInstance().allSharedPreferences().fetchUserLocalityId(providerId); + + if ((CdpStockingDao.getCurrentMaleCondomCount(userLocationId) + CdpStockingDao.getCurrentFemaleCondomCount(userLocationId)) > 0) { + stockDistributionBtn.setVisibility(View.VISIBLE); + } + if (client != null && presenter != null) + presenter.refreshViewPageBottom(client); + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + startActivityForResult(FormUtils.getStartFormActivity(jsonForm, null, this), JsonFormUtils.REQUEST_CODE_GET_JSON); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PartnerRegistrationActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PartnerRegistrationActivity.java new file mode 100644 index 000000000..9e9e4a200 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PartnerRegistrationActivity.java @@ -0,0 +1,365 @@ +package org.smartregister.chw.hf.activity; + +import static com.vijay.jsonwizard.utils.FormUtils.fields; +import static com.vijay.jsonwizard.utils.FormUtils.getFieldJSONObject; +import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; +import static org.smartregister.chw.hf.utils.Constants.Events.PARTNER_REGISTRATION_EVENT; +import static org.smartregister.chw.hf.utils.Constants.PartnerRegistrationConstants.EXISTING_PARTNER_REQUEST_CODE; +import static org.smartregister.chw.hf.utils.Constants.PartnerRegistrationConstants.INTENT_BASE_ENTITY_ID; +import static org.smartregister.chw.hf.utils.Constants.PartnerRegistrationConstants.NEW_PARTNER_REQUEST_CODE; +import static org.smartregister.chw.hf.utils.Constants.PartnerRegistrationConstants.PARTNER_BASE_ENTITY_ID; +import static org.smartregister.chw.hf.utils.JsonFormUtils.METADATA; +import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; +import static org.smartregister.chw.pmtct.util.NCUtils.getClientProcessorForJava; +import static org.smartregister.chw.pmtct.util.NCUtils.getSyncHelper; +import static org.smartregister.family.util.JsonFormUtils.STEP2; +import static org.smartregister.util.JsonFormUtils.ENCOUNTER_LOCATION; +import static org.smartregister.util.JsonFormUtils.STEP1; +import static org.smartregister.util.Utils.getAllSharedPreferences; + +import android.app.Activity; +import android.content.Intent; +import android.view.View; +import android.widget.ImageView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.constraintlayout.widget.ConstraintLayout; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; +import com.vijay.jsonwizard.utils.FormUtils; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.BuildConfig; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.AllClientsUtils; +import org.smartregister.clientandeventmodel.Client; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.clientandeventmodel.Obs; +import org.smartregister.dao.LocationsDao; +import org.smartregister.domain.UniqueId; +import org.smartregister.family.util.Constants; +import org.smartregister.family.util.Utils; +import org.smartregister.opd.OpdLibrary; +import org.smartregister.opd.pojo.OpdEventClient; +import org.smartregister.opd.pojo.RegisterParams; +import org.smartregister.opd.utils.OpdConstants; +import org.smartregister.opd.utils.OpdJsonFormUtils; +import org.smartregister.opd.utils.OpdUtils; +import org.smartregister.repository.AllSharedPreferences; +import org.smartregister.repository.EventClientRepository; +import org.smartregister.repository.UniqueIdRepository; +import org.smartregister.util.JsonFormUtils; +import org.smartregister.view.activity.SecuredActivity; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.List; + +import timber.log.Timber; + +public class PartnerRegistrationActivity extends SecuredActivity implements View.OnClickListener { + + private String clientBaseEntityId; + + + @Override + protected void onCreation() { + setContentView(R.layout.activity_partner_registration); + this.clientBaseEntityId = getIntent().getStringExtra(INTENT_BASE_ENTITY_ID); + setupView(); + } + + + @Override + protected void onResumption() { + //overridden + } + + public void setupView() { + ImageView closeImageView = findViewById(R.id.close); + ConstraintLayout newClientRegistrationView = findViewById(R.id.new_client_registration); + ConstraintLayout existingClientRegistrationView = findViewById(R.id.existing_client_registration); + + newClientRegistrationView.setOnClickListener(this); + existingClientRegistrationView.setOnClickListener(this); + closeImageView.setOnClickListener(this); + } + + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.close) { + finish(); + } else if (id == R.id.new_client_registration) { + startPartnerRegistration(); + } else if (id == R.id.existing_client_registration) { + searchForPartner(); + } + } + + public UniqueIdRepository getUniqueIdRepository() { + return OpdLibrary.getInstance().getUniqueIdRepository(); + } + + private void startPartnerRegistration() { + + UniqueId uniqueId = getUniqueIdRepository().getNextUniqueId(); + final String entityId = uniqueId != null ? uniqueId.getOpenmrsId() : ""; + if (StringUtils.isBlank(entityId)) { + Toast.makeText(this, R.string.no_unique_id, Toast.LENGTH_SHORT).show(); + } else { + JSONObject jsonObject = getFormAsJson(org.smartregister.chw.hf.utils.Constants.JsonForm.getPartnerRegistrationForm(), entityId, null); + startFormActivity(jsonObject); + } + } + + public JSONObject getFormAsJson(String formName, String entityId, String currentLocationId) { + try { + JSONObject form; + + form = (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, formName); + + + if (form == null) { + return null; + } + JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(form, STEP1, SYNC_LOCATION_ID); + CoreJsonFormUtils.addLocationsToDropdownField(LocationsDao.getLocationsByTags( + Collections.singleton(SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS)), syncLocationField); + form.getJSONObject(METADATA).put(ENCOUNTER_LOCATION, currentLocationId); + + String newEntityId = entityId; + if (StringUtils.isNotBlank(entityId)) { + newEntityId = entityId.replace("-", ""); + } + + JSONObject stepOneUniqueId = getFieldJSONObject(fields(form, STEP1), Constants.JSON_FORM_KEY.UNIQUE_ID); + + if (stepOneUniqueId != null) { + stepOneUniqueId.remove(org.smartregister.family.util.JsonFormUtils.VALUE); + stepOneUniqueId.put(org.smartregister.family.util.JsonFormUtils.VALUE, newEntityId + "_Family"); + } + + JSONObject stepTwoUniqueId = getFieldJSONObject(fields(form, STEP2), Constants.JSON_FORM_KEY.UNIQUE_ID); + if (stepTwoUniqueId != null) { + stepTwoUniqueId.remove(org.smartregister.family.util.JsonFormUtils.VALUE); + stepTwoUniqueId.put(org.smartregister.family.util.JsonFormUtils.VALUE, newEntityId); + } + + org.smartregister.family.util.JsonFormUtils.addLocHierarchyQuestions(form); + return form; + + } catch (Exception e) { + Timber.e(e, "Error loading All Client registration form"); + } + return null; + } + + public void startFormActivity(JSONObject jsonObject) { + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(OpdConstants.JSON_FORM_EXTRA.JSON, jsonObject.toString()); + + Form form = new Form(); + form.setName(getString(org.smartregister.chw.core.R.string.client_registration)); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setNavigationBackground(org.smartregister.chw.core.R.color.family_navigation); + form.setHomeAsUpIndicator(org.smartregister.chw.core.R.mipmap.ic_cross_white); + form.setPreviousLabel(getResources().getString(org.smartregister.chw.core.R.string.back)); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + + startActivityForResult(intent, NEW_PARTNER_REQUEST_CODE); + } + + private void searchForPartner() { + startActivityForResult(new Intent(this, AllMaleClientsActivity.class), EXISTING_PARTNER_REQUEST_CODE); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == EXISTING_PARTNER_REQUEST_CODE && resultCode == Activity.RESULT_OK) { + String partner_id = data.getStringExtra(INTENT_BASE_ENTITY_ID); + savePartnerDetails(partner_id, clientBaseEntityId); + finish(); + + } + if (requestCode == NEW_PARTNER_REQUEST_CODE && resultCode == Activity.RESULT_OK) { + String jsonString = data.getStringExtra(OpdConstants.JSON_FORM_EXTRA.JSON); + Timber.d("JSONResult : %s", jsonString); + + JSONObject form; + try { + form = new JSONObject(jsonString); + + String encounterType; + encounterType = form.getString(OpdJsonFormUtils.ENCOUNTER_TYPE); + if (encounterType.equals(CoreConstants.EventType.FAMILY_REGISTRATION)) { + RegisterParams registerParam = new RegisterParams(); + registerParam.setEditMode(false); + registerParam.setFormTag(OpdJsonFormUtils.formTag(OpdUtils.context().allSharedPreferences())); + saveForm(jsonString, registerParam); + finish(); + + } + } catch (JSONException e) { + Timber.e(e); + } + + } + + } + + private void saveForm(String jsonString, RegisterParams registerParam) { + try { + List opdEventClientList = processRegistration(jsonString); + if (opdEventClientList == null || opdEventClientList.isEmpty()) { + return; + } + saveRegistration(opdEventClientList, jsonString, registerParam); + } catch (Exception e) { + Timber.e(e); + } + } + + public List processRegistration(String jsonString) { + + List opdEventClients = AllClientsUtils.getOpdEventClients(jsonString); + try { + JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), STEP1, SYNC_LOCATION_ID); + for (OpdEventClient opdEventClient : opdEventClients) { + opdEventClient.getEvent().setLocationId(CoreJsonFormUtils.getSyncLocationUUIDFromDropdown(syncLocationField)); + } + } catch (JSONException e) { + Timber.e(e, "Error retrieving Sync location Field"); + } + return opdEventClients; + } + + public void saveRegistration(@NonNull List allClientEventList, @NonNull String jsonString, + @NonNull RegisterParams params) { + try { + List currentFormSubmissionIds = new ArrayList<>(); + + for (int i = 0; i < allClientEventList.size(); i++) { + try { + + OpdEventClient allClientEvent = allClientEventList.get(i); + Client baseClient = allClientEvent.getClient(); + Event baseEvent = allClientEvent.getEvent(); + addClient(params, baseClient); + addEvent(params, currentFormSubmissionIds, baseEvent); + updateOpenSRPId(jsonString, params, baseClient); + addImageLocation(jsonString, baseClient, baseEvent); + if (baseEvent.getEventType().equalsIgnoreCase("Family Member Registration")) { + savePartnerDetails(baseEvent.getBaseEntityId(), clientBaseEntityId); + } + } catch (Exception e) { + Timber.e(e, "ChwAllClientRegisterInteractor --> saveRegistration"); + } + } + + long lastSyncTimeStamp = getAllSharedPreferences().fetchLastUpdatedAtDate(0); + Date lastSyncDate = new Date(lastSyncTimeStamp); + getClientProcessorForJava().processClient(getSyncHelper().getEvents(currentFormSubmissionIds)); + getAllSharedPreferences().saveLastUpdatedAtDate(lastSyncDate.getTime()); + } catch (Exception e) { + Timber.e(e, "OpdRegisterInteractor --> saveRegistration"); + } + } + + private void addClient(@NonNull RegisterParams params, Client baseClient) throws JSONException { + JSONObject clientJson = new JSONObject(OpdJsonFormUtils.gson.toJson(baseClient)); + if (params.isEditMode()) { + try { + org.smartregister.family.util.JsonFormUtils.mergeAndSaveClient(getSyncHelper(), baseClient); + } catch (Exception e) { + Timber.e(e, "ChwAllClientRegisterInteractor --> mergeAndSaveClient"); + } + } else { + getSyncHelper().addClient(baseClient.getBaseEntityId(), clientJson); + } + } + + private void addImageLocation(String jsonString, Client baseClient, Event baseEvent) { + if (baseClient != null || baseEvent != null) { + String imageLocation = OpdJsonFormUtils.getFieldValue(jsonString, Constants.KEY.PHOTO); + if (StringUtils.isNotBlank(imageLocation)) { + org.smartregister.family.util.JsonFormUtils.saveImage(baseEvent.getProviderId(), baseClient.getBaseEntityId(), imageLocation); + } + } + } + + private void updateOpenSRPId(String jsonString, RegisterParams params, Client baseClient) { + if (params.isEditMode()) { + // UnAssign current OpenSRP ID + if (baseClient != null) { + String newOpenSrpId = baseClient.getIdentifier(Utils.metadata().uniqueIdentifierKey).replace("-", ""); + String currentOpenSrpId = org.smartregister.family.util.JsonFormUtils.getString(jsonString, org.smartregister.family.util.JsonFormUtils.CURRENT_OPENSRP_ID).replace("-", ""); + if (!newOpenSrpId.equals(currentOpenSrpId)) { + //OpenSRP ID was changed + getUniqueIdRepository().open(currentOpenSrpId); + } + } + + } else { + if (baseClient != null) { + String openSrpId = baseClient.getIdentifier(Utils.metadata().uniqueIdentifierKey); + if (StringUtils.isNotBlank(openSrpId) && !openSrpId.contains(Constants.IDENTIFIER.FAMILY_SUFFIX)) { + //Mark OpenSRP ID as used + getUniqueIdRepository().close(openSrpId); + } + } + } + } + + private void addEvent(RegisterParams params, List currentFormSubmissionIds, Event baseEvent) throws JSONException { + if (baseEvent != null) { + JSONObject eventJson = new JSONObject(OpdJsonFormUtils.gson.toJson(baseEvent)); + getSyncHelper().addEvent(baseEvent.getBaseEntityId(), eventJson, params.getStatus()); + currentFormSubmissionIds.add(eventJson.getString(EventClientRepository.event_column.formSubmissionId.toString())); + } + } + + protected void savePartnerDetails(String partnerBaseEntityId, String clientBaseEntityId) { + AllSharedPreferences sharedPreferences = getAllSharedPreferences(); + Event baseEvent = (Event) new Event() + .withBaseEntityId(clientBaseEntityId) + .withEventDate(new Date()) + .withEventType(PARTNER_REGISTRATION_EVENT) + .withFormSubmissionId(JsonFormUtils.generateRandomUUIDString()) + .withEntityType(CoreConstants.TABLE_NAME.ANC_MEMBER) + .withProviderId(sharedPreferences.fetchRegisteredANM()) + .withLocationId(sharedPreferences.fetchDefaultLocalityId(sharedPreferences.fetchRegisteredANM())) + .withTeamId(sharedPreferences.fetchDefaultTeamId(sharedPreferences.fetchRegisteredANM())) + .withTeam(sharedPreferences.fetchDefaultTeam(sharedPreferences.fetchRegisteredANM())) + .withClientDatabaseVersion(BuildConfig.DATABASE_VERSION) + .withClientApplicationVersion(BuildConfig.VERSION_CODE) + .withDateCreated(new Date()); + + baseEvent.addObs( + (new Obs()) + .withFormSubmissionField(PARTNER_BASE_ENTITY_ID) + .withValue(partnerBaseEntityId) + .withFieldCode(PARTNER_BASE_ENTITY_ID) + .withFieldType("formsubmissionField") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + // tag docs + org.smartregister.chw.hf.utils.JsonFormUtils.tagSyncMetadata(Utils.context().allSharedPreferences(), baseEvent); + try { + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(baseEvent))); + } catch (Exception e) { + e.printStackTrace(); + } + + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctEacFirstVisitActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctEacFirstVisitActivity.java new file mode 100644 index 000000000..8091cd3e4 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctEacFirstVisitActivity.java @@ -0,0 +1,30 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.EacFirstVisitInteractor; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.presenter.BasePmtctHomeVisitPresenter; +import org.smartregister.chw.pmtct.util.Constants; + +import java.text.MessageFormat; + + +public class PmtctEacFirstVisitActivity extends PmtctFollowupVisitActivity{ + public static void startEacActivity(Activity activity, String baseEntityID,Boolean isEditMode) { + Intent intent = new Intent(activity, PmtctEacFirstVisitActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID,baseEntityID ); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.EDIT_MODE, isEditMode); + activity.startActivity(intent); + } + @Override + protected void registerPresenter() { + presenter = new BasePmtctHomeVisitPresenter(memberObject,this,new EacFirstVisitInteractor()); + } + @Override + public void redrawHeader(MemberObject memberObject) { + tvTitle.setText(MessageFormat.format("{0}, {1} \u00B7 {2}", memberObject.getFullName(), memberObject.getAge(), getString(R.string.record_eac_first_visit))); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctEacSecondVisitActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctEacSecondVisitActivity.java new file mode 100644 index 000000000..1498dcc4f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctEacSecondVisitActivity.java @@ -0,0 +1,29 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.EacSecondVisitInteractor; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.presenter.BasePmtctHomeVisitPresenter; +import org.smartregister.chw.pmtct.util.Constants; + +import java.text.MessageFormat; + +public class PmtctEacSecondVisitActivity extends PmtctEacFirstVisitActivity{ + public static void startSecondEacActivity(Activity activity, String baseEntityID, Boolean isEditMode) { + Intent intent = new Intent(activity, PmtctEacSecondVisitActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID,baseEntityID ); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.EDIT_MODE, isEditMode); + activity.startActivity(intent); + } + @Override + protected void registerPresenter() { + presenter = new BasePmtctHomeVisitPresenter(memberObject,this,new EacSecondVisitInteractor()); + } + @Override + public void redrawHeader(MemberObject memberObject) { + tvTitle.setText(MessageFormat.format("{0}, {1} \u00B7 {2}", memberObject.getFullName(), memberObject.getAge(), getString(R.string.record_eac_second_visit))); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctFollowupVisitActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctFollowupVisitActivity.java new file mode 100644 index 000000000..3c949c969 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctFollowupVisitActivity.java @@ -0,0 +1,113 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.json.JSONObject; +import org.smartregister.chw.core.task.RunnableTask; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.PmtctFollowupVisitInteractor; +import org.smartregister.chw.hf.schedulers.HfScheduleTaskExecutor; +import org.smartregister.chw.pmtct.activity.BasePmtctHomeVisitActivity; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; +import org.smartregister.chw.pmtct.presenter.BasePmtctHomeVisitPresenter; +import org.smartregister.chw.pmtct.util.Constants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.util.LangUtils; + +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import timber.log.Timber; + +public class PmtctFollowupVisitActivity extends BasePmtctHomeVisitActivity { + public static void startPmtctFollowUpActivity(Activity activity, String baseEntityID, Boolean editMode) { + Intent intent = new Intent(activity, PmtctFollowupVisitActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.EDIT_MODE, editMode); + activity.startActivity(intent); + } + + @Override + protected void registerPresenter() { + presenter = new BasePmtctHomeVisitPresenter(memberObject, this, new PmtctFollowupVisitInteractor()); + } + + @Override + public void submittedAndClose() { + Runnable runnable = () -> HfScheduleTaskExecutor.getInstance().execute(memberObject.getBaseEntityId(), Constants.EVENT_TYPE.PMTCT_FOLLOWUP, new Date()); + Utils.startAsyncTask(new RunnableTask(runnable), null); + super.submittedAndClose(); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(false); + + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + intent.putExtra(org.smartregister.family.util.Constants.WizardFormActivity.EnableOnCloseDialog, false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + protected void attachBaseContext(Context base) { + // get language from prefs + String lang = LangUtils.getLanguage(base.getApplicationContext()); + super.attachBaseContext(LangUtils.setAppLocale(base, lang)); + } + + @Override + public void onDestroy() { + try { + super.onDestroy(); + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + public void initializeActions(LinkedHashMap map) { + actionList.clear(); + + ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap<>(map); + + //Necessary evil to rearrange the actions according to a specific arrangement + if (map.containsKey(getString(R.string.pmtct_followup_status_title))) { + BasePmtctHomeVisitAction followupStatusVisitAction = map.get(getString(R.string.pmtct_followup_status_title)); + actionList.put(getString(R.string.pmtct_followup_status_title), followupStatusVisitAction); + } + //====================End of Necessary evil ==================================== + + for (Map.Entry entry : concurrentHashMap.entrySet()) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + actionList.putIfAbsent(entry.getKey(), entry.getValue()); + } else { + actionList.put(entry.getKey(), entry.getValue()); + } + } + + if (mAdapter != null) { + mAdapter.notifyDataSetChanged(); + } + displayProgressBar(false); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctMedicalHistoryActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctMedicalHistoryActivity.java new file mode 100644 index 000000000..88dcff706 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctMedicalHistoryActivity.java @@ -0,0 +1,59 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; +import android.view.View; +import android.widget.ProgressBar; +import android.widget.TextView; + +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.presenter.BaseAncMedicalHistoryPresenter; +import org.smartregister.chw.core.activity.CoreAncMedicalHistoryActivity; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.PmtctMedicalHistoryInteractor; +import org.smartregister.chw.pmtct.domain.MemberObject; + +import java.util.List; + +public class PmtctMedicalHistoryActivity extends CoreAncMedicalHistoryActivity { + private static MemberObject pmtctMemberObject; + private final Flavor flavor = new PmtctMedicalHistoryActivityFlv(); + private ProgressBar progressBar; + + public static void startMe(Activity activity, MemberObject memberObject) { + Intent intent = new Intent(activity, PmtctMedicalHistoryActivity.class); + pmtctMemberObject = memberObject; + activity.startActivity(intent); + } + + @Override + public void initializePresenter() { + presenter = new BaseAncMedicalHistoryPresenter(new PmtctMedicalHistoryInteractor(), this, pmtctMemberObject.getBaseEntityId()); + } + + @Override + public void setUpView() { + linearLayout = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.linearLayoutMedicalHistory); + progressBar = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.progressBarMedicalHistory); + + TextView tvTitle = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.tvTitle); + tvTitle.setText(getString(org.smartregister.chw.opensrp_chw_anc.R.string.back_to, pmtctMemberObject.getFullName())); + } + + @Override + public View renderView(List visits) { + super.renderView(visits); + View view = flavor.bindViews(this); + displayLoadingState(true); + flavor.processViewData(visits, this); + displayLoadingState(false); + TextView pmtctVisitTitle = view.findViewById(org.smartregister.chw.core.R.id.customFontTextViewHealthFacilityVisitTitle); + pmtctVisitTitle.setText(R.string.pmtct_visit); + return view; + } + + @Override + public void displayLoadingState(boolean state) { + progressBar.setVisibility(state ? View.VISIBLE : View.GONE); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctMedicalHistoryActivityFlv.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctMedicalHistoryActivityFlv.java new file mode 100644 index 000000000..9f5c34b25 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctMedicalHistoryActivityFlv.java @@ -0,0 +1,276 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.style.BulletSpan; +import android.text.style.StyleSpan; +import android.view.View; +import android.widget.TextView; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.Days; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.core.activity.DefaultAncMedicalHistoryActivityFlv; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.pmtct.util.Constants; + +import java.text.MessageFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import timber.log.Timber; + +public class PmtctMedicalHistoryActivityFlv extends DefaultAncMedicalHistoryActivityFlv { + private final StyleSpan boldSpan = new StyleSpan(android.graphics.Typeface.BOLD); + + @Override + protected void processAncCard(String has_card, Context context) { + // super.processAncCard(has_card, context); + linearLayoutAncCard.setVisibility(View.GONE); + } + + @Override + protected void processHealthFacilityVisit(List> hf_visits, Context context) { + //super.processHealthFacilityVisit(hf_visits, context); + } + + @Override + public void processViewData(List visits, Context context) { + + if (visits.size() > 0) { + int days = 0; + List> hf_visits = new ArrayList<>(); + + int x = 0; + while (x < visits.size()) { + + // the first object in this list is the days difference + if (x == 0) { + days = Days.daysBetween(new DateTime(visits.get(visits.size() - 1).getDate()), new DateTime()).getDays(); + } + + + String[] visitParams = { + "followup_visit_date", + "followup_status", + "counselling_topics_provided", + "clinical_staging_disease", + "stage_1_symptoms", + "stage_2_symptoms", + "stage_3_symptoms", + "stage_4_symptoms", + "tb_registration_number", + "tb_symptoms_screening", + "investigate_for_tb", + "reason_for_not_conducting_tb_test", + "other_reason_for_not_conducting_tb_test", + "has_been_provided_with_tpt_before", + "completed_tpt", + "pmtct_is_client_provided_with_tpt", + "pmtct_reason_for_not_providing_tpt", + "number_of_tpt_days_dispensed", + "prescribed_regimes", + "arv_line", + "first_line", + "second_line", + "third_line", + "reason_for_not_prescribing_arv", + "other_reason_for_not_prescribing_arv", + "other_reason_for_not_conducting_tb_test", + "next_facility_visit_date" + }; + extractVisitDetails(visits, visitParams, hf_visits, x, context); + + x++; + } + + processLastVisit(days, context); + processVisit(hf_visits, visits, context); + } + } + + private void extractVisitDetails(List sourceVisits, String[] hf_params, List> hf_visits, int iteration, Context context) { + // get the hf details + Map map = new HashMap<>(); + for (String param : hf_params) { + try { + List details = sourceVisits.get(iteration).getVisitDetails().get(param); + map.put(param, getTexts(context, details)); + } catch (Exception e) { + e.printStackTrace(); + } + + } + hf_visits.add(map); + } + + + private void processLastVisit(int days, Context context) { + linearLayoutLastVisit.setVisibility(View.VISIBLE); + if (days < 1) { + customFontTextViewLastVisit.setText(org.smartregister.chw.core.R.string.less_than_twenty_four); + } else { + customFontTextViewLastVisit.setText(StringUtils.capitalize(MessageFormat.format(context.getString(org.smartregister.chw.core.R.string.days_ago), String.valueOf(days)))); + } + } + + + protected void processVisit(List> hf_visits, List visits, Context context) { + if (hf_visits != null && hf_visits.size() > 0) { + linearLayoutHealthFacilityVisit.setVisibility(View.VISIBLE); + + int x = 0; + for (Map vals : hf_visits) { + View view = inflater.inflate(R.layout.medical_history_pmtct_visit, null); + TextView tvTitle = view.findViewById(R.id.title); + TextView tvFollowupStatus = view.findViewById(R.id.followup_status); + TextView tvCounsellingTopicsProvided = view.findViewById(R.id.counselling_topics_provided); + TextView tvClinicalStagingDisease = view.findViewById(R.id.clinical_staging_disease); + TextView tvSymptoms = view.findViewById(R.id.symptoms); + TextView tvTbRegistrationNumber = view.findViewById(R.id.tb_registration_number); + TextView tvTbSymptomsScreening = view.findViewById(R.id.tb_symptoms_screening); + TextView tvInvestigateForTb = view.findViewById(R.id.investigate_for_tb); + TextView tvReasonForNotConductingTbTest = view.findViewById(R.id.reason_for_not_conducting_tb_test); + TextView tvOtherReasonForNotConductingTbTest = view.findViewById(R.id.other_reason_for_not_conducting_tb_test); + TextView tvHasBeenProvidedWithTptBefore = view.findViewById(R.id.has_been_provided_with_tpt_before); + TextView tvCompletedTpt = view.findViewById(R.id.completed_tpt); + TextView tvIsClientProvidedWithTpt = view.findViewById(R.id.is_client_provided_with_tpt); + TextView tvReasonForNotProvidingTpt = view.findViewById(R.id.reason_for_not_providing_tpt); + TextView tvNumberOfTptDaysDispensed = view.findViewById(R.id.number_of_tpt_days_dispensed); + TextView tvPrescribedRegimes = view.findViewById(R.id.prescribed_regimes); + TextView tvArvLine = view.findViewById(R.id.arv_line); + TextView tvArvPrescription = view.findViewById(R.id.arv_prescription); + TextView tvReasonsForNotPrescribingArv = view.findViewById(R.id.reason_for_not_prescribing_arv); + TextView tvOtherReasonForNotPrescribingArv = view.findViewById(R.id.other_reason_for_not_prescribing_arv); + TextView tvNumberOfArvRegimesDaysDispensed = view.findViewById(R.id.number_of_arv_regimes_days_dispensed); + TextView tvNextFacilityVisitDate = view.findViewById(R.id.next_facility_visit_date); + TextView tvEdit = view.findViewById(R.id.textview_edit); + + evaluateTitle(context, x, visits.get(x).getDate(), tvTitle); + + + // Updating visibility of EDIT button if the visit is the last visit + if (x == visits.size() - 1) + tvEdit.setVisibility(View.VISIBLE); + else + tvEdit.setVisibility(View.GONE); + + tvEdit.setOnClickListener(view1 -> { + ((Activity) context).finish(); + Visit visit = visits.get(0); + if (visit != null && visit.getVisitType().equalsIgnoreCase(Constants.EVENT_TYPE.PMTCT_FOLLOWUP) && visit.getBaseEntityId() != null) + PmtctFollowupVisitActivity.startPmtctFollowUpActivity((Activity) context, visit.getBaseEntityId(), true); + }); + + + evaluateView(context, vals, tvFollowupStatus, "followup_status", R.string.pmtct_followup_status, "pmtct_followup_status_"); + evaluateView(context, vals, tvCounsellingTopicsProvided, "counselling_topics_provided", R.string.pmtct_counselling_topics_provided, "pmtct_counselling_topics_provided_"); + evaluateView(context, vals, tvClinicalStagingDisease, "clinical_staging_disease", R.string.pmtct_clinical_staging_disease, "pmtct_clinical_staging_disease_"); + + String clinicalStage = getMapValue(vals, "clinical_staging_disease"); + if (StringUtils.isNotBlank(clinicalStage)) { + evaluateView(context, vals, tvSymptoms, clinicalStage + "_symptoms", R.string.pmtct_symptoms, "pmtct_clinical_staging_symptoms_"); + } else { + tvSymptoms.setVisibility(View.GONE); + } + + evaluateView(context, vals, tvTbRegistrationNumber, "tb_registration_number", R.string.pmtct_tb_registration_number, ""); + evaluateView(context, vals, tvTbSymptomsScreening, "tb_symptoms_screening", R.string.pmtct_tb_symptoms_screening, "pmtct_tb_symptoms_screening_"); + evaluateView(context, vals, tvInvestigateForTb, "investigate_for_tb", R.string.pmtct_investigate_for_tb, "pmtct_investigate_for_tb_"); + evaluateView(context, vals, tvReasonForNotConductingTbTest, "reason_for_not_conducting_tb_test", R.string.pmtct_reason_for_not_conducting_tb_test, ""); + evaluateView(context, vals, tvOtherReasonForNotConductingTbTest, "other_reason_for_not_conducting_tb_test", R.string.pmtct_other_reason_for_not_conducting_tb_test, ""); + + evaluateView(context, vals, tvHasBeenProvidedWithTptBefore, "has_been_provided_with_tpt_before", R.string.pmtct_has_been_provided_with_tpt_before, "pmtct_has_been_provided_with_tpt_before_"); + evaluateView(context, vals, tvCompletedTpt, "completed_tpt", R.string.pmtct_completed_tpt, ""); + evaluateView(context, vals, tvIsClientProvidedWithTpt, "pmtct_is_client_provided_with_tpt", R.string.pmtct_other_reason_for_not_conducting_tb_test, ""); + evaluateView(context, vals, tvReasonForNotProvidingTpt, "pmtct_reason_for_not_providing_tpt", R.string.pmtct_other_reason_for_not_conducting_tb_test, ""); + evaluateView(context, vals, tvNumberOfTptDaysDispensed, "number_of_tpt_days_dispensed", R.string.pmtct_number_of_tpt_days_dispensed, ""); + + evaluateView(context, vals, tvPrescribedRegimes, "prescribed_regimes", R.string.pmtct_prescribed_regimes, ""); + evaluateView(context, vals, tvArvLine, "arv_line", R.string.pmtct_arv_line, "pmtct_arv_line_"); + + String arvLine = getMapValue(vals, "arv_line"); + if (StringUtils.isNotBlank(arvLine)) { + evaluateView(context, vals, tvArvPrescription, arvLine, R.string.pmtct_arv_prescription, "pmtct_"); + }else{ + tvArvPrescription.setVisibility(View.GONE); + } + + evaluateView(context, vals, tvReasonsForNotPrescribingArv, "reason_for_not_prescribing_arv", R.string.pmtct_reason_for_not_prescribing_arv, ""); + evaluateView(context, vals, tvOtherReasonForNotPrescribingArv, "other_reason_for_not_prescribing_arv", R.string.pmtct_other_reason_for_not_prescribing_arv, ""); + evaluateView(context, vals, tvNumberOfArvRegimesDaysDispensed, "other_reason_for_not_conducting_tb_test", R.string.pmtct_number_of_arv_regimes_days_dispensed, ""); + + + evaluateView(context, vals, tvNextFacilityVisitDate, "pmtctc_next_facility_visit_date", R.string.next_facility_visit_date, ""); + + + linearLayoutHealthFacilityVisitDetails.addView(view, 0); + + x++; + } + } + } + + + private void evaluateTitle(Context context, int x, Date visitDate, TextView tvTitle) { + if (visitDate == null) { + tvTitle.setVisibility(View.GONE); + } else { + try { + tvTitle.setText(MessageFormat.format(context.getString(R.string.pmtct_visit_title), x + 1, new SimpleDateFormat("dd-MM-yyyy HH:mm", Locale.getDefault()).format(visitDate))); + } catch (Exception e) { + Timber.e(e); + } + } + } + + private void evaluateView(Context context, Map vals, TextView tv, String valueKey, int viewTitleStringResource, String valuePrefixInStringResources) { + if (StringUtils.isNotBlank(getMapValue(vals, valueKey))) { + SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(); + spannableStringBuilder.append(context.getString(viewTitleStringResource), boldSpan, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE).append("\n"); + + String stringValue = getMapValue(vals, valueKey); + String[] stringValueArray; + if (stringValue.contains(",")) { + stringValueArray = stringValue.split(","); + for (String value : stringValueArray) { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, value.trim()) + "\n", new BulletSpan(10), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + } + } else { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, stringValue)).append("\n"); + } + tv.setText(spannableStringBuilder); + } else { + tv.setVisibility(View.GONE); + } + } + + + private String getMapValue(Map map, String key) { + if (map.containsKey(key)) { + return map.get(key); + } + return ""; + } + + private String getStringResource(Context context, String prefix, String resourceName) { + int resourceId = context.getResources(). + getIdentifier(prefix + resourceName.trim(), "string", context.getPackageName()); + try { + return context.getString(resourceId); + } catch (Exception e) { + Timber.e(e); + return prefix + resourceName; + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctProfileActivity.java new file mode 100644 index 000000000..292343c58 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctProfileActivity.java @@ -0,0 +1,612 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; +import static org.smartregister.chw.core.utils.CoreConstants.EventType.PMTCT_COMMUNITY_FOLLOWUP; +import static org.smartregister.chw.hf.activity.HivProfileActivity.startUpdateCtcNumber; +import static org.smartregister.chw.hf.utils.Constants.JsonFormConstants.STEP1; +import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; +import static org.smartregister.chw.hf.utils.JsonFormUtils.getAutoPopulatedJsonEditFormString; +import static org.smartregister.util.JsonFormUtils.VALUE; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.AsyncTask; +import android.os.Build; +import android.view.Gravity; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.RequiresApi; +import androidx.recyclerview.widget.RecyclerView; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.core.activity.CoreFamilyProfileActivity; +import org.smartregister.chw.core.activity.CorePmtctProfileActivity; +import org.smartregister.chw.core.custom_views.CorePmtctFloatingMenu; +import org.smartregister.chw.core.listener.OnClickFloatingMenu; +import org.smartregister.chw.core.model.CoreAllClientsMemberModel; +import org.smartregister.chw.core.rule.PmtctFollowUpRule; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.FpUtil; +import org.smartregister.chw.core.utils.UpdateDetailsUtil; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.adapter.PmtctReferralCardViewAdapter; +import org.smartregister.chw.hf.custom_view.PmtctFloatingMenu; +import org.smartregister.chw.hf.dao.HfPmtctDao; +import org.smartregister.chw.hf.interactor.PmtctProfileInteractor; +import org.smartregister.chw.hf.model.FamilyProfileModel; +import org.smartregister.chw.hf.model.PmtctFollowupFeedbackModel; +import org.smartregister.chw.hf.presenter.FamilyOtherMemberActivityPresenter; +import org.smartregister.chw.hf.presenter.PmtctProfilePresenter; +import org.smartregister.chw.hf.utils.HfHomeVisitUtil; +import org.smartregister.chw.hf.utils.LFTUFormUtils; +import org.smartregister.chw.hf.utils.PmtctVisitUtils; +import org.smartregister.chw.hf.utils.TimeUtils; +import org.smartregister.chw.hiv.dao.HivDao; +import org.smartregister.chw.hiv.domain.HivMemberObject; +import org.smartregister.chw.hivst.dao.HivstDao; +import org.smartregister.chw.pmtct.PmtctLibrary; +import org.smartregister.chw.pmtct.dao.PmtctDao; +import org.smartregister.chw.pmtct.domain.Visit; +import org.smartregister.chw.pmtct.util.Constants; +import org.smartregister.chw.referral.util.JsonFormConstants; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.dao.LocationsDao; +import org.smartregister.domain.AlertStatus; +import org.smartregister.family.contract.FamilyProfileContract; +import org.smartregister.family.domain.FamilyEventClient; +import org.smartregister.family.interactor.FamilyProfileInteractor; +import org.smartregister.family.model.BaseFamilyOtherMemberProfileActivityModel; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.opd.utils.OpdDbConstants; +import org.smartregister.repository.AllSharedPreferences; + +import java.text.MessageFormat; +import java.text.SimpleDateFormat; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Locale; + +import javax.annotation.Nullable; + +import timber.log.Timber; + +public class PmtctProfileActivity extends CorePmtctProfileActivity { + private static String baseEntityId; + private static String visitStatus; + private static Date pmtctRegisterDate; + private static Date followUpVisitDate; + private SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + + + public static void startPmtctActivity(Activity activity, String baseEntityId) { + PmtctProfileActivity.baseEntityId = baseEntityId; + Intent intent = new Intent(activity, PmtctProfileActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + activity.startActivity(intent); + } + + + @Override + protected void onResume() { + super.onResume(); + setupViews(); + org.smartregister.util.Utils.startAsyncTask(new UpdateVisitDueTask(), null); + ((PmtctProfilePresenter) profilePresenter).updateFollowupFeedback(baseEntityId); + if (notificationAndReferralRecyclerView != null && notificationAndReferralRecyclerView.getAdapter() != null) { + notificationAndReferralRecyclerView.getAdapter().notifyDataSetChanged(); + } + } + + @Override + protected void initializePresenter() { + showProgressBar(true); + String baseEntityId = getIntent().getStringExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID); + memberObject = PmtctDao.getMember(baseEntityId); + profilePresenter = new PmtctProfilePresenter(this, new PmtctProfileInteractor(), memberObject); + fetchProfileData(); + profilePresenter.refreshProfileBottom(); + } + + @Override + protected void onCreation() { + super.onCreation(); + org.smartregister.util.Utils.startAsyncTask(new UpdateVisitDueTask(), null); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + super.onCreateOptionsMenu(menu); + menu.findItem(R.id.action_remove_member).setVisible(true); + if (HealthFacilityApplication.getApplicationFlavor().hasHivst()) { + int age = memberObject.getAge(); + menu.findItem(R.id.action_hivst_registration).setVisible(HivstDao.isRegisteredForHivst(baseEntityId) && age >= 15); + } + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + try { + if (itemId == R.id.action_remove_member) { + removeMember(); + return true; + } else if (itemId == R.id.action_issue_pmtct_followup_referral) { + JSONObject formJsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, CoreConstants.JSON_FORM.getPmtctcCommunityFollowupReferral()); + //adds the chw locations under the current facility + JSONObject motherChampionLocationField = CoreJsonFormUtils.getJsonField(formJsonObject, org.smartregister.util.JsonFormUtils.STEP1, "mother_champion_location"); + CoreJsonFormUtils.addLocationsToDropdownField(LocationsDao.getLocationsByTags( + Collections.singleton(SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS)), motherChampionLocationField); + + Date lastVisitDate; + if (followUpVisitDate != null) { + lastVisitDate = followUpVisitDate; + } else { + lastVisitDate = pmtctRegisterDate; + } + CoreJsonFormUtils.getJsonField(formJsonObject, STEP1, "last_client_visit_date").put(VALUE, sdf.format(lastVisitDate)); + + startFormActivity(formJsonObject); + return true; + } else if (itemId == org.smartregister.chw.core.R.id.action_location_info) { + JSONObject preFilledForm = getAutoPopulatedJsonEditFormString( + CoreConstants.JSON_FORM.getFamilyDetailsRegister(), this, + UpdateDetailsUtil.getFamilyRegistrationDetails(memberObject.getFamilyBaseEntityId()), Utils.metadata().familyRegister.updateEventType); + if (preFilledForm != null) + UpdateDetailsUtil.startUpdateClientDetailsActivity(preFilledForm, this); + return true; + } else if (itemId == org.smartregister.chw.core.R.id.action_hivst_registration) { + startHivstRegistration(); + return true; + } + } catch (JSONException e) { + Timber.e(e); + } + return super.onOptionsItemSelected(item); + } + + private void startHivstRegistration() { + CommonPersonObjectClient commonPersonObjectClient = getClientDetailsByBaseEntityID(baseEntityId); + String gender = org.smartregister.chw.core.utils.Utils.getValue(commonPersonObjectClient.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.GENDER, false); + HivstRegisterActivity.startHivstRegistrationActivity(this, baseEntityId, gender); + } + + + @SuppressLint("MissingSuperCall") + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + if (requestCode == Constants.REQUEST_CODE_GET_JSON && resultCode == RESULT_OK) { + try { + String jsonString = data.getStringExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON); + JSONObject form = new JSONObject(jsonString); + String encounterType = form.getString(JsonFormUtils.ENCOUNTER_TYPE); + if (encounterType.equals(Utils.metadata().familyMemberRegister.updateEventType)) { + FamilyEventClient familyEventClient = + new FamilyProfileModel(memberObject.getFamilyName()).processUpdateMemberRegistration(jsonString, memberObject.getBaseEntityId()); + new FamilyProfileInteractor().saveRegistration(familyEventClient, jsonString, true, (FamilyProfileContract.InteractorCallBack) profilePresenter); + } else if (encounterType.equals(PMTCT_COMMUNITY_FOLLOWUP)) { + AllSharedPreferences allSharedPreferences = org.smartregister.util.Utils.getAllSharedPreferences(); + ((PmtctProfilePresenter) profilePresenter).createPmtctCommunityFollowupReferralEvent(allSharedPreferences, data.getStringExtra(Constants.JSON_FORM_EXTRA.JSON), baseEntityId); + } else if (encounterType.equals(org.smartregister.chw.hf.utils.Constants.Events.PMTCT_EAC_VISIT)) { + AllSharedPreferences allSharedPreferences = org.smartregister.util.Utils.getAllSharedPreferences(); + Event baseEvent = org.smartregister.chw.anc.util.JsonFormUtils.processJsonForm(allSharedPreferences, jsonString, Constants.TABLES.PMTCT_EAC_VISITS); + org.smartregister.chw.anc.util.JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + baseEvent.setBaseEntityId(baseEntityId); + try { + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(baseEvent))); + } catch (Exception e) { + Timber.e(e); + } + Toast.makeText(this, "EAC Visit saved", Toast.LENGTH_SHORT).show(); + } else if (form.getString(JsonFormUtils.ENCOUNTER_TYPE).equals(org.smartregister.chw.core.utils.Utils.metadata().familyRegister.updateEventType)) { + FamilyEventClient familyEventClient = new CoreAllClientsMemberModel().processJsonForm(jsonString, memberObject.getFamilyBaseEntityId()); + JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), org.smartregister.util.JsonFormUtils.STEP1, SYNC_LOCATION_ID); + familyEventClient.getEvent().setLocationId(CoreJsonFormUtils.getSyncLocationUUIDFromDropdown(syncLocationField)); + familyEventClient.getEvent().setEntityType(CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT); + new FamilyProfileInteractor().saveRegistration(familyEventClient, jsonString, true, (FamilyProfileContract.InteractorCallBack) presenter()); + } else { + profilePresenter.saveForm(data.getStringExtra(Constants.JSON_FORM_EXTRA.JSON)); + finish(); + } + } catch (Exception e) { + Timber.e(e, "PmtctProfileActivity -- > onActivityResult"); + } + } + } + + + @Override + public void initializeFloatingMenu() { + basePmtctFloatingMenu = new PmtctFloatingMenu(this, memberObject); + checkPhoneNumberProvided(StringUtils.isNotBlank(memberObject.getPhoneNumber())); + OnClickFloatingMenu onClickFloatingMenu = viewId -> { + switch (viewId) { + case R.id.hiv_fab: + ((CorePmtctFloatingMenu) basePmtctFloatingMenu).animateFAB(); + break; + case R.id.call_layout: + ((CorePmtctFloatingMenu) basePmtctFloatingMenu).launchCallWidget(); + ((CorePmtctFloatingMenu) basePmtctFloatingMenu).animateFAB(); + break; + case R.id.refer_to_facility_layout: + LFTUFormUtils.startLTFUReferral(this, memberObject.getBaseEntityId()); + break; + default: + Timber.d("Unknown fab action"); + break; + } + + }; + + ((CorePmtctFloatingMenu) basePmtctFloatingMenu).setFloatMenuClickListener(onClickFloatingMenu); + basePmtctFloatingMenu.setGravity(Gravity.BOTTOM | Gravity.END); + LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, + LinearLayout.LayoutParams.MATCH_PARENT); + addContentView(basePmtctFloatingMenu, linearLayoutParams); + } + + @Override + protected void setupViews() { + super.setupViews(); + try { + PmtctVisitUtils.processVisits(); + } catch (Exception e) { + Timber.e(e); + } + if (HfPmtctDao.hasHvlResults(baseEntityId)) { + view_hvl_results_row.setVisibility(View.VISIBLE); + rlHvlResults.setVisibility(View.VISIBLE); + } + + if (HfPmtctDao.hasCd4Results(baseEntityId)) { + view_baseline_results_row.setVisibility(View.VISIBLE); + rlBaselineResults.setVisibility(View.VISIBLE); + } + if (HfPmtctDao.isEligibleForEac(baseEntityId)) { + Date lastEac = HfPmtctDao.getDateEACRecorded(baseEntityId); + RelativeLayout eacVisitDoneBar = findViewById(R.id.eac_visit_done_bar); + TextView eacVisitDoneText = findViewById(R.id.textview_eac_visit_done); + if (lastEac != null) { + int days = TimeUtils.getElapsedDays(lastEac); + if (days < 1) { + textViewRecordEac.setVisibility(View.GONE); + eacVisitDoneBar.setVisibility(View.VISIBLE); + eacVisitDoneText.setText(getString(R.string.eac_visit_done, HfPmtctDao.getEacSessionNumber(baseEntityId) - 1)); + } else { + eacVisitDoneBar.setVisibility(View.GONE); + textViewRecordEac.setVisibility(View.VISIBLE); + } + } else { + eacVisitDoneBar.setVisibility(View.GONE); + textViewRecordEac.setVisibility(View.VISIBLE); + } + textViewRecordEac.setOnClickListener(this); + textViewRecordEac.setText(getString(R.string.record_eac_first_visit, HfPmtctDao.getEacSessionNumber(baseEntityId))); + } else { + textViewRecordEac.setVisibility(View.GONE); + } + Visit lastFollowupVisit = getVisit(Constants.EVENT_TYPE.PMTCT_FOLLOWUP); + if (lastFollowupVisit != null && !lastFollowupVisit.getProcessed()) { + showVisitInProgress(org.smartregister.chw.hf.utils.Constants.Visits.PMTCT_VISIT); + setUpEditButton(); + } + + if (HfPmtctDao.hasTheClientTransferedOut(baseEntityId)) { + showStatusLabel(R.string.transfer_out, org.smartregister.pmtct.R.drawable.medium_risk_label, org.smartregister.pmtct.R.color.medium_risk_text_orange); + } else if (HfPmtctDao.isTheClientLostToFollowup(baseEntityId)) { + showStatusLabel(R.string.lost_to_followup, org.smartregister.pmtct.R.drawable.high_risk_label, org.smartregister.pmtct.R.color.high_risk_text_red); + } + + setClientCtcNumber(textViewClientRegNumber); + } + + private void setClientCtcNumber(TextView tv) { + HivMemberObject hivMemberObject = HivDao.getMember(memberObject.getBaseEntityId()); + if (hivMemberObject != null && StringUtils.isNotBlank(hivMemberObject.getCtcNumber())) { + tv.setVisibility(View.VISIBLE); + tv.setText(hivMemberObject.getCtcNumber()); + } + } + + @Override + public void setProfileViewWithData() { + super.setProfileViewWithData(); + TextView linkedMotherChampion = (TextView) findViewById(R.id.linked_to_mother_champion); + if (HfPmtctDao.hasBeenReferredForMotherChampionServices(baseEntityId)) { + //Checking if CTC Number is visible before showing an additional separator + if (textViewClientRegNumber.getVisibility() == View.VISIBLE) + findViewById(R.id.family_head_separator).setVisibility(View.VISIBLE); + + linkedMotherChampion.setVisibility(View.VISIBLE); + linkedMotherChampion.setText(MessageFormat.format(getString(R.string.linked_to_mother_champion), HfPmtctDao.getLinkedMotherChampionLocation(baseEntityId))); + } else { + findViewById(R.id.family_head_separator).setVisibility(View.GONE); + linkedMotherChampion.setVisibility(View.GONE); + } + } + + private void showStatusLabel(int stringResource, int backgroundResource, int textColorResource) { + if (riskLabel != null) { + riskLabel.setVisibility(View.VISIBLE); + riskLabel.setTextSize(14); + riskLabel.setText(stringResource); + riskLabel.setBackgroundResource(backgroundResource); + riskLabel.setTextColor(context().getColorResource(textColorResource)); + } + } + + @Override + public void refreshFamilyStatus(AlertStatus status) { + super.refreshFamilyStatus(status); + rlFamilyServicesDue.setVisibility(View.GONE); + } + + @NonNull + @Override + public FamilyOtherMemberActivityPresenter presenter() { + return new FamilyOtherMemberActivityPresenter(this, new BaseFamilyOtherMemberProfileActivityModel(), null, memberObject.getRelationalId(), memberObject.getBaseEntityId(), memberObject.getFamilyHead(), memberObject.getPrimaryCareGiver(), memberObject.getAddress(), memberObject.getLastName()); + } + + @Override + protected void removeMember() { + CommonPersonObjectClient commonPersonObjectClient = getClientDetailsByBaseEntityID(memberObject.getBaseEntityId()); + if (commonPersonObjectClient.getColumnmaps().get("entity_type").toString().equals(CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT)) { + commonPersonObjectClient.getColumnmaps().put(OpdDbConstants.KEY.REGISTER_TYPE, CoreConstants.REGISTER_TYPE.INDEPENDENT); + } + + IndividualProfileRemoveActivity.startIndividualProfileActivity(this, + commonPersonObjectClient, + memberObject.getFamilyBaseEntityId(), memberObject.getFamilyHead(), + memberObject.getPrimaryCareGiver(), FpRegisterActivity.class.getCanonicalName()); + } + + @Override + public void setProfileImage(String s, String s1) { + //implement + } + + @Override + public void onClick(View view) { + super.onClick(view); + int id = view.getId(); + + if (id == R.id.textview_record_pmtct) { + TextView textView = findViewById(R.id.textview_record_pmtct); + if (textView.getText().equals(getResources().getString(R.string.record_ctc_number))) { + try { + startUpdateCtcNumber(PmtctProfileActivity.this, baseEntityId); + }catch (Exception e){ + Timber.e(e); + } + } else { + PmtctFollowupVisitActivity.startPmtctFollowUpActivity(this, baseEntityId, false); + } + } else if (id == R.id.textview_record_eac) { + JSONObject formJsonObject; + try { + formJsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, org.smartregister.chw.hf.utils.Constants.JsonForm.getEacVisitsForm()); + if (formJsonObject != null) { + JSONObject global = formJsonObject.getJSONObject("global"); + JSONArray fields = formJsonObject.getJSONObject(STEP1).getJSONArray(JsonFormConstants.FIELDS); + JSONObject eac_visit_session = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "eac_visit_session"); + + assert eac_visit_session != null; + eac_visit_session.put(VALUE, HfPmtctDao.getEacSessionNumber(baseEntityId)); + global.put("eac_session_number", HfPmtctDao.getEacSessionNumber(baseEntityId)); + + startFormActivity(formJsonObject); + } + } catch (JSONException e) { + Timber.e(e); + } + } else if (id == R.id.textview_edit) { + Toast.makeText(this, "Action Not Defined", Toast.LENGTH_SHORT).show(); + } + + } + + private void showVisitInProgress(String typeOfVisit) { + recordVisits.setVisibility(View.GONE); + if (typeOfVisit.equalsIgnoreCase(org.smartregister.chw.hf.utils.Constants.Visits.PMTCT_VISIT)) { + textViewRecordPmtct.setVisibility(View.GONE); + } + textViewVisitDoneEdit.setVisibility(View.VISIBLE); + visitDone.setVisibility(View.VISIBLE); + textViewVisitDone.setText(getContext().getString(R.string.visit_in_progress, typeOfVisit)); + textViewVisitDone.setTextColor(getResources().getColor(R.color.black_text_color)); + imageViewCross.setImageResource(org.smartregister.chw.core.R.drawable.activityrow_notvisited); + } + + private void setUpEditButton() { + textViewVisitDoneEdit.setOnClickListener(v -> { + PmtctFollowupVisitActivity.startPmtctFollowUpActivity(PmtctProfileActivity.this, baseEntityId, true); + }); + } + + public @Nullable + Visit getVisit(String eventType) { + return PmtctLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), eventType); + } + + @Override + public void setProfileDetailThree(String s) { + //implement + } + + @Override + public void toggleFamilyHead(boolean b) { + //implement + } + + @Override + public void togglePrimaryCaregiver(boolean b) { + //implement + } + + @Override + public void refreshList() { + //implement + } + + @Override + public void updateHasPhone(boolean hasPhone) { + //implement + } + + @Override + public void setFamilyServiceStatus(String status) { + //implement + } + + @Override + public Context getContext() { + return this; + } + + @Override + public void openUpcomingService() { + // executeOnLoaded(memberType -> MalariaUpcomingServicesActivity.startMe(PmtctProfileActivity.this, memberType.getMemberObject())); + } + + @Override + public void openFamilyDueServices() { + Intent intent = new Intent(this, FamilyProfileActivity.class); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_BASE_ENTITY_ID, memberObject.getFamilyBaseEntityId()); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_HEAD, memberObject.getFamilyHead()); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.PRIMARY_CAREGIVER, memberObject.getPrimaryCareGiver()); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_NAME, memberObject.getFamilyName()); + + intent.putExtra(CoreConstants.INTENT_KEY.SERVICE_DUE, true); + startActivity(intent); + } + + @Override + protected Class getFamilyProfileActivityClass() { + return FamilyProfileActivity.class; + } + + @Override + public void verifyHasPhone() { +// TODO implement check if has phone number + } + + @Override + public void notifyHasPhone(boolean b) { +// TODO notify if it has phone number + } + + private void checkPhoneNumberProvided(boolean hasPhoneNumber) { + ((CorePmtctFloatingMenu) basePmtctFloatingMenu).redraw(hasPhoneNumber); + } + + public void setFollowupFeedback(List followupFeedbacks) { + if (notificationAndReferralRecyclerView != null && followupFeedbacks.size() > 0) { + RecyclerView.Adapter mAdapter = new PmtctReferralCardViewAdapter(followupFeedbacks, this, org.smartregister.chw.core.utils.Utils.getCommonPersonObjectClient(memberObject.getBaseEntityId()), CoreConstants.REGISTERED_ACTIVITIES.PMTCT_REGISTER_ACTIVITY); + notificationAndReferralRecyclerView.setAdapter(mAdapter); + notificationAndReferralLayout.setVisibility(View.VISIBLE); + findViewById(R.id.view_notification_and_referral_row).setVisibility(View.VISIBLE); + } + } + + @Override + public void openHvlResultsHistory() { + Intent intent = new Intent(this, HvlResultsViewActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + startActivity(intent); + } + + @Override + public void openBaselineInvestigationResults() { + Intent intent = new Intent(this, Cd4ResultsViewActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + startActivity(intent); + } + + @Override + public void refreshMedicalHistory(boolean hasHistory) { + Visit lastFollowupVisit = getVisit(Constants.EVENT_TYPE.PMTCT_FOLLOWUP); + if (lastFollowupVisit != null) { + rlLastVisit.setVisibility(View.VISIBLE); + findViewById(R.id.view_notification_and_referral_row).setVisibility(View.VISIBLE); + } else { + rlLastVisit.setVisibility(View.GONE); + } + } + + @Override + public void openMedicalHistory() { + PmtctMedicalHistoryActivity.startMe(this, memberObject); + } + + private class UpdateVisitDueTask extends AsyncTask { + private PmtctFollowUpRule pmtctFollowUpRule; + + @Override + protected Void doInBackground(Void... voids) { + pmtctRegisterDate = HfPmtctDao.getPmtctRegisterDate(memberObject.getBaseEntityId()); + followUpVisitDate = HfPmtctDao.getNextFacilityVisitDate(memberObject.getBaseEntityId()); + pmtctFollowUpRule = HfHomeVisitUtil.getPmtctVisitStatus(pmtctRegisterDate, followUpVisitDate, baseEntityId); + return null; + } + + @Override + protected void onPostExecute(Void param) { + String visitStatus = pmtctFollowUpRule.getButtonStatus(); + PmtctProfileActivity.visitStatus = visitStatus; + + if (pmtctFollowUpRule.getButtonStatus().equals(CoreConstants.VISIT_STATE.NOT_DUE_YET)) + visitStatus = CoreConstants.VISIT_STATE.DUE; + + profilePresenter.recordPmtctButton(visitStatus); + + HivMemberObject hivMemberObject = HivDao.getMember(baseEntityId); + String ctcNumber = null; + String statusAfterTesting = null; + if (hivMemberObject != null) { + ctcNumber = hivMemberObject.getCtcNumber(); + statusAfterTesting = hivMemberObject.getClientHivStatusAfterTesting(); + } + if (ctcNumber == null || ctcNumber.equals("") && statusAfterTesting != null && statusAfterTesting.equalsIgnoreCase("positive")) { + textViewRecordPmtct.setText(R.string.record_ctc_number); + } else if (HfPmtctDao.isNewClient(baseEntityId)) { + textViewRecordPmtct.setText(R.string.record_pmtct_visit); + } else { + textViewRecordPmtct.setText(R.string.record_pmtct); + } + + Visit lastFolllowUpVisit = getVisit(Constants.EVENT_TYPE.PMTCT_FOLLOWUP); + + if (lastFolllowUpVisit != null && lastFolllowUpVisit.getProcessed()) { + profilePresenter.visitRow(visitStatus); + } + + try { + profilePresenter.nextRow(visitStatus, FpUtil.sdf.format(pmtctFollowUpRule.getDueDate())); + } catch (Exception e) { + Timber.e(e); + } + } + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctRegisterActivity.java new file mode 100644 index 000000000..fc1247432 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctRegisterActivity.java @@ -0,0 +1,134 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.chw.hf.utils.Constants.HIV_STATUS.POSITIVE; +import static org.smartregister.chw.hf.utils.Constants.JsonForm.getPmtctRegistration; +import static org.smartregister.chw.hf.utils.Constants.JsonForm.getPmtctRegistrationForClientsKnownOnArtForm; +import static org.smartregister.chw.pmtct.util.Constants.EVENT_TYPE.PMTCT_REGISTRATION; +import static org.smartregister.util.JsonFormUtils.FIELDS; +import static org.smartregister.util.JsonFormUtils.VALUE; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import com.google.android.material.bottomnavigation.LabelVisibilityMode; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.activity.CorePmtctRegisterActivity; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.custom_view.FacilityMenu; +import org.smartregister.chw.hf.fragment.PmtctRegisterFragment; +import org.smartregister.chw.hf.listener.HfFamilyBottomNavListener; +import org.smartregister.chw.hf.presenter.PmtctRegisterPresenter; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.PncVisitUtils; +import org.smartregister.chw.pmtct.interactor.BasePmtctRegisterInteractor; +import org.smartregister.chw.pmtct.model.BasePmtctRegisterModel; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.helper.BottomNavigationHelper; +import org.smartregister.view.fragment.BaseRegisterFragment; + +import timber.log.Timber; + +public class PmtctRegisterActivity extends CorePmtctRegisterActivity { + private static final String CTC_NUMBER = "ctc_number"; + private String ctcNumber; + + public static void startPmtctRegistrationActivity(Activity activity, String baseEntityID, String ctcNumber, boolean isKnownOnArt) { + Intent intent = new Intent(activity, PmtctRegisterActivity.class); + intent.putExtra(org.smartregister.chw.pmtct.util.Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityID); + if (isKnownOnArt) { + intent.putExtra(org.smartregister.chw.pmtct.util.Constants.ACTIVITY_PAYLOAD.PMTCT_FORM_NAME, getPmtctRegistrationForClientsKnownOnArtForm()); + intent.putExtra(CTC_NUMBER, ctcNumber); + } else { + intent.putExtra(org.smartregister.chw.pmtct.util.Constants.ACTIVITY_PAYLOAD.PMTCT_FORM_NAME, getPmtctRegistration()); + } + intent.putExtra(org.smartregister.chw.pmtct.util.Constants.ACTIVITY_PAYLOAD.ACTION, org.smartregister.chw.anc.util.Constants.ACTIVITY_PAYLOAD_TYPE.REGISTRATION); + activity.startActivity(intent); + } + + @Override + protected void initializePresenter() { + presenter = new PmtctRegisterPresenter(this, new BasePmtctRegisterModel(), new BasePmtctRegisterInteractor()); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + ctcNumber = getIntent().getStringExtra(CTC_NUMBER); + super.onCreate(savedInstanceState); + FacilityMenu.getInstance(this, null, null); + } + + @Override + protected BaseRegisterFragment getRegisterFragment() { + return new PmtctRegisterFragment(); + } + + + @Override + protected void registerBottomNavigation() { + bottomNavigationHelper = new BottomNavigationHelper(); + bottomNavigationView = findViewById(R.id.bottom_navigation); + + if (bottomNavigationView != null) { + bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED); + bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED); + + bottomNavigationView.getMenu().clear(); + bottomNavigationView.inflateMenu(R.menu.bottom_nav_family_menu); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_clients); + bottomNavigationView.getMenu().removeItem(org.smartregister.chw.tb.R.id.action_register); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_search); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_library); + bottomNavigationView.getMenu().removeItem(org.smartregister.family.R.id.action_job_aids); + bottomNavigationView.setOnNavigationItemSelectedListener(new HfFamilyBottomNavListener(this, bottomNavigationView)); + } + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + if (ACTION.equalsIgnoreCase(Constants.ActionList.FOLLOWUP)) { + startActivityForResult(FormUtils.getStartFormActivity(jsonForm, getString(R.string.pmtct_followup_form_title), this), JsonFormUtils.REQUEST_CODE_GET_JSON); + } else { + startActivityForResult(FormUtils.getStartFormActivity(jsonForm, this.getString(org.smartregister.chw.core.R.string.pmtct_registration), this), JsonFormUtils.REQUEST_CODE_GET_JSON); + } + } + + public String getCtcNumber() { + return ctcNumber; + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (resultCode != RESULT_OK) + return; + + if (requestCode == JsonFormUtils.REQUEST_CODE_GET_JSON) { + String jsonString = data.getStringExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON); + try { + JSONObject form = new JSONObject(jsonString); + if (form.getString(JsonFormUtils.ENCOUNTER_TYPE).equals(PMTCT_REGISTRATION)) { + JSONArray fields = form.getJSONObject("step2").getJSONArray(FIELDS); + JSONObject testResultsJsonObject = JsonFormUtils.getFieldJSONObject(fields, "test_results"); + String testResult = POSITIVE; + if (testResultsJsonObject != null) { + testResult = testResultsJsonObject.getString(VALUE); + } + + try { + if (testResult.equalsIgnoreCase(POSITIVE)) + PncVisitUtils.createHeiRegistrationEvent(form.getString("entity_id")); + } catch (Exception e) { + Timber.e(e); + } + } + } catch (JSONException jsonException) { + Timber.e(jsonException); + } + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctReportsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctReportsActivity.java new file mode 100644 index 000000000..e683dc930 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctReportsActivity.java @@ -0,0 +1,154 @@ +package org.smartregister.chw.hf.activity; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.Toast; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; +import androidx.constraintlayout.widget.ConstraintLayout; + +import com.google.android.material.appbar.AppBarLayout; +import com.whiteelephant.monthpicker.MonthPickerDialog; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.ReportUtils; +import org.smartregister.view.activity.SecuredActivity; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; + +import timber.log.Timber; + +public class PmtctReportsActivity extends SecuredActivity implements View.OnClickListener { + protected ConstraintLayout threeMonthsReport; + protected ConstraintLayout twelveMonthsReport; + protected ConstraintLayout twentyFourMonthsReport; + protected ConstraintLayout crossSectionalMonthsReport; + protected AppBarLayout appBarLayout; + Menu menu; + private String reportPeriod = ReportUtils.getDefaultReportPeriod(); + + @Override + protected void onCreation() { + setContentView(R.layout.activity_pmtct_reports); + setUpToolbar(); + setupViews(); + } + + public void setupViews() { + threeMonthsReport = findViewById(R.id.three_months_report); + twelveMonthsReport = findViewById(R.id.twelve_months_report); + twentyFourMonthsReport = findViewById(R.id.twenty_four_months_report); + crossSectionalMonthsReport = findViewById(R.id.cross_sectional_report); + + threeMonthsReport.setOnClickListener(this); + twelveMonthsReport.setOnClickListener(this); + twentyFourMonthsReport.setOnClickListener(this); + crossSectionalMonthsReport.setOnClickListener(this); + } + + public void setUpToolbar() { + Toolbar toolbar = findViewById(org.smartregister.chw.core.R.id.back_to_nav_toolbar); + setSupportActionBar(toolbar); + + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + final Drawable upArrow = getResources().getDrawable(org.smartregister.chw.core.R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setElevation(0); + } + toolbar.setNavigationOnClickListener(v -> finish()); + appBarLayout = findViewById(org.smartregister.chw.core.R.id.app_bar); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + appBarLayout.setOutlineProvider(null); + } + } + + @Override + protected void onResumption() { + //overridden + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.reports_menu, menu); + this.menu = menu; + this.menu.findItem(R.id.action_select_month).setTitle(ReportUtils.displayMonthAndYear()); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == R.id.action_select_month) { + showMonthPicker(this, menu); + return true; + } + return super.onOptionsItemSelected(item); + } + + @SuppressLint("NonConstantResourceId") + @Override + public void onClick(View v) { + int id = v.getId(); + switch (id) { + case R.id.three_months_report: + PmtctReportsViewActivity.startMe(this, Constants.ReportConstants.ReportPaths.PMTCT_3_MONTHS_REPORT_PATH, R.string.three_months_report, reportPeriod); + break; + case R.id.twelve_months_report: + PmtctReportsViewActivity.startMe(this, Constants.ReportConstants.ReportPaths.PMTCT_12_MONTHS_REPORT_PATH, R.string.twelve_months_report, reportPeriod); + break; + case R.id.twenty_four_months_report: + PmtctReportsViewActivity.startMe(this, Constants.ReportConstants.ReportPaths.PMTCT_24_MONTHS_REPORT_PATH, R.string.twenty_four_months_report, reportPeriod); + break; + case R.id.cross_sectional_report: + PmtctReportsViewActivity.startMe(this, Constants.ReportConstants.ReportPaths.PMTCT_EID_MONTHLY_REPORT_PATH, R.string.eid_cross_sectional_report, reportPeriod); + break; + default: + Toast.makeText(this, "Action Not Defined", Toast.LENGTH_SHORT).show(); + break; + } + } + + private void showMonthPicker(Context context, Menu menu) { + //shows the month picker and returns selected period and updated the menu + MonthPickerDialog.Builder builder = new MonthPickerDialog.Builder(context, (selectedMonth, selectedYear) -> { + int month = selectedMonth + 1; + String monthString = String.valueOf(month); + if (month < 10) { + monthString = "0" + monthString; + } + String yearString = String.valueOf(selectedYear); + reportPeriod = monthString + "-" + yearString; + menu.findItem(R.id.action_select_month).setTitle(ReportUtils.displayMonthAndYear(selectedMonth, selectedYear)); + + }, Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH)); + try { + Date reportDate = new SimpleDateFormat("MM-yyyy", Locale.getDefault()).parse(reportPeriod); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(reportDate); + builder.setActivatedMonth(calendar.get(Calendar.MONTH)); + builder.setMinYear(2021); + builder.setActivatedYear(calendar.get(Calendar.YEAR)); + builder.setMaxYear(Calendar.getInstance().get(Calendar.YEAR)); + builder.setMinMonth(Calendar.JANUARY); + builder.setMaxMonth(Calendar.DECEMBER); + builder.setTitle("Select Month 0"); + builder.build().show(); + } catch (ParseException e) { + Timber.e(e); + } + } + +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctReportsViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctReportsViewActivity.java new file mode 100644 index 000000000..46be95667 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PmtctReportsViewActivity.java @@ -0,0 +1,17 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.hf.utils.Constants; + +public class PmtctReportsViewActivity extends HfReportsViewActivity { + public static void startMe(Activity activity, String reportPath, int reportTitle, String reportDate) { + Intent intent = new Intent(activity, PmtctReportsViewActivity.class); + intent.putExtra(ARG_REPORT_PATH, reportPath); + intent.putExtra(ARG_REPORT_TITLE, reportTitle); + intent.putExtra(ARG_REPORT_DATE, reportDate); + intent.putExtra(ARG_REPORT_TYPE, Constants.ReportConstants.ReportTypes.PMTCT_REPORT); + activity.startActivity(intent); + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncFacilityVisitActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncFacilityVisitActivity.java new file mode 100644 index 000000000..21f7a0dab --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncFacilityVisitActivity.java @@ -0,0 +1,32 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.presenter.BaseAncHomeVisitPresenter; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.PncFacilityVisitInteractor; + +import java.text.MessageFormat; + +public class PncFacilityVisitActivity extends AncFirstFacilityVisitActivity { + + public static void startMe(Activity activity, String baseEntityID, Boolean isEditMode) { + Intent intent = new Intent(activity, PncFacilityVisitActivity.class); + intent.putExtra(org.smartregister.chw.anc.util.Constants.ANC_MEMBER_OBJECTS.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(org.smartregister.chw.anc.util.Constants.ANC_MEMBER_OBJECTS.EDIT_MODE, isEditMode); + activity.startActivityForResult(intent, org.smartregister.chw.anc.util.Constants.REQUEST_CODE_HOME_VISIT); + } + + @Override + protected void registerPresenter() { + presenter = new BaseAncHomeVisitPresenter(memberObject, this, new PncFacilityVisitInteractor()); + } + + @Override + public void redrawHeader(MemberObject memberObject) { + tvTitle.setText(MessageFormat.format("{0}, {1} \u00B7 {2}", memberObject.getFullName(), memberObject.getAge(), getString(R.string.pnc_visit))); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncMedicalHistoryActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncMedicalHistoryActivity.java index e4239a776..c3b0b1b1e 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncMedicalHistoryActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncMedicalHistoryActivity.java @@ -1,18 +1,46 @@ package org.smartregister.chw.hf.activity; +import static org.smartregister.chw.hf.utils.Constants.Events.PNC_CHILD_FOLLOWUP; +import static org.smartregister.chw.hf.utils.Constants.Events.PNC_VISIT; + import android.app.Activity; +import android.content.Context; import android.content.Intent; +import android.graphics.Typeface; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.style.BulletSpan; +import android.text.style.StyleSpan; import android.view.View; +import org.apache.commons.lang3.StringUtils; import org.smartregister.chw.anc.domain.GroupedVisit; import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; import org.smartregister.chw.anc.util.Constants; import org.smartregister.chw.core.activity.CorePncMedicalHistoryActivity; +import org.smartregister.chw.core.dao.PNCDao; +import org.smartregister.chw.core.domain.MedicalHistory; import org.smartregister.chw.core.helper.BaMedicalHistoryActivityHelper; +import org.smartregister.chw.hf.R; import org.smartregister.chw.hf.interactor.PncMedicalHistoryActivityInteractor; +import org.smartregister.chw.hf.utils.PncVisitUtils; import org.smartregister.chw.pnc.contract.BasePncMedicalHistoryContract; +import java.text.MessageFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Locale; +import java.util.Map; + +import timber.log.Timber; public class PncMedicalHistoryActivity extends CorePncMedicalHistoryActivity { @@ -40,5 +68,315 @@ protected BasePncMedicalHistoryContract.Interactor getPncMedicalHistoryInteracto } private class HfMedicalHistoryFlavor extends BaMedicalHistoryActivityHelper { + private final StyleSpan boldSpan = new StyleSpan(android.graphics.Typeface.BOLD); + private final StyleSpan italicSpan = new StyleSpan(Typeface.ITALIC); + private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); + + @Override + protected void processChildDetails(List visits, String memberName) { + this.visits = visits; + String childName = StringUtils.isNotBlank(memberName) ? memberName : ""; + addChildDetailsView(childName); + medicalHistories = new ArrayList<>(); // New history list for child details + + for (int i = visits.size() - 1; i >= 0; i--) { + Visit visit = visits.get(i); + if (!visit.getVisitType().equals(PNC_CHILD_FOLLOWUP)) { + continue; + } + Map childVisitDetails = new HashMap<>(); + + // Note the below HashMap are only used for ordering and categorization os the keys + Map generalExamination = new HashMap<>(); + Map immunization = new HashMap<>(); + Map growthData = new HashMap<>(); + //=============================================================================== + + for (Map.Entry> entry : visit.getVisitDetails().entrySet()) { + String val = getText(entry.getValue()); + + switch (entry.getKey()) { + + // general examination + case "child_activeness": + case "hb_level": + case "hiv_antibody_test": + case "temperature": + case "septicaemia": + case "umbilical_cord": + case "jaundice": + case "skin_infection": + case "kangaroo_enrollment": + generalExamination.put(entry.getKey(), val); + break; + // immunization + case "child_opv0_vaccination": + case "child_bcg_vaccination": + immunization.put(entry.getKey(), val); + break; + // growth and nutrition + case "weight": + case "height": + case "head_circumference": + case "upper_arm_circumference": + case "feeding_options": + growthData.put(entry.getKey(), val); + break; + default: + } + } + + childVisitDetails.putAll(generalExamination); + childVisitDetails.putAll(immunization); + childVisitDetails.putAll(growthData); + + processData(childVisitDetails, R.string.pnc_medical_history_child_general_examination_title, i, visit.getDate()); + } + addMedicalHistoriesView(); + } + + + protected void processImmunization(Map immunization) { + Context context = PncMedicalHistoryActivity.this; + if (immunization != null && immunization.size() > 0) { + + List immunizationDetails = new ArrayList<>(); + for (Map.Entry entry : immunization.entrySet()) { + if (entry.getValue() != null) { + String entryValue = entry.getValue().equalsIgnoreCase("Vaccine not given") ? context.getString(R.string.pnc_vaccine_not_given) : entry.getValue(); + if (entry.getKey().contains("bcg")) { + if (entryValue.equalsIgnoreCase(context.getString(R.string.no))) + immunizationDetails.add(MessageFormat.format(context.getString(R.string.pnc_bcg_not_done), entryValue)); + else + immunizationDetails.add(MessageFormat.format(context.getString(R.string.pnc_bcg), entryValue)); + } else if (entry.getKey().contains("opv0")) { + if (entryValue.equalsIgnoreCase(context.getString(R.string.no))) + immunizationDetails.add(MessageFormat.format(context.getString(R.string.pnc_opv0_not_done), entryValue)); + else + immunizationDetails.add(MessageFormat.format(context.getString(R.string.pnc_opv0), entryValue)); + } + } + } + + if (medicalHistories == null) { + medicalHistories = new ArrayList<>(); + } + + MedicalHistory medicalHistory = new MedicalHistory(); + medicalHistory.setTitle(context.getString(R.string.pnc_medical_history_child_immunizations_title)); + medicalHistory.setText(immunizationDetails); + medicalHistories.add(medicalHistory); + } + } + + protected void processData(Map growth_data, int titleStringResourceId, int visitNumber, Date date) { + Context context = PncMedicalHistoryActivity.this; + if (growth_data != null && growth_data.size() > 0) { + + List nutritionDetails = new ArrayList<>(); + for (Map.Entry entry : growth_data.entrySet()) { + SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(); + + spannableStringBuilder.append(getStringResource(context, "pnc_key_", entry.getKey()), boldSpan, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE).append(" : "); + if (entry.getValue().contains(",")) { + String[] values = entry.getValue().split(","); + for (String value : values) { + spannableStringBuilder.append("\n"); + spannableStringBuilder.append(getStringResource(context, "", value) + "\n", new BulletSpan(10), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + } + } else { + spannableStringBuilder.append(getStringResource(context, "", entry.getValue()), italicSpan, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + } + + nutritionDetails.add(spannableStringBuilder); + } + MedicalHistory medicalHistory = new MedicalHistory(); + medicalHistory.setTitle(context.getString(titleStringResourceId) + " " + ++visitNumber + " : " + simpleDateFormat.format(date)); + medicalHistory.setSpannableStringBuilders(nutritionDetails); + + if (medicalHistories == null) { + medicalHistories = new ArrayList<>(); + } + + medicalHistories.add(medicalHistory); + } + } + + @Override + protected void processMotherDetails(List visits, MemberObject memberObject) { + this.visits = visits; + Map homeVisitMap = new LinkedHashMap<>(); + List> healthFacilityVisits = new ArrayList<>(); + int x = visits.size() - 1; + while (x >= 0) { + if (visits.get(x).getVisitType().equals(PNC_VISIT)) { + Map healthFacilityVisitMap = new LinkedHashMap<>(); + extractHealthFacilityVisits(visits, healthFacilityVisitMap, x); + healthFacilityVisits.add(healthFacilityVisitMap); + } + x--; + } + + extractHomeVisits(visits, homeVisitMap); + processLastVisitDate(memberObject.getBaseEntityId()); + addMotherDetailsView(memberObject.getFullName()); + + medicalHistories = new ArrayList<>(); // New history list for mother's details + + processHealthFacilityVisit(healthFacilityVisits, visits.get(0).getBaseEntityId()); + + +// processHomeVisits(homeVisitMap); + processFamilyPlanning(visits); + addMedicalHistoriesView(); + } + + @Override + protected void extractHealthFacilityVisits(List visits, Map healthFacilityVisitMap, int count) { + Visit visit = visits.get(count); + Map> map = visit.getVisitDetails(); + + Map generalExamination = new HashMap<>(); + Map familyPlanning = new HashMap<>(); + Map suppliments = new HashMap<>(); + Map hivMap = new HashMap<>(); + Map systolicAndDiastolicValues = new HashMap<>(); + + for (String key : map.keySet()) { + List visitDetails = map.get(key); + for (VisitDetail visitDetail : visitDetails) { + + switch (visitDetail.getVisitKey()) { + //Blood Pressure + case "systolic": + case "diastolic": + systolicAndDiastolicValues.put(visitDetail.getVisitKey(), visitDetail.getDetails()); + break; + + // general examination + case "hb_level": + case "temperature": + case "weight": + case "breast_milk_flow": + case "engorgement_mastitis": + case "abscess": + case "perineum_infection": + case "uterus_assessment": + case "lochia_assessment": + case "vaginal_assessment": + case "fistula": + case "puerperal_psychosis": + case "mental_illness_symptom": + generalExamination.put(visitDetail.getVisitKey(), visitDetail.getDetails()); + break; + // Family Planning + case "education_counselling_given": + case "iec_given": + case "using_family_planning_method": + case "method_provided": + familyPlanning.put(visitDetail.getVisitKey(), visitDetail.getDetails()); + break; + // Suppliments + case "iron_and_folic_acid": + case "vitamin_a": + suppliments.put(visitDetail.getVisitKey(), visitDetail.getDetails()); + break; + // HIV Test + case "hiv": + case "hiv_test_result_date": + case "next_facility_visit_date": + hivMap.put(visitDetail.getVisitKey(), visitDetail.getDetails()); + break; + default: + } + } + } + + healthFacilityVisitMap.put("followup_visit_date", map.get("followup_visit_date").get(0).getDetails()); + healthFacilityVisitMap.putAll(generalExamination); + + + Map pressureMap = new HashMap<>(); + pressureMap.put("blood_pressure", systolicAndDiastolicValues.get("systolic")+"/"+systolicAndDiastolicValues.get("diastolic")); + healthFacilityVisitMap.putAll(pressureMap); + + healthFacilityVisitMap.putAll(familyPlanning); + healthFacilityVisitMap.putAll(suppliments); + healthFacilityVisitMap.putAll(hivMap); + + } + + + protected void processHealthFacilityVisit(List> healthFacilityVisits, String baseEntityId) { + Context context = PncMedicalHistoryActivity.this; + Date deliveryDate = PNCDao.getPNCDeliveryDate(baseEntityId); + int x = healthFacilityVisits.size(); + for (Map healthFacilityVisit : healthFacilityVisits) { + Date visitDate; + String visitTypeSubTitle = ""; + try { + String followupVisitDate = healthFacilityVisit.get("followup_visit_date"); + if (StringUtils.isNotBlank(followupVisitDate)) { + visitDate = simpleDateFormat.parse(followupVisitDate); + visitTypeSubTitle = getVisitType(context, deliveryDate, visitDate) + " : " + healthFacilityVisit.get("followup_visit_date"); + } + } catch (Exception e) { + Timber.e(e); + } + MedicalHistory medicalHistory = new MedicalHistory(); + medicalHistory.setTitle(MessageFormat.format(PncMedicalHistoryActivity.this.getString(org.smartregister.chw.core.R.string.pnc_health_facility_visit_num), x + " " + visitTypeSubTitle)); + List hfDetails = new ArrayList<>(); + + List keysNotIncluded = Arrays.asList("followup_visit_date", "visit_number", "anc_visit_date"); + for (String key : healthFacilityVisit.keySet()) { + if (!keysNotIncluded.contains(key)) { + String value = healthFacilityVisit.get(key); + if (StringUtils.isNotBlank(value)) { + + SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(); + spannableStringBuilder.append(getStringResource(context, "pnc_key_", key), boldSpan, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE).append(" : "); + if (value.contains(",")) { + String[] listValues = value.split(","); + for (String itemValue : listValues) { + spannableStringBuilder.append("\n"); + spannableStringBuilder.append(getStringResource(context, "", itemValue) + "\n", new BulletSpan(10), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + } + } else { + spannableStringBuilder.append(getStringResource(context, "", value), italicSpan, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + } + + hfDetails.add(spannableStringBuilder); + } + } + } + medicalHistory.setSpannableStringBuilders(hfDetails); + medicalHistories.add(medicalHistory); + x--; + } + } + + private String getStringResource(Context context, String prefix, String resourceName) { + int resourceId = context.getResources(). + getIdentifier(prefix + resourceName.trim(), "string", context.getPackageName()); + try { + return context.getString(resourceId); + } catch (Exception e) { + Timber.e(e); + return prefix + resourceName; + } + } + + + private String getVisitType(Context context, Date deliveryDate, Date visitDate) { + if (PncVisitUtils.getElapsedTimeDays(deliveryDate, visitDate) <= 2) { + return context.getResources().getString(R.string.pnc_visit_less_than_48_hours); + } else if (PncVisitUtils.getElapsedTimeDays(deliveryDate, visitDate) > 2 && PncVisitUtils.getElapsedTimeDays(deliveryDate, visitDate) <= 7) { + return context.getResources().getString(R.string.pnc_visit_3_to_7_days); + } else if (PncVisitUtils.getElapsedTimeDays(deliveryDate, visitDate) > 7 && PncVisitUtils.getElapsedTimeDays(deliveryDate, visitDate) <= 28) { + return context.getResources().getString(R.string.pnc_visit_8_to_28_days); + } else { + return context.getResources().getString(R.string.pnc_visit_29_to_42_days); + } + } } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncMemberProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncMemberProfileActivity.java index 7f82ce466..043880163 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncMemberProfileActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncMemberProfileActivity.java @@ -1,34 +1,66 @@ package org.smartregister.chw.hf.activity; +import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; +import static org.smartregister.chw.hf.utils.Constants.HIV_STATUS.POSITIVE; +import static org.smartregister.chw.hf.utils.Constants.JsonForm.HIV_REGISTRATION; +import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; +import static org.smartregister.chw.hf.utils.JsonFormUtils.getAutoPopulatedJsonEditFormString; +import static org.smartregister.chw.pmtct.util.Constants.EVENT_TYPE.PMTCT_REGISTRATION; +import static org.smartregister.util.JsonFormUtils.FIELDS; +import static org.smartregister.util.JsonFormUtils.STEP1; +import static org.smartregister.util.JsonFormUtils.VALUE; +import static org.smartregister.util.Utils.getAllSharedPreferences; + import android.app.Activity; +import android.app.AlertDialog; import android.content.Intent; import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.widget.Toast; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.floatingactionbutton.FloatingActionButton; +import com.vijay.jsonwizard.utils.FormUtils; +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.Visit; import org.smartregister.chw.anc.util.Constants; import org.smartregister.chw.core.activity.CoreFamilyProfileActivity; import org.smartregister.chw.core.activity.CorePncMemberProfileActivity; import org.smartregister.chw.core.activity.CorePncRegisterActivity; -import org.smartregister.chw.core.dao.PNCDao; +import org.smartregister.chw.core.dao.ChwNotificationDao; +import org.smartregister.chw.core.interactor.CoreChildProfileInteractor; import org.smartregister.chw.core.interactor.CorePncMemberProfileInteractor; import org.smartregister.chw.core.model.ChildModel; +import org.smartregister.chw.core.model.CoreAllClientsMemberModel; import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.UpdateDetailsUtil; import org.smartregister.chw.fp.dao.FpDao; import org.smartregister.chw.fp.util.FamilyPlanningConstants; +import org.smartregister.chw.hf.BuildConfig; +import org.smartregister.chw.hf.HealthFacilityApplication; import org.smartregister.chw.hf.R; import org.smartregister.chw.hf.adapter.ReferralCardViewAdapter; import org.smartregister.chw.hf.contract.PncMemberProfileContract; +import org.smartregister.chw.hf.dao.HfAncDao; +import org.smartregister.chw.hf.dao.HfPncDao; import org.smartregister.chw.hf.interactor.PncMemberProfileInteractor; import org.smartregister.chw.hf.model.FamilyProfileModel; import org.smartregister.chw.hf.presenter.PncMemberProfilePresenter; +import org.smartregister.chw.hf.utils.PncVisitUtils; +import org.smartregister.chw.hiv.dao.HivDao; +import org.smartregister.chw.hivst.dao.HivstDao; import org.smartregister.chw.malaria.dao.MalariaDao; +import org.smartregister.chw.pmtct.dao.PmtctDao; +import org.smartregister.chw.pmtct.util.NCUtils; +import org.smartregister.clientandeventmodel.Event; import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.domain.AlertStatus; import org.smartregister.domain.Task; @@ -37,19 +69,33 @@ import org.smartregister.family.interactor.FamilyProfileInteractor; import org.smartregister.family.util.JsonFormUtils; import org.smartregister.family.util.Utils; +import org.smartregister.opd.utils.OpdDbConstants; +import org.smartregister.repository.AllSharedPreferences; +import java.text.MessageFormat; import java.util.Date; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Set; import timber.log.Timber; -import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; - public class PncMemberProfileActivity extends CorePncMemberProfileActivity implements PncMemberProfileContract.View { private CommonPersonObjectClient commonPersonObjectClient; private PncMemberProfilePresenter pncMemberProfilePresenter; + private boolean hivPositive; + private boolean isKnownOnArt; + private String ctcNumber; + + public static void startMe(Activity activity, String baseEntityID, MemberObject memberObject) { + Intent intent = new Intent(activity, PncMemberProfileActivity.class); + intent.putExtra(Constants.ANC_MEMBER_OBJECTS.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(Constants.ANC_MEMBER_OBJECTS.MEMBER_PROFILE_OBJECT, memberObject); + passToolbarTitle(activity, intent); + activity.startActivity(intent); + } public static void startMe(Activity activity, String baseEntityID) { Intent intent = new Intent(activity, PncMemberProfileActivity.class); @@ -58,6 +104,29 @@ public static void startMe(Activity activity, String baseEntityID) { activity.startActivity(intent); } + public static void closePncMemberVisits(String baseEntityId) { + AllSharedPreferences sharedPreferences = getAllSharedPreferences(); + Event baseEvent = (Event) new Event() + .withBaseEntityId(baseEntityId) + .withEventDate(new Date()) + .withEventType(org.smartregister.chw.hf.utils.Constants.Events.CLOSE_PNC_VISITS) + .withFormSubmissionId(org.smartregister.util.JsonFormUtils.generateRandomUUIDString()) + .withEntityType(CoreConstants.TABLE_NAME.PNC_MEMBER) + .withProviderId(sharedPreferences.fetchRegisteredANM()) + .withLocationId(ChwNotificationDao.getSyncLocationId(baseEntityId)) + .withTeamId(sharedPreferences.fetchDefaultTeamId(sharedPreferences.fetchRegisteredANM())) + .withTeam(sharedPreferences.fetchDefaultTeam(sharedPreferences.fetchRegisteredANM())) + .withClientDatabaseVersion(BuildConfig.DATABASE_VERSION) + .withClientApplicationVersion(BuildConfig.VERSION_CODE) + .withDateCreated(new Date()); + org.smartregister.chw.hf.utils.JsonFormUtils.tagSyncMetadata(Utils.context().allSharedPreferences(), baseEvent); + try { + org.smartregister.chw.anc.util.NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(baseEvent))); + } catch (Exception e) { + Timber.e(e); + } + } + @Override protected void startMalariaRegister() { MalariaRegisterActivity.startMalariaRegistrationActivity(this, memberObject.getBaseEntityId()); @@ -78,6 +147,24 @@ protected void startMalariaFollowUpVisit() { // TODO -> Implement for HF } + @Override + protected void startHivRegister() { + try { + HivRegisterActivity.startHIVFormActivity(this, memberObject.getBaseEntityId(), HIV_REGISTRATION, (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, HIV_REGISTRATION).toString()); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + protected void startTbRegister() { + try { + TbRegisterActivity.startTbFormActivity(this, memberObject.getBaseEntityId(), CoreConstants.JSON_FORM.getTbRegistration(), (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, CoreConstants.JSON_FORM.getTbRegistration()).toString()); + } catch (JSONException e) { + Timber.e(e); + } + } + @Override protected void startHfMalariaFollowupForm() { MalariaFollowUpVisitActivityHelper.startMalariaFollowUpActivity(this, memberObject.getBaseEntityId()); @@ -105,7 +192,7 @@ public void setReferralTasks(Set taskList) { @Override protected void onCreation() { super.onCreation(); - findViewById(R.id.record_visit_panel).setVisibility(View.GONE); + findViewById(R.id.record_visit_panel).setVisibility(View.VISIBLE); setCommonPersonObjectClient(getClientDetailsByBaseEntityID(baseEntityID)); } @@ -141,37 +228,132 @@ public void setCommonPersonObjectClient(CommonPersonObjectClient commonPersonObj @Override protected void onResume() { super.onResume(); + setupViews(); ((PncMemberProfileContract.Presenter) presenter()).fetchReferralTasks(); if (notificationAndReferralRecyclerView != null && notificationAndReferralRecyclerView.getAdapter() != null) { notificationAndReferralRecyclerView.getAdapter().notifyDataSetChanged(); } + invalidateOptionsMenu(); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.pnc_member_profile_menu, menu); - List childModels = PNCDao.childrenForPncWoman(memberObject.getBaseEntityId()); + menu.findItem(org.smartregister.chw.core.R.id.action_location_info).setVisible(UpdateDetailsUtil.isIndependentClient(memberObject.getBaseEntityId())); + List childModels = HfPncDao.childrenForPncWoman(memberObject.getBaseEntityId()); for (int i = 0; i < childModels.size(); i++) { - menu.add(0, R.id.action_pnc_registration, 100 + i, getString(R.string.edit_child_form_title, childModels.get(i).getFirstName())); - menuItemEditNames.put(getString(R.string.edit_child_form_title, childModels.get(i).getFirstName()), childModels.get(i).getBaseEntityId()); + String nameOfMenuItem; + if (childModels.get(i).getFirstName() != null && childModels.get(i).getFirstName().startsWith("Baby of")) { + nameOfMenuItem = getString(R.string.edit_child_form_title_for_child_without_names, childModels.get(i).getFirstName()); + } else { + nameOfMenuItem = getString(R.string.edit_child_form_title, childModels.get(i).getFirstName()); + } + + menu.add(0, R.id.action_pnc_registration, 100 + i, nameOfMenuItem); + menuItemEditNames.put(nameOfMenuItem, childModels.get(i).getBaseEntityId()); } menu.findItem(R.id.action__pnc_remove_member).setVisible(false); - menu.findItem(R.id.action__pnc_danger_sign_outcome).setVisible(true); + menu.findItem(R.id.action__pnc_danger_sign_outcome).setVisible(false); + if (HealthFacilityApplication.getApplicationFlavor().hasHivst()) { + int age = memberObject.getAge(); + menu.findItem(R.id.action_hivst_registration).setVisible(!HivstDao.isRegisteredForHivst(baseEntityID) && age >= 15); + } if (MalariaDao.isRegisteredForMalaria(baseEntityID)) { menu.findItem(R.id.action_malaria_followup_visit).setVisible(true); menu.findItem(R.id.action_malaria_diagnosis).setVisible(false); } else { - menu.findItem(R.id.action_malaria_diagnosis).setVisible(true); + menu.findItem(R.id.action_malaria_diagnosis).setVisible(false); } if (FpDao.isRegisteredForFp(baseEntityID)) { menu.findItem(R.id.action_fp_change).setVisible(true); } else { - menu.findItem(R.id.action_fp_initiation_pnc).setVisible(true); + menu.findItem(R.id.action_fp_initiation_pnc).setVisible(false); } + menu.findItem(R.id.action_pmtct_register).setVisible(!PmtctDao.isRegisteredForPmtct(baseEntityID) && (hivPositive || HivDao.isRegisteredForHiv(baseEntityID) || HfAncDao.getHivStatus(baseEntityID).equalsIgnoreCase("positive"))); return true; } + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == org.smartregister.chw.core.R.id.action_pnc_registration) { + getEditMenuItem(item); + return true; + } else if (itemId == org.smartregister.chw.core.R.id.action_pnc_member_registration) { + if (UpdateDetailsUtil.isIndependentClient(baseEntityID)) { + startFormForEdit(org.smartregister.chw.core.R.string.registration_info, + CoreConstants.JSON_FORM.getAllClientUpdateRegistrationInfoForm()); + } else { + startFormForEdit(org.smartregister.chw.core.R.string.edit_member_form_title, + CoreConstants.JSON_FORM.getFamilyMemberRegister()); + } + return true; + } else if (itemId == org.smartregister.chw.core.R.id.action_location_info) { + + String familyBaseEntityId = UpdateDetailsUtil.getFamilyBaseEntityId(getCommonPersonObjectClient()); + JSONObject preFilledForm = getAutoPopulatedJsonEditFormString( + CoreConstants.JSON_FORM.getFamilyDetailsRegister(), this, + UpdateDetailsUtil.getFamilyRegistrationDetails(familyBaseEntityId), Utils.metadata().familyRegister.updateEventType); + if (preFilledForm != null) + UpdateDetailsUtil.startUpdateClientDetailsActivity(preFilledForm, this); + return true; + } else if (itemId == org.smartregister.chw.core.R.id.action_hivst_registration) { + startHivstRegistration(); + return true; + } else if (itemId == R.id.action_remove_member) { + removeMember(); + return true; + } else if (itemId == R.id.action_pmtct_register) { + startPmtctRegistration(); + return true; + } + return super.onOptionsItemSelected(item); + } + + private void startHivstRegistration() { + CommonPersonObjectClient commonPersonObjectClient = getCommonPersonObjectClient(); + String gender = Utils.getValue(commonPersonObjectClient.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.GENDER, false); + HivstRegisterActivity.startHivstRegistrationActivity(this, baseEntityID, gender); + } + + public void startFormForEdit(Integer title_resource, String formName) { + try { + JSONObject form = CoreJsonFormUtils.getAncPncForm(title_resource, formName, memberObject, this); + startActivityForResult(CoreJsonFormUtils.getAncPncStartFormIntent(form, this), JsonFormUtils.REQUEST_CODE_GET_JSON); + } catch (Exception e) { + Timber.e(e); + } + } + + private void getEditMenuItem(MenuItem item) { + if (getChildren(memberObject).size() > 0) { + for (CommonPersonObjectClient child : getChildren(memberObject)) { + for (Map.Entry entry : menuItemEditNames.entrySet()) { + if (entry.getKey().equalsIgnoreCase(item.getTitle().toString()) && entry.getValue().equalsIgnoreCase(child.entityId())) { + CoreChildProfileInteractor childProfileInteractor = new CoreChildProfileInteractor(); + JSONObject childEnrollmentForm = childProfileInteractor.getAutoPopulatedJsonEditFormString(CoreConstants.JSON_FORM.getChildRegister(), entry.getKey(), this, child); + try { + String famName = memberObject.getLastName(); + JSONObject stepOne = childEnrollmentForm.getJSONObject(JsonFormUtils.STEP1); + JSONArray jsonArray = stepOne.getJSONArray(JsonFormUtils.FIELDS); + + Map values = new HashMap<>(); + + assert famName != null; + values.put(CoreConstants.JsonAssets.FAM_NAME, famName); + org.smartregister.chw.core.utils.FormUtils.updateFormField(jsonArray, values); + } catch (Exception e) { + Timber.e(e); + } + startFormForEdit(org.smartregister.chw.anc.util.JsonFormUtils.setRequiredFieldsToFalseForPncChild(childEnrollmentForm, memberObject.getFamilyBaseEntityId(), + memberObject.getBaseEntityId())); + } + } + } + } + } + @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); @@ -193,6 +375,47 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { } catch (Exception ex) { Timber.e(ex); } + } else if (encounterType.equals(org.smartregister.chw.hf.utils.Constants.Events.PNC_CHILD_FOLLOWUP)) { + try { + AllSharedPreferences allSharedPreferences = org.smartregister.util.Utils.getAllSharedPreferences(); + Event baseEvent = org.smartregister.chw.anc.util.JsonFormUtils.processJsonForm(allSharedPreferences, jsonString, org.smartregister.chw.hf.utils.Constants.TableName.PNC_FOLLOWUP); + org.smartregister.chw.pmtct.util.JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + JSONObject global = form.getJSONObject("global"); + baseEvent.setBaseEntityId(global.getString("baseEntityId")); + + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.pmtct.util.JsonFormUtils.gson.toJson(baseEvent))); + Toast.makeText(this, getString(R.string.saved_child_followup), Toast.LENGTH_SHORT).show(); + } catch (Exception ex) { + Timber.e(ex); + } + } else if (encounterType.equalsIgnoreCase(CoreConstants.EventType.UPDATE_CHILD_REGISTRATION)) { + String childBaseEntityId = form.getString(JsonFormUtils.ENTITY_ID); + if (childBaseEntityId != null) { + FamilyEventClient familyEventClient = + new FamilyProfileModel(memberObject.getFamilyName()).processUpdateMemberRegistration(jsonString, childBaseEntityId); + familyEventClient.getEvent().setEventType(CoreConstants.EventType.UPDATE_CHILD_REGISTRATION); + new FamilyProfileInteractor().saveRegistration(familyEventClient, jsonString, true, (FamilyProfileContract.InteractorCallBack) pncMemberProfilePresenter()); + } + } else if (form.getString(JsonFormUtils.ENCOUNTER_TYPE).equals(org.smartregister.chw.core.utils.Utils.metadata().familyRegister.updateEventType)) { + FamilyEventClient familyEventClient = new CoreAllClientsMemberModel().processJsonForm(jsonString, UpdateDetailsUtil.getFamilyBaseEntityId(getCommonPersonObjectClient())); + JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), STEP1, SYNC_LOCATION_ID); + familyEventClient.getEvent().setLocationId(CoreJsonFormUtils.getSyncLocationUUIDFromDropdown(syncLocationField)); + familyEventClient.getEvent().setEntityType(CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT); + new FamilyProfileInteractor().saveRegistration(familyEventClient, jsonString, true, (FamilyProfileContract.InteractorCallBack) pncMemberProfilePresenter()); + } else if (form.getString(JsonFormUtils.ENCOUNTER_TYPE).equals(PMTCT_REGISTRATION)) { + JSONArray fields = form.getJSONObject("step2").getJSONArray(FIELDS); + JSONObject testResultsJsonObject = JsonFormUtils.getFieldJSONObject(fields, "test_results"); + String testResult = POSITIVE; + if (testResultsJsonObject != null) { + testResult = testResultsJsonObject.getString(VALUE); + } + + try { + if (testResult.equalsIgnoreCase(POSITIVE)) + PncVisitUtils.createHeiRegistrationEvent(form.getString("entity_id")); + } catch (Exception e) { + Timber.e(e); + } } } catch (JSONException jsonException) { Timber.e(jsonException); @@ -203,6 +426,103 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { @Override public void setupViews() { super.setupViews(); + try { + PncVisitUtils.processVisits(); + } catch (Exception e) { + Timber.e(e); + } + textview_record_anc_visit.setVisibility(View.VISIBLE); + textview_record_anc_visit.setOnClickListener(this); + + if (getPncDay() >= 42) { + textViewAncVisitNot.setVisibility(View.VISIBLE); + } + + textViewAncVisitNot.setText(R.string.complete_pnc_visits); + textViewAncVisitNot.setOnClickListener(v -> confirmRemovePncMember()); + + + if (HfPncDao.isMotherEligibleForPmtctRegistration(baseEntityID) && !PmtctDao.isRegisteredForPmtct(baseEntityID)) { + textview_record_anc_visit.setVisibility(View.GONE); + layoutNotRecordView.setVisibility(View.VISIBLE); + textViewUndo.setVisibility(View.GONE); + textViewNotVisitMonth.setText(getContext().getString(R.string.pmtct_pending_registration)); + tvEdit.setText(getContext().getString(R.string.register_button_text)); + tvEdit.setVisibility(View.VISIBLE); + tvEdit.setOnClickListener(v -> startPmtctRegistration()); + imageViewCross.setImageResource(org.smartregister.chw.core.R.drawable.activityrow_notvisited); + } + + Visit latestVisit = getVisit(org.smartregister.chw.hf.utils.Constants.Events.PNC_VISIT); + if (latestVisit != null && !latestVisit.getProcessed()) { + showVisitInProgress(); + } + try { + setHivPositive(latestVisit); + } catch (Exception e) { + Timber.e(e); + } + } + + private void setHivPositive(Visit latestVisit) throws JSONException { + hivPositive = false; + ctcNumber = null; + isKnownOnArt = false; + JSONObject jsonObject = null; + + jsonObject = new JSONObject(latestVisit.getJson()); + + + if (jsonObject != null) { + JSONArray obs = jsonObject.getJSONArray("obs"); + int obsSize = obs.length(); + for (int i = 0; i < obsSize; i++) { + JSONObject checkObj = obs.getJSONObject(i); + if (checkObj.getString("fieldCode").equalsIgnoreCase("known_on_art") && checkObj.getString("values").contains("true")) { + hivPositive = true; + isKnownOnArt = true; + } else if (checkObj.getString("fieldCode").equalsIgnoreCase("hiv")) { + JSONArray values = checkObj.getJSONArray("values"); + if (values.getString(0).equalsIgnoreCase("positive")) { + hivPositive = true; + } + } else if (checkObj.getString("fieldCode").equalsIgnoreCase("ctc_number")) { + JSONArray values = checkObj.getJSONArray("values"); + ctcNumber = values.getString(0); + } + } + } + } + + protected int getPncDay() { + return Integer.parseInt(getPncMemberProfileInteractor().getPncDay(memberObject.getBaseEntityId())); + } + + @Override + public void setMemberName(String memberName) { + getPncMemberProfileInteractor().getPncMotherNameDetails(memberObject, text_view_anc_member_name, imageView); + } + + @Override + public void setProfileImage(String baseEntityId, String entityType) { + String pncDay = getPncMemberProfileInteractor().getPncDay(memberObject.getBaseEntityId()); + if (StringUtils.isNotBlank(pncDay) && Integer.parseInt(pncDay) >= 49) { + imageRenderHelper.refreshProfileImage(baseEntityId, imageView, org.smartregister.chw.anc.util.NCUtils.getMemberProfileImageResourceIDentifier("pnc")); + } else { + imageRenderHelper.refreshProfileImage(baseEntityId, imageView, org.smartregister.chw.pnc.R.drawable.pnc_less_twenty_nine_days); + } + } + + protected void showVisitInProgress() { + textview_record_anc_visit.setVisibility(View.GONE); + layoutNotRecordView.setVisibility(View.VISIBLE); + textViewUndo.setVisibility(View.GONE); + textViewNotVisitMonth.setText(R.string.pnc_visit_in_progress); + tvEdit.setVisibility(View.VISIBLE); + tvEdit.setOnClickListener(v -> { + PncFacilityVisitActivity.startMe(this, baseEntityID, true); + }); + imageViewCross.setImageResource(org.smartregister.chw.core.R.drawable.activityrow_notvisited); } @Override @@ -221,10 +541,40 @@ protected CorePncMemberProfileInteractor getPncMemberProfileInteractor() { return new PncMemberProfileInteractor(); } + @Override + public void onClick(View v) { + super.onClick(v); + int id = v.getId(); + if (id == R.id.textview_record_visit) { + PncFacilityVisitActivity.startMe(this, baseEntityID, false); + } + } + + protected void confirmRemovePncMember() { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(getString(R.string.complete_pnc_visits)); + builder.setMessage(getString(R.string.complete_pnc_message)); + builder.setCancelable(true); + + builder.setPositiveButton(this.getString(R.string.yes), (dialog, id) -> { + try { + removePncMember(); + finish(); + } catch (Exception e) { + Timber.e(e, "PncMemberProfileActivity --> closePncVisitsDialog"); + } + }); + builder.setNegativeButton(this.getString(R.string.cancel), ((dialog, id) -> dialog.cancel())); + + AlertDialog alertDialog = builder.create(); + alertDialog.show(); + } @Override protected void removePncMember() { - //TODO implement functionality to remove PNC member + //creates an event to close pnc visits and removes member from pnc register + closePncMemberVisits(baseEntityID); + finish(); } @Override @@ -238,4 +588,46 @@ public PncMemberProfileContract.Presenter pncMemberProfilePresenter() { } return pncMemberProfilePresenter; } + + protected void startPmtctRegistration() { + try { + if (HivDao.isRegisteredForHiv(baseEntityID) || (HfAncDao.getHivStatus(baseEntityID).equalsIgnoreCase("positive") && !HfAncDao.getClientCtcNumber(baseEntityID).equals("null"))) { + String ctcNumber = HfAncDao.getClientCtcNumber(baseEntityID); + if (ctcNumber.equals("null")) + ctcNumber = HivDao.getMember(baseEntityID).getCtcNumber(); + PmtctRegisterActivity.startPmtctRegistrationActivity(this, baseEntityID, ctcNumber, true); + } else { + PmtctRegisterActivity.startPmtctRegistrationActivity(this, baseEntityID, ctcNumber, isKnownOnArt || HfAncDao.isClientKnownOnArt(baseEntityID)); + } + } catch (Exception e) { + Timber.e(e); + PmtctRegisterActivity.startPmtctRegistrationActivity(this, baseEntityID, "", false); + } + } + + protected void removeMember() { + CommonPersonObjectClient commonPersonObjectClient = getClientDetailsByBaseEntityID(memberObject.getBaseEntityId()); + if (commonPersonObjectClient.getColumnmaps().get("entity_type").equals(CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT)) { + commonPersonObjectClient.getColumnmaps().put(OpdDbConstants.KEY.REGISTER_TYPE, CoreConstants.REGISTER_TYPE.INDEPENDENT); + } + + IndividualProfileRemoveActivity.startIndividualProfileActivity(this, + commonPersonObjectClient, + memberObject.getFamilyBaseEntityId(), memberObject.getFamilyHead(), + memberObject.getPrimaryCareGiver(), FpRegisterActivity.class.getCanonicalName()); + } + + + @Override + public void setLastVisit(Date lastVisitDate) { + Visit lastFollowupVisit = getVisit(org.smartregister.chw.hf.utils.Constants.Events.PNC_VISIT); + + if (lastFollowupVisit != null) { + rlLastVisit.setVisibility(View.VISIBLE); + view_last_visit_row.setVisibility(View.VISIBLE); + String x = lastFollowupVisit.getDate().toString(); + tvLastVisitDate.setText(MessageFormat.format(getString(org.smartregister.chw.pnc.R.string.pnc_last_visit_text), x)); + } + } + } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncNoMotherProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncNoMotherProfileActivity.java new file mode 100644 index 000000000..628466752 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncNoMotherProfileActivity.java @@ -0,0 +1,302 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.chw.core.utils.Utils.getDuration; +import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; +import static org.smartregister.chw.hf.utils.Constants.Events.HEI_REGISTRATION; +import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; +import static org.smartregister.util.JsonFormUtils.FIELDS; +import static org.smartregister.util.JsonFormUtils.STEP1; +import static org.smartregister.util.JsonFormUtils.VALUE; +import static org.smartregister.util.Utils.getName; + +import android.app.Activity; +import android.content.Intent; +import android.view.Gravity; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import org.joda.time.DateTime; +import org.joda.time.Days; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.util.Constants; +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.chw.core.domain.Child; +import org.smartregister.chw.core.interactor.CoreChildProfileInteractor; +import org.smartregister.chw.core.model.CoreAllClientsMemberModel; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.UpdateDetailsUtil; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.custom_view.PncNoMotherFloatingMenu; +import org.smartregister.chw.hf.dao.HfChildDao; +import org.smartregister.chw.hf.dao.HfPncDao; +import org.smartregister.chw.hf.model.FamilyProfileModel; +import org.smartregister.chw.hf.utils.HfChildUtils; +import org.smartregister.chw.hf.utils.PncVisitUtils; +import org.smartregister.chw.pmtct.util.NCUtils; +import org.smartregister.chw.pnc.PncLibrary; +import org.smartregister.chw.pnc.util.PncUtil; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.clientandeventmodel.Obs; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.family.contract.FamilyProfileContract; +import org.smartregister.family.domain.FamilyEventClient; +import org.smartregister.family.interactor.FamilyProfileInteractor; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.repository.AllSharedPreferences; +import org.smartregister.util.Utils; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.Locale; +import java.util.UUID; + +import timber.log.Timber; + +public class PncNoMotherProfileActivity extends PncMemberProfileActivity { + private static String caregiverName; + private static String caregiverPhoneNumber; + private static String dayPnc; + private static char gender; + private static String dob; + protected TextView childCaregiver; + + + public static void startMe(Activity activity, String baseEntityID, MemberObject memberObject, CommonPersonObjectClient pc) { + Intent intent = new Intent(activity, PncNoMotherProfileActivity.class); + intent.putExtra(Constants.ANC_MEMBER_OBJECTS.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(Constants.ANC_MEMBER_OBJECTS.MEMBER_PROFILE_OBJECT, memberObject); + passToolbarTitle(activity, intent); + caregiverName = Utils.getValue(pc.getColumnmaps(), org.smartregister.chw.hf.utils.Constants.DBConstants.CAREGIVER_NAME, false); + caregiverPhoneNumber = Utils.getValue(pc.getColumnmaps(), org.smartregister.chw.hf.utils.Constants.DBConstants.CAREGIVER_PHONE_NUMBER, false); + dayPnc = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.DELIVERY_DATE, true); + dob = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.DOB, true); + gender = Utils.getValue(pc.getColumnmaps(), org.smartregister.chw.pnc.util.Constants.KEY.GENDER, false).charAt(0); + + activity.startActivity(intent); + } + + public static void startChildForm(Activity activity, String childBaseEntityId) { + JSONObject jsonForm = org.smartregister.chw.core.utils.FormUtils.getFormUtils().getFormJson(org.smartregister.chw.hf.utils.Constants.JsonForm.getPncChildGeneralExamination()); + try { + Child child = HfChildDao.getNoMotherChild(childBaseEntityId); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ", Locale.getDefault()); + int ageInDays = PncUtil.getDaysDifference(dateFormat.format(child.getDateOfBirth())); + + child.getDateOfBirth(); + jsonForm.getJSONObject("global").put("baseEntityId", childBaseEntityId); + jsonForm.getJSONObject("global").put("is_eligible_for_bcg", HfPncDao.isChildEligibleForBcg(childBaseEntityId)); + jsonForm.getJSONObject("global").put("is_eligible_for_opv0", ageInDays <= 14 && HfPncDao.isChildEligibleForOpv0(childBaseEntityId)); + jsonForm.getJSONObject("global").put("anti_body_test_conducted", HfPncDao.hasHivAntibodyTestBeenConducted(childBaseEntityId)); + jsonForm.getJSONObject("global").put("is_a_child_without_mother", HfPncDao.isAChildWithoutMother(childBaseEntityId)); + activity.startActivityForResult(org.smartregister.chw.core.utils.FormUtils.getStartFormActivity(jsonForm, activity.getString(R.string.record_child_followup), activity), JsonFormUtils.REQUEST_CODE_GET_JSON); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public void setupViews() { + super.setupViews(); + try { + PncVisitUtils.processVisits(); + } catch (Exception e) { + Timber.e(e); + } + + textview_record_anc_visit.setVisibility(View.VISIBLE); + textview_record_anc_visit.setOnClickListener(this); + textViewAncVisitNot.setText(R.string.complete_pnc_visits); + textViewAncVisitNot.setOnClickListener(v -> confirmRemovePncMember()); + childCaregiver = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.primary_anc_caregiver); + + findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.family_anc_head).setVisibility(View.GONE); + childCaregiver.setVisibility(View.VISIBLE); + + childCaregiver.setText(this.getString(R.string.caregiver_name, caregiverName)); + } + + @Override + public void setProfileImage(String baseEntityId, String entityType) { + imageRenderHelper.refreshProfileImage(baseEntityId, imageView, org.smartregister.chw.core.R.drawable.rowavatar_child); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == R.id.action_pnc_member_registration) { + startFormForEdit(org.smartregister.chw.core.R.string.registration_info, + CoreConstants.JSON_FORM.getChildRegister()); + return true; + } + return super.onOptionsItemSelected(item); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + super.onCreateOptionsMenu(menu); + menu.findItem(R.id.action_location_info).setVisible(false); + return true; + } + + @Override + protected int getPncDay() { + DateTimeFormatter formatter = DateTimeFormat.forPattern("dd-MM-yyyy"); + return Days.daysBetween(new DateTime(formatter.parseDateTime(dayPnc)), new DateTime()).getDays(); + } + + @Override + public void startFormForEdit(Integer title_resource, String formName) { + + JSONObject childEnrollmentForm = null; + CommonPersonObjectClient client = HfChildUtils.getChildClientByBaseEntityId(memberObject.getBaseEntityId()); + + if (client == null) { + return; + } + if (formName.equals(CoreConstants.JSON_FORM.getChildRegister())) { + CoreChildProfileInteractor childProfileInteractor = new CoreChildProfileInteractor(); + childEnrollmentForm = childProfileInteractor.getAutoPopulatedJsonEditFormString(CoreConstants.JSON_FORM.getChildRegister(), (title_resource != null) ? getResources().getString(title_resource) : null, this, client); + try { + JSONObject stepOne = childEnrollmentForm.getJSONObject(JsonFormUtils.STEP1); + JSONArray fields = stepOne.getJSONArray(JsonFormUtils.FIELDS); + JSONObject sameAsFamName = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "same_as_fam_name"); + sameAsFamName.put("type", "hidden"); + } catch (Exception e) { + Timber.e(e); + } + } + try { + assert childEnrollmentForm != null; + startFormActivity(childEnrollmentForm); + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + public void setMemberGA(String memberGA) { + text_view_ga.setText(getName(getString(org.smartregister.chw.pnc.R.string.pnc_day), String.valueOf(getPncDay()))); + } + + @Override + public void setMemberName(String memberName) { + String age = org.smartregister.family.util.Utils.getTranslatedDate(getDuration(dob), this); + text_view_anc_member_name.setText(String.format("%s %s %s, %s", memberObject.getFirstName(), + memberObject.getMiddleName(), memberObject.getLastName(), age)); + if (gender == 'M') { + imageView.setBorderColor(PncLibrary.getInstance().context().getColorResource(org.smartregister.chw.pnc.R.color.light_blue)); + } else { + imageView.setBorderColor(PncLibrary.getInstance().context().getColorResource(org.smartregister.chw.pnc.R.color.light_pink)); + } + imageView.setBorderWidth(10); + } + + @Override + public void initializeFloatingMenu() { + baseAncFloatingMenu = new PncNoMotherFloatingMenu(this, caregiverName, caregiverPhoneNumber); + baseAncFloatingMenu.setGravity(Gravity.BOTTOM | Gravity.RIGHT); + LinearLayout.LayoutParams linearLayoutParams = new LinearLayout.LayoutParams( + LinearLayout.LayoutParams.MATCH_PARENT, + LinearLayout.LayoutParams.MATCH_PARENT); + addContentView(baseAncFloatingMenu, linearLayoutParams); + } + + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.textview_record_visit) { + startChildForm(this, baseEntityID); + } else { + super.onClick(v); + } + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (resultCode != RESULT_OK) + return; + + if (requestCode == JsonFormUtils.REQUEST_CODE_GET_JSON) { + String jsonString = data.getStringExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON); + try { + JSONObject form = new JSONObject(jsonString); + String encounterType = form.getString(JsonFormUtils.ENCOUNTER_TYPE); + if (encounterType.equals(org.smartregister.chw.hf.utils.Constants.Events.PNC_CHILD_FOLLOWUP)) { + try { + AllSharedPreferences allSharedPreferences = Utils.getAllSharedPreferences(); + Event baseEvent = org.smartregister.chw.anc.util.JsonFormUtils.processJsonForm(allSharedPreferences, jsonString, org.smartregister.chw.hf.utils.Constants.TableName.PNC_FOLLOWUP); + org.smartregister.chw.pmtct.util.JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + JSONObject global = form.getJSONObject("global"); + baseEvent.setBaseEntityId(global.getString("baseEntityId")); + + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.pmtct.util.JsonFormUtils.gson.toJson(baseEvent))); + + JSONArray fields = form.getJSONObject(STEP1).getJSONArray(FIELDS); + JSONObject hivAntibodyTest = JsonFormUtils.getFieldJSONObject(fields, "hiv_antibody_test"); + if (hivAntibodyTest != null && hivAntibodyTest.has(VALUE) && hivAntibodyTest.getString(VALUE).equalsIgnoreCase("positive")) { + createHeiRegistrationEvent(global.getString("baseEntityId")); + } + Toast.makeText(this, getString(R.string.saved_child_followup), Toast.LENGTH_SHORT).show(); + } catch (Exception ex) { + Timber.e(ex); + } + } else if (encounterType.equalsIgnoreCase(CoreConstants.EventType.UPDATE_CHILD_REGISTRATION)) { + String childBaseEntityId = form.getString(JsonFormUtils.ENTITY_ID); + FamilyEventClient familyEventClient = + new FamilyProfileModel(memberObject.getFamilyName()).processUpdateMemberRegistration(jsonString, childBaseEntityId); + familyEventClient.getEvent().setEventType(CoreConstants.EventType.UPDATE_CHILD_REGISTRATION); + new FamilyProfileInteractor().saveRegistration(familyEventClient, jsonString, true, (FamilyProfileContract.InteractorCallBack) pncMemberProfilePresenter()); + } else if (form.getString(JsonFormUtils.ENCOUNTER_TYPE).equals(org.smartregister.chw.core.utils.Utils.metadata().familyRegister.updateEventType)) { + FamilyEventClient familyEventClient = new CoreAllClientsMemberModel().processJsonForm(jsonString, UpdateDetailsUtil.getFamilyBaseEntityId(getCommonPersonObjectClient())); + JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), STEP1, SYNC_LOCATION_ID); + familyEventClient.getEvent().setLocationId(CoreJsonFormUtils.getSyncLocationUUIDFromDropdown(syncLocationField)); + familyEventClient.getEvent().setEntityType(CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT); + new FamilyProfileInteractor().saveRegistration(familyEventClient, jsonString, true, (FamilyProfileContract.InteractorCallBack) pncMemberProfilePresenter()); + } + } catch (JSONException jsonException) { + Timber.e(jsonException); + } + } + } + + private static void createHeiRegistrationEvent(String baseEntityId) throws Exception { + Event baseEvent = new Event(); + baseEvent.setFormSubmissionId(UUID.randomUUID().toString()); + baseEvent.setEventType(HEI_REGISTRATION); + baseEvent.addObs( + (new Obs()) + .withFormSubmissionField("risk_category") + .withValue("high") + .withFieldCode("risk_category") + .withFieldType("formsubmissionField") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + + + baseEvent.setEventDate(new Date()); + baseEvent.setDateCreated(new Date()); + baseEvent.setBaseEntityId(baseEntityId); + baseEvent.setEntityType(org.smartregister.chw.hf.utils.Constants.TableName.HEI); + + AllSharedPreferences allSharedPreferences = AncLibrary.getInstance().context().allSharedPreferences(); + + org.smartregister.chw.anc.util.JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + org.smartregister.chw.anc.util.NCUtils.addEvent(allSharedPreferences, baseEvent); + org.smartregister.chw.anc.util.NCUtils.startClientProcessing(); + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncNoMotherRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncNoMotherRegisterActivity.java new file mode 100644 index 000000000..be59b0a81 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncNoMotherRegisterActivity.java @@ -0,0 +1,265 @@ +package org.smartregister.chw.hf.activity; + +import static com.vijay.jsonwizard.utils.FormUtils.fields; +import static com.vijay.jsonwizard.utils.FormUtils.getFieldJSONObject; +import static org.smartregister.chw.hf.utils.Constants.Events.PNC_NO_MOTHER_REGISTRATION; +import static org.smartregister.chw.pmtct.util.NCUtils.getClientProcessorForJava; +import static org.smartregister.chw.pmtct.util.NCUtils.getSyncHelper; +import static org.smartregister.family.util.JsonFormUtils.STEP2; +import static org.smartregister.util.JsonFormUtils.STEP1; +import static org.smartregister.util.Utils.getAllSharedPreferences; + +import android.app.Activity; +import android.content.Intent; + +import androidx.annotation.NonNull; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.core.utils.CoreReferralUtils; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.AllClientsUtils; +import org.smartregister.clientandeventmodel.Client; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.family.util.Constants; +import org.smartregister.family.util.Utils; +import org.smartregister.opd.OpdLibrary; +import org.smartregister.opd.pojo.OpdEventClient; +import org.smartregister.opd.pojo.RegisterParams; +import org.smartregister.opd.utils.OpdConstants; +import org.smartregister.opd.utils.OpdJsonFormUtils; +import org.smartregister.opd.utils.OpdUtils; +import org.smartregister.repository.AllSharedPreferences; +import org.smartregister.repository.EventClientRepository; +import org.smartregister.repository.UniqueIdRepository; +import org.smartregister.util.JsonFormUtils; +import org.smartregister.view.activity.SecuredActivity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import timber.log.Timber; + +public class PncNoMotherRegisterActivity extends SecuredActivity { + private static String formName; + + public static void startPncNoMotherRegistrationActivity(Activity activity, String formName) { + Intent intent = new Intent(activity, PncNoMotherRegisterActivity.class); + PncNoMotherRegisterActivity.formName = formName; + activity.startActivity(intent); + } + + @Override + protected void onCreation() { + startFormActivity(FormUtils.getFormUtils().getFormJson(formName)); + } + + @Override + protected void onResumption() { + //do nothing + } + + public UniqueIdRepository getUniqueIdRepository() { + return OpdLibrary.getInstance().getUniqueIdRepository(); + } + + public void startFormActivity(JSONObject jsonForm) { + try { + String entityId = getUniqueIdRepository().getNextUniqueId().getOpenmrsId(); + String newEntityId = entityId; + if (StringUtils.isNotBlank(entityId)) { + newEntityId = entityId.replace("-", ""); + } + + JSONObject stepOneUniqueId = getFieldJSONObject(fields(jsonForm, STEP1), Constants.JSON_FORM_KEY.UNIQUE_ID); + + if (stepOneUniqueId != null) { + stepOneUniqueId.remove(org.smartregister.family.util.JsonFormUtils.VALUE); + stepOneUniqueId.put(org.smartregister.family.util.JsonFormUtils.VALUE, newEntityId + "_Family"); + } + + JSONObject stepTwoUniqueId = getFieldJSONObject(fields(jsonForm, STEP2), Constants.JSON_FORM_KEY.UNIQUE_ID); + if (stepTwoUniqueId != null) { + stepTwoUniqueId.remove(org.smartregister.family.util.JsonFormUtils.VALUE); + stepTwoUniqueId.put(org.smartregister.family.util.JsonFormUtils.VALUE, newEntityId); + } + + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + + form.setWizard(true); + form.setNavigationBackground(org.smartregister.chw.core.R.color.family_navigation); + form.setName(getString(R.string.no_mother_child_reg)); + form.setNextLabel(this.getResources().getString(org.smartregister.chw.core.R.string.next)); + form.setPreviousLabel(this.getResources().getString(org.smartregister.chw.core.R.string.back)); + + + startActivityForResult(intent, org.smartregister.family.util.JsonFormUtils.REQUEST_CODE_GET_JSON); + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (resultCode == RESULT_CANCELED) { + Intent intent = new Intent(this, PncRegisterActivity.class); + startActivity(intent); + } + if (requestCode == org.smartregister.family.util.JsonFormUtils.REQUEST_CODE_GET_JSON && resultCode == RESULT_OK) { + String jsonString = data.getStringExtra(OpdConstants.JSON_FORM_EXTRA.JSON); + Timber.d("JSONResult : %s", jsonString); + + try { + RegisterParams registerParam = new RegisterParams(); + registerParam.setEditMode(false); + registerParam.setFormTag(OpdJsonFormUtils.formTag(OpdUtils.context().allSharedPreferences())); + saveForm(jsonString, registerParam); + startActivity(new Intent(this, PncRegisterActivity.class)); + } catch (Exception e) { + Timber.e(e); + } + } + + } + + private void saveForm(String jsonString, RegisterParams registerParam) { + try { + List opdEventClientList = processRegistration(jsonString); + if (opdEventClientList == null || opdEventClientList.isEmpty()) { + return; + } + saveRegistration(opdEventClientList, jsonString, registerParam); + } catch (Exception e) { + Timber.e(e); + } + } + + public List processRegistration(String jsonString) { + + List opdEventClients = AllClientsUtils.getOpdEventClients(jsonString); + try { + //set sync location the same as the facility + for (OpdEventClient opdEventClient : opdEventClients) { + AllSharedPreferences allSharedPreferences = getAllSharedPreferences(); + String anmIdentifier = allSharedPreferences.fetchRegisteredANM(); + opdEventClient.getEvent().setLocationId(allSharedPreferences.fetchUserLocalityId(anmIdentifier)); + } + } catch (Exception e) { + Timber.e(e, "Error retrieving Sync location Field"); + } + return opdEventClients; + } + + public void saveRegistration(@NonNull List allClientEventList, @NonNull String jsonString, + @NonNull RegisterParams params) { + try { + List currentFormSubmissionIds = new ArrayList<>(); + + for (int i = 0; i < allClientEventList.size(); i++) { + try { + + OpdEventClient allClientEvent = allClientEventList.get(i); + Client baseClient = allClientEvent.getClient(); + Event baseEvent = allClientEvent.getEvent(); + addClient(params, baseClient); + addEvent(params, currentFormSubmissionIds, baseEvent); + updateOpenSRPId(jsonString, params, baseClient); + addImageLocation(jsonString, baseClient, baseEvent); + if (baseEvent.getEventType().equalsIgnoreCase("Family Member Registration")) + createPncRegistrationEvent(baseEvent.getBaseEntityId(), jsonString); + } catch (Exception e) { + Timber.e(e, "ChwAllClientRegisterInteractor --> saveRegistration"); + } + } + + long lastSyncTimeStamp = getAllSharedPreferences().fetchLastUpdatedAtDate(0); + Date lastSyncDate = new Date(lastSyncTimeStamp); + getClientProcessorForJava().processClient(getSyncHelper().getEvents(currentFormSubmissionIds)); + getAllSharedPreferences().saveLastUpdatedAtDate(lastSyncDate.getTime()); + } catch (Exception e) { + Timber.e(e, "OpdRegisterInteractor --> saveRegistration"); + } + } + + private void addClient(@NonNull RegisterParams params, Client baseClient) throws JSONException { + JSONObject clientJson = new JSONObject(OpdJsonFormUtils.gson.toJson(baseClient)); + if (params.isEditMode()) { + try { + org.smartregister.family.util.JsonFormUtils.mergeAndSaveClient(getSyncHelper(), baseClient); + } catch (Exception e) { + Timber.e(e, "ChwAllClientRegisterInteractor --> mergeAndSaveClient"); + } + } else { + getSyncHelper().addClient(baseClient.getBaseEntityId(), clientJson); + } + } + + private void addImageLocation(String jsonString, Client baseClient, Event baseEvent) { + if (baseClient != null || baseEvent != null) { + String imageLocation = OpdJsonFormUtils.getFieldValue(jsonString, Constants.KEY.PHOTO); + if (StringUtils.isNotBlank(imageLocation)) { + org.smartregister.family.util.JsonFormUtils.saveImage(baseEvent.getProviderId(), baseClient.getBaseEntityId(), imageLocation); + } + } + } + + private void updateOpenSRPId(String jsonString, RegisterParams params, Client baseClient) { + if (params.isEditMode()) { + // UnAssign current OpenSRP ID + if (baseClient != null) { + String newOpenSrpId = baseClient.getIdentifier(Utils.metadata().uniqueIdentifierKey).replace("-", ""); + String currentOpenSrpId = org.smartregister.family.util.JsonFormUtils.getString(jsonString, org.smartregister.family.util.JsonFormUtils.CURRENT_OPENSRP_ID).replace("-", ""); + if (!newOpenSrpId.equals(currentOpenSrpId)) { + //OpenSRP ID was changed + getUniqueIdRepository().open(currentOpenSrpId); + } + } + + } else { + if (baseClient != null) { + String openSrpId = baseClient.getIdentifier(Utils.metadata().uniqueIdentifierKey); + if (StringUtils.isNotBlank(openSrpId) && !openSrpId.contains(Constants.IDENTIFIER.FAMILY_SUFFIX)) { + //Mark OpenSRP ID as used + getUniqueIdRepository().close(openSrpId); + } + } + } + } + + private void addEvent(RegisterParams params, List currentFormSubmissionIds, Event baseEvent) throws JSONException { + if (baseEvent != null) { + JSONObject eventJson = new JSONObject(OpdJsonFormUtils.gson.toJson(baseEvent)); + getSyncHelper().addEvent(baseEvent.getBaseEntityId(), eventJson, params.getStatus()); + currentFormSubmissionIds.add(eventJson.getString(EventClientRepository.event_column.formSubmissionId.toString())); + } + } + + private void createPncRegistrationEvent(String baseEntityId, String jsonString) { + AllSharedPreferences sharedPreferences = getAllSharedPreferences(); + Event baseEvent = org.smartregister.chw.anc.util.JsonFormUtils.processJsonForm(sharedPreferences, CoreReferralUtils.setEntityId(jsonString, baseEntityId), org.smartregister.chw.hf.utils.Constants.TableName.NO_MOTHER_PNC); + + baseEvent.setEventType(PNC_NO_MOTHER_REGISTRATION); + baseEvent.setFormSubmissionId(JsonFormUtils.generateRandomUUIDString()); + baseEvent.setEntityType(org.smartregister.chw.hf.utils.Constants.TableName.NO_MOTHER_PNC); + + // tag docs + org.smartregister.chw.hf.utils.JsonFormUtils.tagSyncMetadata(Utils.context().allSharedPreferences(), baseEvent); + try { + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(baseEvent))); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncRegisterActivity.java index 353d052b9..da4d7f8b5 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncRegisterActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncRegisterActivity.java @@ -1,35 +1,122 @@ package org.smartregister.chw.hf.activity; +import static org.smartregister.chw.hf.utils.Constants.REQUEST_FILTERS; + +import android.annotation.SuppressLint; import android.app.Activity; import android.content.Intent; +import android.view.MenuItem; + +import androidx.annotation.MenuRes; +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; + +import com.google.android.material.bottomnavigation.BottomNavigationView; +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; +import org.apache.commons.lang3.EnumUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.model.BaseAncRegisterModel; +import org.smartregister.chw.anc.presenter.BaseAncRegisterPresenter; import org.smartregister.chw.anc.util.Constants; -import org.smartregister.chw.core.activity.CoreAncRegisterActivity; +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.chw.anc.util.JsonFormUtils; import org.smartregister.chw.core.activity.CoreFamilyRegisterActivity; import org.smartregister.chw.core.activity.CorePncRegisterActivity; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.fragment.PncNoMotherRegisterFragment; import org.smartregister.chw.hf.fragment.PncRegisterFragment; +import org.smartregister.chw.hf.interactor.AncRegisterInteractor; +import org.smartregister.family.util.Utils; +import org.smartregister.helper.BottomNavigationHelper; +import org.smartregister.job.SyncServiceJob; import org.smartregister.view.fragment.BaseRegisterFragment; -public class PncRegisterActivity extends CorePncRegisterActivity { +import java.util.HashMap; +import java.util.Map; + +import timber.log.Timber; + +public class PncRegisterActivity extends CorePncRegisterActivity implements BottomNavigationView.OnNavigationItemSelectedListener { + protected static boolean motherHivStatus; - public static void startAncRegistrationActivity(Activity activity, String memberBaseEntityID, String phoneNumber, String formName, - String uniqueId, String familyBaseID, String family_name) { - Intent intent = new Intent(activity, CoreAncRegisterActivity.class); + public static void startPncRegistrationActivity(Activity activity, String memberBaseEntityID, String phoneNumber, String formName, + String uniqueId, String familyBaseID, String family_name, String last_menstrual_period, boolean motherHivStatus) { + Intent intent = new Intent(activity, PncRegisterActivity.class); intent.putExtra(org.smartregister.chw.anc.util.Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, memberBaseEntityID); phone_number = phoneNumber; familyBaseEntityId = familyBaseID; form_name = formName; familyName = family_name; + PncRegisterActivity.motherHivStatus = motherHivStatus; unique_id = uniqueId; + lastMenstrualPeriod = last_menstrual_period; intent.putExtra(org.smartregister.chw.anc.util.Constants.ACTIVITY_PAYLOAD.ACTION, org.smartregister.chw.anc.util.Constants.ACTIVITY_PAYLOAD_TYPE.REGISTRATION); intent.putExtra(Constants.ACTIVITY_PAYLOAD.TABLE_NAME, getFormTable()); activity.startActivity(intent); } + @Override + public void startFormActivity(JSONObject jsonForm) { + try { + JSONObject stepOne = jsonForm.getJSONObject(org.smartregister.family.util.JsonFormUtils.STEP1); + JSONArray fields = stepOne.getJSONArray(org.smartregister.family.util.JsonFormUtils.FIELDS); + JSONObject global = jsonForm.getJSONObject("global"); + + Map values = new HashMap<>(); + values.put(DBConstants.KEY.TEMP_UNIQUE_ID, unique_id); + values.put(CoreConstants.JsonAssets.FAM_NAME, familyName); + values.put(CoreConstants.JsonAssets.FAMILY_MEMBER.PHONE_NUMBER, phone_number); + values.put(org.smartregister.family.util.DBConstants.KEY.RELATIONAL_ID, familyBaseEntityId); + FormUtils.updateFormField(fields, values); + + global.put("hiv_status_mother", motherHivStatus); + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + + if (jsonForm.getString("encounter_type").equals("Pregnancy Outcome")) { + form.setWizard(true); + form.setNavigationBackground(org.smartregister.chw.core.R.color.family_navigation); + form.setName(getString(R.string.pregnancy_outcome_title)); + form.setNextLabel(this.getResources().getString(org.smartregister.chw.core.R.string.next)); + form.setPreviousLabel(this.getResources().getString(org.smartregister.chw.core.R.string.back)); + } else if (jsonForm.getString("encounter_type").equals("PMTCT Post PNC Registration")) { + form.setWizard(true); + form.setNavigationBackground(org.smartregister.chw.core.R.color.family_navigation); + form.setName(getString(R.string.pmtct_registration)); + form.setNextLabel(this.getResources().getString(org.smartregister.chw.core.R.string.next)); + form.setPreviousLabel(this.getResources().getString(org.smartregister.chw.core.R.string.back)); + } + + startActivityForResult(intent, org.smartregister.family.util.JsonFormUtils.REQUEST_CODE_GET_JSON); + } catch (JSONException e) { + Timber.e(e); + } + } + + @MenuRes + public int getMenuResource() { + return R.menu.bottom_nav_anc_menu; + } + @Override protected void registerBottomNavigation() { - super.registerBottomNavigation(); - FamilyRegisterActivity.registerBottomNavigation(bottomNavigationHelper, bottomNavigationView, this); + bottomNavigationHelper = new BottomNavigationHelper(); + bottomNavigationView = findViewById(R.id.bottom_navigation); + bottomNavigationView.getMenu().clear(); + + bottomNavigationView.inflateMenu(R.menu.bottom_nav_pnc_menu); + bottomNavigationView.setOnNavigationItemSelectedListener(this); } @Override @@ -39,13 +126,87 @@ public void switchToBaseFragment() { finish(); } + @Override + protected Fragment[] getOtherFragments() { + return new PncNoMotherRegisterFragment[]{ + new PncNoMotherRegisterFragment()}; + } + @Override protected Class getFamilyRegisterActivity() { return FamilyRegisterActivity.class; } + @Override + public void onRegistrationSaved(String encounterType, boolean isEdit, boolean hasChildren) { + if (encounterType.equalsIgnoreCase(Constants.EVENT_TYPE.PREGNANCY_OUTCOME) || encounterType.equalsIgnoreCase(org.smartregister.chw.hf.utils.Constants.Events.PMTCT_POST_PNC_REGISTRATION)) { + hideProgressDialog(); + Timber.d("We are home - PNC Register"); + if (encounterType.equalsIgnoreCase(org.smartregister.chw.hf.utils.Constants.Events.PMTCT_POST_PNC_REGISTRATION)) { + finish(); + Intent intent = new Intent(this, PmtctRegisterActivity.class); + startActivity(intent); + } + + } else { + super.onRegistrationSaved(encounterType, isEdit, hasChildren); + } + } + @Override protected BaseRegisterFragment getRegisterFragment() { return new PncRegisterFragment(); } + + @Override + protected void initializePresenter() { + this.presenter = new BaseAncRegisterPresenter(this, new BaseAncRegisterModel(), new AncRegisterInteractor()); + } + + + @SuppressLint("MissingSuperCall") + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResultExtended(requestCode, resultCode, data); + if (resultCode == Activity.RESULT_OK && requestCode == REQUEST_FILTERS) { + ((PncRegisterFragment) mBaseFragment).onFiltersUpdated(requestCode, data); + } else if (resultCode == Activity.RESULT_OK) { + try { + JSONObject form = new JSONObject(data.getStringExtra(Constants.JSON_FORM_EXTRA.JSON)); + String encounter_type = form.optString(Constants.JSON_FORM_EXTRA.ENCOUNTER_TYPE); + String table = data.getStringExtra(Constants.ACTIVITY_PAYLOAD.TABLE_NAME); + + if (CoreConstants.EventType.PREGNANCY_OUTCOME.equals(encounter_type)) { + JSONArray fields = org.smartregister.util.JsonFormUtils.fields(form); + String pregnancyOutcome = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, org.smartregister.chw.hf.utils.Constants.pregnancyOutcome).optString(JsonFormUtils.VALUE); + if (EnumUtils.isValidEnum(org.smartregister.chw.hf.utils.Constants.FamilyRegisterOptionsUtil.class, pregnancyOutcome)) { + startRegisterActivity(FamilyRegisterActivity.class); + this.finish(); + return; + } + } else if (encounter_type.equalsIgnoreCase(org.smartregister.chw.hf.utils.Constants.Events.PMTCT_POST_PNC_REGISTRATION)) { + presenter().saveForm(form.toString(), false, table); + } + SyncServiceJob.scheduleJobImmediately(SyncServiceJob.TAG); + + } catch (Exception e) { + Timber.e(e); + } + } + } + + @Override + public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) { + if (menuItem.getItemId() == R.id.action_pnc) { + switchToFragment(0); + return true; + } else if (menuItem.getItemId() == R.id.action_no_mother) { + switchToFragment(1); + return true; + } else if (menuItem.getItemId() == R.id.action_register_child) { + PncNoMotherRegisterActivity.startPncNoMotherRegistrationActivity(this, "pnc_no_mother_registration"); + return true; + } + return false; + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncReportsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncReportsActivity.java new file mode 100644 index 000000000..b679fdd79 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncReportsActivity.java @@ -0,0 +1,126 @@ +package org.smartregister.chw.hf.activity; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; +import androidx.constraintlayout.widget.ConstraintLayout; + +import com.google.android.material.appbar.AppBarLayout; +import com.whiteelephant.monthpicker.MonthPickerDialog; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.ReportUtils; +import org.smartregister.view.activity.SecuredActivity; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; + +import timber.log.Timber; + +public class PncReportsActivity extends SecuredActivity implements View.OnClickListener { + protected ConstraintLayout monthlyReport; + protected AppBarLayout appBarLayout; + Menu menu; + protected String reportPeriod = ReportUtils.getDefaultReportPeriod(); + + @Override + protected void onCreation() { + setContentView(R.layout.activity_pnc_reports); + setUpToolbar(); + setupViews(); + } + + public void setupViews() { + monthlyReport = findViewById(R.id.pnc_monthly_report); + monthlyReport.setOnClickListener(this); + } + + @Override + protected void onResumption() { + //do nothing + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.reports_menu, menu); + this.menu = menu; + this.menu.findItem(R.id.action_select_month).setTitle(ReportUtils.displayMonthAndYear()); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == R.id.action_select_month) { + showMonthPicker(this, menu); + return true; + } + return super.onOptionsItemSelected(item); + } + + public void setUpToolbar() { + Toolbar toolbar = findViewById(org.smartregister.chw.core.R.id.back_to_nav_toolbar); + setSupportActionBar(toolbar); + + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + final Drawable upArrow = getResources().getDrawable(org.smartregister.chw.core.R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setElevation(0); + } + toolbar.setNavigationOnClickListener(v -> finish()); + appBarLayout = findViewById(org.smartregister.chw.core.R.id.app_bar); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + appBarLayout.setOutlineProvider(null); + } + } + + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.pnc_monthly_report) { + PncReportsViewActivity.startMe(this, Constants.ReportConstants.ReportPaths.PNC_REPORT_PATH, reportPeriod); + } + } + + private void showMonthPicker(Context context, Menu menu) { + //shows the month picker and returns selected period and updated the menu + MonthPickerDialog.Builder builder = new MonthPickerDialog.Builder(context, (selectedMonth, selectedYear) -> { + int month = selectedMonth + 1; + String monthString = String.valueOf(month); + if (month < 10) { + monthString = "0" + monthString; + } + String yearString = String.valueOf(selectedYear); + reportPeriod = monthString + "-" + yearString; + menu.findItem(R.id.action_select_month).setTitle(ReportUtils.displayMonthAndYear(selectedMonth, selectedYear)); + + }, Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH)); + try { + Date reportDate = new SimpleDateFormat("MM-yyyy", Locale.getDefault()).parse(reportPeriod); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(reportDate); + builder.setActivatedMonth(calendar.get(Calendar.MONTH)); + builder.setMinYear(2021); + builder.setActivatedYear(calendar.get(Calendar.YEAR)); + builder.setMaxYear(Calendar.getInstance().get(Calendar.YEAR)); + builder.setMinMonth(Calendar.JANUARY); + builder.setMaxMonth(Calendar.DECEMBER); + builder.setTitle(getString(R.string.select_reporting_month_pnc)); + builder.build().show(); + } catch (ParseException e) { + Timber.e(e); + } + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncReportsViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncReportsViewActivity.java new file mode 100644 index 000000000..d4b9c69e4 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PncReportsViewActivity.java @@ -0,0 +1,18 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; + +public class PncReportsViewActivity extends HfReportsViewActivity { + public static void startMe(Activity activity, String reportPath, String reportDate) { + Intent intent = new Intent(activity, PncReportsViewActivity.class); + intent.putExtra(ARG_REPORT_PATH, reportPath); + intent.putExtra(ARG_REPORT_DATE, reportDate); + intent.putExtra(ARG_REPORT_TITLE, R.string.pnc_reports); + intent.putExtra(ARG_REPORT_TYPE, Constants.ReportConstants.ReportTypes.PNC_REPORT); + activity.startActivity(intent); + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PrEPMedicalHistoryActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PrEPMedicalHistoryActivity.java new file mode 100644 index 000000000..0deedb7aa --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PrEPMedicalHistoryActivity.java @@ -0,0 +1,256 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.Spanned; +import android.text.style.BulletSpan; +import android.text.style.StyleSpan; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.Days; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.presenter.BaseAncMedicalHistoryPresenter; +import org.smartregister.chw.core.activity.CoreAncMedicalHistoryActivity; +import org.smartregister.chw.core.activity.DefaultAncMedicalHistoryActivityFlv; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.PrEPMedicalHistoryInteractor; +import org.smartregister.chw.kvp.domain.MemberObject; + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PrEPMedicalHistoryActivity extends CoreAncMedicalHistoryActivity { + private static MemberObject kvpMemberObject; + private final Flavor flavor = new KvpPrEPMedicalHistoryActivityFlv(); + private ProgressBar progressBar; + + public static void startMe(Activity activity, MemberObject memberObject) { + Intent intent = new Intent(activity, PrEPMedicalHistoryActivity.class); + kvpMemberObject = memberObject; + activity.startActivity(intent); + } + + @Override + public void initializePresenter() { + presenter = new BaseAncMedicalHistoryPresenter(new PrEPMedicalHistoryInteractor(), this, kvpMemberObject.getBaseEntityId()); + } + + @Override + public void setUpView() { + linearLayout = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.linearLayoutMedicalHistory); + progressBar = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.progressBarMedicalHistory); + + TextView tvTitle = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.tvTitle); + tvTitle.setText(getString(org.smartregister.chw.opensrp_chw_anc.R.string.back_to, kvpMemberObject.getFullName())); + + ((TextView) findViewById(R.id.medical_history)).setText(getString(R.string.visits_history)); + } + + @Override + public View renderView(List visits) { + super.renderView(visits); + View view = flavor.bindViews(this); + displayLoadingState(true); + flavor.processViewData(visits, this); + displayLoadingState(false); + TextView agywVisitTitle = view.findViewById(org.smartregister.chw.core.R.id.customFontTextViewHealthFacilityVisitTitle); + agywVisitTitle.setText(R.string.visits_history); + return view; + } + + @Override + public void displayLoadingState(boolean state) { + progressBar.setVisibility(state ? View.VISIBLE : View.GONE); + } + + private static class KvpPrEPMedicalHistoryActivityFlv extends DefaultAncMedicalHistoryActivityFlv { + private final StyleSpan boldSpan = new StyleSpan(android.graphics.Typeface.BOLD); + + @Override + protected void processAncCard(String has_card, Context context) { + // super.processAncCard(has_card, context); + linearLayoutAncCard.setVisibility(View.GONE); + } + + @Override + protected void processHealthFacilityVisit(List> hf_visits, Context context) { + //super.processHealthFacilityVisit(hf_visits, context); + } + + @Override + public void processViewData(List visits, Context context) { + + if (visits.size() > 0) { + int days = 0; + List> hf_visits = new ArrayList<>(); + + int x = 0; + while (x < visits.size()) { + LinkedHashMap visitDetails = new LinkedHashMap<>(); + + // the first object in this list is the days difference + if (x == 0) { + days = Days.daysBetween(new DateTime(visits.get(visits.size() - 1).getDate()), new DateTime()).getDays(); + } + + String[] visitTypeParams = {"place", "visit_type"}; + extractVisitDetails(visits, visitTypeParams, visitDetails, x, context); + + String[] prepScreeningParams = {"diabetes", "blood_pressure", "kidney_disease", ""}; + extractVisitDetails(visits, prepScreeningParams, visitDetails, x, context); + + String[] otherServicesParams = {"other_services_referrals_provided", "other_other_services_referrals_provided", "nephrotoxic_drugs", "tested_hbv", "hbv_results", "tested_hcv", "hcv_results", "tested_crcl", "crcl_results", "weight_35_or_above", "acute_hiv", "substantial_criteria", "should_initiate"}; + extractVisitDetails(visits, otherServicesParams, visitDetails, x, context); + + String[] prepInitiationServicesParams = {"prep_status", "prep_drug_offered", "prep_pills_number", "prep_adherence", "poor_prep_adherence_reason", "other_poor_prep_adherence_reason", "prep_side_effects", "other_prep_side_effects", "reasons_stopping_prep", "other_reason_stopping_prep", "next_visit_date"}; + extractVisitDetails(visits, prepInitiationServicesParams, visitDetails, x, context); + + String[] stiScreeningServicesParams = {"sti_screening", "treatment_provided"}; + extractVisitDetails(visits, stiScreeningServicesParams, visitDetails, x, context); + + String[] tbScreeningServicesParams = {"tb_screening"}; + extractVisitDetails(visits, tbScreeningServicesParams, visitDetails, x, context); + + String[] vmmcServicesParams = {"vmcc_provided"}; + extractVisitDetails(visits, vmmcServicesParams, visitDetails, x, context); + + String[] cervicalCancerScreeningServicesParams = {"cervical_cancer_screening"}; + extractVisitDetails(visits, cervicalCancerScreeningServicesParams, visitDetails, x, context); + + String[] clientStatusServicesParams = {"client_status", "other_kvp_category"}; + extractVisitDetails(visits, clientStatusServicesParams, visitDetails, x, context); + + String[] nextAppointmentDateParams = {"next_visit_date"}; + extractVisitDetails(visits, nextAppointmentDateParams, visitDetails, x, context); + + hf_visits.add(visitDetails); + + x++; + } + + processLastVisit(days, context); + processVisit(hf_visits, context, visits); + } + } + + private void extractVisitDetails(List sourceVisits, String[] hf_params, LinkedHashMap visitDetailsMap, int iteration, Context context) { + // get the hf details + Map map = new HashMap<>(); + for (String param : hf_params) { + try { + List details = sourceVisits.get(iteration).getVisitDetails().get(param); + map.put(param, getTexts(context, details)); + } catch (Exception e) { + e.printStackTrace(); + } + + } + visitDetailsMap.putAll(map); + } + + + private void processLastVisit(int days, Context context) { + linearLayoutLastVisit.setVisibility(View.VISIBLE); + if (days < 1) { + customFontTextViewLastVisit.setText(org.smartregister.chw.core.R.string.less_than_twenty_four); + } else { + customFontTextViewLastVisit.setText(StringUtils.capitalize(MessageFormat.format(context.getString(org.smartregister.chw.core.R.string.days_ago), String.valueOf(days)))); + } + } + + + protected void processVisit(List> community_visits, Context context, List visits) { + if (community_visits != null && community_visits.size() > 0) { + linearLayoutHealthFacilityVisit.setVisibility(View.VISIBLE); + + int x = 0; + for (LinkedHashMap vals : community_visits) { + View view = inflater.inflate(R.layout.medical_history_visit, null); + TextView tvTitle = view.findViewById(R.id.title); + LinearLayout visitDetailsLayout = view.findViewById(R.id.visit_details_layout); + + tvTitle.setText(visits.get(x).getVisitType() + " " + visits.get(x).getDate()); + + + for (LinkedHashMap.Entry entry : vals.entrySet()) { + TextView visitDetailTv = new TextView(context); + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams + ((int) LinearLayout.LayoutParams.MATCH_PARENT, (int) LinearLayout.LayoutParams.WRAP_CONTENT); + + visitDetailTv.setLayoutParams(params); + float scale = context.getResources().getDisplayMetrics().density; + int dpAsPixels = (int) (10 * scale + 0.5f); + visitDetailTv.setPadding(dpAsPixels, 0, 0, 0); + visitDetailsLayout.addView(visitDetailTv); + + + try { + int resource = context.getResources().getIdentifier("prep_" + entry.getKey(), "string", context.getPackageName()); + evaluateView(context, vals, visitDetailTv, entry.getKey(), resource, ""); + } catch (Exception e) { + Timber.e(e); + } + } + linearLayoutHealthFacilityVisitDetails.addView(view, 0); + + x++; + } + } + } + + private void evaluateView(Context context, Map vals, TextView tv, String valueKey, int viewTitleStringResource, String valuePrefixInStringResources) { + if (StringUtils.isNotBlank(getMapValue(vals, valueKey))) { + SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(); + spannableStringBuilder.append(context.getString(viewTitleStringResource), boldSpan, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE).append("\n"); + + String stringValue = getMapValue(vals, valueKey); + String[] stringValueArray; + if (stringValue.contains(",")) { + stringValueArray = stringValue.split(","); + for (String value : stringValueArray) { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, value.trim()) + "\n", new BulletSpan(10), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + } + } else { + spannableStringBuilder.append(getStringResource(context, valuePrefixInStringResources, stringValue)).append("\n"); + } + tv.setText(spannableStringBuilder); + } else { + tv.setVisibility(View.GONE); + } + } + + + private String getMapValue(Map map, String key) { + if (map.containsKey(key)) { + return map.get(key); + } + return ""; + } + + private String getStringResource(Context context, String prefix, String resourceName) { + int resourceId = context.getResources(). + getIdentifier(prefix + resourceName.trim(), "string", context.getPackageName()); + try { + return context.getString(resourceId); + } catch (Exception e) { + Timber.e(e); + return prefix + resourceName; + } + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PrEPProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PrEPProfileActivity.java new file mode 100644 index 000000000..db9cb7581 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PrEPProfileActivity.java @@ -0,0 +1,92 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; +import android.view.Menu; +import android.view.View; +import android.widget.TextView; + +import org.smartregister.chw.core.activity.CoreKvpProfileActivity; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hivst.dao.HivstDao; +import org.smartregister.chw.kvp.KvpLibrary; +import org.smartregister.chw.kvp.domain.Visit; +import org.smartregister.chw.kvp.util.Constants; +import org.smartregister.chw.kvp.util.DBConstants; +import org.smartregister.commonregistry.CommonPersonObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.commonregistry.CommonRepository; +import org.smartregister.family.util.Utils; + +public class PrEPProfileActivity extends CoreKvpProfileActivity { + + public static void startProfile(Activity activity, String baseEntityId) { + Intent intent = new Intent(activity, PrEPProfileActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.PROFILE_TYPE, Constants.PROFILE_TYPES.PrEP_PROFILE); + activity.startActivity(intent); + } + + + @Override + public void openFollowupVisit() { + PrEPVisitActivity.startPrEPVisitActivity(this, memberObject.getBaseEntityId(), false); + } + + @Override + public void onClick(View view) { + int id = view.getId(); + if (id == R.id.textview_continue) { + PrEPVisitActivity.startPrEPVisitActivity(this, memberObject.getBaseEntityId(), true); + } else { + super.onClick(view); + } + } + + @Override + public void refreshMedicalHistory(boolean hasHistory) { + Visit kvpBehavioralServices = getVisit(Constants.EVENT_TYPE.PrEP_FOLLOWUP_VISIT); + if (kvpBehavioralServices != null) { + rlLastVisit.setVisibility(View.VISIBLE); + findViewById(R.id.view_notification_and_referral_row).setVisibility(View.VISIBLE); + ((TextView) findViewById(R.id.vViewHistory)).setText(R.string.visits_history); + ((TextView) findViewById(R.id.ivViewHistoryArrow)).setText(getString(R.string.view_visits_history)); + } else { + rlLastVisit.setVisibility(View.GONE); + } + } + + @Override + public void openMedicalHistory() { + PrEPMedicalHistoryActivity.startMe(this, memberObject); + } + + private Visit getVisit(String eventType) { + return KvpLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), eventType); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + super.onCreateOptionsMenu(menu); + + if (HealthFacilityApplication.getApplicationFlavor().hasHivst()) { + int age = memberObject.getAge(); + menu.findItem(R.id.action_hivst_registration).setVisible(!HivstDao.isRegisteredForHivst(memberObject.getBaseEntityId()) && age >= 15); + } + + return true; + } + + @Override + public void startHivstRegistration() { + CommonRepository commonRepository = Utils.context().commonrepository(Utils.metadata().familyMemberRegister.tableName); + + final CommonPersonObject commonPersonObject = commonRepository.findByBaseEntityId(memberObject.getBaseEntityId()); + final CommonPersonObjectClient client = + new CommonPersonObjectClient(commonPersonObject.getCaseId(), commonPersonObject.getDetails(), ""); + client.setColumnmaps(commonPersonObject.getColumnmaps()); + String gender = Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.GENDER, false); + HivstRegisterActivity.startHivstRegistrationActivity(this, memberObject.getBaseEntityId(), gender); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PrEPRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PrEPRegisterActivity.java new file mode 100644 index 000000000..f9276bd02 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PrEPRegisterActivity.java @@ -0,0 +1,39 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.core.activity.CoreKvpRegisterActivity; +import org.smartregister.chw.core.custom_views.NavigationMenu; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.fragment.PrEPRegisterFragment; +import org.smartregister.chw.kvp.util.Constants; +import org.smartregister.view.fragment.BaseRegisterFragment; + +public class PrEPRegisterActivity extends CoreKvpRegisterActivity { + + public static void startMe(Activity activity, String baseEntityId, String gender, int age) { + Intent intent = new Intent(activity, PrEPRegisterActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.ACTION, Constants.ACTIVITY_PAYLOAD_TYPE.REGISTRATION); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.KVP_FORM_NAME, Constants.FORMS.PrEP_REGISTRATION); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.GENDER, gender); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.AGE, age); + + activity.startActivity(intent); + } + + @Override + protected BaseRegisterFragment getRegisterFragment() { + return new PrEPRegisterFragment(); + } + + @Override + protected void onResumption() { + super.onResumption(); + NavigationMenu menu = NavigationMenu.getInstance(this, null, null); + if (menu != null) { + menu.getNavigationAdapter().setSelectedView(CoreConstants.DrawerMenu.PrEP); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PrEPVisitActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PrEPVisitActivity.java new file mode 100644 index 000000000..a243480e8 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PrEPVisitActivity.java @@ -0,0 +1,102 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.Build; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.json.JSONObject; +import org.smartregister.chw.core.task.RunnableTask; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.interactor.PrEPVisitInteractor; +import org.smartregister.chw.hf.schedulers.HfScheduleTaskExecutor; +import org.smartregister.chw.kvp.activity.BaseKvpVisitActivity; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; +import org.smartregister.chw.kvp.presenter.BaseKvpVisitPresenter; +import org.smartregister.chw.kvp.util.Constants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.util.LangUtils; + +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.Map; + +public class PrEPVisitActivity extends BaseKvpVisitActivity { + + public static void startPrEPVisitActivity(Activity activity, String baseEntityId, Boolean editMode) { + Intent intent = new Intent(activity, PrEPVisitActivity.class); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.EDIT_MODE, editMode); + intent.putExtra(Constants.ACTIVITY_PAYLOAD.PROFILE_TYPE, Constants.PROFILE_TYPES.PrEP_PROFILE); + activity.startActivity(intent); + } + + @Override + protected void registerPresenter() { + presenter = new BaseKvpVisitPresenter(memberObject, this, new PrEPVisitInteractor(Constants.EVENT_TYPE.PrEP_FOLLOWUP_VISIT)); + } + + @Override + public void startFormActivity(JSONObject jsonForm) { + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(false); + + Intent intent = new Intent(this, Utils.metadata().familyMemberFormActivity); + intent.putExtra(org.smartregister.family.util.Constants.JSON_FORM_EXTRA.JSON, jsonForm.toString()); + intent.putExtra(org.smartregister.family.util.Constants.WizardFormActivity.EnableOnCloseDialog, false); + intent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, form); + startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + public void submittedAndClose() { + Runnable runnable = () -> HfScheduleTaskExecutor.getInstance().execute(memberObject.getBaseEntityId(), Constants.EVENT_TYPE.PrEP_FOLLOWUP_VISIT, new Date()); + Utils.startAsyncTask(new RunnableTask(runnable), null); + super.submittedAndClose(); + } + + @Override + public void initializeActions(LinkedHashMap map) { + actionList.clear(); + + //Necessary evil to rearrange the actions according to a specific arrangement + + if (map.containsKey(getString(R.string.prep_visit_type))) { + BaseKvpVisitAction visitTypeAction = map.get(getString(R.string.prep_visit_type)); + actionList.put(getString(R.string.prep_visit_type), visitTypeAction); + } + if (map.containsKey(getString(R.string.prep_screening))) { + BaseKvpVisitAction prepScreeningAction = map.get(getString(R.string.prep_screening)); + actionList.put(getString(R.string.prep_screening), prepScreeningAction); + } + + + for (Map.Entry entry : map.entrySet()) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + actionList.putIfAbsent(entry.getKey(), entry.getValue()); + } else { + actionList.put(entry.getKey(), entry.getValue()); + } + } + //====================End of Necessary evil ==================================== + + if (mAdapter != null) { + mAdapter.notifyDataSetChanged(); + } + displayProgressBar(false); + } + + @Override + protected void attachBaseContext(Context base) { + // get language from prefs + String lang = LangUtils.getLanguage(base.getApplicationContext()); + super.attachBaseContext(LangUtils.setAppLocale(base, lang)); + } + +} + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PregnancyConfirmationViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PregnancyConfirmationViewActivity.java new file mode 100644 index 000000000..946072fb6 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/PregnancyConfirmationViewActivity.java @@ -0,0 +1,135 @@ +package org.smartregister.chw.hf.activity; + +import static android.view.View.GONE; +import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.view.View; + +import androidx.annotation.NonNull; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.AllClientsUtils; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.domain.Task; +import org.smartregister.opd.utils.OpdDbConstants; +import org.smartregister.view.customcontrols.CustomFontTextView; + +import java.util.Map; + +public class PregnancyConfirmationViewActivity extends ReferralTaskViewActivity implements View.OnClickListener { + private static String CLIENT_PHONE_NUMBER; + + public static void startPregnancyConfirmationViewActivity(Activity activity, CommonPersonObjectClient personObjectClient, Task task, String startingActivity, Map details) { + PregnancyConfirmationViewActivity.personObjectClient = personObjectClient; + CLIENT_PHONE_NUMBER = details.get("family_member_phone_number"); + Intent intent = new Intent(activity, PregnancyConfirmationViewActivity.class); + intent.putExtra(CoreConstants.INTENT_KEY.USERS_TASKS, task); + intent.putExtra(CoreConstants.INTENT_KEY.CHILD_COMMON_PERSON, personObjectClient); + intent.putExtra(CoreConstants.INTENT_KEY.STARTING_ACTIVITY, startingActivity); + passToolbarTitle(activity, intent); + activity.startActivity(intent); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.referrals_tasks_view_layout); + if (getIntent().getExtras() != null) { + extraClientTask(); + extraDetails(); + setStartingActivity((String) getIntent().getSerializableExtra(CoreConstants.INTENT_KEY.STARTING_ACTIVITY)); + inflateToolbar(); + setUpViews(); + } + } + + @Override + protected void onCreation() { + //overridden + } + + @Override + protected void onResumption() { + //Overridden + } + + public void setUpViews() { + clientName = findViewById(R.id.client_name); + careGiverName = findViewById(R.id.care_giver_name); + childName = findViewById(R.id.child_name); + careGiverPhone = findViewById(R.id.care_giver_phone); + clientReferralProblem = findViewById(R.id.client_referral_problem); + chwDetailsNames = findViewById(R.id.chw_details_names); + referralDate = findViewById(R.id.referral_date); + + womanGaLayout = findViewById(R.id.woman_ga_layout); + careGiverLayout = findViewById(R.id.care_giver_name_layout); + childNameLayout = findViewById(R.id.child_name_layout); + + womanGa = findViewById(R.id.woman_ga); + CustomFontTextView viewProfile = findViewById(R.id.view_profile); + + CustomFontTextView markAskDone = findViewById(R.id.mark_ask_done); + markAskDone.setOnClickListener(this); + + if (getStartingActivity().equals(CoreConstants.REGISTERED_ACTIVITIES.REFERRALS_REGISTER_ACTIVITY)) { + viewProfile.setOnClickListener(this); + } else { + viewProfile.setVisibility(View.INVISIBLE); + } + getReferralDetails(); + + ((CustomFontTextView) findViewById(R.id.toolbar_title)).setText(getResources().getString(R.string.return_to_all_anc_women)); + ((CustomFontTextView) findViewById(R.id.mark_ask_done)).setText(getResources().getString(R.string.pregnancy_confirmation)); + findViewById(R.id.view_profile).setVisibility(GONE); + } + + public void setStartingActivity(String startingActivity) { + this.startingActivity = startingActivity; + } + + public String getBaseEntityId() { + return task.getForEntity(); + } + + @Override + protected void getReferralDetails() { + super.getReferralDetails(); + careGiverPhone.setText(StringUtils.isBlank(CLIENT_PHONE_NUMBER) ? getString(org.smartregister.chw.core.R.string.phone_not_provided) : CLIENT_PHONE_NUMBER); + } + + @Override + public void onClick(View view) { + if (view.getId() == R.id.view_profile) { + personObjectClient.getDetails().put(OpdDbConstants.KEY.REGISTER_TYPE, mapTaskFocusToRegisterType()); + AllClientsUtils.goToClientProfile(this, personObjectClient); + } else if (view.getId() == R.id.mark_ask_done) { + AncRegisterActivity.startAncRegistrationActivity(PregnancyConfirmationViewActivity.this, getBaseEntityId(), getFamilyMemberContacts(), + CoreConstants.JSON_FORM.ANC_PREGNANCY_CONFIRMATION, null, getBaseEntityId(), name, task.getIdentifier()); + } + } + + @NonNull + private String mapTaskFocusToRegisterType() { + switch (task.getFocus()) { + case CoreConstants.TASKS_FOCUS.SICK_CHILD: + return CoreConstants.REGISTER_TYPE.CHILD; + case CoreConstants.TASKS_FOCUS.SUSPECTED_MALARIA: + return CoreConstants.REGISTER_TYPE.MALARIA; + case CoreConstants.TASKS_FOCUS.ANC_DANGER_SIGNS: + return CoreConstants.REGISTER_TYPE.ANC; + case CoreConstants.TASKS_FOCUS.PNC_DANGER_SIGNS: + return CoreConstants.REGISTER_TYPE.PNC; + case CoreConstants.TASKS_FOCUS.FP_SIDE_EFFECTS: + return CoreConstants.REGISTER_TYPE.FAMILY_PLANNING; + default: + return ""; + } + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReferralRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReferralRegisterActivity.java index a4208b20f..a1907f477 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReferralRegisterActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReferralRegisterActivity.java @@ -1,14 +1,21 @@ package org.smartregister.chw.hf.activity; -import android.content.Intent; +import android.view.MenuItem; + +import androidx.annotation.NonNull; +import androidx.fragment.app.Fragment; + +import com.google.android.material.bottomnavigation.BottomNavigationView; import org.smartregister.chw.core.activity.BaseReferralRegister; import org.smartregister.chw.core.presenter.BaseReferralPresenter; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.fragment.IssuedReferralsRegisterFragment; import org.smartregister.chw.hf.fragment.ReferralRegisterFragment; import org.smartregister.helper.BottomNavigationHelper; import org.smartregister.view.fragment.BaseRegisterFragment; -public class ReferralRegisterActivity extends BaseReferralRegister { +public class ReferralRegisterActivity extends BaseReferralRegister implements BottomNavigationView.OnNavigationItemSelectedListener { @Override protected void onDestroy() { @@ -26,16 +33,31 @@ protected BaseRegisterFragment getRegisterFragment() { } @Override - public void switchToBaseFragment() { - Intent intent = new Intent(this, FamilyRegisterActivity.class); - startActivity(intent); - finish(); + protected Fragment[] getOtherFragments() { + return new IssuedReferralsRegisterFragment[]{new IssuedReferralsRegisterFragment()}; } @Override protected void registerBottomNavigation() { bottomNavigationHelper = new BottomNavigationHelper(); bottomNavigationView = findViewById(org.smartregister.R.id.bottom_navigation); - FamilyRegisterActivity.registerBottomNavigation(bottomNavigationHelper, bottomNavigationView, this); + bottomNavigationView.getMenu().clear(); + + bottomNavigationView.inflateMenu(R.menu.referrals_bottom_nav_menu); + bottomNavigationView.getMenu().removeItem(R.id.action_completed_referrals); + bottomNavigationView.setOnNavigationItemSelectedListener(this); + + } + + @Override + public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) { + if (menuItem.getItemId() == R.id.action_home) { + switchToFragment(0); + return true; + } else if (menuItem.getItemId() == R.id.action_issued_referrals) { + switchToFragment(1); + return true; + } else + return false; } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReferralRegistrationActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReferralRegistrationActivity.java new file mode 100644 index 000000000..6e08017bd --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReferralRegistrationActivity.java @@ -0,0 +1,100 @@ +package org.smartregister.chw.hf.activity; + +import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.custom_views.NavigationMenu; +import org.smartregister.chw.hf.presenter.IssueReferralActivityPresenter; +import org.smartregister.chw.referral.activity.BaseIssueReferralActivity; +import org.smartregister.chw.referral.contract.BaseIssueReferralContract; +import org.smartregister.chw.referral.interactor.BaseIssueReferralInteractor; +import org.smartregister.chw.referral.model.BaseIssueReferralModel; +import org.smartregister.chw.referral.presenter.BaseIssueReferralPresenter; +import org.smartregister.chw.referral.util.Constants; +import org.smartregister.dao.LocationsDao; +import org.smartregister.domain.Location; +import org.smartregister.family.util.JsonFormUtils; + +import java.util.Collections; +import java.util.List; + +import timber.log.Timber; + +public class ReferralRegistrationActivity extends BaseIssueReferralActivity { + private static String BASE_ENTITY_ID; + + public static void startGeneralReferralFormActivityForResults(Activity activity, String baseEntityID, JSONObject formJsonObject, boolean useCustomLayout) { + BASE_ENTITY_ID = baseEntityID; + Intent intent = new Intent(activity, ReferralRegistrationActivity.class); + intent.putExtra(Constants.ActivityPayload.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(Constants.ActivityPayload.JSON_FORM, formJsonObject.toString()); + intent.putExtra(Constants.ActivityPayload.ACTION, Constants.ActivityPayloadType.REGISTRATION); + intent.putExtra(Constants.ActivityPayload.USE_CUSTOM_LAYOUT, useCustomLayout); + activity.startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + NavigationMenu.getInstance(this, null, null); + } + +// @Override + public void initializeHealthFacilitiesList(JSONObject form) { + //overrides and loads the list of chw under that facility + JSONArray steps; + List locationList = LocationsDao.getLocationsByTags(Collections.singleton(SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS)); + try { + JSONArray options = new JSONArray(); + for (Location location : locationList) { + JSONObject option = new JSONObject(); + option.put("name", StringUtils.capitalize(location.getProperties().getName())); + option.put("text", StringUtils.capitalize(location.getProperties().getName())); + JSONObject metaData = new JSONObject(); + metaData.put("openmrs_entity", "location_uuid"); + metaData.put("openmrs_entity_id", location.getProperties().getUid()); + option.put("meta_data", metaData); + + options.put(option); + } + + steps = form.getJSONArray("steps"); + JSONObject step = steps.getJSONObject(0); + JSONArray fields = step.getJSONArray("fields"); + int i = 0; + int j = 0; + int fieldCount = fields.length(); + int optionCount = options.length(); + while (i < fieldCount) { + JSONObject field = fields.getJSONObject(i); + if (field.getString("name").equals("chw_referral_hf")) { + JSONArray optionsArr = field.getJSONArray("options"); + while (j < optionCount) { + optionsArr.put(options.get(j)); + j++; + } + break; + } + i++; + } + } catch (JSONException e) { + Timber.e(e); + } + } + + @NotNull + @Override + public BaseIssueReferralPresenter presenter() { + return new IssueReferralActivityPresenter(BASE_ENTITY_ID, (BaseIssueReferralContract.View) this, + BaseIssueReferralModel.class, (BaseIssueReferralContract.Interactor) new BaseIssueReferralInteractor()); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReferralTaskViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReferralTaskViewActivity.java index ffe6a7a85..810671528 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReferralTaskViewActivity.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReferralTaskViewActivity.java @@ -1,5 +1,7 @@ package org.smartregister.chw.hf.activity; +import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; + import android.app.Activity; import android.app.AlertDialog; import android.content.Intent; @@ -34,8 +36,6 @@ import timber.log.Timber; -import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; - public class ReferralTaskViewActivity extends BaseReferralTaskViewActivity implements View.OnClickListener { public static void startReferralTaskViewActivity(Activity activity, CommonPersonObjectClient personObjectClient, Task task, String startingActivity) { diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReferralsDetailsViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReferralsDetailsViewActivity.java new file mode 100644 index 000000000..0922cfbf0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReferralsDetailsViewActivity.java @@ -0,0 +1,338 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.Period; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.LTFUFeedbackDao; +import org.smartregister.chw.referral.activity.ReferralDetailsViewActivity; +import org.smartregister.chw.referral.domain.MemberObject; +import org.smartregister.chw.referral.util.Constants; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.domain.Location; +import org.smartregister.domain.Task; +import org.smartregister.repository.LocationRepository; +import org.smartregister.view.customcontrols.CustomFontTextView; + +import java.math.BigDecimal; +import java.sql.Date; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Locale; + +import timber.log.Timber; + +public class ReferralsDetailsViewActivity extends ReferralDetailsViewActivity { + private static CommonPersonObjectClient client; + private static Task task; + private static boolean isSuccessfulReferral = false; + private final SimpleDateFormat dateFormatter = new SimpleDateFormat("dd MMM yyyy", Locale.getDefault()); + private CustomFontTextView clientName; + private CustomFontTextView careGiverName; + private CustomFontTextView careGiverPhone; + private CustomFontTextView clientReferralProblem; + private CustomFontTextView referralDate; + private CustomFontTextView referralFacility; + private LinearLayout feedBackReasonsLayout; + private CustomFontTextView feedBackReasons; + private LinearLayout dateOfDeathLayout; + private CustomFontTextView dateOfDeath; + private LinearLayout returnDateLayout; + private CustomFontTextView returnDate; + private CustomFontTextView feedBackDate; + private CustomFontTextView feedBackFollowupStatus; + private CustomFontTextView referralType; + + public static void startReferralsDetailsViewActivity(Activity activity, MemberObject memberObject, CommonPersonObjectClient client) { + Intent intent = new Intent(activity, ReferralsDetailsViewActivity.class); + intent.putExtra(Constants.ReferralMemberObject.MEMBER_OBJECT, memberObject); + ReferralsDetailsViewActivity.client = client; + task = null; + isSuccessfulReferral = false; + activity.startActivity(intent); + } + + public static void startSuccessfulReferralDetailsViewActivity(Activity activity, MemberObject memberObject, CommonPersonObjectClient client, Task passedTask) { + Intent intent = new Intent(activity, ReferralsDetailsViewActivity.class); + intent.putExtra(Constants.ReferralMemberObject.MEMBER_OBJECT, memberObject); + ReferralsDetailsViewActivity.client = client; + task = passedTask; + isSuccessfulReferral = true; + activity.startActivity(intent); + } + + @Override + protected void onCreation() { + setContentView(R.layout.referral_details_activity); + inflateToolbar(); + setupViews(); + } + + private void inflateToolbar() { + Toolbar toolbar = findViewById(R.id.back_referrals_toolbar); + CustomFontTextView toolBarTextView = toolbar.findViewById(R.id.toolbar_title); + setSupportActionBar(toolbar); + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + Drawable upArrow = getResources().getDrawable(R.drawable.ic_arrow_back_white_24dp); + upArrow.setColorFilter(getResources().getColor(R.color.text_blue), PorterDuff.Mode.SRC_ATOP); + actionBar.setHomeAsUpIndicator(upArrow); + } + toolbar.setNavigationOnClickListener(v -> finish()); + toolBarTextView.setText(R.string.back_to_referrals); + toolBarTextView.setOnClickListener(v -> finish()); + appBarLayout = findViewById(R.id.app_bar); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) + appBarLayout.setOutlineProvider(null); + } + + private void setupViews() { + clientName = findViewById(R.id.client_name); + careGiverName = findViewById(R.id.care_giver_name); + careGiverPhone = findViewById(R.id.care_giver_phone); + clientReferralProblem = findViewById(R.id.client_referral_problem); + referralDate = findViewById(R.id.referral_date); + referralFacility = findViewById(R.id.referral_facility); + referralType = findViewById(R.id.referral_type); + + LinearLayout feedBackDetailsLayout = findViewById(R.id.referral_details_feedback); + feedBackDate = findViewById(R.id.feedback_date); + feedBackFollowupStatus = findViewById(R.id.feedback_followup_status); + feedBackReasonsLayout = findViewById(R.id.feedback_reasons_layout); + feedBackReasons = findViewById(R.id.feedback_reasons); + dateOfDeathLayout = findViewById(R.id.date_of_death_layout); + dateOfDeath = findViewById(R.id.date_of_death); + returnDateLayout = findViewById(R.id.return_date_layout); + returnDate = findViewById(R.id.return_date); + + ViewGroup problemLayout = findViewById(R.id.client_referral_problem_layout); + ViewGroup preManagementServicesServices = findViewById(R.id.client_pre_referral_management_layout); + preManagementServicesServices.setVisibility(View.GONE); + problemLayout.setVisibility(View.VISIBLE); + MemberObject memberObject = new MemberObject(client); + if (memberObject.getReferralType().equalsIgnoreCase("LTFU")) { + CustomFontTextView problemLabel = findViewById(R.id.client_referral_problem_label); + problemLabel.setText(R.string.referral_clinic); + + CustomFontTextView referralVillageLabel = findViewById(R.id.referral_facility_label); + referralVillageLabel.setText(R.string.referral_village); + } + + obtainReferralDetails(); + + + if (isSuccessfulReferral) { + obtainFeedbackDetails(); + feedBackDetailsLayout.setVisibility(View.VISIBLE); + } else { + feedBackDetailsLayout.setVisibility(View.GONE); + } + } + + private void obtainFeedbackDetails() { + //TODO: implement inflating of strings from strings.xml + Date feedbackDate = LTFUFeedbackDao.getFeedBackDate(task.getIdentifier()); + String followupStatus = LTFUFeedbackDao.getFollowupStatus(task.getIdentifier()); + + if (feedbackDate != null) { + feedBackDate.setText(dateFormatter.format(feedbackDate)); + } + + if (followupStatus != null) { + feedBackFollowupStatus.setText(getTranslatedFollowupStatus(followupStatus, this)); + } + + if (followupStatus != null && followupStatus.equalsIgnoreCase("client_found_ready_to_return")) { + feedBackReasonsLayout.setVisibility(View.VISIBLE); + String reasons = LTFUFeedbackDao.getReasonsForMissedAppointment(task.getIdentifier()); + if (reasons != null) { + feedBackReasons.setText(getTranslatedReasonsForMissedAppointment(reasons, this)); + } + returnDateLayout.setVisibility(View.VISIBLE); + returnDate.setText(dateFormatter.format(LTFUFeedbackDao.getReferralAppointmentDate(task.getIdentifier()))); + } + + if (followupStatus != null && followupStatus.equalsIgnoreCase("deceased")) { + dateOfDeathLayout.setVisibility(View.VISIBLE); + dateOfDeath.setText(dateFormatter.format(LTFUFeedbackDao.getDateOfDeath(task.getIdentifier()))); + } + + if (followupStatus != null && followupStatus.equalsIgnoreCase("client_not_found")) { + feedBackReasonsLayout.setVisibility(View.VISIBLE); + String reasons = LTFUFeedbackDao.getReasonClientNotFound(task.getIdentifier()); + if (reasons != null) { + feedBackReasons.setText(getTranslatedReasonClientNotFound(reasons, this)); + } + } + + + } + + private void obtainReferralDetails() { + + MemberObject memberObject = new MemberObject(client); + + clientReferralProblem.setText(getReferralClinic(memberObject.getProblem(), this)); + + int clientAge = new Period(new DateTime(memberObject.getAge()), new DateTime()).getYears(); + clientName.setText(String.format(Locale.getDefault(), "%s %s %s, %d", memberObject.getFirstName(), memberObject.getMiddleName(), memberObject.getLastName(), clientAge)); + + + Calendar referralDateCalendar = Calendar.getInstance(); + referralDateCalendar.setTimeInMillis(new BigDecimal(memberObject.getChwReferralDate()).longValue()); + + referralDate.setText(dateFormatter.format(referralDateCalendar.getTime())); + + setReferralFacility(memberObject); + + referralType.setText(memberObject.getReferralType()); + + if (!StringUtils.isNotBlank(memberObject.getPrimaryCareGiver()) && clientAge < 5) { + careGiverName.setText(String.format("CG : %s", memberObject.getPrimaryCareGiver())); + } else { + careGiverName.setVisibility(View.GONE); + } + + if (!StringUtils.isNotBlank(getContacts(memberObject))) { + careGiverPhone.setText(getString(R.string.phone_not_provided)); + } else { + careGiverPhone.setText(getContacts(memberObject)); + } + + } + + private void setReferralFacility(MemberObject memberObject) { + String locationId = memberObject.getChwReferralHf(); + LocationRepository locationRepository = new LocationRepository(); + Location location = locationRepository.getLocationById(locationId); + if (location != null) { + referralFacility.setText(location.getProperties().getName()); + } else { + referralFacility.setText(locationId); + } + } + + private String getReferralClinic(String key, Context context) { + try { + switch (key.toLowerCase()) { + case "ctc": + return context.getString(R.string.ltfu_clinic_ctc); + case "pwid": + return context.getString(R.string.ltfu_clinic_pwid); + case "prep": + return context.getString(R.string.ltfu_clinic_prep); + case "pmtct": + return context.getString(R.string.ltfu_clinic_pmtct); + case "tb": + return context.getString(R.string.ltfu_clinic_tb); + default: + return removeSquareBrackets(key); + } + }catch (Exception e){ + Timber.e(e); + } + return ""; + } + + private String removeSquareBrackets(String text){ + if(text.startsWith("[") && text.endsWith("]")){ + return text.substring(1, text.length() - 1).toUpperCase(); + } + return text.toUpperCase(); + } + + private String getTranslatedFollowupStatus(String key, Context context) { + switch (key.toLowerCase()) { + case "continuing_with_services": + return context.getString(R.string.ltfu_followup_status_continuing_with_services); + case "client_found_ready_to_return": + return context.getString(R.string.ltfu_followup_status_client_found_ready_to_return); + case "client_found_and_has_returned_to_clinic": + return context.getString(R.string.ltfu_followup_status_client_found_and_has_returned_to_clinic); + case "client_has_moved_to_another_facility": + return context.getString(R.string.ltfu_followup_status_client_has_moved_to_another_facility); + case "client_has_relocated": + return context.getString(R.string.ltfu_followup_status_client_has_relocated); + case "client_does_not_want_to_return": + return context.getString(R.string.ltfu_followup_status_client_does_not_want_to_return); + case "deceased": + return context.getString(R.string.ltfu_followup_status_deceased); + case "client_not_found": + return context.getString(R.string.ltfu_followup_status_client_not_found); + default: + return key.toUpperCase(); + } + } + + private String getTranslatedReasonsForMissedAppointment(String key, Context context) { + switch (key.toLowerCase()) { + case "client_has_forgotten": + return context.getString(R.string.ltfu_reasons_for_missed_appointment_client_has_forgotten); + case "client_was_ill": + return context.getString(R.string.ltfu_reasons_for_missed_appointment_client_was_ill); + case "client_failed_to_disclose_his_status": + return context.getString(R.string.ltfu_reasons_for_missed_appointment_client_failed_to_disclose_his_status); + case "client_did_not_have_fare": + return context.getString(R.string.ltfu_reasons_for_missed_appointment_client_did_not_have_fare); + case "client_lives_far_away_from_the_health_facility": + return context.getString(R.string.ltfu_reasons_for_missed_appointment_client_lives_far_away_from_the_health_facility); + case "client_feels_well": + return context.getString(R.string.ltfu_reasons_for_missed_appointment_client_feels_well); + case "client_was_busy_at_work": + return context.getString(R.string.ltfu_reasons_for_missed_appointment_client_was_busy_at_work); + case "client_traveled": + return context.getString(R.string.ltfu_reasons_for_missed_appointment_client_traveled); + case "client_uses_alternative_medicine": + return context.getString(R.string.ltfu_reasons_for_missed_appointment_client_uses_alternative_medicine); + case "poor_services_at_health_facility": + return context.getString(R.string.ltfu_reasons_for_missed_appointment_poor_services_at_health_facility); + default: + return key.toUpperCase(); + } + } + + private String getTranslatedReasonClientNotFound(String key, Context context) { + switch (key.toLowerCase()) { + case "address_incorrect": + return context.getString(R.string.ltfu_reason_client_not_found_address_incorrect); + case "client_relocated": + return context.getString(R.string.ltfu_reason_client_not_found_client_relocated); + case "seasonal_work": + return context.getString(R.string.ltfu_reason_client_not_found_seasonal_work); + default: + return key.toUpperCase(); + } + } + + private String getContacts(MemberObject memberObject) { + String phoneNumber = ""; + String familyPhoneNumber = memberObject.getPhoneNumber(); + String familyOtherPhoneNumber = memberObject.getOtherPhoneNumber(); + + if (StringUtils.isNotBlank(familyPhoneNumber)) { + phoneNumber = familyPhoneNumber; + } + if (StringUtils.isNotBlank(familyOtherPhoneNumber)) { + phoneNumber = familyOtherPhoneNumber; + } + if (StringUtils.isNotBlank(familyPhoneNumber) && StringUtils.isNotBlank(familyOtherPhoneNumber)) { + phoneNumber = familyPhoneNumber + ", " + familyOtherPhoneNumber; + } + + return phoneNumber; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReportsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReportsActivity.java new file mode 100644 index 000000000..45ffca96d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/ReportsActivity.java @@ -0,0 +1,141 @@ +package org.smartregister.chw.hf.activity; + +import android.content.Intent; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.view.Menu; +import android.view.View; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; +import androidx.constraintlayout.widget.ConstraintLayout; + +import com.google.android.material.appbar.AppBarLayout; + +import org.smartregister.chw.core.job.ChwIndicatorGeneratingJob; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.R; +import org.smartregister.view.activity.SecuredActivity; +import org.smartregister.view.customcontrols.CustomFontTextView; + +public class ReportsActivity extends SecuredActivity implements View.OnClickListener { + protected CustomFontTextView toolBarTextView; + protected AppBarLayout appBarLayout; + protected ConstraintLayout pmtctReportsLayout; + protected ConstraintLayout ancReportsLayout; + protected ConstraintLayout pncReportsLayout; + protected ConstraintLayout cbhsReportsLayout; + protected ConstraintLayout ltfuSummaryLayout; + protected ConstraintLayout ldReportsLayout; + protected ConstraintLayout motherChampionReportsLayout; + protected ConstraintLayout selfTestingReports; + protected ConstraintLayout condomDistributionReports; + protected ConstraintLayout kvpReports; + + @Override + protected void onCreation() { + ChwIndicatorGeneratingJob.scheduleJobImmediately(ChwIndicatorGeneratingJob.TAG); + setContentView(R.layout.activity_reports); + setUpToolbar(); + setUpViews(); + } + + public void setUpViews() { + pmtctReportsLayout = findViewById(R.id.pmtct_reports); + ancReportsLayout = findViewById(R.id.anc_reports); + pncReportsLayout = findViewById(R.id.pnc_reports); + cbhsReportsLayout = findViewById(R.id.cbhs_reports); + ltfuSummaryLayout = findViewById(R.id.ltfu_summary); + ldReportsLayout = findViewById(R.id.ld_reports); + motherChampionReportsLayout = findViewById(R.id.mother_champion_reports); + selfTestingReports = findViewById(R.id.self_testing_reports); + condomDistributionReports = findViewById(R.id.cdp_reports); + kvpReports = findViewById(R.id.kvp_reports); + + if (HealthFacilityApplication.getApplicationFlavor().hasLD()) + ldReportsLayout.setVisibility(View.VISIBLE); + + if (HealthFacilityApplication.getApplicationFlavor().hasHivst()) + selfTestingReports.setVisibility(View.VISIBLE); + + if (HealthFacilityApplication.getApplicationFlavor().hasCdp()) + condomDistributionReports.setVisibility(View.VISIBLE); + + if (HealthFacilityApplication.getApplicationFlavor().hasKvpPrEP()) + kvpReports.setVisibility(View.VISIBLE); + + + pmtctReportsLayout.setOnClickListener(this); + ancReportsLayout.setOnClickListener(this); + pncReportsLayout.setOnClickListener(this); + cbhsReportsLayout.setOnClickListener(this); + ltfuSummaryLayout.setOnClickListener(this); + ldReportsLayout.setOnClickListener(this); + motherChampionReportsLayout.setOnClickListener(this); + selfTestingReports.setOnClickListener(this); + condomDistributionReports.setOnClickListener(this); + kvpReports.setOnClickListener(this); + } + + public void setUpToolbar() { + Toolbar toolbar = findViewById(org.smartregister.chw.core.R.id.back_to_nav_toolbar); + toolBarTextView = toolbar.findViewById(org.smartregister.chw.core.R.id.toolbar_title); + setSupportActionBar(toolbar); + + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + final Drawable upArrow = getResources().getDrawable(org.smartregister.chw.core.R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setElevation(0); + } + toolbar.setNavigationOnClickListener(v -> finish()); + toolBarTextView.setText(R.string.reports_title); + toolBarTextView.setOnClickListener(v -> finish()); + appBarLayout = findViewById(org.smartregister.chw.core.R.id.app_bar); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + appBarLayout.setOutlineProvider(null); + } + } + + @Override + protected void onResumption() { + //overridden + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + return false; + } + + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.anc_reports) { + startActivity(new Intent(this, AncReportsActivity.class)); + } else if (id == R.id.pmtct_reports) { + startActivity(new Intent(this, PmtctReportsActivity.class)); + } else if (id == R.id.pnc_reports) { + startActivity(new Intent(this, PncReportsActivity.class)); + } else if (id == R.id.cbhs_reports) { + startActivity(new Intent(this, CbhsReportsActivity.class)); + } else if (id == R.id.ltfu_summary) { + startActivity(new Intent(this, LtfuSummaryActivity.class)); + } else if (id == R.id.ld_reports) { + startActivity(new Intent(this, LdReportsActivity.class)); + } else if (id == R.id.mother_champion_reports) { + startActivity(new Intent(this, MotherChampionReportsActivity.class)); + } else if (id == R.id.self_testing_reports) { + Intent intent = new Intent(this, SelfTestingReportsActivity.class); + startActivity(intent); + } + else if (id==R.id.cdp_reports){ + Intent intent = new Intent(this, CdpReportsActivity.class); + startActivity(intent); + } + else if (id==R.id.kvp_reports){ + Intent intent = new Intent(this, KvpReportsActivity.class); + startActivity(intent); + } + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/RequestPhoneNumberCollectionPermission.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/RequestPhoneNumberCollectionPermission.java new file mode 100644 index 000000000..fb789b507 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/RequestPhoneNumberCollectionPermission.java @@ -0,0 +1,72 @@ +package org.smartregister.chw.hf.activity; + +import android.Manifest; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.os.Build; +import android.os.Bundle; +import android.view.View; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; +import androidx.fragment.app.FragmentActivity; + +import org.smartregister.chw.hf.R; + +public class RequestPhoneNumberCollectionPermission extends FragmentActivity { + private static final int READ_PHONE_NUMBERS_PERMISSION_CODE = 100; + + @Override + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + if (requestCode == READ_PHONE_NUMBERS_PERMISSION_CODE) { + if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { + Toast.makeText(RequestPhoneNumberCollectionPermission.this, "Read Phone Number Permission Granted", Toast.LENGTH_SHORT).show(); + startLoginActivity(); + } else { + Toast.makeText(RequestPhoneNumberCollectionPermission.this, "Read Phone Number Permission Not Granted", Toast.LENGTH_SHORT).show(); + } + } + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && ContextCompat.checkSelfPermission(RequestPhoneNumberCollectionPermission.this, + Manifest.permission.READ_PHONE_NUMBERS) == PackageManager.PERMISSION_GRANTED) { + startLoginActivity(); + }else if (ContextCompat.checkSelfPermission(RequestPhoneNumberCollectionPermission.this, + Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) { + startLoginActivity(); + } + setContentView(R.layout.activity_request_call_phone_permission); + } + + public void onClickNoThanks(View view) { + finish(); + } + + public void onClickGrant(View view) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + checkPermission(Manifest.permission.READ_PHONE_NUMBERS, READ_PHONE_NUMBERS_PERMISSION_CODE); + } else { + checkPermission(Manifest.permission.READ_PHONE_STATE, READ_PHONE_NUMBERS_PERMISSION_CODE); + } + } + + public void checkPermission(String permission, int requestCode) { + if (ContextCompat.checkSelfPermission(RequestPhoneNumberCollectionPermission.this, permission) == PackageManager.PERMISSION_DENIED) { + ActivityCompat.requestPermissions(RequestPhoneNumberCollectionPermission.this, new String[]{permission}, requestCode); + } else { + Toast.makeText(RequestPhoneNumberCollectionPermission.this, "Permission already granted", Toast.LENGTH_SHORT).show(); + } + } + + public void startLoginActivity() { + Intent intent = new Intent(RequestPhoneNumberCollectionPermission.this, LoginActivity.class); + startActivity(intent); + finish(); + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/SelfTestingReportsActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/SelfTestingReportsActivity.java new file mode 100644 index 000000000..f68e42496 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/SelfTestingReportsActivity.java @@ -0,0 +1,102 @@ +package org.smartregister.chw.hf.activity; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.widget.TextView; + +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.widget.Toolbar; + +import com.whiteelephant.monthpicker.MonthPickerDialog; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.ReportUtils; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; + +import timber.log.Timber; + + +public class SelfTestingReportsActivity extends PncReportsActivity{ + @Override + public void onClick(View v) { + int id = v.getId(); + if (id == R.id.pnc_monthly_report) { + SelfTestingReportsViewActivity.startMe(this, Constants.ReportConstants.ReportPaths.SELF_TESTING_REPORT_PATH, reportPeriod); + } + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int itemId = item.getItemId(); + if (itemId == R.id.action_select_month) { + showMonthPicker(this, menu); + return true; + } + return super.onOptionsItemSelected(item); + } + + @Override + public void setUpToolbar() { + super.setUpToolbar(); + TextView title = findViewById(R.id.toolbar_title); + title.setText(R.string.selftesting_reports); + + Toolbar toolbar = findViewById(org.smartregister.chw.core.R.id.back_to_nav_toolbar); + setSupportActionBar(toolbar); + + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + final Drawable upArrow = getResources().getDrawable(org.smartregister.chw.core.R.drawable.ic_arrow_back_white_24dp); + actionBar.setHomeAsUpIndicator(upArrow); + actionBar.setElevation(0); + } + toolbar.setNavigationOnClickListener(v -> finish()); + appBarLayout = findViewById(org.smartregister.chw.core.R.id.app_bar); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + appBarLayout.setOutlineProvider(null); + } + } + + private void showMonthPicker(Context context, Menu menu) { + //shows the month picker and returns selected period and updated the menu + MonthPickerDialog.Builder builder = new MonthPickerDialog.Builder(context, (selectedMonth, selectedYear) -> { + int month = selectedMonth + 1; + String monthString = String.valueOf(month); + if (month < 10) { + monthString = "0" + monthString; + } + String yearString = String.valueOf(selectedYear); + reportPeriod = monthString + "-" + yearString; + menu.findItem(R.id.action_select_month).setTitle(ReportUtils.displayMonthAndYear(selectedMonth, selectedYear)); + + }, Calendar.getInstance().get(Calendar.YEAR), Calendar.getInstance().get(Calendar.MONTH)); + try { + Date reportDate = new SimpleDateFormat("MM-yyyy", Locale.getDefault()).parse(reportPeriod); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(reportDate); + builder.setActivatedMonth(calendar.get(Calendar.MONTH)); + builder.setMinYear(2021); + builder.setActivatedYear(calendar.get(Calendar.YEAR)); + builder.setMaxYear(Calendar.getInstance().get(Calendar.YEAR)); + builder.setMinMonth(Calendar.JANUARY); + builder.setMaxMonth(Calendar.DECEMBER); + builder.setTitle(getString(R.string.select_reporting_month_anc)); + builder.build().show(); + } catch (ParseException e) { + Timber.e(e); + } + + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/SelfTestingReportsViewActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/SelfTestingReportsViewActivity.java new file mode 100644 index 000000000..b87cc7c03 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/SelfTestingReportsViewActivity.java @@ -0,0 +1,19 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; + + +public class SelfTestingReportsViewActivity extends HfReportsViewActivity{ + public static void startMe(Activity activity, String reportPath, String reportDate) { + Intent intent = new Intent(activity, SelfTestingReportsViewActivity.class); + intent.putExtra(ARG_REPORT_PATH, reportPath); + intent.putExtra(ARG_REPORT_DATE, reportDate); + intent.putExtra(ARG_REPORT_TITLE, R.string.selftesting_reports_title); + intent.putExtra(ARG_REPORT_TYPE, Constants.ReportConstants.ReportTypes.SELF_TESTING_REPORT); + activity.startActivity(intent); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/TbProfileActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/TbProfileActivity.java new file mode 100644 index 000000000..3b951ae34 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/TbProfileActivity.java @@ -0,0 +1,217 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; + +import androidx.recyclerview.widget.RecyclerView; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.json.JSONException; +import org.smartregister.chw.core.activity.CoreTbProfileActivity; +import org.smartregister.chw.core.activity.CoreTbUpcomingServicesActivity; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.adapter.HivAndTbReferralCardViewAdapter; +import org.smartregister.chw.hf.contract.TbProfileContract; +import org.smartregister.chw.hf.interactor.HfTbProfileInteractor; +import org.smartregister.chw.hf.model.HivTbReferralTasksAndFollowupFeedbackModel; +import org.smartregister.chw.hf.presenter.TbProfilePresenter; +import org.smartregister.chw.tb.activity.BaseTbRegistrationFormsActivity; +import org.smartregister.chw.tb.domain.TbMemberObject; +import org.smartregister.chw.tb.util.Constants; +import org.smartregister.chw.tb.util.TbUtil; +import org.smartregister.commonregistry.CommonPersonObjectClient; + +import java.util.Date; +import java.util.List; + +import timber.log.Timber; + +public class TbProfileActivity extends CoreTbProfileActivity + implements TbProfileContract.View { + + private CommonPersonObjectClient commonPersonObjectClient; + + public static void startTbProfileActivity(Activity activity, TbMemberObject memberObject) { + Intent intent = new Intent(activity, TbProfileActivity.class); + intent.putExtra(Constants.ActivityPayload.MEMBER_OBJECT, memberObject); + activity.startActivity(intent); + } + + public void startTbFollowupActivity(Activity activity, String baseEntityID) throws JSONException { + Intent intent = new Intent(activity, BaseTbRegistrationFormsActivity.class); + intent.putExtra(Constants.ActivityPayload.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(Constants.ActivityPayload.JSON_FORM, (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, CoreConstants.JSON_FORM.getTbFollowupVisit()).toString()); + intent.putExtra(Constants.ActivityPayload.USE_DEFAULT_NEAT_FORM_LAYOUT, false); + + activity.startActivityForResult(intent, org.smartregister.chw.anc.util.Constants.REQUEST_CODE_HOME_VISIT); + } + + public void setReferralTasksAndFollowupFeedback(List tasksAndFollowupFeedbackModels) { + if (notificationAndReferralRecyclerView != null && tasksAndFollowupFeedbackModels.size() > 0) { + RecyclerView.Adapter mAdapter = new HivAndTbReferralCardViewAdapter(tasksAndFollowupFeedbackModels, this, getCommonPersonObjectClient(), CoreConstants.REGISTERED_ACTIVITIES.FP_REGISTER_ACTIVITY); + notificationAndReferralRecyclerView.setAdapter(mAdapter); + notificationAndReferralLayout.setVisibility(View.VISIBLE); + findViewById(R.id.view_notification_and_referral_row).setVisibility(View.VISIBLE); + } + } + + @Override + protected void onCreation() { + super.onCreation(); + setCommonPersonObjectClient(getClientDetailsByBaseEntityID(getTbMemberObject().getBaseEntityId())); + } + + @Override + protected void onResume() { + super.onResume(); + ((TbProfileContract.Presenter) getTbProfilePresenter()).fetchReferralTasks(); + if (notificationAndReferralRecyclerView != null && notificationAndReferralRecyclerView.getAdapter() != null) { + notificationAndReferralRecyclerView.getAdapter().notifyDataSetChanged(); + } + } + + public CommonPersonObjectClient getCommonPersonObjectClient() { + return commonPersonObjectClient; + } + + public void setCommonPersonObjectClient(CommonPersonObjectClient commonPersonObjectClient) { + this.commonPersonObjectClient = commonPersonObjectClient; + } + + @Override + protected void initializePresenter() { + showProgressBar(true); + setTbProfilePresenter(new TbProfilePresenter(this, new HfTbProfileInteractor(this), getTbMemberObject())); + fetchProfileData(); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + + int itemId = item.getItemId(); + try { + if (itemId == R.id.action_tb_outcome) { + TbRegisterActivity.startTbFormActivity(this, getTbMemberObject().getBaseEntityId(), CoreConstants.JSON_FORM.getTbOutcome(), (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, CoreConstants.JSON_FORM.getTbOutcome()).toString()); + return true; + } else if (itemId == R.id.action_issue_tb_community_followup_referral) { + TbRegisterActivity.startTbFormActivity(this, getTbMemberObject().getBaseEntityId(), CoreConstants.JSON_FORM.getTbCommunityFollowupReferral(), (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, CoreConstants.JSON_FORM.getTbCommunityFollowupReferral()).toString()); + return true; + } + + } catch (JSONException e) { + Timber.e(e); + } + + return super.onOptionsItemSelected(item); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(org.smartregister.chw.core.R.menu.tb_profile_menu, menu); + menu.findItem(R.id.action_tb_outcome).setVisible(true); + menu.findItem(R.id.action_issue_tb_community_followup_referral).setVisible(true); + return true; + } + + @Override + protected void removeMember() { + // Not required for HF (as seen in other profile activities)? + } + + @Override + protected void startTbCaseClosure() { + try { + TbRegisterActivity.startTbFormActivity(this, getTbMemberObject().getBaseEntityId(), CoreConstants.JSON_FORM.getTbCaseClosure(), (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, CoreConstants.JSON_FORM.getTbCaseClosure()).toString()); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public void onClick(View view) { + super.onClick(view); + int id = view.getId(); + if (id == R.id.record_tb_followup_visit) { + openFollowUpVisitForm(false); + } + } + + @Override + public Context getContext() { + return null; + } + + @Override + public void verifyHasPhone() { + // Implement + } + + @Override + public void notifyHasPhone(boolean b) { + // Implement + } + + @Override + public void openMedicalHistory() { + //TODO implement + } + + @Override + public void openTbRegistrationForm() { + try { + TbRegisterActivity.startTbFormActivity(this, getTbMemberObject().getBaseEntityId(), CoreConstants.JSON_FORM.getTbRegistration(), (new FormUtils()).getFormJsonFromRepositoryOrAssets(this, CoreConstants.JSON_FORM.getTbRegistration()).toString()); + } catch (JSONException e) { + Timber.e(e); + } + + } + + @Override + public void openUpcomingServices() { + CoreTbUpcomingServicesActivity.startMe(this, TbUtil.toMember(getTbMemberObject())); + } + + @Override + public void openFamilyDueServices() { + Intent intent = new Intent(this, FamilyProfileActivity.class); + + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_BASE_ENTITY_ID, getTbMemberObject().getFamilyBaseEntityId()); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_HEAD, getTbMemberObject().getFamilyHead()); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.PRIMARY_CAREGIVER, getTbMemberObject().getPrimaryCareGiver()); + intent.putExtra(org.smartregister.family.util.Constants.INTENT_KEY.FAMILY_NAME, getTbMemberObject().getFamilyName()); + + intent.putExtra(CoreConstants.INTENT_KEY.SERVICE_DUE, true); + startActivity(intent); + } + + @Override + public void openFollowUpVisitForm(boolean isEdit) { + if (!isEdit) { + try { + startTbFollowupActivity(this, getTbMemberObject().getBaseEntityId()); + } catch (JSONException e) { + Timber.e(e); + } + } + } + + + @Override + public void updateLastVisitRow(Date lastVisitDate) { + //overriding showing of last visit row + } + + @Override + public void setupFollowupVisitEditViews(boolean isWithin24Hours) { + //overriding setupFollowupVisitEditViews row + } + + +} + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/TbRegisterActivity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/TbRegisterActivity.java new file mode 100644 index 000000000..82f4e7a4b --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/activity/TbRegisterActivity.java @@ -0,0 +1,71 @@ +package org.smartregister.chw.hf.activity; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import com.google.android.material.bottomnavigation.LabelVisibilityMode; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.activity.CoreTbRegisterActivity; +import org.smartregister.chw.hf.custom_view.FacilityMenu; +import org.smartregister.chw.hf.fragment.TbFollowupFragment; +import org.smartregister.chw.hf.fragment.TbRegisterFragment; +import org.smartregister.chw.tb.fragment.BaseTbCommunityFollowupRegisterFragment; +import org.smartregister.chw.tb.fragment.BaseTbRegisterFragment; +import org.smartregister.helper.BottomNavigationHelper; +import org.smartregister.listener.BottomNavigationListener; + +public class TbRegisterActivity extends CoreTbRegisterActivity { + + public static void startTbFormActivity(Activity activity, String baseEntityID, String formName, String payloadType) { + Intent intent = new Intent(activity, TbRegisterActivity.class); + intent.putExtra(org.smartregister.chw.tb.util.Constants.ActivityPayload.BASE_ENTITY_ID, baseEntityID); + intent.putExtra(org.smartregister.chw.tb.util.Constants.ActivityPayload.ACTION, payloadType); + intent.putExtra(org.smartregister.chw.tb.util.Constants.ActivityPayload.TB_REGISTRATION_FORM_NAME, formName); + activity.startActivity(intent); + } + + @NotNull + @Override + protected BaseTbRegisterFragment getRegisterFragment() { + return new TbRegisterFragment(); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + FacilityMenu.getInstance(this, null, null); + } + + @NotNull + @Override + protected BaseTbCommunityFollowupRegisterFragment[] getOtherFragments() { + return new TbFollowupFragment[]{ + new TbFollowupFragment()}; + } + + @Override + protected void registerBottomNavigation() { + bottomNavigationHelper = new BottomNavigationHelper(); + bottomNavigationView = findViewById(org.smartregister.R.id.bottom_navigation); + + if (bottomNavigationView != null) { + bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_clients); + bottomNavigationView.getMenu().removeItem(org.smartregister.chw.tb.R.id.action_register); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_search); + bottomNavigationView.getMenu().removeItem(org.smartregister.R.id.action_library); + bottomNavigationView.getMenu().removeItem(org.smartregister.chw.tb.R.id.action_received_referrals); + + bottomNavigationView.inflateMenu(getMenuResource()); + bottomNavigationHelper.disableShiftMode(bottomNavigationView); + + BottomNavigationListener tbBottomNavigationListener = getBottomNavigation(this); + bottomNavigationView.setOnNavigationItemSelectedListener(tbBottomNavigationListener); + + } + } + +} + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/adapter/FamilyMemberAdapter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/adapter/FamilyMemberAdapter.java new file mode 100644 index 000000000..3f8a077ca --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/adapter/FamilyMemberAdapter.java @@ -0,0 +1,231 @@ +package org.smartregister.chw.hf.adapter; + + +import static org.smartregister.chw.core.utils.CoreReferralUtils.getCommonRepository; +import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; + +import android.app.Activity; +import android.app.ProgressDialog; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.ImageView; +import android.widget.TextView; + +import org.joda.time.DateTime; +import org.smartregister.chw.core.dao.AncDao; +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.AllClientsMemberProfileActivity; +import org.smartregister.chw.hf.activity.FamilyOtherMemberProfileActivity; +import org.smartregister.chw.hf.dao.HfPncDao; +import org.smartregister.chw.hf.dao.LDDao; +import org.smartregister.chw.hf.domain.Entity; +import org.smartregister.chw.hf.utils.AllClientsUtils; +import org.smartregister.chw.hf.utils.PullEventClientRecordUtil; +import org.smartregister.chw.pmtct.util.PmtctUtil; +import org.smartregister.commonregistry.CommonPersonObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.event.Listener; +import org.smartregister.family.util.Constants; +import org.smartregister.family.util.DBConstants; +import org.smartregister.family.util.Utils; +import org.smartregister.helper.ImageRenderHelper; + +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +public class FamilyMemberAdapter extends ArrayAdapter { + private boolean isLocal = false; + + public FamilyMemberAdapter(Context context, List members, boolean isLocal) { + super(context, 0, members); + this.isLocal = isLocal; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + // Get the data item for this position + Entity member = getItem(position); + // Check if an existing view is being reused, otherwise inflate the view + if (convertView == null) { + convertView = LayoutInflater.from(getContext()).inflate(R.layout.family_member_register_list_row, parent, false); + } + + // Lookup view for data population + TextView tvName = convertView.findViewById(R.id.patient_name_age); + TextView tvGender = convertView.findViewById(R.id.gender); + ImageView profile = convertView.findViewById(org.smartregister.family.R.id.profile); + // Populate the data into the template view using the data object + String fullName = String.format(Locale.getDefault(), "%s %s %s, %s", isNull(member.getFirstName()), isNull(member.getMiddleName()), isNull(member.getLastName()), getAge(member.getBirthdate())); + tvName.setText(fullName); + + tvGender.setText(PmtctUtil.getGenderTranslated(getContext(), member.getGender())); + new ImageRenderHelper(getContext()).refreshProfileImage("8e3738ba-c510-44ba-92d2-49e3938d2415", profile, + Utils.getMemberProfileImageResourceIDentifier("")); + + convertView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + String familyId = member.getFamilyId(); + CommonPersonObject patient = null; + if (familyId != null) { + Log.d("Family", familyId); + patient = Utils.context().commonrepository(Utils.metadata().familyRegister.tableName) + .findByCaseID(familyId); + } + if (isLocal && patient != null) { + // show family profile + Intent intent = new Intent(getContext(), Utils.metadata().profileActivity); + intent.putExtra("family_base_entity_id", patient.getCaseId()); + intent.putExtra("family_head", + Utils.getValue(patient.getColumnmaps(), "family_head", false)); + intent.putExtra("primary_caregiver", + Utils.getValue(patient.getColumnmaps(), "primary_caregiver", false)); + intent.putExtra("village_town", + Utils.getValue(patient.getColumnmaps(), "village_town", false)); + intent.putExtra("family_name", + Utils.getValue(patient.getColumnmaps(), "first_name", false)); + intent.putExtra("go_to_due_page", false); + getContext().startActivity(intent); + } else { + // check if member exists locally + CommonPersonObject personObject = getCommonRepository(Utils.metadata().familyMemberRegister.tableName).findByBaseEntityId(member.getBaseEntityId()); + + if (personObject == null) { + // pull client record from server + ProgressDialog progressDialog = new ProgressDialog(getContext()); + progressDialog.setCancelable(false); + PullEventClientRecordUtil.pullEventClientRecord(member.getBaseEntityId(), pullEventClientRecordListener, progressDialog, ""); + + } else { + // show member profile + showProfile(personObject, v); + } + } + } + }); + + // Return the completed view to render on screen + return convertView; + } + + private String isNull(String string) { + if (string == null) { + return ""; + } else { + return string.trim(); + } + } + + private String getAge(Date birthDate) { + DateTime birthDateTime = new DateTime(birthDate.getTime()); + DateTime now = new DateTime(new Date().getTime()); + int age = now.getYear() - birthDateTime.getYear(); + if (age == 0) { + return now.getMonthOfYear() - birthDateTime.getMonthOfYear() + " M"; + } + return String.valueOf(age); + + } + + public void goToProfileActivity(View view, Bundle fragmentArguments) { + if (view.getTag() instanceof CommonPersonObjectClient) { + CommonPersonObjectClient commonPersonObjectClient = (CommonPersonObjectClient) view.getTag(); + String entityType = Utils.getValue(commonPersonObjectClient.getColumnmaps(), ChildDBConstants.KEY.ENTITY_TYPE, false); + if (CoreConstants.TABLE_NAME.CHILD.equals(entityType) || CoreConstants.TABLE_NAME.FAMILY_MEMBER.equals(entityType) || CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT.equals(entityType)) { + if (isAncMember(commonPersonObjectClient.entityId())) { + AllClientsUtils.goToAncProfile((Activity) getContext(), commonPersonObjectClient); + } else if (isPncMember(commonPersonObjectClient.entityId())) { + AllClientsUtils.gotToPncProfile((Activity) getContext(), commonPersonObjectClient, fragmentArguments); + } else if (isLDMember(commonPersonObjectClient.entityId())) { + AllClientsUtils.goToLDProfile((Activity) getContext(), commonPersonObjectClient); + } else if (CoreConstants.TABLE_NAME.CHILD.equals(entityType)) { + AllClientsUtils.goToChildProfile((Activity) getContext(), commonPersonObjectClient, fragmentArguments); + } else { + goToOtherMemberProfileActivity(commonPersonObjectClient, fragmentArguments); + } + } + ((Activity) getContext()).finish(); + } + } + + public void goToOtherMemberProfileActivity(CommonPersonObjectClient patient, Bundle bundle) { + String entityType = patient.getColumnmaps().get("entity_type"); + + Intent intent; + if (CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT.equals(entityType)) { + intent = new Intent(getContext(), AllClientsMemberProfileActivity.class); + } else { + intent = new Intent(getContext(), FamilyOtherMemberProfileActivity.class); + } + intent.putExtras(bundle != null ? bundle : new Bundle()); + intent.putExtra(Constants.INTENT_KEY.BASE_ENTITY_ID, patient.getCaseId()); + intent.putExtra(CoreConstants.INTENT_KEY.CHILD_COMMON_PERSON, patient); + intent.putExtra(Constants.INTENT_KEY.VILLAGE_TOWN, patient.getColumnmaps().get(DBConstants.KEY.VILLAGE_TOWN)); + passToolbarTitle((Activity) getContext(), intent); + + getContext().startActivity(intent); + } + + private boolean isPncMember(String entityId) { + return HfPncDao.isPNCMember(entityId); + } + + private boolean isAncMember(String entityId) { + return AncDao.isANCMember(entityId); + } + + private boolean isLDMember(String entityId) { + return LDDao.isRegisteredForLD(entityId); + } + + private final Listener pullEventClientRecordListener = new Listener() { + public void onEvent(final String baseEntityId) { + if (baseEntityId != null) { + // show profile view + CommonPersonObject personObject = getCommonRepository(Utils.metadata().familyMemberRegister.tableName).findByBaseEntityId(baseEntityId); + + if (personObject == null) return; + + View v = new View(getContext()); + showProfile(personObject, v); + + } else { + Utils.showShortToast(getContext(), "Error pulling record from server"); + } + } + }; + + private void showProfile(CommonPersonObject personObject, View v) { + final CommonPersonObjectClient client = new CommonPersonObjectClient(personObject.getCaseId(), personObject.getDetails(), ""); + + String relationId = Utils.getValue(personObject.getColumnmaps(), "relational_id", false); + CommonPersonObject family = getCommonRepository(Utils.metadata().familyRegister.tableName).findByBaseEntityId(relationId); + + if (family == null) { + ProgressDialog progressDialog = new ProgressDialog(getContext()); + progressDialog.setCancelable(false); + PullEventClientRecordUtil.pullEventClientRecord(relationId, pullEventClientRecordListener, progressDialog, personObject.getCaseId()); + } else { + String village = Utils.getValue(family.getColumnmaps(), Constants.INTENT_KEY.VILLAGE_TOWN, false); + + Map columnMaps = personObject.getColumnmaps(); + columnMaps.put(Constants.INTENT_KEY.VILLAGE_TOWN, village); + client.setColumnmaps(columnMaps); + + v.setTag(client); + + Bundle s = new Bundle(); + goToProfileActivity(v, s); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/adapter/HivAndTbReferralCardViewAdapter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/adapter/HivAndTbReferralCardViewAdapter.java new file mode 100644 index 000000000..b3eb73bef --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/adapter/HivAndTbReferralCardViewAdapter.java @@ -0,0 +1,75 @@ +package org.smartregister.chw.hf.adapter; + +import android.app.Activity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.holder.ReferralCardViewHolder; +import org.smartregister.chw.hf.listener.CommunityFollowupFeedbackRecyclerClickListener; +import org.smartregister.chw.hf.listener.ReferralRecyclerClickListener; +import org.smartregister.chw.hf.model.HivTbReferralTasksAndFollowupFeedbackModel; +import org.smartregister.commonregistry.CommonPersonObjectClient; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by cozej4 on 6/21/20. + * + * @author cozej4 https://github.com/cozej4 + */ +public class HivAndTbReferralCardViewAdapter extends RecyclerView.Adapter { + private List tasksAndFollowupFeedbackModels; + private CommonPersonObjectClient personObjectClient; + private Activity context; + private String startingActivity; + + public HivAndTbReferralCardViewAdapter(List tasksAndFollowupFeedbackModels, Activity activity, CommonPersonObjectClient personObjectClient, String startingActivity) { + this.tasksAndFollowupFeedbackModels = new ArrayList<>(tasksAndFollowupFeedbackModels); + this.context = activity; + this.personObjectClient = personObjectClient; + this.startingActivity = startingActivity; + } + + @NonNull + @Override + public ReferralCardViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { + View referralLayout = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.profile_referral_card_row, viewGroup, false); + return new ReferralCardViewHolder(referralLayout); + } + + @Override + public void onBindViewHolder(@NonNull ReferralCardViewHolder referralCardViewHolder, int position) { + HivTbReferralTasksAndFollowupFeedbackModel tasksAndFollowupFeedbackModel = tasksAndFollowupFeedbackModels.get(position); + if (tasksAndFollowupFeedbackModel.getType().equals("TASK")) { + ReferralRecyclerClickListener referralRecyclerClickListener = new ReferralRecyclerClickListener(); + referralRecyclerClickListener.setTask(tasksAndFollowupFeedbackModel.getTask()); + referralRecyclerClickListener.setCommonPersonObjectClient(personObjectClient); + referralRecyclerClickListener.setActivity(context); + referralRecyclerClickListener.setStartingActivity(startingActivity); + referralCardViewHolder.textViewReferralHeader.setText(String.format(context.getApplicationContext().getResources().getString(R.string.referral_for), tasksAndFollowupFeedbackModel.getTask().getFocus())); + referralCardViewHolder.referralRow.setOnClickListener(referralRecyclerClickListener); + } else if (tasksAndFollowupFeedbackModel.getType().equals("FOLLOWUP_FEEDBACK")) { + CommunityFollowupFeedbackRecyclerClickListener listener = new CommunityFollowupFeedbackRecyclerClickListener(); + listener.setActivity(context); + listener.setFollowupFeedbackDetailsModel(tasksAndFollowupFeedbackModel.getFollowupFeedbackDetailsModel()); + listener.setStartingActivity(startingActivity); + listener.setCommonPersonObjectClient(personObjectClient); + referralCardViewHolder.textViewReferralHeader.setText(context.getApplicationContext().getResources().getString(R.string.followup_feedback)); + referralCardViewHolder.textViewReferralInfo.setText(context.getApplicationContext().getResources().getString(R.string.view_followup_feedback_info)); + referralCardViewHolder.referralRow.setOnClickListener(listener); + referralCardViewHolder.textViewReferralHeader.setTextColor(context.getResources().getColor(R.color.accent)); + referralCardViewHolder.referralRowImage.setImageResource(R.drawable.ic_feedback); + } + } + + @Override + public int getItemCount() { + return tasksAndFollowupFeedbackModels.size(); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/adapter/HivIndexFollowupCardViewAdapter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/adapter/HivIndexFollowupCardViewAdapter.java new file mode 100644 index 000000000..517aec8fd --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/adapter/HivIndexFollowupCardViewAdapter.java @@ -0,0 +1,61 @@ +package org.smartregister.chw.hf.adapter; + +import android.app.Activity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.holder.ReferralCardViewHolder; +import org.smartregister.chw.hf.listener.CommunityIndexFollowupFeedbackRecyclerClickListener; +import org.smartregister.chw.hf.model.HivIndexFollowupFeedbackDetailsModel; +import org.smartregister.commonregistry.CommonPersonObjectClient; + +import java.util.ArrayList; +import java.util.List; + +public class HivIndexFollowupCardViewAdapter extends RecyclerView.Adapter{ + private List tasksAndFollowupFeedbackModel; + private CommonPersonObjectClient personObjectClient; + private Activity context; + private String startingActivity; + + public HivIndexFollowupCardViewAdapter(List tasksAndFollowupFeedbackModel, Activity activity, CommonPersonObjectClient personObjectClient, String startingActivity) { + this.tasksAndFollowupFeedbackModel = new ArrayList<>(tasksAndFollowupFeedbackModel); + this.context = activity; + this.personObjectClient = personObjectClient; + this.startingActivity = startingActivity; + } + + + @NonNull + @Override + public ReferralCardViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View referralLayout = LayoutInflater.from(parent.getContext()).inflate(R.layout.profile_referral_card_row, parent, false); + return new ReferralCardViewHolder(referralLayout); + } + + @Override + public void onBindViewHolder(@NonNull ReferralCardViewHolder holder, int position) { + HivIndexFollowupFeedbackDetailsModel tasksAndFollowupFeedbackList = tasksAndFollowupFeedbackModel.get(position); + + CommunityIndexFollowupFeedbackRecyclerClickListener listener = new CommunityIndexFollowupFeedbackRecyclerClickListener(); + listener.setCommonPersonObjectClient(personObjectClient); + listener.setFollowupFeedbackDetailsModel(tasksAndFollowupFeedbackList); + listener.setActivity(context); + listener.setStartingActivity(startingActivity); + holder.textViewReferralHeader.setText(context.getApplicationContext().getResources().getString(R.string.followup_feedback)); + holder.textViewReferralInfo.setText(context.getApplicationContext().getResources().getString(R.string.view_followup_feedback_info)); + holder.referralRow.setOnClickListener(listener); + holder.textViewReferralHeader.setTextColor(context.getResources().getColor(R.color.accent)); + holder.referralRowImage.setImageResource(R.drawable.ic_feedback); + } + + @Override + public int getItemCount() { + return tasksAndFollowupFeedbackModel.size(); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/adapter/PmtctReferralCardViewAdapter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/adapter/PmtctReferralCardViewAdapter.java new file mode 100644 index 000000000..1fe5517bc --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/adapter/PmtctReferralCardViewAdapter.java @@ -0,0 +1,65 @@ +package org.smartregister.chw.hf.adapter; + +import android.app.Activity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.holder.ReferralCardViewHolder; +import org.smartregister.chw.hf.listener.CommunityFollowupFeedbackRecyclerClickListener; +import org.smartregister.chw.hf.model.PmtctFollowupFeedbackModel; +import org.smartregister.commonregistry.CommonPersonObjectClient; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by cozej4 on 3/3/22. + * + * @author cozej4 https://github.com/cozej4 + */ +public class PmtctReferralCardViewAdapter extends RecyclerView.Adapter { + private List pmtctFollowupFeedbackModels; + private CommonPersonObjectClient personObjectClient; + private Activity context; + private String startingActivity; + + public PmtctReferralCardViewAdapter(List pmtctFollowupFeedbackModels, Activity activity, CommonPersonObjectClient personObjectClient, String startingActivity) { + this.pmtctFollowupFeedbackModels = new ArrayList<>(pmtctFollowupFeedbackModels); + this.context = activity; + this.personObjectClient = personObjectClient; + this.startingActivity = startingActivity; + } + + @NonNull + @Override + public ReferralCardViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) { + View referralLayout = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.profile_referral_card_row, viewGroup, false); + return new ReferralCardViewHolder(referralLayout); + } + + @Override + public void onBindViewHolder(@NonNull ReferralCardViewHolder referralCardViewHolder, int position) { + PmtctFollowupFeedbackModel pmtctFollowupFeedbackModel = pmtctFollowupFeedbackModels.get(position); + + CommunityFollowupFeedbackRecyclerClickListener listener = new CommunityFollowupFeedbackRecyclerClickListener(); + listener.setActivity(context); + listener.setFollowupFeedbackDetailsModel(pmtctFollowupFeedbackModel.getFollowupFeedbackDetailsModel()); + listener.setStartingActivity(startingActivity); + listener.setCommonPersonObjectClient(personObjectClient); + referralCardViewHolder.textViewReferralHeader.setText(context.getApplicationContext().getResources().getString(R.string.followup_feedback)); + referralCardViewHolder.textViewReferralInfo.setText(context.getApplicationContext().getResources().getString(R.string.view_followup_feedback_info)); + referralCardViewHolder.referralRow.setOnClickListener(listener); + referralCardViewHolder.textViewReferralHeader.setTextColor(context.getResources().getColor(R.color.accent)); + referralCardViewHolder.referralRowImage.setImageResource(R.drawable.ic_feedback); + } + + @Override + public int getItemCount() { + return pmtctFollowupFeedbackModels.size(); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/AdvancedSearchContract.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/AdvancedSearchContract.java new file mode 100644 index 000000000..58759fb84 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/AdvancedSearchContract.java @@ -0,0 +1,25 @@ +package org.smartregister.chw.hf.contract; + +import org.smartregister.chw.hf.domain.Entity; +import org.smartregister.view.contract.BaseRegisterFragmentContract; + +import java.util.List; +import java.util.Map; + +public interface AdvancedSearchContract { + interface Presenter { + void search(Map searchMap, boolean isLocal); + } + + interface View extends BaseRegisterFragmentContract.View { + void showResults(List members, boolean isLocal); + } + + interface Interactor { + void search(Map editMap, boolean isLocal, InteractorCallBack callBack); + } + + interface InteractorCallBack { + void onResultsFound(List members, boolean isLocal); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/HfLDProfileContract.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/HfLDProfileContract.java new file mode 100644 index 000000000..41f0599c1 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/HfLDProfileContract.java @@ -0,0 +1,28 @@ +package org.smartregister.chw.hf.contract; + +import org.smartregister.chw.ld.contract.LDProfileContract; +import org.smartregister.domain.Task; + +import java.util.Set; + +public interface HfLDProfileContract extends LDProfileContract { + interface View extends LDProfileContract.View { + void setClientTasks(Set taskList); + } + + interface Presenter extends LDProfileContract.Presenter { + void fetchTasks(); + + void setEntityId(String entityId); + + } + + interface Interactor extends LDProfileContract.Interactor { + void getClientTasks(String planId, String baseEntityId, HfLDProfileContract.InteractorCallBack callback); + } + + + interface InteractorCallBack { + void setClientTasks(Set taskList); + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/HivIndexContactProfileContract.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/HivIndexContactProfileContract.java new file mode 100644 index 000000000..5cd42bd35 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/HivIndexContactProfileContract.java @@ -0,0 +1,33 @@ +package org.smartregister.chw.hf.contract; + +import org.apache.commons.lang3.tuple.Triple; +import org.smartregister.chw.core.contract.CoreIndexContactProfileContract; +import org.smartregister.chw.hf.model.HivIndexFollowupFeedbackDetailsModel; +import org.smartregister.chw.hiv.domain.HivIndexContactObject; +import org.smartregister.opd.contract.OpdRegisterActivityContract; +import org.smartregister.opd.pojo.OpdEventClient; +import org.smartregister.opd.pojo.RegisterParams; + +import java.util.List; + +public interface HivIndexContactProfileContract extends CoreIndexContactProfileContract { + interface View extends CoreIndexContactProfileContract.View { + void setReferralAndFollowupFeedback(List followupFeedbackDetailsModel); + } + + interface Presenter extends CoreIndexContactProfileContract.Presenter { + void fetchReferralTasks(); + } + + interface Interactor extends CoreIndexContactProfileContract.Interactor { + void getReferralTasks(String planId, String baseEntityId, HivIndexContactProfileContract.InteractorCallback callback); + + void getNextUniqueId(Triple triple, OpdRegisterActivityContract.InteractorCallBack callBack); + + void saveRegistration(List opdEventClientList, String jsonString, RegisterParams registerParams, HivIndexContactObject hivIndexContactObject, OpdRegisterActivityContract.InteractorCallBack callBack); + } + + interface InteractorCallback { + void getReferralAndFollowupFeedback(List followupFeedbackDetailsModel); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/HivProfileContract.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/HivProfileContract.java new file mode 100644 index 000000000..a573b0603 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/HivProfileContract.java @@ -0,0 +1,33 @@ +package org.smartregister.chw.hf.contract; + +import org.apache.commons.lang3.tuple.Triple; +import org.smartregister.chw.core.contract.CoreHivProfileContract; +import org.smartregister.chw.hf.model.HivTbReferralTasksAndFollowupFeedbackModel; +import org.smartregister.chw.hiv.domain.HivMemberObject; +import org.smartregister.opd.contract.OpdRegisterActivityContract; +import org.smartregister.opd.pojo.OpdEventClient; +import org.smartregister.opd.pojo.RegisterParams; + +import java.util.List; + +public interface HivProfileContract extends CoreHivProfileContract { + interface View extends CoreHivProfileContract.View { + void setReferralTasksAndFollowupFeedback(List tasksAndFollowupFeedbackModels); + } + + interface Presenter extends CoreHivProfileContract.Presenter { + void fetchReferralTasks(); + } + + interface Interactor { + void getReferralTasks(String planId, String baseEntityId, HivProfileContract.InteractorCallback callback); + + void getNextUniqueId(Triple triple, OpdRegisterActivityContract.InteractorCallBack callBack); + + void saveRegistration(List opdEventClientList, String jsonString, RegisterParams registerParams, HivMemberObject hivMemberObject, OpdRegisterActivityContract.InteractorCallBack callBack); + } + + interface InteractorCallback { + void updateReferralTasksAndFollowupFeedback(List tasksAndFollowupFeedbackModels); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/PmtctProfileContract.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/PmtctProfileContract.java new file mode 100644 index 000000000..3c5f00b96 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/PmtctProfileContract.java @@ -0,0 +1,32 @@ +package org.smartregister.chw.hf.contract; + +import org.apache.commons.lang3.tuple.Triple; +import org.smartregister.chw.core.contract.CorePmtctProfileContract; +import org.smartregister.chw.hf.model.HivTbReferralTasksAndFollowupFeedbackModel; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.opd.contract.OpdRegisterActivityContract; +import org.smartregister.opd.pojo.OpdEventClient; +import org.smartregister.opd.pojo.RegisterParams; + +import java.util.List; + +public interface PmtctProfileContract { + interface View extends CorePmtctProfileContract.View { + void setReferralTasksAndFollowupFeedback(List tasksAndFollowupFeedbackModels); + } + interface Presenter extends CorePmtctProfileContract.Presenter { + void fetchReferralTasks(); + } + + interface Interactor { + void getReferralTasks(String planId, String baseEntityId, PmtctProfileContract.InteractorCallback callback); + + void getNextUniqueId(Triple triple, OpdRegisterActivityContract.InteractorCallBack callBack); + + void saveRegistration(List opdEventClientList, String jsonString, RegisterParams registerParams, MemberObject hivMemberObject, OpdRegisterActivityContract.InteractorCallBack callBack); + } + + interface InteractorCallback { + void updateReferralTasksAndFollowupFeedback(List tasksAndFollowupFeedbackModels); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/TbProfileContract.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/TbProfileContract.java new file mode 100644 index 000000000..34266ef4a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/contract/TbProfileContract.java @@ -0,0 +1,24 @@ +package org.smartregister.chw.hf.contract; + +import org.smartregister.chw.core.contract.CoreTbProfileContract; +import org.smartregister.chw.hf.model.HivTbReferralTasksAndFollowupFeedbackModel; + +import java.util.List; + +public interface TbProfileContract extends CoreTbProfileContract { + interface View extends CoreTbProfileContract.View { + void setReferralTasksAndFollowupFeedback(List tasksAndFollowupFeedbackModels); + } + + interface Presenter extends CoreTbProfileContract.Presenter { + void fetchReferralTasks(); + } + + interface Interactor { + void getReferralTasks(String planId, String baseEntityId, TbProfileContract.InteractorCallback callback); + } + + interface InteractorCallback { + void updateReferralTasksAndFollowupFeedback(List tasksAndFollowupFeedbackModels); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/FacilityMenu.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/FacilityMenu.java new file mode 100644 index 000000000..13dd4a168 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/FacilityMenu.java @@ -0,0 +1,29 @@ +package org.smartregister.chw.hf.custom_view; + +import android.app.Activity; +import android.view.View; + +import androidx.appcompat.widget.Toolbar; + +import org.smartregister.chw.core.custom_views.NavigationMenu; +import org.smartregister.chw.hf.presenter.HfNavigationPresenter; + +import timber.log.Timber; + +public class FacilityMenu extends NavigationMenu { + + @Override + protected void init(Activity activity, View myParentView, Toolbar myToolbar) { + try { + setParentView(activity, parentView); + toolbar = myToolbar; + parentView = myParentView; + mPresenter = new HfNavigationPresenter(application, this, modelFlavor); + prepareViews(activity); + mPresenter.updateTableMap(menuFlavor.getTableMapValues()); + } catch (Exception e) { + Timber.e(e); + } + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/FamilyMemberFloatingMenu.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/FamilyMemberFloatingMenu.java index 550ceb3b7..642e85bd0 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/FamilyMemberFloatingMenu.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/FamilyMemberFloatingMenu.java @@ -1,10 +1,13 @@ package org.smartregister.chw.hf.custom_view; +import static org.smartregister.chw.core.utils.Utils.redrawWithOption; + import android.content.Context; +import android.widget.RelativeLayout; +import android.widget.TextView; import org.smartregister.chw.core.custom_views.CoreFamilyMemberFloatingMenu; - -import static org.smartregister.chw.core.utils.Utils.redrawWithOption; +import org.smartregister.chw.hf.R; public class FamilyMemberFloatingMenu extends CoreFamilyMemberFloatingMenu { public FamilyMemberFloatingMenu(Context context) { @@ -15,10 +18,50 @@ public FamilyMemberFloatingMenu(Context context) { public void initUi() { super.initUi(); fab.setOnClickListener(v -> animateFAB()); + fab.setImageResource(org.smartregister.chw.core.R.drawable.ic_edit_white); + RelativeLayout referToFacilityLayout = findViewById(R.id.refer_to_facility_layout); + referToFacilityLayout.setVisibility(VISIBLE); + TextView referToFacilityLabel = (TextView) referToFacilityLayout.getChildAt(0); + referToFacilityLabel.setText(R.string.lost_to_followup_referral); } @Override public void reDraw(boolean has_phone) { redrawWithOption(this, has_phone); } + + @Override + public void animateFAB() { + if (menuBar.getVisibility() == GONE) { + menuBar.setVisibility(VISIBLE); + } + + if (isFabMenuOpen) { + activityMain.setBackgroundResource(org.smartregister.chw.core.R.color.transparent); + + fab.startAnimation(rotateBack); + fab.setImageResource(org.smartregister.chw.core.R.drawable.ic_edit_white); + + callLayout.startAnimation(fabClose); + referLayout.startAnimation(fabClose); + + callLayout.setClickable(false); + referLayout.setClickable(false); + isFabMenuOpen = false; + + } else { + activityMain.setBackgroundResource(org.smartregister.chw.core.R.color.grey_tranparent_50); + + fab.startAnimation(rotateForward); + fab.setImageResource(org.smartregister.chw.core.R.drawable.ic_input_add); + + callLayout.startAnimation(fabOpen); + referLayout.startAnimation(fabOpen); + + callLayout.setClickable(true); + referLayout.setClickable(true); + + isFabMenuOpen = true; + } + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/HfNavigationMenu.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/HfNavigationMenu.java index 2e639e935..d65362dbc 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/HfNavigationMenu.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/HfNavigationMenu.java @@ -8,6 +8,7 @@ import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.chw.hf.activity.HfHIA2ReportsActivity; import org.smartregister.chw.hf.activity.ProvidersReportListActivity; +import org.smartregister.chw.hf.activity.ReportsActivity; import org.smartregister.chw.hf.activity.ServiceActivity; import java.util.Arrays; @@ -25,18 +26,18 @@ public List> getSupportedLanguages() { @Override public HashMap getTableMapValues() { HashMap tableMap = new HashMap<>(); - tableMap.put(CoreConstants.DrawerMenu.REFERRALS, CoreConstants.TABLE_NAME.TASK); + tableMap.put(CoreConstants.DrawerMenu.REFERRALS, CoreConstants.TABLE_NAME.REFERRAL); return tableMap; } @Override public boolean hasServiceReport() { - return true; + return false; } @Override public boolean hasStockReport() { - return true; + return false; } @Override @@ -63,4 +64,14 @@ public String childNavigationMenuCountString() { public Intent getHIA2ReportActivityIntent(Activity activity) { return new Intent(activity, HfHIA2ReportsActivity.class); } + + @Override + public boolean hasInAppReports() { + return true; + } + + @Override + public Intent getInAppReportsActivityIntent(Activity activity) { + return new Intent(activity, ReportsActivity.class); + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/HivFloatingMenu.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/HivFloatingMenu.java new file mode 100644 index 000000000..3bb9f6064 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/HivFloatingMenu.java @@ -0,0 +1,18 @@ +package org.smartregister.chw.hf.custom_view; + +import android.content.Context; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import org.smartregister.chw.core.custom_views.CoreHivFloatingMenu; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hiv.domain.HivMemberObject; + +public class HivFloatingMenu extends CoreHivFloatingMenu { + public HivFloatingMenu(Context context, HivMemberObject hivMemberObject) { + super(context, hivMemberObject); + RelativeLayout referToFacilityLayout = findViewById(R.id.refer_to_facility_layout); + TextView referTextView = (TextView) referToFacilityLayout.getChildAt(0); + referTextView.setText(R.string.lost_to_followup_referral); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/HivIndexContactFloatingMenu.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/HivIndexContactFloatingMenu.java new file mode 100644 index 000000000..96b72a33e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/HivIndexContactFloatingMenu.java @@ -0,0 +1,13 @@ +package org.smartregister.chw.hf.custom_view; + +import android.content.Context; + +import org.smartregister.chw.core.custom_views.CoreHivIndexContactFloatingMenu; +import org.smartregister.chw.hiv.domain.HivIndexContactObject; + +public class HivIndexContactFloatingMenu extends CoreHivIndexContactFloatingMenu { + public HivIndexContactFloatingMenu(Context context, HivIndexContactObject hivIndexContactObject) { + super(context, hivIndexContactObject); + referLayout.setVisibility(GONE); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/PmtctFloatingMenu.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/PmtctFloatingMenu.java new file mode 100644 index 000000000..8a8040a37 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/PmtctFloatingMenu.java @@ -0,0 +1,124 @@ +package org.smartregister.chw.hf.custom_view; + +import static org.smartregister.chw.core.utils.Utils.redrawWithOption; + +import android.app.Activity; +import android.content.Context; +import android.view.View; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import com.google.android.material.floatingactionbutton.FloatingActionButton; + +import org.smartregister.chw.core.custom_views.CorePmtctFloatingMenu; +import org.smartregister.chw.core.listener.OnClickFloatingMenu; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.HeiProfileActivity; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.fragment.BasePmtctCallDialogFragment; + +public class PmtctFloatingMenu extends CorePmtctFloatingMenu { + public FloatingActionButton fab; + private Animation fabOpen; + private Animation fabClose; + private Animation rotateForward; + private Animation rotateBack; + private View callLayout; + protected RelativeLayout referLayout; + private RelativeLayout activityMain; + private boolean isFabMenuOpen = false; + private LinearLayout menuBar; + private OnClickFloatingMenu onClickFloatingMenu; + private MemberObject MEMBER_OBJECT; + public PmtctFloatingMenu(Context context, MemberObject MEMBER_OBJECT) { + super(context, MEMBER_OBJECT); + if(context instanceof HeiProfileActivity){ + referLayout.setVisibility(View.GONE); + } + this.MEMBER_OBJECT = MEMBER_OBJECT; + } + + @Override + protected void initUi() { + inflate(getContext(), R.layout.view_hiv_call_client_floating_menu, this); + fabOpen = AnimationUtils.loadAnimation(getContext(), org.smartregister.chw.core.R.anim.fab_open); + fabClose = AnimationUtils.loadAnimation(getContext(), org.smartregister.chw.core.R.anim.fab_close); + rotateForward = AnimationUtils.loadAnimation(getContext(), org.smartregister.chw.core.R.anim.rotate_forward); + rotateBack = AnimationUtils.loadAnimation(getContext(), org.smartregister.chw.core.R.anim.rotate_back); + + activityMain = findViewById(org.smartregister.chw.core.R.id.activity_main); + menuBar = findViewById(org.smartregister.chw.core.R.id.menu_bar); + + fab = findViewById(org.smartregister.chw.core.R.id.hiv_fab); + fab.setOnClickListener(this); + + callLayout = findViewById(org.smartregister.chw.core.R.id.call_layout); + callLayout.setOnClickListener(this); + callLayout.setClickable(false); + + referLayout = findViewById(org.smartregister.chw.core.R.id.refer_to_facility_layout); + referLayout.setOnClickListener(this); + referLayout.setClickable(false); + + TextView referTextView = (TextView) referLayout.getChildAt(0); + referTextView.setText(R.string.lost_to_followup_referral); + + menuBar.setVisibility(GONE); + } + + public void setFloatMenuClickListener(OnClickFloatingMenu onClickFloatingMenu) { + this.onClickFloatingMenu = onClickFloatingMenu; + } + @Override + public void onClick(View view) { + onClickFloatingMenu.onClickMenu(view.getId()); + } + + public void animateFAB() { + if (menuBar.getVisibility() == GONE) { + menuBar.setVisibility(VISIBLE); + } + + if (isFabMenuOpen) { + activityMain.setBackgroundResource(org.smartregister.chw.core.R.color.transparent); + fab.startAnimation(rotateBack); + fab.setImageResource(org.smartregister.chw.core.R.drawable.ic_edit_white); + + callLayout.startAnimation(fabClose); + callLayout.setClickable(false); + + referLayout.startAnimation(fabClose); + referLayout.setClickable(false); + + isFabMenuOpen = false; + } else { + activityMain.setBackgroundResource(org.smartregister.chw.core.R.color.grey_tranparent_50); + fab.startAnimation(rotateForward); + fab.setImageResource(org.smartregister.chw.core.R.drawable.ic_input_add); + + callLayout.startAnimation(fabOpen); + callLayout.setClickable(true); + + referLayout.startAnimation(fabOpen); + referLayout.setClickable(true); + + isFabMenuOpen = true; + } + } + + + public void launchCallWidget() { + BasePmtctCallDialogFragment.launchDialog((Activity) this.getContext(), MEMBER_OBJECT); + } + + public void redraw(boolean hasPhoneNumber) { + redrawWithOption(this, hasPhoneNumber); + } + + public View getCallLayout() { + return callLayout; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/PncNoMotherFloatingMenu.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/PncNoMotherFloatingMenu.java new file mode 100644 index 000000000..8e39bd02e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/custom_view/PncNoMotherFloatingMenu.java @@ -0,0 +1,44 @@ +package org.smartregister.chw.hf.custom_view; + +import android.app.Activity; +import android.content.Context; +import android.util.AttributeSet; +import android.view.View; + +import com.google.android.material.floatingactionbutton.FloatingActionButton; + +import org.smartregister.chw.anc.custom_views.BaseAncFloatingMenu; +import org.smartregister.chw.hf.fragment.PncNoMotherCallDialogFragment; + +public class PncNoMotherFloatingMenu extends BaseAncFloatingMenu { + private String caregiverName; + private String phoneNumber; + + public PncNoMotherFloatingMenu(Context context, String ancWomanName, String ancWomanPhone) { + super(context, ancWomanName, ancWomanPhone, null, null, null); + caregiverName = ancWomanName; + phoneNumber = ancWomanPhone; + } + + public PncNoMotherFloatingMenu(Context context, AttributeSet attrs) { + super(context, attrs); + } + + @Override + protected void initUi() { + inflate(getContext(), org.smartregister.chw.opensrp_chw_anc.R.layout.view_anc_call_woma_floating_menu, this); + FloatingActionButton fab = findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.anc_fab); + fab.setOnClickListener(this); + fab.setImageResource(org.smartregister.chw.opensrp_chw_anc.R.drawable.floating_call); + } + + @Override + public void onClick(View view) { + if (view.getId() == org.smartregister.chw.opensrp_chw_anc.R.id.anc_fab) { + Activity activity = (Activity) getContext(); + PncNoMotherCallDialogFragment.launchDialog(activity, caregiverName, phoneNumber); + } else { + super.onClick(view); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/FamilyDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/FamilyDao.java index 4ac881a78..8c67c7371 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/FamilyDao.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/FamilyDao.java @@ -1,13 +1,17 @@ package org.smartregister.chw.hf.dao; +import android.database.Cursor; import android.util.Pair; import net.sqlcipher.database.SQLiteDatabase; import org.json.JSONObject; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.domain.Entity; import org.smartregister.chw.hf.model.FamilyDetailsModel; import org.smartregister.dao.AbstractDao; +import java.util.ArrayList; import java.util.List; import timber.log.Timber; @@ -19,17 +23,22 @@ public static FamilyDetailsModel getFamilyDetail(String baseEntityId) { "SELECT ec_family.base_entity_id,\n" + " ec_family.primary_caregiver,\n" + " ec_family.first_name as family_name,\n" + + " ec_family.village_town as village_town,\n" + " ec_family.family_head\n" + "FROM ec_family\n" + " INNER JOIN ec_family_member ON ec_family.base_entity_id = ec_family_member.relational_id\n" + "WHERE ec_family_member.base_entity_id = '%s'", baseEntityId); - DataMap dataMap = cursor -> new FamilyDetailsModel( - getCursorValue(cursor, "base_entity_id"), - getCursorValue(cursor, "family_head"), - getCursorValue(cursor, "primary_caregiver"), - getCursorValue(cursor, "family_name") - ); + DataMap dataMap = cursor -> { + FamilyDetailsModel familyDetailsModel = new FamilyDetailsModel( + getCursorValue(cursor, "base_entity_id"), + getCursorValue(cursor, "family_head"), + getCursorValue(cursor, "primary_caregiver"), + getCursorValue(cursor, "family_name") + ); + familyDetailsModel.setVillageTown(getCursorValue(cursor, "village_town")); + return familyDetailsModel; + }; List familyProfileModels = readData(sql, dataMap); if (familyProfileModels == null || familyProfileModels.size() != 1) @@ -72,4 +81,45 @@ public static String getLocationId(String jsonString) { return ""; } } + + public static List search(String searchText) { + Cursor cursor = null; + List entitySet = new ArrayList<>(); + try { + String query = String.format("SELECT * FROM ec_family_member WHERE first_name LIKE '%%%s%%' " + + "OR middle_name LIKE '%%%s%%' OR last_name LIKE '%%%s%%'", searchText, searchText, searchText); + cursor = HealthFacilityApplication.getInstance().getRepository().getReadableDatabase().rawQuery(query, + new String[]{}); + while (cursor.moveToNext()) { + Entity entity = readCursor(cursor); + if (!entity.getVoided()) { + entitySet.add(entity); + } + } + } catch (Exception e) { + Timber.e(e); + } finally { + if (cursor != null) + cursor.close(); + } + return entitySet; + } + + private static Entity readCursor(Cursor cursor) { + Entity entity = new Entity(); + + entity.setBaseEntityId(cursor.getString(cursor.getColumnIndex("base_entity_id"))); + entity.setFirstName(cursor.getString(cursor.getColumnIndex("first_name"))); + entity.setMiddleName(cursor.getString(cursor.getColumnIndex("middle_name"))); + entity.setLastName(cursor.getString(cursor.getColumnIndex("last_name"))); + entity.setGender(cursor.getString(cursor.getColumnIndex("gender"))); + entity.setFamilyId(cursor.getString(cursor.getColumnIndex("relational_id"))); + entity.setVoided(getRemovedStatus(cursor.getString(cursor.getColumnIndex("is_closed")))); + + return entity; + } + + private static Boolean getRemovedStatus(String is_closed) { + return "1".equalsIgnoreCase(is_closed); + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HeiDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HeiDao.java new file mode 100644 index 000000000..30bb5dcce --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HeiDao.java @@ -0,0 +1,526 @@ +package org.smartregister.chw.hf.dao; + +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.Months; +import org.joda.time.Weeks; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.dao.AbstractDao; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; + +import timber.log.Timber; + +public class HeiDao extends AbstractDao { + public static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + + public static MemberObject getMember(String baseEntityID) { + String sql = "select m.base_entity_id , m.unique_id , m.relational_id , m.dob , m.first_name , m.middle_name , m.last_name , m.gender , m.phone_number , m.other_phone_number , f.first_name family_name ,f.primary_caregiver , f.family_head , f.village_town ,fh.first_name family_head_first_name , fh.middle_name family_head_middle_name , fh.last_name family_head_last_name, fh.phone_number family_head_phone_number , ancr.is_closed anc_is_closed, pncr.is_closed pnc_is_closed, pcg.first_name pcg_first_name , pcg.last_name pcg_last_name , pcg.middle_name pcg_middle_name , pcg.phone_number pcg_phone_number , mr.* from ec_family_member m inner join ec_family f on m.relational_id = f.base_entity_id inner join ec_hei mr on mr.base_entity_id = m.base_entity_id left join ec_family_member fh on fh.base_entity_id = f.family_head left join ec_family_member pcg on pcg.base_entity_id = f.primary_caregiver left join ec_anc_register ancr on ancr.base_entity_id = m.base_entity_id left join ec_pregnancy_outcome pncr on pncr.base_entity_id = m.base_entity_id where m.base_entity_id ='" + baseEntityID + "' "; + + + DataMap dataMap = cursor -> { + MemberObject memberObject = new MemberObject(); + + memberObject.setFirstName(getCursorValue(cursor, "first_name", "")); + memberObject.setMiddleName(getCursorValue(cursor, "middle_name", "")); + memberObject.setLastName(getCursorValue(cursor, "last_name", "")); + memberObject.setAddress(getCursorValue(cursor, "village_town")); + memberObject.setGender(getCursorValue(cursor, "gender")); + memberObject.setUniqueId(getCursorValue(cursor, "unique_id", "")); + memberObject.setAge(getCursorValue(cursor, "dob")); + memberObject.setFamilyBaseEntityId(getCursorValue(cursor, "relational_id", "")); + memberObject.setRelationalId(getCursorValue(cursor, "relational_id", "")); + memberObject.setPrimaryCareGiver(getCursorValue(cursor, "primary_caregiver")); + memberObject.setFamilyName(getCursorValue(cursor, "family_name", "")); + memberObject.setPhoneNumber(getCursorValue(cursor, "phone_number", "")); + memberObject.setBaseEntityId(getCursorValue(cursor, "base_entity_id", "")); + memberObject.setFamilyHead(getCursorValue(cursor, "family_head", "")); + memberObject.setFamilyHeadPhoneNumber(getCursorValue(cursor, "pcg_phone_number", "")); + memberObject.setFamilyHeadPhoneNumber(getCursorValue(cursor, "family_head_phone_number", "")); + memberObject.setAncMember(getCursorValue(cursor, "anc_is_closed", "")); + memberObject.setPncMember(getCursorValue(cursor, "pnc_is_closed", "")); + + String familyHeadName = getCursorValue(cursor, "family_head_first_name", "") + " " + + getCursorValue(cursor, "family_head_middle_name", ""); + + familyHeadName = + (familyHeadName.trim() + " " + getCursorValue(cursor, "family_head_last_name", "")).trim(); + memberObject.setFamilyHeadName(familyHeadName); + + String familyPcgName = getCursorValue(cursor, "pcg_first_name", "") + " " + + getCursorValue(cursor, "pcg_middle_name", ""); + + familyPcgName = + (familyPcgName.trim() + " " + getCursorValue(cursor, "pcg_last_name", "")).trim(); + memberObject.setPrimaryCareGiverName(familyPcgName); + + return memberObject; + }; + + List res = readData(sql, dataMap); + if (res == null || res.size() != 1) + return null; + + return res.get(0); + } + + public static boolean isEligibleForDnaCprHivTest(String baseEntityID) { + try { + String riskLevel = getRiskLevel(baseEntityID); + DateTime dobDateTime = new DateTime(getMember(baseEntityID).getDob()); + int months = getElapsedTimeInMonths(simpleDateFormat.format(dobDateTime.toDate())); + if (months >= 15) { + return false; + } + int weeks = getElapsedTimeInWeeks(simpleDateFormat.format(dobDateTime.toDate())); + if (riskLevel != null && riskLevel.equalsIgnoreCase("high_risk")) { + return true; + } else return riskLevel != null && riskLevel.equalsIgnoreCase("low_risk") && weeks >= 4; + + } catch (Exception e) { + Timber.e(e); + return true; + } + } + + public static boolean isEligibleForArvPrescriptionForHighRisk(String baseEntityID) { + String sql = "SELECT * FROM ec_hei hei\n" + + " LEFT JOIN (SELECT * FROM ec_hei_followup WHERE prophylaxis_arv_for_high_risk_given IS NOT NULL AND ec_hei_followup.entity_id ='" + baseEntityID + "'" + + " ORDER BY visit_number DESC LIMIT 1) heif\n" + + " on hei.base_entity_id = heif.entity_id\n" + + "WHERE hei.base_entity_id='" + baseEntityID + "'"; + + DataMap dobMap = cursor -> getCursorValue(cursor, "dob"); + DataMap prophylaxisArvForHighRiskMap = cursor -> getCursorValue(cursor, "prophylaxis_arv_for_high_risk_given"); + DataMap riskCategoryMap = cursor -> getCursorValue(cursor, "risk_category"); + + List dobRes = readData(sql, dobMap); + List prophylaxisArvForHighRiskRes = readData(sql, prophylaxisArvForHighRiskMap); + List riskCategoryRes = readData(sql, riskCategoryMap); + + DateTime dobDateTime = new DateTime(dobRes.get(0)); + Date dob = dobDateTime.toDate(); + + int weeks = getElapsedTimeInWeeks(simpleDateFormat.format(dob)); + + if (weeks < 4 && getNextHivTestAge(baseEntityID).equals(Constants.HeiHIVTestAtAge.AT_BIRTH) && riskCategoryRes != null && riskCategoryRes.get(0) != null && riskCategoryRes.get(0).equals("high")) { + return prophylaxisArvForHighRiskRes == null || prophylaxisArvForHighRiskRes.get(0) == null; + } else return false; + } + + + public static boolean isArvPrescriptionForHighRiskGiven(String baseEntityID) { + String sql = "SELECT * FROM ec_hei hei\n" + + " LEFT JOIN (SELECT * FROM ec_hei_followup WHERE prophylaxis_arv_for_high_risk_given IS NOT NULL AND ec_hei_followup.entity_id ='" + baseEntityID + "'" + + " ORDER BY visit_number DESC LIMIT 1) heif\n" + + " on hei.base_entity_id = heif.entity_id\n" + + "WHERE hei.base_entity_id='" + baseEntityID + "'"; + + DataMap prophylaxisArvForHighRiskMap = cursor -> getCursorValue(cursor, "prophylaxis_arv_for_high_risk_given"); + DataMap riskCategoryMap = cursor -> getCursorValue(cursor, "risk_category"); + + List prophylaxisArvForHighRiskRes = readData(sql, prophylaxisArvForHighRiskMap); + List riskCategoryRes = readData(sql, riskCategoryMap); + + if (riskCategoryRes != null && riskCategoryRes.get(0) != null && riskCategoryRes.get(0).equals("high") && prophylaxisArvForHighRiskRes != null && prophylaxisArvForHighRiskRes.get(0) != null) { + return prophylaxisArvForHighRiskRes.get(0).equalsIgnoreCase("yes"); + } else return false; + } + + public static boolean isEligibleForArvPrescriptionForHighAndLowRisk(String baseEntityID) { + String sql = "SELECT * FROM ec_hei hei\n" + + " LEFT JOIN (SELECT * FROM ec_hei_followup WHERE prophylaxis_arv_for_high_and_low_risk_given IS NOT NULL AND ec_hei_followup.entity_id ='" + baseEntityID + "'" + + " ORDER BY visit_number DESC LIMIT 1) heif\n" + + " on hei.base_entity_id = heif.entity_id\n" + + "WHERE hei.base_entity_id='" + baseEntityID + "'"; + + DataMap dobMap = cursor -> getCursorValue(cursor, "dob"); + DataMap prophylaxisArvForHighAndLowRiskMap = cursor -> getCursorValue(cursor, "prophylaxis_arv_for_high_and_low_risk_given"); + DataMap riskCategoryMap = cursor -> getCursorValue(cursor, "risk_category"); + List riskCategoryRes = readData(sql, riskCategoryMap); + + List dobRes = readData(sql, dobMap); + List prophylaxisArvForHighAndLowRiskRes = readData(sql, prophylaxisArvForHighAndLowRiskMap); + + DateTime dobDateTime = new DateTime(dobRes.get(0)); + Date dob = dobDateTime.toDate(); + + int weeks = getElapsedTimeInWeeks(simpleDateFormat.format(dob)); + + if (weeks < 9 && weeks >= 4 && getNextHivTestAge(baseEntityID).equals(Constants.HeiHIVTestAtAge.AT_6_WEEKS) && riskCategoryRes != null && riskCategoryRes.get(0) != null && riskCategoryRes.get(0).equals("high") && isArvPrescriptionForHighRiskGiven(baseEntityID)) { + return prophylaxisArvForHighAndLowRiskRes == null || prophylaxisArvForHighAndLowRiskRes.get(0) == null; + } else if (weeks < 4 && getNextHivTestAge(baseEntityID).equals(Constants.HeiHIVTestAtAge.AT_BIRTH) && riskCategoryRes != null && riskCategoryRes.get(0) != null && riskCategoryRes.get(0).equals("low")) { + return prophylaxisArvForHighAndLowRiskRes == null || prophylaxisArvForHighAndLowRiskRes.get(0) == null; + } else return false; + } + + public static boolean isEligibleForAntiBodiesHivTest(String baseEntityID) { + String sql = "SELECT * FROM ec_hei hei\n" + + " LEFT JOIN (SELECT * FROM ec_hei_followup WHERE sample_id IS NOT NULL AND ec_hei_followup.entity_id ='" + baseEntityID + "'" + + "ORDER BY visit_number DESC LIMIT 1) heif\n" + + " on hei.base_entity_id = heif.entity_id\n" + + "WHERE hei.base_entity_id='" + baseEntityID + "'"; + + DataMap map = cursor -> getCursorValue(cursor, "dob"); + List res = readData(sql, map); + + DateTime dobDateTime = new DateTime(res.get(0)); + Date dob = dobDateTime.toDate(); + + int months = getElapsedTimeInMonths(simpleDateFormat.format(dob)); + return months >= 15; + } + + public static boolean isEligibleForCtx(String baseEntityID) { + String sql = "SELECT * FROM ec_hei hei\n" + + "WHERE hei.base_entity_id='" + baseEntityID + "'"; + + DataMap dobMap = cursor -> getCursorValue(cursor, "dob"); + + List dobRes = readData(sql, dobMap); + + DateTime dobDateTime = new DateTime(dobRes.get(0)); + Date dob = dobDateTime.toDate(); + + int weeks = getElapsedTimeInWeeks(simpleDateFormat.format(dob)); + return weeks >= 4; + } + + public static int getElapsedTimeInMonths(String startDateString) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + Date startDate = null; + try { + startDate = simpleDateFormat.parse(startDateString); + } catch (ParseException e) { + e.printStackTrace(); + } + + Calendar startDateCal = Calendar.getInstance(); + startDateCal.setTimeInMillis(startDate.getTime()); + startDateCal.set(Calendar.DAY_OF_MONTH, 1); + + + LocalDate startLocalDate = new LocalDate(startDateCal.get(Calendar.YEAR), startDateCal.get(Calendar.MONTH) + 1, startDateCal.get(Calendar.DAY_OF_MONTH)); + + + LocalDate now = new LocalDate(); + + return Months.monthsBetween(startLocalDate, now).getMonths(); + } + + private static int getElapsedTimeInWeeks(String startDateString) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + Date startDate = null; + try { + startDate = simpleDateFormat.parse(startDateString); + } catch (ParseException e) { + e.printStackTrace(); + } + + Calendar startDateCal = Calendar.getInstance(); + startDateCal.setTimeInMillis(startDate.getTime()); + + LocalDate startLocalDate = new LocalDate(startDateCal.get(Calendar.YEAR), startDateCal.get(Calendar.MONTH) + 1, startDateCal.get(Calendar.DAY_OF_MONTH)); + LocalDate now = new LocalDate(); + + return Weeks.weeksBetween(startLocalDate, now).getWeeks(); + } + + public static String getNextHivTestAge(String baseEntityID) { + String sql = "SELECT * FROM ec_hei WHERE base_entity_id='" + baseEntityID + "'"; + + DataMap dobMap = cursor -> getCursorValue(cursor, "dob"); + List dobRes = readData(sql, dobMap); + + if (dobRes != null && dobRes.size() > 0 && dobRes.get(0) != null) { + DateTime dobDateTime = new DateTime(dobRes.get(0)); + Date dob = dobDateTime.toDate(); + + int weeks = getElapsedTimeInWeeks(simpleDateFormat.format(dob)); + int months = getElapsedTimeInMonths(simpleDateFormat.format(dob)); + + if (months >= 18) + return Constants.HeiHIVTestAtAge.AT_18_MONTHS; + else if (months >= 15) + return Constants.HeiHIVTestAtAge.AT_15_MONTHS; + else if (months >= 9) + return Constants.HeiHIVTestAtAge.AT_9_MONTHS; + else if (weeks >= 4) + return Constants.HeiHIVTestAtAge.AT_6_WEEKS; + else return Constants.HeiHIVTestAtAge.AT_BIRTH; + } else return Constants.HeiHIVTestAtAge.AT_BIRTH; + + } + + public static int getVisitNumber(String baseEntityID) { + String sql = "SELECT visit_number FROM ec_hei_followup WHERE entity_id='" + baseEntityID + "' ORDER BY visit_number DESC LIMIT 1"; + DataMap map = cursor -> getCursorIntValue(cursor, "visit_number"); + List res = readData(sql, map); + + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0) + 1; + } else + return 0; + + } + + public static String getRiskLevel(String baseEntityID) { + String sql = "SELECT risk_category FROM ec_hei hei\n" + + " WHERE hei.base_entity_id='" + baseEntityID + "'" + + " AND risk_category IS NOT NULL"; + + DataMap riskCategoryMap = cursor -> getCursorValue(cursor, "risk_category"); + + List riskCategoryRes = readData(sql, riskCategoryMap); + if (riskCategoryRes.get(0).equals("high")) { + return org.smartregister.chw.pmtct.util.Constants.RISK_LEVELS.RISK_HIGH; + } + if (riskCategoryRes.get(0).equals("low")) { + return org.smartregister.chw.pmtct.util.Constants.RISK_LEVELS.RISK_LOW; + } + return ""; + } + + public static String getMotherBaseEntityId(String baseEntityID) { + String sql = "SELECT mother_entity_id FROM ec_hei hei\n" + + " WHERE hei.base_entity_id='" + baseEntityID + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "mother_entity_id"); + + List res = readData(sql, dataMap); + + return (res != null && res.get(0) != null) ? res.get(0) : ""; + } + + public static String getTestAtAgeForFollowupVisit(String baseEntityID) { + String sql = "SELECT test_at_age FROM ec_hei_followup \n" + + " WHERE base_entity_id='" + baseEntityID + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "test_at_age"); + + List res = readData(sql, dataMap); + + return (res != null && res.get(0) != null) ? res.get(0) : null; + } + + public static String getLatestTestAtAge(String baseEntityID) { + String sql = "SELECT test_at_age FROM ec_hei_followup \n" + + " WHERE entity_id='" + baseEntityID + "'" + + " AND test_at_age IS NOT NULL" + + " ORDER BY visit_number DESC " + + " LIMIT 1"; + DataMap dataMap = cursor -> getCursorValue(cursor, "test_at_age"); + + List res = readData(sql, dataMap); + //for low risk will return at birth for test_at_age + return (res != null && res.size() > 0 && res.get(0) != null) ? res.get(0) : Constants.HeiHIVTestAtAge.AT_BIRTH; + } + + public static Date getHeiRegisterDate(String baseEntityID) { + //basically returns back the date of birth of the child + String sql = "select dob from ec_hei where base_entity_id = '" + baseEntityID + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "dob"); + + List res = readData(sql, dataMap); + if (res == null || res.size() != 1) + return null; + Date date = null; + try { + date = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).parse(res.get(0)); + } catch (ParseException e) { + e.printStackTrace(); + } + return date; + } + + public static Date getHeiFollowUpVisitDate(String baseEntityID) { + //for latest followup visit dates + String sql = "SELECT next_visit_date FROM ec_hei_followup WHERE followup_status <> 'lost_to_followup' AND followup_status <> 'transfer_out' AND entity_id = '" + baseEntityID + "'" + + "ORDER BY visit_number DESC " + + "LIMIT 1"; + DataMap dataMap = cursor -> getCursorValue(cursor, "next_visit_date"); + + List res = readData(sql, dataMap); + if (res == null || res.size() != 1 || res.get(0) == null) + return null; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).parse(res.get(0)); + } catch (ParseException e) { + e.printStackTrace(); + } + + return date; + } + + + public static boolean hasTheChildTransferedOut(String baseEntityID) { + String sql = "SELECT p.base_entity_id\n" + + "FROM ec_hei as p\n" + + " INNER JOIN (SELECT *\n" + + " FROM ec_hei_followup\n" + + " WHERE ec_hei_followup.entity_id ='" + baseEntityID + "'" + + " ORDER BY visit_number DESC\n" + + " LIMIT 1) as pf on pf.entity_id = p.base_entity_id\n" + + "WHERE (pf.followup_status = 'transfer_out')\n" + + "AND p.base_entity_id = '" + baseEntityID + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "base_entity_id"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0 && res.get(0) != null; + } + + + public static boolean isTheChildLostToFollowup(String baseEntityID) { + String sql = "SELECT p.base_entity_id\n" + + "FROM ec_hei as p\n" + + " INNER JOIN (SELECT *\n" + + " FROM ec_hei_followup\n" + + " WHERE ec_hei_followup.entity_id ='" + baseEntityID + "'" + + " ORDER BY visit_number DESC\n" + + " LIMIT 1) as pf on pf.entity_id = p.base_entity_id\n" + + "WHERE (pf.followup_status = 'lost_to_followup')\n" + + "AND p.base_entity_id = '" + baseEntityID + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "base_entity_id"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static boolean hasHeiNumber(String baseEntityId) { + String sql = "SELECT hei_number FROM ec_hei WHERE base_entity_id = '" + baseEntityId + "'"; + DataMap dataMap = cursor -> getCursorValue(cursor, "hei_number"); + List res = readData(sql, dataMap); + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static String getHeiNumber(String baseEntityId) { + String sql = "SELECT hei_number FROM ec_hei WHERE base_entity_id = '" + baseEntityId + "'"; + DataMap dataMap = cursor -> getCursorValue(cursor, "hei_number"); + List res = readData(sql, dataMap); + return res != null && res.size() > 0 && res.get(0) != null ? res.get(0) : null; + } + + public static boolean hasHivResults(String baseEntityId) { + String sql = "SELECT sample_id FROM ec_hei_followup WHERE sample_id IS NOT NULL AND entity_id = '" + baseEntityId + "'"; + DataMap dataMap = cursor -> getCursorValue(cursor, "sample_id"); + List res = readData(sql, dataMap); + return res != null && res.size() > 0; + } + + public static List getMember() { + String sql = "select m.base_entity_id , m.unique_id , m.relational_id , m.dob , m.first_name , m.middle_name , m.last_name , m.gender , m.phone_number , m.other_phone_number , f.first_name family_name ,f.primary_caregiver , f.family_head , f.village_town ,fh.first_name family_head_first_name , fh.middle_name family_head_middle_name , fh.last_name family_head_last_name, fh.phone_number family_head_phone_number , ancr.is_closed anc_is_closed, pncr.is_closed pnc_is_closed, pcg.first_name pcg_first_name , pcg.last_name pcg_last_name , pcg.middle_name pcg_middle_name , pcg.phone_number pcg_phone_number , mr.* from ec_family_member m inner join ec_family f on m.relational_id = f.base_entity_id inner join ec_hei mr on mr.base_entity_id = m.base_entity_id left join ec_family_member fh on fh.base_entity_id = f.family_head left join ec_family_member pcg on pcg.base_entity_id = f.primary_caregiver left join ec_anc_register ancr on ancr.base_entity_id = m.base_entity_id left join ec_pregnancy_outcome pncr on pncr.base_entity_id = m.base_entity_id where mr.is_closed = 0 "; + + + DataMap dataMap = cursor -> { + MemberObject memberObject = new MemberObject(); + + memberObject.setFirstName(getCursorValue(cursor, "first_name", "")); + memberObject.setMiddleName(getCursorValue(cursor, "middle_name", "")); + memberObject.setLastName(getCursorValue(cursor, "last_name", "")); + memberObject.setAddress(getCursorValue(cursor, "village_town")); + memberObject.setGender(getCursorValue(cursor, "gender")); + memberObject.setUniqueId(getCursorValue(cursor, "unique_id", "")); + memberObject.setAge(getCursorValue(cursor, "dob")); + memberObject.setDod(getCursorValue(cursor, "dod", null)); + memberObject.setFamilyBaseEntityId(getCursorValue(cursor, "relational_id", "")); + memberObject.setRelationalId(getCursorValue(cursor, "relational_id", "")); + memberObject.setPrimaryCareGiver(getCursorValue(cursor, "primary_caregiver")); + memberObject.setFamilyName(getCursorValue(cursor, "family_name", "")); + memberObject.setPhoneNumber(getCursorValue(cursor, "phone_number", "")); + memberObject.setBaseEntityId(getCursorValue(cursor, "base_entity_id", "")); + memberObject.setFamilyHead(getCursorValue(cursor, "family_head", "")); + memberObject.setFamilyHeadPhoneNumber(getCursorValue(cursor, "pcg_phone_number", "")); + memberObject.setFamilyHeadPhoneNumber(getCursorValue(cursor, "family_head_phone_number", "")); + memberObject.setAncMember(getCursorValue(cursor, "anc_is_closed", "")); + memberObject.setPncMember(getCursorValue(cursor, "pnc_is_closed", "")); + + String familyHeadName = getCursorValue(cursor, "family_head_first_name", "") + " " + + getCursorValue(cursor, "family_head_middle_name", ""); + + familyHeadName = + (familyHeadName.trim() + " " + getCursorValue(cursor, "family_head_last_name", "")).trim(); + memberObject.setFamilyHeadName(familyHeadName); + + String familyPcgName = getCursorValue(cursor, "pcg_first_name", "") + " " + + getCursorValue(cursor, "pcg_middle_name", ""); + + familyPcgName = + (familyPcgName.trim() + " " + getCursorValue(cursor, "pcg_last_name", "")).trim(); + memberObject.setPrimaryCareGiverName(familyPcgName); + + return memberObject; + }; + + List res = readData(sql, dataMap); + if (res == null || res.size() == 0) + return null; + + return res; + } + + public static List getMembersByMotherBaseEntityId(String motherBaseEntityId) { + String sql = "select m.base_entity_id , m.unique_id , m.relational_id , m.dob , m.first_name , m.middle_name , m.last_name , m.gender , m.phone_number , m.other_phone_number , f.first_name family_name ,f.primary_caregiver , f.family_head , f.village_town ,fh.first_name family_head_first_name , fh.middle_name family_head_middle_name , fh.last_name family_head_last_name, fh.phone_number family_head_phone_number , ancr.is_closed anc_is_closed, pncr.is_closed pnc_is_closed, pcg.first_name pcg_first_name , pcg.last_name pcg_last_name , pcg.middle_name pcg_middle_name , pcg.phone_number pcg_phone_number , mr.* from ec_family_member m inner join ec_family f on m.relational_id = f.base_entity_id inner join ec_hei mr on mr.base_entity_id = m.base_entity_id left join ec_family_member fh on fh.base_entity_id = f.family_head left join ec_family_member pcg on pcg.base_entity_id = f.primary_caregiver left join ec_anc_register ancr on ancr.base_entity_id = m.base_entity_id left join ec_pregnancy_outcome pncr on pncr.base_entity_id = m.base_entity_id where mr.is_closed = 0 AND mr.mother_entity_id = '" + motherBaseEntityId + "'"; + + + DataMap dataMap = cursor -> { + MemberObject memberObject = new MemberObject(); + + memberObject.setFirstName(getCursorValue(cursor, "first_name", "")); + memberObject.setMiddleName(getCursorValue(cursor, "middle_name", "")); + memberObject.setLastName(getCursorValue(cursor, "last_name", "")); + memberObject.setAddress(getCursorValue(cursor, "village_town")); + memberObject.setGender(getCursorValue(cursor, "gender")); + memberObject.setUniqueId(getCursorValue(cursor, "unique_id", "")); + memberObject.setAge(getCursorValue(cursor, "dob")); + memberObject.setDod(getCursorValue(cursor, "dod", null)); + memberObject.setFamilyBaseEntityId(getCursorValue(cursor, "relational_id", "")); + memberObject.setRelationalId(getCursorValue(cursor, "relational_id", "")); + memberObject.setPrimaryCareGiver(getCursorValue(cursor, "primary_caregiver")); + memberObject.setFamilyName(getCursorValue(cursor, "family_name", "")); + memberObject.setPhoneNumber(getCursorValue(cursor, "phone_number", "")); + memberObject.setBaseEntityId(getCursorValue(cursor, "base_entity_id", "")); + memberObject.setFamilyHead(getCursorValue(cursor, "family_head", "")); + memberObject.setFamilyHeadPhoneNumber(getCursorValue(cursor, "pcg_phone_number", "")); + memberObject.setFamilyHeadPhoneNumber(getCursorValue(cursor, "family_head_phone_number", "")); + memberObject.setAncMember(getCursorValue(cursor, "anc_is_closed", "")); + memberObject.setPncMember(getCursorValue(cursor, "pnc_is_closed", "")); + + String familyHeadName = getCursorValue(cursor, "family_head_first_name", "") + " " + + getCursorValue(cursor, "family_head_middle_name", ""); + + familyHeadName = + (familyHeadName.trim() + " " + getCursorValue(cursor, "family_head_last_name", "")).trim(); + memberObject.setFamilyHeadName(familyHeadName); + + String familyPcgName = getCursorValue(cursor, "pcg_first_name", "") + " " + + getCursorValue(cursor, "pcg_middle_name", ""); + + familyPcgName = + (familyPcgName.trim() + " " + getCursorValue(cursor, "pcg_last_name", "")).trim(); + memberObject.setPrimaryCareGiverName(familyPcgName); + + return memberObject; + }; + + List res = readData(sql, dataMap); + if (res == null || res.size() == 0) + return null; + + return res; + } + + public static void saveAntiBodyTestResults(String baseEntityID, String formSubmissionId, String hivTestResults, String hivTestResultsDate, String ctcNumber) { + String sql = String.format("INSERT INTO ec_hei_hiv_results (id, entity_id, base_entity_id, hei_followup_form_submission_id, hiv_test_result, hiv_test_result_date, ctc_number) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s') ON CONFLICT (id) DO UPDATE SET hiv_test_result = '%s', hiv_test_result_date = '%s', ctc_number = '%s'", baseEntityID, baseEntityID, formSubmissionId, formSubmissionId, hivTestResults, hivTestResultsDate, ctcNumber, hivTestResults, hivTestResultsDate, ctcNumber); + updateDB(sql); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfAncBirthEmergencyPlanDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfAncBirthEmergencyPlanDao.java new file mode 100644 index 000000000..c67e405d0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfAncBirthEmergencyPlanDao.java @@ -0,0 +1,89 @@ +package org.smartregister.chw.hf.dao; + +import org.smartregister.dao.AbstractDao; + +import java.util.List; + +public class HfAncBirthEmergencyPlanDao extends AbstractDao { + private static final String TABLE_NAME = "ec_anc_birth_emergency_plan"; + + public static boolean isAllFilled(String baseEntityId){ + return isDeliveryPlaceIdentified(baseEntityId) + && isBloodDonorIdentified(baseEntityId) + && isHouseholdSupportIdentified(baseEntityId) + && isTransportMethodIdentified(baseEntityId) + && isBirthCompanionIdentified(baseEntityId) + && areEmergencyFundsPrepared(baseEntityId); + } + + public static boolean isDeliveryPlaceIdentified(String baseEntityId) { + //adding a check for name_of_hf because question for delivery place didn't exist prior + DataMap dataMap = cursor -> getCursorValue(cursor, "name_of_hf"); + String sql = String.format( + "SELECT name_of_hf FROM %s WHERE entity_id = '%s'" + + " AND is_closed = 0 AND name_of_hf IS NOT NULL", + TABLE_NAME, baseEntityId); + List res =readData(sql, dataMap); + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static boolean isBloodDonorIdentified(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "blood_donor"); + String sql = String.format( + "SELECT blood_donor FROM %s WHERE entity_id = '%s' " + + "AND is_closed = 0 AND blood_donor is not null AND blood_donor <> 'not_prepared'", + TABLE_NAME, + baseEntityId + ); + List res = readData(sql, dataMap); + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static boolean isHouseholdSupportIdentified(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "household_support"); + String sql = String.format( + "SELECT household_support FROM %s WHERE entity_id = '%s' " + + "AND is_closed = 0 AND household_support is not null AND household_support <> 'not_prepared'", + TABLE_NAME, + baseEntityId + ); + List res = readData(sql, dataMap); + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static boolean isTransportMethodIdentified(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "transport"); + String sql = String.format( + "SELECT transport FROM %s WHERE entity_id = '%s' " + + "AND is_closed = 0 AND transport is not null AND transport <> 'not_prepared'", + TABLE_NAME, + baseEntityId + ); + List res = readData(sql, dataMap); + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static boolean isBirthCompanionIdentified(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "birth_companion"); + String sql = String.format( + "SELECT birth_companion FROM %s WHERE entity_id = '%s' " + + "AND is_closed = 0 AND birth_companion is not null AND birth_companion <> 'not_prepared'", + TABLE_NAME, + baseEntityId + ); + List res = readData(sql, dataMap); + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static boolean areEmergencyFundsPrepared(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "emergency_funds"); + String sql = String.format( + "SELECT emergency_funds FROM %s WHERE entity_id = '%s' " + + "AND is_closed = 0 AND emergency_funds is not null AND emergency_funds <> 'not_prepared'", + TABLE_NAME, + baseEntityId + ); + List res = readData(sql, dataMap); + return res != null && res.size() > 0 && res.get(0) != null; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfAncDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfAncDao.java new file mode 100644 index 000000000..895867b58 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfAncDao.java @@ -0,0 +1,773 @@ +package org.smartregister.chw.hf.dao; + +import org.smartregister.chw.core.dao.AncDao; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class HfAncDao extends AncDao { + + public static boolean isReviewFormFilled(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "name_of_hf"); + + String sql = String.format( + "SELECT name_of_hf FROM %s WHERE base_entity_id = '%s' " + + "AND name_of_hf is not null " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + + return res.size() == 1; + } + + public static boolean isPartnerRegistered(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "partner_base_entity_id"); + + String sql = String.format( + "SELECT partner_base_entity_id FROM %s WHERE base_entity_id = '%s' " + + "AND partner_base_entity_id is not null " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + + return res.size() == 1; + } + + public static String getPartnerBaseEntityId(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "partner_base_entity_id"); + + String sql = String.format( + "SELECT partner_base_entity_id FROM %s WHERE base_entity_id = '%s' " + + "AND partner_base_entity_id is not null " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + + if (res.size() == 1) { + return res.get(0); + } + + return ""; + } + + + public static boolean isPartnerTestedForHiv(String baseEntityId) { + DataMap partnerHivDataMap = cursor -> getCursorValue(cursor, "partner_hiv"); + DataMap reasonForNotConductingPartnerHivTestDataMap = cursor -> getCursorValue(cursor, "reason_for_not_conducting_partner_hiv_test"); + + String sql = String.format( + "SELECT partner_hiv, reason_for_not_conducting_partner_hiv_test FROM %s WHERE base_entity_id = '%s' " + + "AND partner_hiv is not null " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List partnerHivRes = readData(sql, partnerHivDataMap); + List reasonForNotConductingPartnerHivTestRes = readData(sql, reasonForNotConductingPartnerHivTestDataMap); + + if (partnerHivRes.size() == 1) { + if (!partnerHivRes.get(0).equalsIgnoreCase("test_not_conducted")) + return !partnerHivRes.get(0).equalsIgnoreCase("test_not_conducted"); + else if (reasonForNotConductingPartnerHivTestRes.size() == 1) { + return reasonForNotConductingPartnerHivTestRes.get(0).equalsIgnoreCase("known_on_art"); + } + } + + return false; + } + + public static boolean isPartnerHivTestConductedAtWk32(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "partner_hiv_test_at_32"); + + String sql = String.format( + "SELECT partner_hiv_test_at_32 FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + if (res.get(0) != null) + return res.get(0).equalsIgnoreCase("true"); + + return false; + } + + public static int getPartnerHivTestNumber(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "partner_hiv"); + DataMap testNumberMap = cursor -> getCursorValue(cursor, "partner_hiv_test_number"); + String sql = String.format( + "SELECT partner_hiv,partner_hiv_test_number FROM %s WHERE base_entity_id = '%s' " + + " AND partner_hiv IS NOT NULL" + + " AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + List testNumberRes = readData(sql, testNumberMap); + if (res.size() > 0) { + if (res.get(0).equalsIgnoreCase("test_not_conducted")) { + return Integer.parseInt(testNumberRes.get(0)) - 1; + } + return Integer.parseInt(testNumberRes.get(0)); + } + return 0; + } + + public static int getNextPartnerHivTestNumber(String baseEntityId) { + return getPartnerHivTestNumber(baseEntityId) + 1; + } + + public static String getPartnerHivStatus(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "partner_hiv"); + + String sql = String.format( + "SELECT partner_hiv FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0); + } + return "null"; + } + + public static boolean isPartnerTestedForSyphilis(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "partner_syphilis"); + + String sql = String.format( + "SELECT partner_syphilis FROM %s WHERE base_entity_id = '%s' " + + "AND partner_syphilis is not null " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + + if (res.size() == 1) { + return !res.get(0).equalsIgnoreCase("test_not_conducted"); + } + + return false; + } + + public static boolean isPartnerTestedForHepatitis(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "partner_hepatitis"); + + String sql = String.format( + "SELECT partner_hepatitis FROM %s WHERE base_entity_id = '%s' " + + "AND partner_hepatitis is not null " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + + if (res.size() == 1) { + return !res.get(0).equalsIgnoreCase("test_not_conducted"); + } + + return false; + } + + public static String getPartnerOtherStdsStatus(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "partner_other_stds"); + + String sql = String.format( + "SELECT partner_other_stds FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + if (res.get(0) != null) { + return res.get(0); + } + return "null"; + } + + public static boolean isClientClosed(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "is_closed"); + + String sql = String.format( + "SELECT is_closed FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 1", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + + return res.size() == 1; + } + + public static boolean isTestConducted(String testName, String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, testName); + + String sql = String.format( + "SELECT %s FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0", + testName, + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) + return res.get(0).equalsIgnoreCase("positive") || res.get(0).equalsIgnoreCase("negative"); + return false; + } + + public static boolean isDewormingGiven(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "deworming"); + String sql = String.format( + "SELECT deworming FROM %s WHERE entity_id = '%s' " + + "AND is_closed = 0 AND deworming is not null AND deworming <> 'medication_not_given'", + "ec_anc_followup", + baseEntityId + ); + + List res = readData(sql, dataMap); + return res != null && res.size() > 0 && res.get(0) != null; + } + + //This method is used to obtain previous values during Editing Visits. + public static boolean wasDewormingGivenPreviously(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "deworming"); + String sql = String.format( + "SELECT deworming FROM %s WHERE entity_id = '%s' " + + "AND is_closed = 0 AND deworming is not null AND deworming <> 'medication_not_given' ORDER BY visit_date DESC Limit 1,1", + "ec_anc_followup", + baseEntityId + ); + + List res = readData(sql, dataMap); + return res != null && res.size() > 0 && res.get(0) != null; + } + + //This method is used to obtain previous values during Editing Visits. + public static boolean isDewormingGivenPreviously(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "deworming"); + String sql = String.format( + "SELECT deworming FROM %s WHERE entity_id = '%s' " + + "AND is_closed = 0 AND deworming is not null AND deworming <> 'medication_not_given' ORDER BY visit_date DESC Limit 1", + "ec_anc_followup", + baseEntityId + ); + + List res = readData(sql, dataMap); + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static String malariaLastIptDose(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "malaria_preventive_therapy"); + + String sql = String.format( + "SELECT malaria_preventive_therapy FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0); + } + return "null"; + } + + public static String malariaIptDosage(String iptDosage, String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, iptDosage); + + String sql = String.format( + "SELECT %s FROM %s WHERE entity_id = '%s' " + + "AND is_closed = 0 AND %s IS NOT NULL ORDER BY visit_date DESC Limit 1", + iptDosage, + "ec_anc_followup", + baseEntityId, + iptDosage + ); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0); + } + return "null"; + } + + //This method is used to obtain previous Malaria IPT Dosage during Editing Visits. + public static String previousMalariaIptDosage(String iptDosage, String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, iptDosage); + + String sql = String.format( + "SELECT %s FROM %s WHERE entity_id = '%s' " + + "AND is_closed = 0 AND %s IS NOT NULL ORDER BY visit_date DESC Limit 1,1", + iptDosage, + "ec_anc_followup", + baseEntityId, + iptDosage + ); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0); + } + return "null"; + } + + public static boolean isHivTestConductedAtWk32(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "hiv_test_at_32"); + + String sql = String.format( + "SELECT hiv_test_at_32 FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + if (res.get(0) != null) + return res.get(0).equalsIgnoreCase("true"); + + return false; + } + + public static int getHivTestNumber(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "hiv"); + DataMap testNumberMap = cursor -> getCursorValue(cursor, "hiv_test_number"); + String sql = String.format( + "SELECT hiv, hiv_test_number FROM %s WHERE base_entity_id = '%s' " + + " AND hiv IS NOT NULL" + + " AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + List testNumberRes = readData(sql, testNumberMap); + if (res.size() > 0) { + if (res.get(0).equalsIgnoreCase("test_not_conducted")) { + return Integer.parseInt(testNumberRes.get(0)) - 1; + } + return Integer.parseInt(testNumberRes.get(0)); + } + return 0; + } + + public static int getNextHivTestNumber(String baseEntityId) { + return getHivTestNumber(baseEntityId) + 1; + } + + public static String getHivStatus(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "hiv"); + + String sql = String.format( + "SELECT CASE known_on_art\n" + + " WHEN 'true'\n" + + " THEN 'positive'\n" + + " ELSE hiv\n" + + " END\n" + + " as 'hiv'\n" + + "FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0); + } + return "null"; + } + + public static boolean isClientKnownOnArt(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "known_on_art"); + + String sql = String.format( + "SELECT known_on_art\n" + + "FROM %s WHERE base_entity_id = '%s' " + + "AND known_on_art IS NOT NULL " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + return res.size() > 0 && !res.get(0).equalsIgnoreCase("null") && !res.get(0).equalsIgnoreCase("0"); + } + + public static String getClientCtcNumber(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "ctc_number"); + + String sql = String.format( + "SELECT ctc_number FROM %s WHERE base_entity_id = '%s' " + + " AND ctc_number IS NOT NULL" + + " AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0); + } + return "null"; + } + + public static String getClientHeight(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "height"); + + String sql = String.format( + "SELECT height FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + if (res.get(0) != null) { + return res.get(0); + } + return "null"; + } + + public static int getVisitNumber(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "visit_number"); + + String sql = String.format( + "SELECT visit_number FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + if (res.get(0) != null) { + return Integer.parseInt(res.get(0)); + } + return 0; + } + + public static String getFundalHeight(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "fundal_height"); + + String sql = String.format( + "SELECT fundal_height FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0); + } + return "12"; + } + + public static List getPresentTaskIds(String baseEntityId) { + DataMap> dataMap = cursor -> Collections.singletonList(getCursorValue(cursor, "task_id")); + + String sql = String.format( + "SELECT task_id FROM ec_anc_register WHERE base_entity_id = '%s' ", baseEntityId); + + List> res = readData(sql, dataMap); + if (res.size() > 0) { + return res.get(0); + } + return new ArrayList<>(); + } + + public static boolean isLLINProvided(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "llin_provision"); + + String sql = String.format( + "SELECT llin_provision FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0", + "ec_anc_register", + baseEntityId + ); + + List res = readData(sql, dataMap); + if (res.get(0) != null) { + return res.get(0).equalsIgnoreCase("yes"); + } + return false; + } + + public static boolean isEligibleForTtVaccination(String baseEntityId) { + DataMap> dataMap = cursor -> Collections.singletonList(getCursorValue(cursor, "tt_vaccination_type")); + + String sql = "SELECT tt_vaccination_type FROM ec_anc_register WHERE base_entity_id = '" + baseEntityId + "' AND tt_vaccination_type like '%tt5%'"; + + List> res = readData(sql, dataMap); + return res == null || res.size() <= 0; + } + + public static boolean isTransferInClient(String baseEntityId) { + DataMap> dataMap = cursor -> Collections.singletonList(getCursorValue(cursor, "is_transfer_in")); + + String sql = "SELECT is_transfer_in FROM ec_anc_register WHERE base_entity_id = '" + baseEntityId + "' AND is_transfer_in = true"; + + List> res = readData(sql, dataMap); + return res != null && res.size() > 0; + } + + public static String getIptDoses(String baseEntityId) { + int iptDoses = 0; + DataMap dataMap = cursor -> getCursorValue(cursor, "malaria_preventive_therapy"); + String sql = "SELECT malaria_preventive_therapy FROM ec_anc_register WHERE base_entity_id = '" + baseEntityId + "' AND malaria_preventive_therapy IS NOT NULL AND malaria_preventive_therapy <> '0' "; + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return res.get(0).split("ipt")[1]; + } + + return String.valueOf(iptDoses); + } + + public static String getMalariaTestResults(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "mRDT_for_malaria"); + String sql = "SELECT mRDT_for_malaria FROM ec_anc_register WHERE base_entity_id = '" + baseEntityId + "' AND mRDT_for_malaria IS NOT NULL"; + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return res.get(0); + } + + return "test_not_conducted"; + } + + public static String getTTDoses(String baseEntityId) { + DataMap> dataMap = cursor -> Collections.singletonList(getCursorValue(cursor, "tt_vaccination_type")); + + String sql = "SELECT tt_vaccination_type FROM ec_anc_register WHERE base_entity_id = '" + baseEntityId + "'"; + + List> res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return String.valueOf(res.get(0).toString().split(",").length); + } + return ""; + } + + public static String getLastMeasuredHB(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "hb_level"); + + String sql = String.format( + "SELECT hb_level FROM %s WHERE entity_id = '%s' " + + "AND is_closed = 0 " + + "AND hb_level IS NOT NULL " + + "ORDER BY visit_date DESC LIMIT 1 ", + "ec_anc_followup", + baseEntityId + ); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return res.get(0); + } + return ""; + } + + public static String getLastMeasuredHBDate(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "measured_date"); + + String sql = "SELECT strftime('%d-%m-%Y', datetime(visit_date / 1000, 'unixepoch')) measured_date " + + " FROM ec_anc_followup " + + " WHERE entity_id = '" + baseEntityId + "' " + + " AND hb_level IS NOT NULL" + + " AND is_closed = 0" + + " ORDER BY visit_date desc" + + " LIMIT 1"; + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return res.get(0); + } + return ""; + } + + public static String getSyphilisTestResult(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "syphilis"); + + String sql = String.format( + "SELECT syphilis FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0 " + + "AND syphilis IS NOT NULL ", + "ec_anc_register", + baseEntityId); + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return res.get(0); + } + return ""; + } + + + public static boolean getSyphilisTreatment(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "syphilis_treatment"); + + String sql = String.format( + "SELECT syphilis_treatment FROM %s WHERE entity_id = '%s' " + + "AND is_closed = 0 " + + "AND syphilis_treatment IS NOT NULL " + + "ORDER BY visit_date DESC LIMIT 1 ", + "ec_anc_followup", + baseEntityId + ); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return res.get(0).equalsIgnoreCase("yes"); + } + return false; + } + + public static String getBloodGroup(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "blood_group"); + String sql = String.format( + "SELECT blood_group FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0 " + + "AND blood_group IS NOT NULL ", + "ec_anc_register", + baseEntityId); + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return res.get(0); + } + return ""; + } + + public static String getRhFactor(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "rh_factor"); + String sql = String.format( + "SELECT rh_factor FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0 " + + "AND rh_factor IS NOT NULL ", + "ec_anc_register", + baseEntityId); + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return res.get(0); + } + return ""; + } + + public static String getHivTestDate(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "date_anc_hiv_test"); + String sql = String.format( + "SELECT date_anc_hiv_test FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0 " + + "AND date_anc_hiv_test IS NOT NULL ", + "ec_anc_register", + baseEntityId); + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return res.get(0); + } + return ""; + } + + public static String getParity(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "parity"); + String sql = String.format( + "SELECT parity FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0 " + + "AND parity IS NOT NULL ", + "ec_anc_register", + baseEntityId); + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return res.get(0); + } + return ""; + } + + public static String getMedicalAndSurgicalHistory(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "medical_surgical_history"); + String sql = String.format( + "SELECT medical_surgical_history FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0 " + + "AND medical_surgical_history IS NOT NULL ", + "ec_anc_register", + baseEntityId); + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return res.get(0); + } + return ""; + } + + public static String getOtherMedicalAndSurgicalHistory(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "other_medical_surgical_history"); + String sql = String.format( + "SELECT other_medical_surgical_history FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0 " + + "AND other_medical_surgical_history IS NOT NULL ", + "ec_anc_register", + baseEntityId); + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return res.get(0); + } + return ""; + } + + public static String getNumberOfSurvivingChildren(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "no_surv_children"); + String sql = String.format( + "SELECT no_surv_children FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0 " + + "AND no_surv_children IS NOT NULL ", + "ec_anc_register", + baseEntityId); + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return res.get(0); + } + return ""; + } + + public static boolean hasNoFollowups(String baseEntityId) { + DataMap dataMap = cursor -> getCursorIntValue(cursor, "count"); + String sql = String.format( + "SELECT count(*) as count FROM %s WHERE entity_id = '%s' " + + "AND is_closed = 0 ", + "ec_anc_followup", + baseEntityId); + List res = readData(sql, dataMap); + return res != null && res.size() > 0; + } + + public static boolean isBloodGroupTestConducted(String baseEntityId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "blood_group"); + String sql = String.format( + "SELECT blood_group FROM %s WHERE base_entity_id = '%s' " + + "AND is_closed = 0 " + + "AND blood_group IS NOT NULL ", + "ec_anc_register", + baseEntityId); + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) { + return !res.get(0).equalsIgnoreCase("test_not_conducted"); + } + return false; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfChildDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfChildDao.java new file mode 100644 index 000000000..64227f508 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfChildDao.java @@ -0,0 +1,57 @@ +package org.smartregister.chw.hf.dao; + +import org.smartregister.chw.core.domain.Child; +import org.smartregister.dao.AbstractDao; + +import java.util.List; + +public class HfChildDao extends AbstractDao { + public static String getNoMotherChildQuery(String baseEntityID) { + return "select c.base_entity_id , c.first_name , c.last_name , c.middle_name , c.mother_entity_id , c.relational_id , c.dob , c.date_created , lastVisit.last_visit_date , last_visit_not_done_date " + + "from ec_child c " + + "inner join ec_family_member m on c.base_entity_id = m.base_entity_id COLLATE NOCASE " + + "inner join ec_family f on f.base_entity_id = m.relational_id COLLATE NOCASE " + + "left join ( " + + " select base_entity_id , max(visit_date) last_visit_date " + + " from visits " + + " where visit_type in ('Child Home Visit') " + + " group by base_entity_id " + + ") lastVisit on lastVisit.base_entity_id = c.base_entity_id " + + "left join ( " + + " select base_entity_id , max(visit_date) last_visit_not_done_date " + + " from visits " + + " where visit_type in ('Visit not done') " + + " group by base_entity_id " + + ") lastVisitNotDone on lastVisitNotDone.base_entity_id = c.base_entity_id " + + "where c.base_entity_id = '" + baseEntityID + "' " + + "and m.date_removed is null and m.is_closed = 0 " + + "and ((( julianday('now') - julianday(c.dob))/365.25) < 5) and c.is_closed = 0 "; + } + + public static Child getNoMotherChild(String baseEntityID) { + String sql = getNoMotherChildQuery(baseEntityID); + + List values = AbstractDao.readData(sql, getChildDataMap()); + if (values == null || values.size() != 1) + return null; + + return values.get(0); + } + + public static AbstractDao.DataMap getChildDataMap() { + return c -> { + Child record = new Child(); + record.setBaseEntityID(getCursorValue(c, "base_entity_id")); + record.setFirstName(getCursorValue(c, "first_name")); + record.setLastName(getCursorValue(c, "last_name")); + record.setMiddleName(getCursorValue(c, "middle_name")); + record.setMotherBaseEntityID(getCursorValue(c, "mother_entity_id")); + record.setFamilyBaseEntityID(getCursorValue(c, "relational_id")); + record.setDateOfBirth(getCursorValueAsDate(c, "dob", getDobDateFormat())); + record.setDateCreated(getCursorValueAsDate(c, "date_created", getDobDateFormat())); + record.setLastVisitDate(getCursorValueAsDate(c, "last_visit_date")); + record.setLastVisitNotDoneDate(getCursorValueAsDate(c, "last_visit_not_done_date")); + return record; + }; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfFollowupFeedbackDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfFollowupFeedbackDao.java new file mode 100644 index 000000000..c3080ffef --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfFollowupFeedbackDao.java @@ -0,0 +1,61 @@ +package org.smartregister.chw.hf.dao; + +import org.smartregister.chw.hf.model.ChwFollowupFeedbackDetailsModel; +import org.smartregister.dao.AbstractDao; + +import java.util.List; + +/** + * Created by cozej4 on 6/21/20. + * + * @author cozej4 https://github.com/cozej4 + */ +public class HfFollowupFeedbackDao extends AbstractDao { + + public static AbstractDao.DataMap dataMap = cursor -> { + ChwFollowupFeedbackDetailsModel followupFeedbackDetailsModel = new ChwFollowupFeedbackDetailsModel(); + followupFeedbackDetailsModel.setBaseEntityId(getCursorValue(cursor, "entity_id")); + followupFeedbackDetailsModel.setFeedbackFormSubmissionId(getCursorValue(cursor, "base_entity_id")); + followupFeedbackDetailsModel.setChwName(getCursorValue(cursor, "chw_name")); + followupFeedbackDetailsModel.setFollowupFeedback(getCursorValue(cursor, "followup_status")); + followupFeedbackDetailsModel.setFollowupFeedbackDate(getCursorValue(cursor, "pmtct_community_followup_visit_date")); + followupFeedbackDetailsModel.setFeedbackType(getCursorValue(cursor, "feedback_type")); + return followupFeedbackDetailsModel; + }; + + public static List getHivFollowupFeedback(String baseEntityId) { + String sql = String.format( + "SELECT 'HIV' as feedback_type, ec_hiv_community_feedback.* FROM ec_hiv_community_feedback " + + "WHERE ec_hiv_community_feedback.entity_id = '%s' AND mark_as_done IS NULL ", baseEntityId); + List feedbackList = readData(sql, dataMap); + + if (feedbackList == null) + return null; + + return feedbackList; + } + + public static List getPmtctFollowupFeedback(String baseEntityId) { + String sql = String.format( + "SELECT 'PMTCT' as feedback_type, ec_pmtct_community_feedback.* FROM ec_pmtct_community_feedback " + + "WHERE ec_pmtct_community_feedback.entity_id = '%s' AND mark_as_done IS NULL ", baseEntityId); + List feedbackList = readData(sql, dataMap); + + if (feedbackList == null) + return null; + + return feedbackList; + } + + public static List getTbFollowupFeedback(String baseEntityId) { + String sql = String.format( + "SELECT 'TB' as feedback_type, ec_tb_community_feedback.* FROM ec_tb_community_feedback " + + "WHERE ec_tb_community_feedback.entity_id = '%s' AND mark_as_done IS NULL ", baseEntityId); + List feedbackList = readData(sql, dataMap); + + if (feedbackList == null) + return null; + + return feedbackList; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfHivDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfHivDao.java new file mode 100644 index 000000000..bfb95e56f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfHivDao.java @@ -0,0 +1,19 @@ +package org.smartregister.chw.hf.dao; + +import org.smartregister.dao.AbstractDao; + +import java.util.List; + +public class HfHivDao extends AbstractDao { + public static boolean isHivMember(String baseEntityId) { + String sql = "select count(*) count from ec_hiv_register where base_entity_id = '" + baseEntityId + "'" + " AND (UPPER (ec_hiv_register.client_hiv_status_after_testing) LIKE UPPER('Positive')) "; + + DataMap dataMap = cursor -> getCursorIntValue(cursor, "count"); + + List res = readData(sql, dataMap); + + if (res == null || res.size() < 1) + return false; + return res.get(0) == 1; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfHtsDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfHtsDao.java new file mode 100644 index 000000000..062990c6c --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfHtsDao.java @@ -0,0 +1,140 @@ +package org.smartregister.chw.hf.dao; + + +import org.smartregister.chw.hiv.domain.HivMemberObject; +import org.smartregister.chw.hiv.util.DBConstants; +import org.smartregister.dao.AbstractDao; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +import timber.log.Timber; + +public class HfHtsDao extends AbstractDao { + + private static DataMap dataMap; + + public static DataMap getDataMap() { + if (dataMap == null) { + dataMap = cursor -> { + HivMemberObject memberObject = new HivMemberObject(null); + memberObject.setFirstName(getCursorValue(cursor, DBConstants.Key.FIRST_NAME, "")); + memberObject.setMiddleName(getCursorValue(cursor, DBConstants.Key.MIDDLE_NAME, "")); + memberObject.setLastName(getCursorValue(cursor, DBConstants.Key.LAST_NAME, "")); + memberObject.setAddress(getCursorValue(cursor, DBConstants.Key.VILLAGE_TOWN, "")); + memberObject.setGender(getCursorValue(cursor, DBConstants.Key.GENDER)); + memberObject.setUniqueId(getCursorValue(cursor, DBConstants.Key.UNIQUE_ID, "")); + memberObject.setAge(getCursorValue(cursor, DBConstants.Key.DOB)); + memberObject.setFamilyBaseEntityId(getCursorValue(cursor, DBConstants.Key.FAMILY_BASE_ENTITY_ID, "")); + memberObject.setRelationalId(getCursorValue(cursor, DBConstants.Key.FAMILY_BASE_ENTITY_ID, "")); + memberObject.setPrimaryCareGiver(getCursorValue(cursor, DBConstants.Key.PRIMARY_CARE_GIVER)); + try { + memberObject.setCommunityReferralFormId(getCursorValue(cursor, DBConstants.Key.COMMUNITY_REFERRAL_FORM_ID, "")); + } catch (Exception e) { + Timber.e(e); + } + memberObject.setFamilyName(getCursorValue(cursor, DBConstants.Key.FAMILY_NAME, "")); + memberObject.setPhoneNumber(getCursorValue(cursor, DBConstants.Key.PHONE_NUMBER, "")); + memberObject.setBaseEntityId(getCursorValue(cursor, DBConstants.Key.BASE_ENTITY_ID, "")); + memberObject.setFamilyHead(getCursorValue(cursor, DBConstants.Key.FAMILY_HEAD, "")); + memberObject.setFamilyHeadPhoneNumber(getCursorValue(cursor, DBConstants.Key.FAMILY_HEAD_PHONE_NUMBER, "")); + memberObject.setCtcNumber(getCursorValue(cursor, DBConstants.Key.CTC_NUMBER, "")); + memberObject.setCbhsNumber(getCursorValue(cursor, DBConstants.Key.CBHS_NUMBER, "")); + memberObject.setTbNumber(getCursorValue(cursor, DBConstants.Key.TB_NUMBER, "")); + memberObject.setMatNumber(getCursorValue(cursor, DBConstants.Key.MAT_NUMBER, "")); + memberObject.setRchNumber(getCursorValue(cursor, DBConstants.Key.RCH_NUMBER, "")); + memberObject.setClientHivStatusDuringRegistration(getCursorValue( + cursor, + DBConstants.Key.CLIENT_HIV_STATUS_DURING_REGISTRATION, + "" + )); + + memberObject.setClientHivStatusAfterTesting(getCursorValue(cursor, DBConstants.Key.CLIENT_HIV_STATUS_AFTER_TESTING, "")); + + memberObject.setHivRegistrationDate( + new Date( + new BigDecimal( + getCursorValue( + cursor, + DBConstants.Key.HIV_REGISTRATION_DATE, "0" + ) + ).longValue() + )); + + memberObject.setHivCommunityReferralDate( + new Date( + new BigDecimal( + getCursorValue(cursor, DBConstants.Key.HIV_COMMUNITY_REFERRAL_DATE, "0") + ).longValue() + )); + + memberObject.setLastFacilityVisitDate( + new Date( + new BigDecimal( + getCursorValue(cursor, DBConstants.Key.LAST_FACILITY_VISIT_DATE, "0") + ).longValue() + )); + + memberObject.setReasonsForIssuingCommunityFollowupReferral(getCursorValue(cursor, DBConstants.Key.REASONS_FOR_ISSUING_COMMUNITY_REFERRAL, "")); + memberObject.setComment(getCursorValue(cursor, DBConstants.Key.COMMENTS, "")); + memberObject.setClientFollowupStatus(getCursorValue(cursor, DBConstants.Key.CLIENT_FOLLOWUP_STATUS, "")); + memberObject.setClosed(getCursorIntValue(cursor, DBConstants.Key.IS_CLOSED, 0) == 1); + + String familyHeadName = getCursorValue(cursor, "family_head_first_name", "") + " " + getCursorValue(cursor, "family_head_middle_name", ""); + + familyHeadName = familyHeadName.trim() + getCursorValue(cursor, "family_head_last_name", "").trim(); + memberObject.setFamilyHead(familyHeadName); + + String entityType = getCursorValue(cursor, "entity_type", ""); + String familyPcgName = ""; + if (entityType.equals("ec_independent_client")) { + familyPcgName = getCursorValue(cursor, "primary_caregiver_name", ""); + memberObject.setPrimaryCareGiverPhoneNumber(getCursorValue(cursor, DBConstants.Key.OTHER_PHONE_NUMBER, "")); + } else { + familyPcgName = (getCursorValue(cursor, "pcg_first_name", "") + " " + + getCursorValue(cursor, "pcg_middle_name", "")); + familyPcgName = + (familyPcgName.trim() + " " + getCursorValue( + cursor, + "pcg_last_name", + "" + )).trim(); + memberObject.setPrimaryCareGiverPhoneNumber( + getCursorValue(cursor, DBConstants.Key.PRIMARY_CARE_GIVER_PHONE_NUMBER, "")); + } + + memberObject.setPrimaryCareGiver(familyPcgName); + memberObject.setFamilyMemberEntityType(getCursorValue(cursor, DBConstants.Key.FAMILY_MEMBER_ENTITY_TYPE, "")); + return memberObject; + }; + + } + return dataMap; + } + + public static HivMemberObject getMember(String baseEntityId) { + + + String sql = String.format( + " select m.base_entity_id , m.unique_id , m.relational_id as family_base_entity_id , m.dob , m.first_name , " + + " m.middle_name , m.last_name , m.gender , m.phone_number , m.other_phone_number , m.entity_type, m.has_primary_caregiver, m.has_primary_caregiver, m.primary_caregiver_name, " + + " f.first_name family_name ,f.primary_caregiver , f.family_head , f.village_town , " + + " fh.first_name family_head_first_name , fh.middle_name family_head_middle_name , " + + " fh.last_name family_head_last_name, fh.phone_number family_head_phone_number, " + + " pcg.first_name pcg_first_name , pcg.last_name pcg_last_name , pcg.middle_name pcg_middle_name , " + + " pcg.phone_number pcg_phone_number , mr.* " + + " from ec_family_member m " + + " inner join ec_family f on m.relational_id = f.base_entity_id " + + " left join ec_hts_register mr on mr.base_entity_id = m.base_entity_id " + + " left join ec_family_member fh on fh.base_entity_id = f.family_head " + + " left join ec_family_member pcg on pcg.base_entity_id = f.primary_caregiver " + + " where m.base_entity_id ='%s' ", + baseEntityId + ); + + List res = readData(sql, getDataMap()); + + return (res == null || res.size() == 0) ? null : res.get(0); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfKvpDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfKvpDao.java new file mode 100644 index 000000000..2de3661e4 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfKvpDao.java @@ -0,0 +1,107 @@ +package org.smartregister.chw.hf.dao; + +import org.smartregister.chw.kvp.dao.KvpDao; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Locale; + +import timber.log.Timber; + +public class HfKvpDao extends KvpDao { + + public static String getClientStatus(String baseEntityId) { + String sql = "SELECT client_status FROM ec_kvp_bio_medical_services p " + + " WHERE p.entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "client_status"); + + List res = readData(sql, dataMap); + if (res != null && res.size() != 0 && res.get(0) != null) { + return res.get(0); + } + return ""; + } + + public static boolean hasPrepFollowup(String baseEntityId) { + String sql = "SELECT visit_type FROM ec_prep_followup p " + + " WHERE p.entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "visit_type"); + + List res = readData(sql, dataMap); + return res != null && res.size() != 0 && res.get(0) != null; + } + + public static Date getHbvTestDate(String baseEntityId) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + String sql = "SELECT hbv_test_date FROM ec_prep_register p " + + " WHERE p.base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "hbv_test_date"); + + List res = readData(sql, dataMap); + if (res != null && res.size() != 0 && res.get(0) != null) { + try { + return simpleDateFormat.parse(res.get(0)); + } catch (ParseException e) { + Timber.e(e); + return null; + } + } + return null; + } + + public static Date getHcvTestDate(String baseEntityId) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + String sql = "SELECT hcv_test_date FROM ec_prep_register p " + + " WHERE p.base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "hcv_test_date"); + + List res = readData(sql, dataMap); + if (res != null && res.size() != 0 && res.get(0) != null) { + try { + return simpleDateFormat.parse(res.get(0)); + } catch (ParseException e) { + Timber.e(e); + return null; + } + } + return null; + } + + public static Date getCrclTestDate(String baseEntityId) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + String sql = "SELECT crcl_test_date FROM ec_prep_register p " + + " WHERE p.base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "crcl_test_date"); + + List res = readData(sql, dataMap); + if (res != null && res.size() != 0 && res.get(0) != null) { + try { + return simpleDateFormat.parse(res.get(0)); + } catch (ParseException e) { + Timber.e(e); + return null; + } + } + return null; + } + + public static String getCrclResults(String baseEntityId) { + String sql = "SELECT crcl_results FROM ec_prep_register p " + + " WHERE p.base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "crcl_results"); + + List res = readData(sql, dataMap); + if (res != null && res.size() != 0 && res.get(0) != null) { + return res.get(0); + } + return null; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfPmtctDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfPmtctDao.java new file mode 100644 index 000000000..bbf8d18c7 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfPmtctDao.java @@ -0,0 +1,661 @@ +package org.smartregister.chw.hf.dao; + +import org.joda.time.LocalDate; +import org.joda.time.Months; +import org.smartregister.chw.core.dao.CorePmtctDao; +import org.smartregister.chw.hf.utils.TimeUtils; +import org.smartregister.chw.pmtct.domain.MemberObject; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; + +import timber.log.Timber; + + +public class HfPmtctDao extends CorePmtctDao { + public static boolean isEligibleForEac(String baseEntityID) { + boolean enrollToEac = isToBeEnrolledToEac(baseEntityID); + boolean hasEacVisits = hasEacVisits(baseEntityID); + boolean isEacCompleted = isEacCompleted(baseEntityID); + + + if (enrollToEac) { + if (hasEacVisits) { + return !isEacCompleted; + } + return true; + } + return false; + } + + public static boolean isEligibleForHlvTest(String baseEntityID) { + Boolean eligible = isEligibleForHlvTestForNewlyRegisteredClients(baseEntityID); + if (eligible != null) { + return eligible; + } + + eligible = isEligibleForHlvTestForNewlyRegisteredClientsWithVisitsButNotTestedViralLoad(baseEntityID); + if (eligible != null) { + return eligible; + } + + + eligible = isEligibleForHlvTestForClientsWithPreviousLackOfSuppression(baseEntityID); + if (eligible != null) { + return eligible; + } + + eligible = isEligibleForHlvTestForClientsWithPreviousHvlTests(baseEntityID); + if (eligible != null) { + return eligible; + } + + return false; + } + + public static Boolean isEligibleForHlvTestForNewlyRegisteredClients(String baseEntityID) { + //Checking eligibility for newly registered PMTCT Clients + String sql = "SELECT known_on_art FROM ec_pmtct_registration p WHERE p.base_entity_id = '" + baseEntityID + "' AND p.base_entity_id NOT IN (SELECT entity_id FROM ec_pmtct_followup)"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "known_on_art"); + List res = readData(sql, dataMap); + + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0).equalsIgnoreCase("yes"); + } + return null; + } + + public static Boolean isEligibleForHlvTestForNewlyRegisteredClientsWithVisitsButNotTestedViralLoad(String baseEntityID) { + //Checking eligibility for newly registered PMTCT clients with visits but who have not tested Viral Load + String sql = "SELECT pmtct_register_date FROM ec_pmtct_registration p WHERE p.base_entity_id = '" + baseEntityID + "' AND known_on_art = 'no' AND p.base_entity_id NOT IN (SELECT entity_id FROM ec_pmtct_followup WHERE hvl_sample_id IS NOT NULL)"; + + DataMap registrationDateMap = cursor -> getCursorValue(cursor, "pmtct_register_date"); + List res = readData(sql, registrationDateMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + return getElapsedTimeInMonths(res.get(0)) >= 3; + } + return null; + } + + public static Boolean isEligibleForHlvTestForClientsWithPreviousLackOfSuppression(String baseEntityID) { + //Checking eligibility for PMTCT clients with lack of suppression after EAC visits + String sql = "SELECT hvl_collection_date\n" + + "FROM (SELECT *\n" + + " FROM ec_pmtct_followup\n" + + " WHERE entity_id = '" + baseEntityID + "'\n" + + " AND hvl_sample_id IS NOT NULL\n" + + " AND hvl_collection_date IS NOT NULL\n" + + " ORDER BY visit_number DESC\n" + + " LIMIT 1) pm\n" + + " INNER JOIN ec_pmtct_hvl_results ephr on pm.base_entity_id = ephr.hvl_pmtct_followup_form_submission_id\n" + + "WHERE ephr.enroll_to_eac IS NOT NULL AND ephr.enroll_to_eac = 'yes' "; + + String completionSql = "SELECT strftime('%d-%m-%Y', form_submission_timestamp) as completion_date " + + " FROM ec_pmtct_eac_visit " + + " WHERE entity_id = '" + baseEntityID + "'" + + " AND eac_completion_status = 'complete' " + + " ORDER BY form_submission_timestamp DESC " + + " LIMIT 1"; + + SimpleDateFormat dt = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + + DataMap hvlCollectionDateMap = cursor -> getCursorValue(cursor, "hvl_collection_date"); + DataMap completionDateMap = cursor -> getCursorValue(cursor, "completion_date"); + List hvlCollectionDateRes = readData(sql, hvlCollectionDateMap); + List completionDateRes = readData(completionSql, completionDateMap); + + if (hvlCollectionDateRes != null && hvlCollectionDateRes.size() > 0 && hvlCollectionDateRes.get(0) != null) { + if (completionDateRes != null && completionDateRes.size() > 0 && completionDateRes.get(0) != null) { + Date completionDate = null; + Date hvlCollectionDate = null; + try { + completionDate = dt.parse(completionDateRes.get(0)); + hvlCollectionDate = dt.parse(hvlCollectionDateRes.get(0)); + } catch (ParseException e) { + e.printStackTrace(); + } + return completionDate != null && completionDate.after(hvlCollectionDate); + } + return null; + } + return null; + } + + public static Boolean isEligibleForHlvTestForClientsWithPreviousHvlTests(String baseEntityID) { + //Checking eligibility for registered PMTCT clients with previous Viral Load tests + String sql = + "SELECT hvl_collection_date " + + "FROM ec_pmtct_followup epf " + + "WHERE epf.hvl_sample_id IS NOT NULL AND epf.entity_id = '" + baseEntityID + "' " + + "ORDER BY epf.visit_number DESC " + + "LIMIT 1"; + + + DataMap hvlCollectionDateMap = cursor -> getCursorValue(cursor, "hvl_collection_date"); + List res = readData(sql, hvlCollectionDateMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + return getElapsedTimeInMonths(res.get(0)) >= 6; + } + return null; + } + + public static boolean isEligibleForCD4Retest(String baseEntityID) { + String sql = "SELECT cd4_collection_date\n" + + "FROM (SELECT *\n" + + " FROM ec_pmtct_followup f\n" + + " WHERE f.entity_id = '" + baseEntityID + "'\n" + + " AND cd4_sample_id IS NOT NULL\n" + + " AND cd4_collection_date IS NOT NULL\n" + + " ORDER BY visit_number DESC\n" + + " LIMIT 1) f\n" + + " LEFT JOIN ec_pmtct_cd4_results epc4r on f.base_entity_id = epc4r.cd4_pmtct_followup_form_submission_id\n" + + "WHERE epc4r.cd4_result IS NULL\n" + + " OR CAST(epc4r.cd4_result as INT) < 350\n" + + "ORDER BY visit_number DESC\n" + + "LIMIT 1"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "cd4_collection_date"); + List res = readData(sql, dataMap); + + if (res != null && res.size() > 0 && res.get(0) != null) { + return getElapsedTimeInMonths(res.get(0)) >= 6; + } + return false; + } + + public static boolean isEligibleForCD4Test(String baseEntityID) { + String sql = "SELECT known_on_art FROM ec_pmtct_registration WHERE base_entity_id NOT IN (SELECT entity_id FROM ec_pmtct_followup WHERE cd4_sample_id IS NOT NULL) AND ec_pmtct_registration.base_entity_id = '" + baseEntityID + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "known_on_art"); + List res = readData(sql, dataMap); + + if (res != null && res.size() > 0 && res.get(0) != null) { + return !res.get(0).equals("yes"); + } + return false; + } + + public static boolean isEligibleForBaselineInvestigation(String baseEntityID) { + String sql = "SELECT known_on_art FROM ec_pmtct_registration WHERE known_on_art = 'no' AND base_entity_id NOT IN (SELECT entity_id FROM ec_pmtct_followup) AND base_entity_id = '" + baseEntityID + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "known_on_art"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static boolean isEligibleForBaselineInvestigationOnFollowupVisit(String baseEntityID) { + String sql = "SELECT p.base_entity_id FROM ec_pmtct_registration as p INNER JOIN (SELECT * FROM ec_pmtct_followup WHERE followup_status <> 'lost_to_followup' AND followup_status <> 'transfer_out' AND entity_id = '" + baseEntityID + "' ORDER BY visit_number DESC LIMIT 1) as pf on pf.entity_id = p.base_entity_id WHERE (pf.liver_function_test_conducted = 'test_not_conducted' OR pf.receive_liver_function_test_results='no' OR pf.renal_function_test_conducted = 'test_not_conducted' OR pf.receive_renal_function_test_results='no')"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "base_entity_id"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static int getVisitNumber(String baseEntityID) { + String sql = "SELECT base_entity_id FROM ec_pmtct_followup WHERE entity_id = '" + baseEntityID + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "base_entity_id"); + List res = readData(sql, dataMap); + + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.size(); + } + + return 0; + } + + private static int getElapsedTimeInMonths(String startDateString) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + Date startDate = null; + try { + startDate = simpleDateFormat.parse(startDateString); + } catch (ParseException e) { + e.printStackTrace(); + } + + Calendar startDateCal = Calendar.getInstance(); + startDateCal.setTimeInMillis(startDate.getTime()); + startDateCal.set(Calendar.DAY_OF_MONTH, 1); + + + LocalDate startLocalDate = new LocalDate(startDateCal.get(Calendar.YEAR), startDateCal.get(Calendar.MONTH) + 1, startDateCal.get(Calendar.DAY_OF_MONTH)); + + + LocalDate now = new LocalDate(); + + return Months.monthsBetween(startLocalDate, now).getMonths(); + } + + public static boolean hasHvlResults(String baseEntityId) { + String sql = "SELECT hvl_sample_id from ec_pmtct_followup\n" + + " WHERE entity_id = '" + baseEntityId + "'" + + " AND hvl_sample_id IS NOT NULL"; + + + DataMap dataMap = cursor -> getCursorValue(cursor, "hvl_sample_id"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0; + } + + public static boolean hasCd4Results(String baseEntityId) { + String sql = "SELECT cd4_sample_id from ec_pmtct_followup\n" + + " WHERE entity_id = '" + baseEntityId + "'" + + " AND cd4_sample_id IS NOT NULL"; + + + DataMap dataMap = cursor -> getCursorValue(cursor, "cd4_sample_id"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0; + } + + + public static boolean isLiverFunctionTestConducted(String baseEntityID) { + String sql = "SELECT p.base_entity_id FROM ec_pmtct_registration as p INNER JOIN (SELECT * FROM ec_pmtct_followup WHERE followup_status <> 'lost_to_followup' AND followup_status <> 'transfer_out' AND ec_pmtct_followup.entity_id = " + "'" + baseEntityID + "'" + " ORDER BY visit_number DESC LIMIT 1) as pf on pf.entity_id = p.base_entity_id WHERE (pf.liver_function_test_conducted = 'test_conducted') AND p.base_entity_id = '" + baseEntityID + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "base_entity_id"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static boolean isLiverFunctionTestResultsFilled(String baseEntityID) { + String sql = "SELECT p.base_entity_id FROM ec_pmtct_registration as p INNER JOIN (SELECT * FROM ec_pmtct_followup WHERE followup_status <> 'lost_to_followup' AND followup_status <> 'transfer_out' AND ec_pmtct_followup.entity_id = " + "'" + baseEntityID + "'" + " ORDER BY visit_number DESC LIMIT 1) as pf on pf.entity_id = p.base_entity_id WHERE (pf.receive_liver_function_test_results='yes') AND p.base_entity_id = '" + baseEntityID + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "base_entity_id"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static boolean isRenalFunctionTestConducted(String baseEntityID) { + String sql = "SELECT p.base_entity_id FROM ec_pmtct_registration as p INNER JOIN (SELECT * FROM ec_pmtct_followup WHERE followup_status <> 'lost_to_followup' AND followup_status <> 'transfer_out' AND ec_pmtct_followup.entity_id = " + "'" + baseEntityID + "'" + " ORDER BY visit_number DESC LIMIT 1) as pf on pf.entity_id = p.base_entity_id WHERE (pf.renal_function_test_conducted = 'test_conducted') AND p.base_entity_id = '" + baseEntityID + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "base_entity_id"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static boolean isRenalFunctionTestResultsFilled(String baseEntityID) { + String sql = "SELECT p.base_entity_id FROM ec_pmtct_registration as p INNER JOIN (SELECT * FROM ec_pmtct_followup WHERE followup_status <> 'lost_to_followup' AND followup_status <> 'transfer_out' AND ec_pmtct_followup.entity_id = " + "'" + baseEntityID + "'" + " ORDER BY visit_number DESC LIMIT 1) as pf on pf.entity_id = p.base_entity_id WHERE (pf.receive_renal_function_test_results='yes') AND p.base_entity_id = '" + baseEntityID + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "base_entity_id"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static boolean hasTheClientTransferedOut(String baseEntityID) { + String sql = "SELECT p.base_entity_id\n" + + "FROM ec_pmtct_registration as p\n" + + " INNER JOIN (SELECT *\n" + + " FROM ec_pmtct_followup\n" + + " WHERE entity_id ='" + baseEntityID + "'" + + " ORDER BY visit_number DESC\n" + + " LIMIT 1) as pf on pf.entity_id = p.base_entity_id\n" + + "WHERE (pf.followup_status = 'transfer_out')\n" + + "AND p.base_entity_id = '" + baseEntityID + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "base_entity_id"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static boolean isTheClientLostToFollowup(String baseEntityID) { + String sql = "SELECT p.base_entity_id\n" + + "FROM ec_pmtct_registration as p\n" + + " INNER JOIN (SELECT *\n" + + " FROM ec_pmtct_followup\n" + + " WHERE entity_id ='" + baseEntityID + "'" + + " ORDER BY visit_number DESC\n" + + " LIMIT 1) as pf on pf.entity_id = p.base_entity_id\n" + + "WHERE (pf.followup_status = 'lost_to_followup')\n" + + "AND p.base_entity_id = '" + baseEntityID + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "base_entity_id"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static String hasTheClientBeenProvidedWithTpt(String baseEntityID) { + String sql = "SELECT has_been_provided_with_tpt_before FROM ec_pmtct_followup WHERE has_been_provided_with_tpt_before IS NOT NULL AND entity_id = '" + baseEntityID + "' ORDER BY visit_number DESC LIMIT 1"; + + DataMap hasBeenProvidedWithTptBeforeDataMap = cursor -> getCursorValue(cursor, "has_been_provided_with_tpt_before"); + List hasBeenProvidedWithTptBeforeRes = readData(sql, hasBeenProvidedWithTptBeforeDataMap); + + + if (hasBeenProvidedWithTptBeforeRes != null && hasBeenProvidedWithTptBeforeRes.size() > 0 && hasBeenProvidedWithTptBeforeRes.get(0) != null) { + return hasBeenProvidedWithTptBeforeRes.get(0); + } else { + return null; + } + + } + + + public static boolean hasTheClientBeenProvidedWithTptInPreviousSessions(String baseEntityID) { + String sql = "SELECT is_client_provided_with_tpt FROM ec_pmtct_followup WHERE (is_client_provided_with_tpt IS NOT NULL) AND entity_id = '" + baseEntityID + "' ORDER BY visit_number DESC LIMIT 1"; + + DataMap isClientProvidedWithTptDataMap = cursor -> getCursorValue(cursor, "is_client_provided_with_tpt"); + List isClientProvidedWithTptRes = readData(sql, isClientProvidedWithTptDataMap); + + if (isClientProvidedWithTptRes != null && isClientProvidedWithTptRes.size() > 0 && isClientProvidedWithTptRes.get(0) != null) { + return isClientProvidedWithTptRes.get(0).equals("yes"); + } else { + return false; + } + } + + public static boolean hasTheClientCompletedTpt(String baseEntityID) { + String sql = "SELECT completed_tpt FROM ec_pmtct_followup WHERE (completed_tpt IS NOT NULL) AND entity_id = '" + baseEntityID + "' ORDER BY visit_number DESC LIMIT 1"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "completed_tpt"); + List res = readData(sql, dataMap); + + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0).equals("yes"); + } else { + return false; + } + + } + + public static List getMembers() { + String sql = "select m.base_entity_id , m.unique_id , m.relational_id , m.dob , m.first_name , m.middle_name , m.last_name , m.gender , m.phone_number , m.other_phone_number , f.first_name family_name ,f.primary_caregiver , f.family_head , f.village_town ,fh.first_name family_head_first_name , fh.middle_name family_head_middle_name , fh.last_name family_head_last_name, fh.phone_number family_head_phone_number , ancr.is_closed anc_is_closed, pncr.is_closed pnc_is_closed, pcg.first_name pcg_first_name , pcg.last_name pcg_last_name , pcg.middle_name pcg_middle_name , pcg.phone_number pcg_phone_number , mr.* from ec_family_member m inner join ec_family f on m.relational_id = f.base_entity_id inner join ec_pmtct_registration mr on mr.base_entity_id = m.base_entity_id left join ec_family_member fh on fh.base_entity_id = f.family_head left join ec_family_member pcg on pcg.base_entity_id = f.primary_caregiver left join ec_anc_register ancr on ancr.base_entity_id = m.base_entity_id left join ec_pregnancy_outcome pncr on pncr.base_entity_id = m.base_entity_id where mr.is_closed = 0 "; + SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + + DataMap dataMap = cursor -> { + MemberObject memberObject = new MemberObject(); + + memberObject.setFirstName(getCursorValue(cursor, "first_name", "")); + memberObject.setMiddleName(getCursorValue(cursor, "middle_name", "")); + memberObject.setLastName(getCursorValue(cursor, "last_name", "")); + memberObject.setAddress(getCursorValue(cursor, "village_town")); + memberObject.setGender(getCursorValue(cursor, "gender")); + memberObject.setUniqueId(getCursorValue(cursor, "unique_id", "")); + memberObject.setAge(getCursorValue(cursor, "dob")); + memberObject.setDod(getCursorValue(cursor, "dod", null)); + memberObject.setFamilyBaseEntityId(getCursorValue(cursor, "relational_id", "")); + memberObject.setRelationalId(getCursorValue(cursor, "relational_id", "")); + memberObject.setPrimaryCareGiver(getCursorValue(cursor, "primary_caregiver")); + memberObject.setFamilyName(getCursorValue(cursor, "family_name", "")); + memberObject.setPhoneNumber(getCursorValue(cursor, "phone_number", "")); + memberObject.setBaseEntityId(getCursorValue(cursor, "base_entity_id", "")); + memberObject.setFamilyHead(getCursorValue(cursor, "family_head", "")); + memberObject.setFamilyHeadPhoneNumber(getCursorValue(cursor, "pcg_phone_number", "")); + memberObject.setFamilyHeadPhoneNumber(getCursorValue(cursor, "family_head_phone_number", "")); + memberObject.setAncMember(getCursorValue(cursor, "anc_is_closed", "")); + memberObject.setPncMember(getCursorValue(cursor, "pnc_is_closed", "")); + + String familyHeadName = getCursorValue(cursor, "family_head_first_name", "") + " " + + getCursorValue(cursor, "family_head_middle_name", ""); + + familyHeadName = + (familyHeadName.trim() + " " + getCursorValue(cursor, "family_head_last_name", "")).trim(); + memberObject.setFamilyHeadName(familyHeadName); + + String familyPcgName = getCursorValue(cursor, "pcg_first_name", "") + " " + + getCursorValue(cursor, "pcg_middle_name", ""); + + familyPcgName = + (familyPcgName.trim() + " " + getCursorValue(cursor, "pcg_last_name", "")).trim(); + memberObject.setPrimaryCareGiverName(familyPcgName); + + return memberObject; + }; + + List res = readData(sql, dataMap); + if (res == null || res.size() == 0) + return null; + + return res; + } + + public static boolean isNewClient(String baseEntityId) { + DataMap knownOnArtDataMap = cursor -> getCursorValue(cursor, "known_on_art"); + DataMap pmtctRegisterDateDataMap = cursor -> getCursorValue(cursor, "pmtct_register_date"); + + String sql = "SELECT pmtct_register_date, known_on_art FROM ec_pmtct_registration WHERE base_entity_id = '" + baseEntityId + "' AND base_entity_id NOT IN (SELECT entity_id FROM ec_pmtct_followup)"; + + List resKnownOnArtRes = readData(sql, knownOnArtDataMap); + List pmtctRegisterDateRes = readData(sql, pmtctRegisterDateDataMap); + if (resKnownOnArtRes != null && resKnownOnArtRes.size() > 0) { + if (resKnownOnArtRes.get(0).equals("yes")) { + if (pmtctRegisterDateRes != null && pmtctRegisterDateRes.size() > 0) { + try { + Date pmtctRegisterDate = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).parse(pmtctRegisterDateRes.get(0)); + int daysDiff = TimeUtils.getElapsedDays(pmtctRegisterDate); + if (daysDiff < 2) { + return true; + } + + } catch (Exception e) { + Timber.e(e); + return false; + } + } else { + return false; + } + } else { + return true; + } + } + + return false; + } + + public static Date getNextFacilityVisitDate(String baseEntityID) { + //get next followup visit date + String sql = "SELECT next_facility_visit_date FROM ec_pmtct_registration " + + " WHERE followup_status <> 'lost_to_followup' " + + " AND followup_status <> 'transfer_out' AND base_entity_id = '" + baseEntityID + "'"; + DataMap dataMap = cursor -> getCursorValue(cursor, "next_facility_visit_date"); + + List res = readData(sql, dataMap); + if (res == null || res.size() != 1 || res.get(0) == null) + return null; + Date date = null; + try { + date = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).parse(res.get(0)); + } catch (ParseException e) { + e.printStackTrace(); + } + + return date; + } + + public static int getEacSessionNumber(String baseEntityId) { + String sql = "SELECT eac_visit_session from ec_pmtct_eac_visit" + + " WHERE entity_id = '" + baseEntityId + "'" + + "ORDER BY form_submission_timestamp DESC " + + "LIMIT 1"; + String completionSql = "SELECT eac_completion_status from ec_pmtct_eac_visit" + + " WHERE entity_id = '" + baseEntityId + "'" + + "ORDER BY form_submission_timestamp DESC " + + "LIMIT 1"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "eac_visit_session"); + DataMap completionDataMap = cursor -> getCursorValue(cursor, "eac_completion_status"); + + + List res = readData(sql, dataMap); + List completionRes = readData(completionSql, completionDataMap); + + if (completionRes != null && completionRes.size() > 0 && completionRes.get(0) != null && completionRes.get(0).equalsIgnoreCase("complete")) { + return 1; + } + if (res != null && res.size() > 0 && res.get(0) != null) { + return Integer.parseInt(res.get(0)) + 1; + } + return 1; + } + + private static boolean isToBeEnrolledToEac(String baseEntityId) { + String sql = "SELECT enroll_to_eac " + + "FROM ec_pmtct_hvl_results " + + "WHERE entity_id = '" + baseEntityId + "'" + + " ORDER BY hvl_result_date DESC" + + " LIMIT 1"; + DataMap dataMap = cursor -> getCursorValue(cursor, "enroll_to_eac"); + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0).equalsIgnoreCase("yes"); + } + return false; + } + + private static boolean hasEacVisits(String baseEntityId) { + String sql = "SELECT eac_visit_session " + + " FROM ec_pmtct_eac_visit " + + " WHERE entity_id = '" + baseEntityId + "'"; + DataMap dataMap = cursor -> getCursorValue(cursor, "eac_visit_session"); + List res = readData(sql, dataMap); + return res != null && res.size() > 0; + } + + private static boolean isEacCompleted(String baseEntityId) { + String completionSql = "SELECT strftime('%d-%m-%Y', form_submission_timestamp) as completion_date " + + " FROM ec_pmtct_eac_visit " + + " WHERE entity_id = '" + baseEntityId + "'" + + " AND eac_completion_status = 'complete' " + + " ORDER BY form_submission_timestamp DESC " + + " LIMIT 1"; + + String hvlResultDateSql = "SELECT hvl_result_date " + + " FROM ec_pmtct_hvl_results " + + " WHERE entity_id = '" + baseEntityId + "'" + + " ORDER BY hvl_result_date DESC " + + " LIMIT 1"; + SimpleDateFormat dt = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + + DataMap completionDateDataMap = cursor -> getCursorValue(cursor, "completion_date"); + DataMap hvlResultDateDataMap = cursor -> getCursorValue(cursor, "hvl_result_date"); + + List completionDateRes = readData(completionSql, completionDateDataMap); + List hvlResultDateRes = readData(hvlResultDateSql, hvlResultDateDataMap); + + if (completionDateRes != null && completionDateRes.size() > 0 && completionDateRes.get(0) != null) { + Date completionDate = null; + Date hvlResultDate = null; + try { + completionDate = dt.parse(completionDateRes.get(0)); + hvlResultDate = dt.parse(hvlResultDateRes.get(0)); + } catch (ParseException e) { + e.printStackTrace(); + } + return completionDate != null && completionDate.after(hvlResultDate); + } + return false; + } + + public static boolean isAfterEAC(String baseEntityId) { + String sql = "SELECT enroll_to_eac " + + "FROM ec_pmtct_hvl_results " + + "WHERE entity_id = '" + baseEntityId + "'" + + " ORDER BY hvl_result_date DESC" + + " LIMIT 1"; + DataMap dataMap = cursor -> getCursorValue(cursor, "enroll_to_eac"); + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0).equalsIgnoreCase("yes"); + } + return false; + } + + public static boolean wasPreviousResultsAfterEAC(String baseEntityId) { + String sql = "SELECT enroll_to_eac " + + "FROM ec_pmtct_hvl_results " + + "WHERE entity_id = '" + baseEntityId + "'" + + " ORDER BY hvl_result_date DESC" + + " LIMIT 1,1"; + DataMap dataMap = cursor -> getCursorValue(cursor, "enroll_to_eac"); + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0).equalsIgnoreCase("yes"); + } + return false; + } + + public static Date getDateEACRecorded(String baseEntityId) { + String sql = "SELECT strftime('%d-%m-%Y', form_submission_timestamp) as record_date " + + " FROM ec_pmtct_eac_visit " + + " WHERE entity_id = '" + baseEntityId + "'" + + " ORDER BY form_submission_timestamp DESC " + + " LIMIT 1"; + DataMap dataMap = cursor -> getCursorValue(cursor, "record_date"); + + SimpleDateFormat dt = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + try { + return dt.parse(res.get(0)); + } catch (ParseException e) { + e.printStackTrace(); + } + } + return null; + } + + public static boolean isPrescribedArtRegimes(String baseEntityId) { + String sql = "SELECT prescribed_regimes " + + " FROM ec_pmtct_followup " + + " WHERE entity_id = '" + baseEntityId + "'" + + " ORDER BY visit_number DESC " + + " LIMIT 1"; + DataMap dataMap = cursor -> getCursorValue(cursor, "prescribed_regimes"); + + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + try { + return res.get(0).equalsIgnoreCase("yes"); + } catch (Exception e) { + e.printStackTrace(); + } + } + return false; + } + + public static boolean hasBeenReferredForMotherChampionServices(String baseEntityId) { + String sql = "SELECT reasons_for_issuing_community_referral FROM ec_mother_champion WHERE reasons_for_issuing_community_referral = 'mother_champion_services' AND entity_id = '" + baseEntityId + "' "; + DataMap dataMap = cursor -> getCursorValue(cursor, "reasons_for_issuing_community_referral"); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + try { + return true; + } catch (Exception e) { + e.printStackTrace(); + } + } + return false; + } + + public static String getLinkedMotherChampionLocation(String baseEntityId) { + String sql = "SELECT mother_champion_location FROM ec_mother_champion WHERE reasons_for_issuing_community_referral = 'mother_champion_services' AND entity_id = '" + baseEntityId + "' ORDER BY last_interacted_with DESC LIMIT 1 "; + DataMap dataMap = cursor -> getCursorValue(cursor, "mother_champion_location"); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0); + } + return null; + } + + public static void deleteEntryFromTableByFormSubmissionId(String tableName, String submissionId) { + String sql = "delete from " + tableName + " where base_entity_id = '" + submissionId + "'"; + updateDB(sql); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfPncDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfPncDao.java new file mode 100644 index 000000000..d289711e6 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HfPncDao.java @@ -0,0 +1,214 @@ +package org.smartregister.chw.hf.dao; + +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.core.dao.PNCDao; +import org.smartregister.chw.core.model.ChildModel; + +import java.util.List; + +public class HfPncDao extends PNCDao { + public static boolean isChildEligibleForBcg(String baseEntityId) { + String sql = "SELECT child_bcg_vaccination FROM ec_child WHERE child_bcg_vaccination = 'yes' AND base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "child_bcg_vaccination"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static boolean isChildEligibleForOpv0(String baseEntityId) { + String sql = "SELECT child_opv0_vaccination FROM ec_child WHERE child_opv0_vaccination = 'yes' AND base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "child_opv0_vaccination"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static boolean isMotherEligibleForHepB(String baseEntityId) { + String sql = "SELECT hepatitis_b_vaccination FROM ec_pregnancy_outcome WHERE hepatitis_b_vaccination = 'yes' AND base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "hepatitis_b_vaccination"); + List res = readData(sql, dataMap); + + return res == null || res.size() == 0 || res.get(0) == null; + } + + public static boolean isMotherEligibleForTetanus(String baseEntityId) { + String sql = "SELECT tetanus_vaccination FROM ec_pregnancy_outcome WHERE tetanus_vaccination = 'yes' AND base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "tetanus_vaccination"); + List res = readData(sql, dataMap); + + return res == null || res.size() == 0 || res.get(0) == null; + } + + public static boolean isMotherEligibleForHivTest(String baseEntityId) { + String sql = "SELECT hiv FROM ec_pregnancy_outcome WHERE (hiv = 'test_not_conducted' OR hiv = 'unknown' OR hiv IS NULL) AND base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "hiv"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0; + } + + public static boolean isMotherEligibleForPmtctRegistration(String baseEntityId) { + String sql = "SELECT hiv FROM ec_pregnancy_outcome WHERE hiv = 'positive' AND base_entity_id NOT IN (SELECT base_entity_id FROM ec_pmtct_registration WHERE is_closed = 0) AND base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "hiv"); + List res = readData(sql, dataMap); + + return res != null && res.size() > 0 && res.get(0) != null; + } + + public static List childrenForPncWoman(String baseEntityId) { + String sql = String.format("select c.first_name || ' ' || c.middle_name || ' ' || c.last_name as child_name, c.dob , c.first_name, c.base_entity_id " + + "FROM ec_child c " + + "INNER JOIN ec_family_member fm on fm.base_entity_id = c.base_entity_id " + + "WHERE c.mother_entity_id = '" + baseEntityId + "' COLLATE NOCASE " + + "AND (c.entry_point = 'PNC' OR c.entry_point = 'LD') " + + "AND c.is_closed = 0 " + + "AND fm.is_closed = 0 " + + "AND ( date (c.dob, '+49 days') > date()) " + + "ORDER by c.first_name ASC"); + + DataMap dataMap = cursor -> + new ChildModel(getCursorValue(cursor, "child_name"), getCursorValue(cursor, "dob"), getCursorValue(cursor, "first_name"), getCursorValue(cursor, "base_entity_id")); + + return readData(sql, dataMap); + } + + public static List getPncMembersWithMoreThan42Days() { + String sql = "select m.base_entity_id,\n" + + " m.unique_id,\n" + + " m.relational_id,\n" + + " m.dob,\n" + + " m.first_name,\n" + + " m.middle_name,\n" + + " m.last_name,\n" + + " m.gender,\n" + + " m.phone_number,\n" + + " m.other_phone_number,\n" + + " f.first_name family_name,\n" + + " f.primary_caregiver,\n" + + " f.family_head,\n" + + " fh.first_name family_head_first_name,\n" + + " fh.middle_name family_head_middle_name,\n" + + " fh.last_name family_head_last_name,\n" + + " fh.phone_number family_head_phone_number,\n" + + " f.village_town,\n" + + " epo.delivery_date\n" + + "from ec_family_member m\n" + + " inner join ec_family f on m.relational_id = f.base_entity_id\n" + + " inner join ec_pregnancy_outcome epo on m.base_entity_id = epo.base_entity_id\n" + + " left join ec_family_member fh on fh.base_entity_id = f.family_head\n" + + "where cast(julianday(datetime('now')) - julianday(datetime(substr(epo.delivery_date, 7,4)\n" + + " || '-' || substr(epo.delivery_date, 4,2) || '-' || substr(epo.delivery_date, 1,2))) as integer) >= 43\n" + + " AND epo.is_closed = 0 "; + + DataMap dataMap = cursor -> { + MemberObject memberObject = new MemberObject(); + memberObject.setLastMenstrualPeriod(getCursorValue(cursor, "last_menstrual_period")); + memberObject.setChwMemberId(getCursorValue(cursor, "unique_id", "")); + memberObject.setBaseEntityId(getCursorValue(cursor, "base_entity_id", "")); + memberObject.setFamilyBaseEntityId(getCursorValue(cursor, "relational_id", "")); + memberObject.setFamilyHead(getCursorValue(cursor, "family_head", "")); + + String familyHeadName = getCursorValue(cursor, "family_head_first_name", "") + " " + + getCursorValue(cursor, "family_head_middle_name", ""); + + familyHeadName = (familyHeadName.trim() + " " + getCursorValue(cursor, "family_head_last_name", "")).trim(); + + memberObject.setFamilyHeadName(familyHeadName); + memberObject.setFamilyHeadPhoneNumber(getCursorValue(cursor, "family_head_phone_number", "")); + memberObject.setPrimaryCareGiver(getCursorValue(cursor, "primary_caregiver")); + memberObject.setFamilyName(getCursorValue(cursor, "family_name", "")); + memberObject.setLastContactVisit(getCursorValue(cursor, "last_contact_visit")); + memberObject.setLastInteractedWith(getCursorValue(cursor, "last_interacted_with")); + memberObject.setFirstName(getCursorValue(cursor, "first_name", "")); + memberObject.setMiddleName(getCursorValue(cursor, "middle_name", "")); + memberObject.setLastName(getCursorValue(cursor, "last_name", "")); + memberObject.setDob(getCursorValue(cursor, "dob")); + memberObject.setPhoneNumber(getCursorValue(cursor, "phone_number", "")); + memberObject.setConfirmedContacts(getCursorIntValue(cursor, "confirmed_visits", 0)); + memberObject.setDateCreated(getCursorValue(cursor, "date_created")); + memberObject.setAddress(getCursorValue(cursor, "village_town")); + memberObject.setHasAncCard(getCursorValue(cursor, "has_anc_card", "")); + + return memberObject; + }; + List res = readData(sql, dataMap); + if (res == null || res.size() == 0) + return null; + + return res; + } + + public static boolean isChildEligibleForKangaroo(String baseEntityId, String motherBaseEntityId) { + //child is eligible for kangaroo if weight at birth is less than 2.5kg and if its first visit + String query = "SELECT weight FROM ec_child WHERE base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> Double.parseDouble(getCursorValue(cursor, "weight", "0")); + List res = readData(query, dataMap); + + if ((res != null && res.size() != 0)) { + return (res.get(0) < 2.5 && getVisitNumber(motherBaseEntityId) == 0); + } + return false; + } + + public static double getChildMinHeadCircumference(String baseEntityId) { + //query from child table the head_circumference and return the value + String query = "SELECT head_circumference FROM ec_child WHERE base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> Double.parseDouble(getCursorValue(cursor, "head_circumference", "0")); + List res = readData(query, dataMap); + + if ((res != null && res.size() != 0)) { + return res.get(0); + } + return 0; + } + + + public static int getVisitNumber(String baseEntityID) { + String sql = "SELECT visit_number FROM ec_pnc_followup WHERE entity_id='" + baseEntityID + "' ORDER BY visit_number DESC LIMIT 1"; + DataMap map = cursor -> getCursorIntValue(cursor, "visit_number"); + List res = readData(sql, map); + + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0) + 1; + } else + return 0; + + } + + public static boolean hasHivAntibodyTestBeenConducted(String baseEntityID) { + String sql = "SELECT hiv_antibody_test FROM ec_pnc_child_followup WHERE entity_id='" + baseEntityID + "' AND hiv_antibody_test IS NOT NULL ORDER BY last_interacted_with DESC LIMIT 1"; + DataMap map = cursor -> getCursorValue(cursor, "hiv_antibody_test"); + List res = readData(sql, map); + + if (res != null && res.size() > 0 && res.get(0) != null) { + return !res.get(0).equals("test_not_conducted"); + } else + return false; + } + + public static boolean isAChildWithoutMother(String baseEntityID) { + String sql = "SELECT base_entity_id FROM ec_no_mother_pnc WHERE base_entity_id='" + baseEntityID + "'"; + DataMap map = cursor -> getCursorValue(cursor, "base_entity_id"); + List res = readData(sql, map); + + return res != null && res.size() > 0 && res.get(0) != null; + } + + + public static boolean isMotherEligibleForVitaminA(String baseEntityId) { + String sql = "SELECT vitamin_a FROM ec_pnc_followup WHERE vitamin_a = 'yes' AND entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "vitamin_a"); + List res = readData(sql, dataMap); + + return res == null || res.size() == 0 || res.get(0) == null || res.get(0).equals("no"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HivIndexFollowupFeedbackDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HivIndexFollowupFeedbackDao.java new file mode 100644 index 000000000..f55dbfb86 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/HivIndexFollowupFeedbackDao.java @@ -0,0 +1,32 @@ +package org.smartregister.chw.hf.dao; + +import org.smartregister.chw.hf.model.HivIndexFollowupFeedbackDetailsModel; +import org.smartregister.dao.AbstractDao; + +import java.util.List; + +public class HivIndexFollowupFeedbackDao extends AbstractDao { + public static AbstractDao.DataMap dataMap = cursor -> { + HivIndexFollowupFeedbackDetailsModel followupFeedbackDetailsModel = new HivIndexFollowupFeedbackDetailsModel(); + followupFeedbackDetailsModel.setBaseEntityId(getCursorValue(cursor, "base_entity_id")); + followupFeedbackDetailsModel.setFeedbackFormSubmissionId(getCursorValue(cursor, "entity_id")); + followupFeedbackDetailsModel.setFollowedByChw(getCursorValue(cursor, "followed_by_chw")); + followupFeedbackDetailsModel.setClientFound(getCursorValue(cursor, "client_found")); + followupFeedbackDetailsModel.setAgreedToBeTested(getCursorValue(cursor, "agreed_to_be_tested")); + followupFeedbackDetailsModel.setTestLocation(getCursorValue(cursor, "test_location")); + return followupFeedbackDetailsModel; + }; + + public static List getHivIndexFollowupFeedback(String baseEntityId) { + String sql = String.format( + "SELECT * from ec_hiv_index_chw_followup " + + "WHERE base_entity_id = '%s' AND is_closed == 0 ", baseEntityId); + List feedbackList = readData(sql, dataMap); + + if (feedbackList == null) + return null; + + return feedbackList; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/LDDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/LDDao.java new file mode 100644 index 000000000..b38525f66 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/LDDao.java @@ -0,0 +1,258 @@ +package org.smartregister.chw.hf.dao; + +import static org.smartregister.chw.hf.utils.Constants.FOCUS.LD_CHILD_EMERGENCY; +import static org.smartregister.chw.hf.utils.Constants.FOCUS.LD_EMERGENCY; + +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.util.Constants; +import org.smartregister.dao.AbstractDao; +import org.smartregister.repository.AllSharedPreferences; +import org.smartregister.util.Utils; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Locale; + +/** + * Created by Kassim Sheghembe on 2022-05-08 + */ +public class LDDao extends org.smartregister.chw.ld.dao.LDDao { + + // This can be refactored to the LD Library, more DB definition needed to create a Member Object that reflects LD + public static org.smartregister.chw.ld.domain.MemberObject getLDMember(String baseEntityId) { + String sql = "select " + + "m.base_entity_id , " + + "m.unique_id , " + + "m.relational_id , " + + "m.dob , " + + "m.first_name , " + + "m.middle_name , " + + "m.last_name , " + + "m.gender , " + + "m.phone_number , " + + "m.other_phone_number , " + + "f.first_name family_name ," + + "f.primary_caregiver , " + + "f.family_head , " + + "f.village_town , " + + "fh.first_name family_head_first_name , " + + "fh.middle_name family_head_middle_name , " + + "fh.last_name family_head_last_name, " + + "fh.phone_number family_head_phone_number , " + + "ancr.is_closed anc_is_closed, " + + "pcg.first_name pcg_first_name , " + + "pcg.last_name pcg_last_name , " + + "pcg.middle_name pcg_middle_name , " + + "pcg.phone_number " + + "from ec_family_member m " + + "inner join ec_family f on m.relational_id = f.base_entity_id " + + "left join ec_family_member fh on fh.base_entity_id = f.family_head " + + "left join ec_family_member pcg on pcg.base_entity_id = f.primary_caregiver " + + "left join ec_anc_register ancr on ancr.base_entity_id = m.base_entity_id " + + "where m.base_entity_id ='" + baseEntityId + "' "; + + SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + + AbstractDao.DataMap dataMap = cursor -> { + org.smartregister.chw.ld.domain.MemberObject memberObject = new org.smartregister.chw.ld.domain.MemberObject(); + + memberObject.setFirstName(getCursorValue(cursor, "first_name", "")); + memberObject.setMiddleName(getCursorValue(cursor, "middle_name", "")); + memberObject.setLastName(getCursorValue(cursor, "last_name", "")); + memberObject.setAddress(getCursorValue(cursor, "village_town")); + memberObject.setGender(getCursorValue(cursor, "gender")); + memberObject.setUniqueId(getCursorValue(cursor, "unique_id", "")); + memberObject.setAge(String.valueOf(Utils.getAgeFromDate(getCursorValue(cursor, "dob")))); + memberObject.setFamilyBaseEntityId(getCursorValue(cursor, "relational_id", "")); + memberObject.setRelationalId(getCursorValue(cursor, "relational_id", "")); + memberObject.setPrimaryCareGiver(getCursorValue(cursor, "primary_caregiver")); + memberObject.setFamilyName(getCursorValue(cursor, "family_name", "")); + memberObject.setPhoneNumber(getCursorValue(cursor, "phone_number", "")); + memberObject.setBaseEntityId(getCursorValue(cursor, "base_entity_id", "")); + memberObject.setFamilyHead(getCursorValue(cursor, "family_head", "")); + memberObject.setFamilyHeadPhoneNumber(getCursorValue(cursor, "pcg_phone_number", "")); + memberObject.setFamilyHeadPhoneNumber(getCursorValue(cursor, "family_head_phone_number", "")); + memberObject.setAncMember(getCursorValue(cursor, "anc_is_closed", "")); + memberObject.setPncMember(getCursorValue(cursor, "pnc_is_closed", "")); + + String familyHeadName = getCursorValue(cursor, "family_head_first_name", "") + " " + + getCursorValue(cursor, "family_head_middle_name", ""); + + familyHeadName = + (familyHeadName.trim() + " " + getCursorValue(cursor, "family_head_last_name", "")).trim(); + memberObject.setFamilyHeadName(familyHeadName); + + String familyPcgName = getCursorValue(cursor, "pcg_first_name", "") + " " + + getCursorValue(cursor, "pcg_middle_name", ""); + + familyPcgName = + (familyPcgName.trim() + " " + getCursorValue(cursor, "pcg_last_name", "")).trim(); + memberObject.setPrimaryCareGiverName(familyPcgName); + + return memberObject; + }; + + List res = readData(sql, dataMap); + if (res == null || res.size() != 1) + return null; + + return res.get(0); + } + + public static String getPmtctTestDate(String baseEntityId) { + String sql = "SELECT pmtct_test_date FROM " + Constants.TABLES.LD_CONFIRMATION + " WHERE base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "pmtct_test_date"); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) + return res.get(0); + return null; + } + + public static String getHbTestDate(String baseEntityId) { + String sql = "SELECT hb_test_date FROM " + Constants.TABLES.LD_CONFIRMATION + " WHERE base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "hb_test_date"); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) + return res.get(0); + return null; + } + + public static String getHealthcareProviderNameWhoConductedLastPartographSession(String baseEntityId) { + String sql = "SELECT name_of_the_health_care_provider FROM " + Constants.TABLES.EC_LD_PARTOGRAPH + " WHERE entity_id = '" + baseEntityId + "' ORDER BY last_interacted_with DESC LIMIT 1"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "name_of_the_health_care_provider"); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) + return res.get(0); + return null; + } + + public static Boolean isTheClientReferred(String baseEntityId) { + AllSharedPreferences allSharedPreferences = org.smartregister.chw.core.utils.Utils.getAllSharedPreferences(); + String anm = allSharedPreferences.fetchRegisteredANM(); + String currentLoaction = allSharedPreferences.fetchUserLocalityId(anm); + + String sql = "SELECT base_entity_id FROM " + Constants.TABLES.LD_CONFIRMATION + " elc " + + " INNER JOIN task t on elc.base_entity_id = t.for " + + " WHERE base_entity_id = '" + baseEntityId + "' " + + " AND t.location = '" + currentLoaction + "' COLLATE NOCASE " + + " AND t.focus = '" + LD_EMERGENCY + "' COLLATE NOCASE "; + + DataMap dataMap = cursor -> getCursorValue(cursor, "base_entity_id"); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) + return true; + return null; + } + + public static String getSyphilisTest(String baseEntityId) { + String sql = "SELECT syphilis FROM " + Constants.TABLES.LD_CONFIRMATION + " WHERE base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "syphilis"); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) + return res.get(0); + return null; + } + + public static String getMalariaTest(String baseEntityId) { + String sql = "SELECT malaria FROM " + Constants.TABLES.LD_CONFIRMATION + " WHERE base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "malaria"); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) + return res.get(0); + return null; + } + + public static String getBloodGroup(String baseEntityId) { + String sql = "SELECT blood_group FROM " + Constants.TABLES.LD_CONFIRMATION + " WHERE base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "blood_group"); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) + return res.get(0); + return null; + } + + public static String getFundalHeight(String baseEntityId) { + String sql = "SELECT fundal_height FROM " + Constants.TABLES.EC_LD_GENERAL_EXAMINATION + " WHERE base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "fundal_height"); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) + return res.get(0); + return null; + } + + public static String getFetalLie(String baseEntityId) { + String sql = "SELECT lie FROM " + Constants.TABLES.EC_LD_GENERAL_EXAMINATION + " WHERE base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "lie"); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) + return res.get(0); + return null; + } + + + public static List getBaseEntityIdsOfMothersForChildrenWithEmergencyReferrals() { + String sql = "SELECT ec.mother_entity_id as mother_entity_id FROM task t" + + " INNER JOIN ec_child ec ON ec.base_entity_id = t.for " + + " WHERE " + + " focus LIKE '%" + LD_CHILD_EMERGENCY + "%' AND ec.mother_entity_id NOT IN (SELECT base_entity_id FROM ec_family_member)"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "mother_entity_id"); + return readData(sql, dataMap); + } + + public static boolean isClosed(String baseEntityId) { + String sql = "SELECT is_closed FROM " + Constants.TABLES.LD_CONFIRMATION + " WHERE base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "is_closed"); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) + return res.get(0).equalsIgnoreCase("1"); + return false; + } + + public static String getLastInteractedWith(String baseEntityId) { + SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + String sql = "SELECT last_interacted_with FROM " + Constants.TABLES.LD_CONFIRMATION + " WHERE base_entity_id = '" + baseEntityId + "'"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "last_interacted_with"); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0 && res.get(0) != null) { + Date lastInteractedWithDate = new Date(Long.parseLong(res.get(0))); + return df.format(lastInteractedWithDate); + } + return null; + } + + public static String getPreviousPartographTime(String baseEntityId) { + String sql = "SELECT partograph_time FROM " + Constants.TABLES.EC_LD_PARTOGRAPH + " WHERE entity_id = '" + baseEntityId + "' " + + "order by DATETIME(substr(partograph_date, 7, 4) || '-' || substr(partograph_date, 4, 2) || '-' ||\n" + + " substr(partograph_date, 1, 2) || ' ' || partograph_time || ':' || '00') DESC LIMIT 1,1"; + + DataMap dataMap = cursor -> getCursorValue(cursor, "partograph_time"); + + List res = readData(sql, dataMap); + if (res != null && res.size() > 0) + return res.get(0); + return null; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/LTFUFeedbackDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/LTFUFeedbackDao.java new file mode 100644 index 000000000..737d8fb27 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/LTFUFeedbackDao.java @@ -0,0 +1,135 @@ +package org.smartregister.chw.hf.dao; + +import org.smartregister.dao.AbstractDao; + +import java.math.BigDecimal; +import java.sql.Date; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.List; +import java.util.Locale; + +import timber.log.Timber; + +public class LTFUFeedbackDao extends AbstractDao { + + public static final String TABLE_NAME = "ec_ltfu_feedback"; + + public static Date getFeedBackDate(String taskId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "feedback_date"); + + String sql = "SELECT feedback_date from " + TABLE_NAME + + " WHERE referral_task_id = '" + taskId + "' "; + List res = readData(sql, dataMap); + + if (res != null && res.size() > 0 && res.get(0) != null) { + Calendar cal = Calendar.getInstance(); + try { + cal.setTimeInMillis(new BigDecimal(res.get(0)).longValue()); + } catch (Exception e) { + //NEEDED FOR THE ISSUE IN SOME TABLETS FAILING TO CREATE A TIMESTAMP + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); + try { + cal.setTime(sdf.parse(res.get(0))); + } catch (ParseException parseException) { + Timber.e(parseException); + return null; + } + } + return new Date(cal.getTimeInMillis()); + } + return null; + } + + public static String getFollowupStatus(String taskId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "followup_status"); + + String sql = "SELECT followup_status from " + TABLE_NAME + + " WHERE referral_task_id = '" + taskId + "' "; + List res = readData(sql, dataMap); + + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0); + } + return null; + } + + public static String getReasonsForMissedAppointment(String taskId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "reasons_for_missed_appointment"); + + String sql = "SELECT reasons_for_missed_appointment from " + TABLE_NAME + + " WHERE referral_task_id = '" + taskId + "' "; + List res = readData(sql, dataMap); + + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0); + } + return null; + } + + public static Date getReferralAppointmentDate(String taskId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "referral_appointment_date"); + + String sql = "SELECT referral_appointment_date from " + TABLE_NAME + + " WHERE referral_task_id = '" + taskId + "' "; + List res = readData(sql, dataMap); + + if (res != null && res.size() > 0 && res.get(0) != null) { + Calendar cal = Calendar.getInstance(); + try { + cal.setTimeInMillis(new BigDecimal(res.get(0)).longValue()); + } catch (Exception e) { + //NEEDED FOR THE ISSUE IN SOME TABLETS FAILING TO CREATE A TIMESTAMP + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); + try { + cal.setTime(sdf.parse(res.get(0))); + } catch (ParseException parseException) { + Timber.e(parseException); + return null; + } + } + return new Date(cal.getTimeInMillis()); + } + return null; + } + + public static String getReasonClientNotFound(String taskId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "reason_client_not_found"); + + String sql = "SELECT reason_client_not_found from " + TABLE_NAME + + " WHERE referral_task_id = '" + taskId + "' "; + List res = readData(sql, dataMap); + + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0); + } + return null; + } + + public static Date getDateOfDeath(String taskId) { + DataMap dataMap = cursor -> getCursorValue(cursor, "date_of_death"); + + String sql = "SELECT date_of_death from " + TABLE_NAME + + " WHERE referral_task_id = '" + taskId + "' "; + List res = readData(sql, dataMap); + + if (res != null && res.size() > 0 && res.get(0) != null) { + Calendar cal = Calendar.getInstance(); + try { + cal.setTimeInMillis(new BigDecimal(res.get(0)).longValue()); + } catch (Exception e) { + //NEEDED FOR THE ISSUE IN SOME TABLETS FAILING TO CREATE A TIMESTAMP + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); + try { + cal.setTime(sdf.parse(res.get(0))); + } catch (ParseException parseException) { + Timber.e(parseException); + return null; + } + } + return new Date(cal.getTimeInMillis()); + } + return null; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/ReportDao.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/ReportDao.java new file mode 100644 index 000000000..5c1df8bcc --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dao/ReportDao.java @@ -0,0 +1,205 @@ +package org.smartregister.chw.hf.dao; + +import org.smartregister.dao.AbstractDao; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +public class ReportDao extends AbstractDao { + public static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + + public static List> getMotherChampions(Date reportDate) { + String sql = "SELECT chw_name, provider_id \n" + + "from ec_mother_champion_followup \n" + + "WHERE chw_name IS NOT NULL \n" + + " AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) =\n" + + " date(substr(strftime('%Y-%m-%d', datetime(last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||\n" + + " '-' ||\n" + + " substr(strftime('%Y-%m-%d', datetime(last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||\n" + + " '-' || '01')\n" + + "UNION \n" + + "SELECT chw_name, provider_id \n" + + "from ec_anc_partner_community_feedback \n" + + "WHERE chw_name IS NOT NULL \n" + + " AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) =\n" + + " date(substr(strftime('%Y-%m-%d', datetime(last_interacted_with / 1000, 'unixepoch', 'localtime')), 1, 4) ||\n" + + " '-' ||\n" + + " substr(strftime('%Y-%m-%d', datetime(last_interacted_with / 1000, 'unixepoch', 'localtime')), 6, 2) ||\n" + + " '-' || '01') \n" + + "UNION \n" + + "SELECT chw_name, provider_id \n" + + "from ec_sbcc \n" + + "WHERE chw_name IS NOT NULL \n" + + " AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) =\n" + + " date(substr(sbcc_date, 7, 4) || '-' || substr(sbcc_date, 4, 2) || '-' || '01')\n" + + "UNION\n" + + "SELECT chw_name, provider_id\n" + + "from ec_pmtct_community_feedback\n" + + "WHERE chw_name IS NOT NULL\n" + + " AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) =\n" + + " date(substr(strftime('%Y-%m-%d', datetime(pmtct_community_followup_visit_date / 1000, 'unixepoch', 'localtime')),\n" + + " 1, 4) ||\n" + + " '-' ||\n" + + " substr(strftime('%Y-%m-%d', datetime(pmtct_community_followup_visit_date / 1000, 'unixepoch', 'localtime')),\n" + + " 6, 2) ||\n" + + " '-' || '01')\n"; + + String queryDate = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(reportDate); + + sql = sql.contains("%s") ? sql.replaceAll("%s", queryDate) : sql; + + DataMap> map = cursor -> { + Map data = new HashMap<>(); + data.put("chw_name", cursor.getString(cursor.getColumnIndex("chw_name"))); + data.put("provider_id", cursor.getString(cursor.getColumnIndex("provider_id"))); + return data; + }; + + List> res = readData(sql, map); + + + if (res != null && res.size() > 0) { + return res; + } else + return new ArrayList<>(); + } + + public static List> getHfIssuingCdpStockLog(Date reportDate) { + + String query1 = " SELECT point_of_service,other_pos ,female_condoms_offset,male_condoms_offset\n" + + " FROM ec_cdp_issuing_hf\n" + + " WHERE point_of_service='rch_clinic' \n" + + " OR point_of_service='ctc' OR point_of_service='opd' OR point_of_service='other'\n" + + " OR point_of_service='tb_clinic' OR point_of_service='outreach' \n" + + " AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) =\n" + + " date(substr(condom_restock_date, 7, 4) || '-' || substr(condom_restock_date, 4, 2) || '-' || '01')"; + + + String query2 = + "SELECT requester,cof.condom_type as condom_type,quantity_response\n" + + " FROM ec_cdp_order_feedback cof\n" + + " INNER JOIN ec_cdp_orders eco ON eco.form_submission_id = cof.request_reference\n" + + " INNER JOIN task t ON t.for = eco.base_entity_id\n" + + " WHERE (t.status='IN_PROGRESS'OR t.status='COMPLETED') \n" + + " AND date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) =\n" + + " date(substr(strftime('%Y-%m-%d', datetime(response_at / 1000, 'unixepoch', 'localtime')),\n" + + " 1, 4) ||\n" + + " '-' ||\n" + + " substr(strftime('%Y-%m-%d', datetime(response_at / 1000, 'unixepoch', 'localtime')),\n" + + " 6, 2) ||\n" + + " '-' || '01')\n"; + + + String queryDate = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(reportDate); + + query1 = query1.contains("%s") ? query1.replaceAll("%s", queryDate) : query1; + query2 = query2.contains("%s") ? query2.replaceAll("%s", queryDate) : query2; + + DataMap> map1 = cursor -> { + Map data1 = new HashMap<>(); + data1.put("point_of_service", cursor.getString(cursor.getColumnIndex("point_of_service"))); + data1.put("other_point_of_service", cursor.getString(cursor.getColumnIndex("other_pos"))); + data1.put("female_condoms_offset", cursor.getString(cursor.getColumnIndex("female_condoms_offset"))); + data1.put("male_condoms_offset", cursor.getString(cursor.getColumnIndex("male_condoms_offset"))); + return data1; + }; + + DataMap> map2= cursor2 -> { + Map data2 = new HashMap<>(); + data2.put("requester", cursor2.getString(cursor2.getColumnIndex("requester"))); + data2.put("quantity_response", cursor2.getString(cursor2.getColumnIndex("quantity_response"))); + data2.put("condom_type", cursor2.getString(cursor2.getColumnIndex("condom_type"))); + return data2; + }; + + List> res1 = readData(query1, map1); + List> res2 = readData(query2, map2); + List> res = new ArrayList<>(); + res.addAll(res1); + res.addAll(res2); + + if (res.size() > 0) { + return res; + } else + return new ArrayList<>(); + } + + public static List> getHfCdpStockLog(Date reportDate) + { + String sql = " SELECT female_condoms_offset,male_condoms_offset,issuing_organization,female_condom_brand,male_condom_brand \n" + + " FROM ec_cdp_stock_log \n" + + " WHERE (issuing_organization='MSD' OR issuing_organization='PSI' OR issuing_organization='T-MARC' OR issuing_organization='other') \n" + + " AND (stock_event_type ='increment' ) \n" + + " AND date(substr(strftime('%Y-%m-%d', datetime(date_updated / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || \n" + + " substr(strftime('%Y-%m-%d', datetime(date_updated / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = \n" + + " date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) \n" + + " UNION ALL \n" + + " SELECT ec_cdp_order_feedback.quantity_response,'0' as male_condoms_offset,location.name,ec_cdp_order_feedback.condom_brand,'-' as male_condom_brand \n" + + " FROM task \n" + + " INNER JOIN location ON location.uuid = task.group_id \n" + + " INNER JOIN ec_cdp_order_feedback ON ec_cdp_order_feedback.request_reference = task.reason_reference \n" + + "\t\t\t\t INNER JOIN ec_cdp_orders ON ec_cdp_orders.form_submission_id = ec_cdp_order_feedback.request_reference\n" + + " WHERE (ec_cdp_order_feedback.condom_type = 'female_condom' AND task.status = 'COMPLETED' AND request_type='facility_to_facility') \n" + + " AND date(substr(strftime('%Y-%m-%d', datetime(response_at / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || \n" + + " substr(strftime('%Y-%m-%d', datetime(response_at / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = \n" + + " date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) \n" + + " UNION ALL \n" + + " SELECT '0' as female_condoms_offset,quantity_response,location.name,'-' as female_condom_brand,ec_cdp_order_feedback.condom_brand \n" + + " FROM task \n" + + " INNER JOIN location ON location.uuid = task.group_id \n" + + " INNER JOIN ec_cdp_order_feedback ON ec_cdp_order_feedback.request_reference = task.reason_reference \n" + + "\t\t\t\t INNER JOIN ec_cdp_orders ON ec_cdp_orders.form_submission_id = ec_cdp_order_feedback.request_reference\n" + + " WHERE (ec_cdp_order_feedback.condom_type = 'male_condom' AND task.status = 'COMPLETED' AND request_type='facility_to_facility') \n" + + " AND date(substr(strftime('%Y-%m-%d', datetime(response_at / 1000, 'unixepoch', 'localtime')), 1, 4) || '-' || \n" + + " substr(strftime('%Y-%m-%d', datetime(response_at / 1000, 'unixepoch', 'localtime')), 6, 2) || '-' || '01') = \n" + + " date((substr('%s', 1, 4) || '-' || substr('%s', 6, 2) || '-' || '01')) "; + + String queryDate = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(reportDate); + + sql = sql.contains("%s") ? sql.replaceAll("%s", queryDate) : sql; + + DataMap> map = cursor -> { + Map data = new HashMap<>(); + data.put("female_condoms_offset", cursor.getString(cursor.getColumnIndex("female_condoms_offset"))); + data.put("male_condoms_offset", cursor.getString(cursor.getColumnIndex("male_condoms_offset"))); + data.put("issuing_organization", cursor.getString(cursor.getColumnIndex("issuing_organization"))); + data.put("male_condom_brand", cursor.getString(cursor.getColumnIndex("male_condom_brand"))); + data.put("female_condom_brand", cursor.getString(cursor.getColumnIndex("female_condom_brand"))); + + return data; + }; + + List> res = readData(sql, map); + + + if (res != null && res.size() > 0) { + return res; + } else + return new ArrayList<>(); + } + + public static int getReportPerIndicatorCode(String indicatorCode, Date reportDate) { + String reportDateString = simpleDateFormat.format(reportDate); + String sql = "SELECT indicator_value\n" + + "FROM indicator_daily_tally\n" + + "WHERE indicator_code = '" + indicatorCode + "'\n" + + " AND date((substr('" + reportDateString + "', 7, 4) || '-' || substr('" + reportDateString + "', 4, 2) || '-' || '01')) = date((substr(day, 1, 4) || '-' || substr(day, 6, 2) || '-' || '01'))\n" + + "ORDER BY day DESC LIMIT 1"; + + DataMap map = cursor -> getCursorIntValue(cursor, "indicator_value"); + + List res = readData(sql, map); + + + if (res != null && res.size() > 0 && res.get(0) != null) { + return res.get(0); + } else + return 0; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dataloader/FamilyMemberDataLoader.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dataloader/FamilyMemberDataLoader.java new file mode 100644 index 000000000..2b4d9cfba --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/dataloader/FamilyMemberDataLoader.java @@ -0,0 +1,157 @@ +package org.smartregister.chw.hf.dataloader; + +import android.content.Context; + +import com.vijay.jsonwizard.constants.JsonFormConstants; + +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; +import org.joda.time.DateTime; +import org.joda.time.Years; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.form_data.NativeFormsDataLoader; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.Utils; +import org.smartregister.domain.Client; +import org.smartregister.domain.Photo; +import org.smartregister.family.util.Constants; +import org.smartregister.family.util.DBConstants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.util.ImageUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class FamilyMemberDataLoader extends NativeFormsDataLoader { + private String familyName; + private boolean isPrimaryCaregiver; + private String title; + private String eventType; + private String uniqueID; + + public FamilyMemberDataLoader(String familyName, boolean isPrimaryCaregiver, String title, String eventType, String uniqueID) { + this.familyName = familyName; + this.isPrimaryCaregiver = isPrimaryCaregiver; + this.title = title; + this.eventType = eventType; + this.uniqueID = uniqueID; + } + + @Override + public String getValue(Context context, String baseEntityID, JSONObject jsonObject, Map> dbData) throws JSONException { + String key = jsonObject.getString(JsonFormConstants.KEY); + Client client = getClient(baseEntityID); + switch (key) { + case org.smartregister.family.util.Constants.JSON_FORM_KEY.DOB_UNKNOWN: + computeDOBUnknown(context, baseEntityID, jsonObject, dbData); + break; + + case CoreConstants.JsonAssets.AGE: + return String.valueOf(Years.yearsBetween(client.getBirthdate(), new DateTime()).getYears()); + + case DBConstants.KEY.DOB: + return JsonFormUtils.dd_MM_yyyy.format(client.getBirthdate().toDate()); + + case org.smartregister.family.util.Constants.KEY.PHOTO: + return getPhoto(baseEntityID); + + case DBConstants.KEY.UNIQUE_ID: + return super.getValue(context, baseEntityID, jsonObject, dbData) + .replace("-", ""); + + case CoreConstants.JsonAssets.FAM_NAME: + case CoreConstants.JsonAssets.SURNAME: + computeFamName(client, jsonObject, jsonArray, familyName); + break; + + case CoreConstants.JsonAssets.PRIMARY_CARE_GIVER: + case CoreConstants.JsonAssets.IS_PRIMARY_CARE_GIVER: + jsonObject.put(JsonFormUtils.READ_ONLY, true); + return isPrimaryCaregiver ? "Yes" : "No"; + + default: + return super.getValue(context, baseEntityID, jsonObject, dbData); + + } + + return super.getValue(context, baseEntityID, jsonObject, dbData); + } + + @Override + public void bindNativeFormsMetaData(@NotNull JSONObject jsonObjectForm, Context context, String baseEntityID) throws JSONException { + super.bindNativeFormsMetaData(jsonObjectForm, context, baseEntityID); + + jsonObjectForm.put(JsonFormUtils.ENCOUNTER_TYPE, eventType); + if (StringUtils.isNotBlank(uniqueID)) + jsonObjectForm.put("current_opensrp_id", uniqueID); + + Map> dbVals = getDbData(context, baseEntityID, eventType); + if (dbVals != null) { + for (Map.Entry> entry : dbVals.entrySet()) { + String val = (String) entry.getValue().get(DBConstants.KEY.UNIQUE_ID); + if (StringUtils.isNotBlank(val)) + jsonObjectForm.put(JsonFormUtils.CURRENT_OPENSRP_ID, val); + } + } + + JSONObject stepOne = jsonObjectForm.getJSONObject("step1"); + if (StringUtils.isNotBlank(title)) + stepOne.put("title", title); + } + + private void computeDOBUnknown(Context context, String baseEntityID, JSONObject jsonObject, Map> dbData) throws JSONException { + String val = super.getValue(context, baseEntityID, jsonObject, dbData); + jsonObject.put(JsonFormUtils.READ_ONLY, false); + JSONObject optionsObject = jsonObject.getJSONArray(Constants.JSON_FORM_KEY.OPTIONS).getJSONObject(0); + optionsObject.put(JsonFormUtils.VALUE, val); + } + + private String getPhoto(String baseEntityID) { + Photo photo = ImageUtils.profilePhotoByClientID(baseEntityID, Utils.getProfileImageResourceIDentifier()); + if (StringUtils.isNotBlank(photo.getFilePath())) { + return photo.getFilePath(); + } + return ""; + } + + private void computeFamName(Client client, JSONObject jsonObject, JSONArray jsonArray, String familyName) throws JSONException { + final String SAME_AS_FAM_NAME = "same_as_fam_name"; + final String SURNAME = "surname"; + + jsonObject.put(JsonFormUtils.VALUE, familyName); + + String lastName = client.getLastName(); + + JSONObject sameAsFamName = org.smartregister.util.JsonFormUtils.getFieldJSONObject(jsonArray, SAME_AS_FAM_NAME); + if (sameAsFamName != null) { + JSONObject sameOptions = sameAsFamName.getJSONArray(Constants.JSON_FORM_KEY.OPTIONS).getJSONObject(0); + + if (familyName.equals(lastName)) { + sameOptions.put(JsonFormUtils.VALUE, true); + } else { + sameOptions.put(JsonFormUtils.VALUE, false); + } + } + + JSONObject surname = org.smartregister.util.JsonFormUtils.getFieldJSONObject(jsonArray, SURNAME); + if (surname != null) { + if (!familyName.equals(lastName)) { + surname.put(JsonFormUtils.VALUE, lastName); + } else { + surname.put(JsonFormUtils.VALUE, familyName); + } + } + } + + @Override + protected List getEventTypes() { + List res = new ArrayList<>(); + res.add(CoreConstants.EventType.FAMILY_MEMBER_REGISTRATION); + res.add(CoreConstants.EventType.UPDATE_FAMILY_MEMBER_REGISTRATION); + return res; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/Entity.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/Entity.java new file mode 100644 index 000000000..5159311d0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/Entity.java @@ -0,0 +1,25 @@ +package org.smartregister.chw.hf.domain; + +import org.opensrp.api.domain.BaseEntity; + + +public class Entity extends BaseEntity { + private String baseEntityId; + private String familyId; + + public String getBaseEntityId() { + return baseEntityId; + } + + public void setBaseEntityId(String baseEntityId) { + this.baseEntityId = baseEntityId; + } + + public String getFamilyId() { + return familyId; + } + + public void setFamilyId(String familyId) { + this.familyId = familyId; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/JSONObjectHolder.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/JSONObjectHolder.java new file mode 100644 index 000000000..29d359233 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/JSONObjectHolder.java @@ -0,0 +1,54 @@ +package org.smartregister.chw.hf.domain; + +import org.json.JSONObject; + +/** + * JSONObjectHolder is a Singleton class that holds a large JSONObject. + * This class provides a way to pass a large JSONObject between Activities + * without using Intent extras or temporary files. + * + * Usage: + * To set the large JSONObject: + * JSONObjectHolder.getInstance().setLargeJSONObject(largeJSONObject); + * + * To get the large JSONObject: + * JSONObject largeJSONObject = JSONObjectHolder.getInstance().getLargeJSONObject(); + */ +public class JSONObjectHolder { + private static JSONObjectHolder instance; + private JSONObject largeJSONObject; + + private JSONObjectHolder() { + } + + /** + * Returns the JSONObjectHolder instance, creating one if it doesn't exist. + * This method is synchronized to ensure that only one instance is created. + * + * @return JSONObjectHolder instance + */ + public static synchronized JSONObjectHolder getInstance() { + if (instance == null) { + instance = new JSONObjectHolder(); + } + return instance; + } + + /** + * Returns the large JSONObject held by this JSONObjectHolder. + * + * @return large JSONObject + */ + public JSONObject getLargeJSONObject() { + return largeJSONObject; + } + + /** + * Sets the large JSONObject to be held by this JSONObjectHolder. + * + * @param largeJSONObject JSONObject to be held + */ + public void setLargeJSONObject(JSONObject largeJSONObject) { + this.largeJSONObject = largeJSONObject; + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/ReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/ReportObject.java new file mode 100644 index 000000000..53fc5d9a0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/ReportObject.java @@ -0,0 +1,36 @@ +package org.smartregister.chw.hf.domain; + +import com.google.gson.Gson; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.Date; +import java.util.List; + +public abstract class ReportObject { + + private List indicatorCodes; + private final Date reportDate; + + public ReportObject( Date reportDate) { + this.reportDate = reportDate; + } + + public List getIndicatorCodes() { + return indicatorCodes; + } + + public Date getReportDate() { + return reportDate; + } + + public JSONObject getIndicatorData() throws JSONException { + return new JSONObject(); + } + + public String getIndicatorDataAsGson(JSONObject jsonObject) throws JSONException { + Gson gson = new Gson(); + return gson.toJson(jsonObject); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/SortableVisit.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/SortableVisit.java new file mode 100644 index 000000000..bcd19e704 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/SortableVisit.java @@ -0,0 +1,11 @@ +package org.smartregister.chw.hf.domain; + +import org.smartregister.chw.anc.domain.Visit; + +public class SortableVisit extends Visit implements Comparable { + @Override + public int compareTo(SortableVisit sortableVisit) { + long data = getDate().getTime() - sortableVisit.getDate().getTime(); + return (int) data; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/anc_reports/AncMonthlyReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/anc_reports/AncMonthlyReportObject.java new file mode 100644 index 000000000..3ebb42edc --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/anc_reports/AncMonthlyReportObject.java @@ -0,0 +1,86 @@ +package org.smartregister.chw.hf.domain.anc_reports; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class AncMonthlyReportObject extends ReportObject { + private final Date reportDate; + private final List indicatorCodesWithAgeGroups = new ArrayList<>(); + private final String[] indicatorCodesArray = new String[]{"2a", "2b", "2c", "2d", "2e", "3", "4a", "4b", "4c", "4d", "4e", "4f", "4g", "4h", "4i", "4j", "4k", "4l", "4m", "4n", "4o", "4p", "4q", "4r", "5a", "5b", "5c", "5d", "5e", "5f", "5g", "5h", "5i", "5j", "5k", "5l", "5m", "5n", "5o", "5p", "6a", "6b", "6c", "6d", "6e", "6f", "7", "8", "9", "10", "11"}; + private final String[] indicatorAgeGroups = new String[]{"10-14", "15-19", "20-24", "25-29", "30-34", "35+"}; + + public AncMonthlyReportObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + setIndicatorCodesWithAgeGroups(indicatorCodesWithAgeGroups); + } + + public void setIndicatorCodesWithAgeGroups(List indicatorCodesWithAgeGroups) { + for (String indicatorCode : indicatorCodesArray) { + for (String indicatorKey : indicatorAgeGroups) { + indicatorCodesWithAgeGroups.add(indicatorCode + "-" + indicatorKey); + } + } + indicatorCodesWithAgeGroups.remove("4a-" + indicatorAgeGroups[0]); + indicatorCodesWithAgeGroups.remove("4b-" + indicatorAgeGroups[2]); + indicatorCodesWithAgeGroups.remove("4b-" + indicatorAgeGroups[3]); + indicatorCodesWithAgeGroups.remove("4b-" + indicatorAgeGroups[4]); + indicatorCodesWithAgeGroups.remove("4b-" + indicatorAgeGroups[5]); + indicatorCodesWithAgeGroups.remove("4c-" + indicatorAgeGroups[0]); + indicatorCodesWithAgeGroups.remove("4c-" + indicatorAgeGroups[1]); + indicatorCodesWithAgeGroups.remove("4c-" + indicatorAgeGroups[2]); + indicatorCodesWithAgeGroups.remove("4c-" + indicatorAgeGroups[3]); + indicatorCodesWithAgeGroups.remove("4c-" + indicatorAgeGroups[4]); + indicatorCodesWithAgeGroups.remove("5e-" + indicatorAgeGroups[3]); + indicatorCodesWithAgeGroups.remove("5e-" + indicatorAgeGroups[4]); + indicatorCodesWithAgeGroups.remove("5e-" + indicatorAgeGroups[5]); + indicatorCodesWithAgeGroups.remove("5p-" + indicatorAgeGroups[3]); + indicatorCodesWithAgeGroups.remove("5p-" + indicatorAgeGroups[4]); + indicatorCodesWithAgeGroups.remove("5p-" + indicatorAgeGroups[5]); + } + + @Override + public JSONObject getIndicatorData() throws JSONException { + JSONObject jsonObject = new JSONObject(); + for (String indicatorCode : indicatorCodesWithAgeGroups) { + jsonObject.put(indicatorCode, ReportDao.getReportPerIndicatorCode(indicatorCode, reportDate)); + } + for (String indicator : indicatorCodesArray) { + jsonObject.put(indicator + "-jumla", getIndicatorTotal(indicator)); + } + + jsonObject.put("2a+2b-10-14", getIndicatorTotal("2a-10-14") + getIndicatorTotal("2b-10-14")); + jsonObject.put("2a+2b-15-19", getIndicatorTotal("2a-15-19") + getIndicatorTotal("2b-15-19")); + jsonObject.put("2a+2b-20-24", getIndicatorTotal("2a-20-24") + getIndicatorTotal("2b-20-24")); + jsonObject.put("2a+2b-25-29", getIndicatorTotal("2a-25-29") + getIndicatorTotal("2b-25-29")); + jsonObject.put("2a+2b-30-34", getIndicatorTotal("2a-30-34") + getIndicatorTotal("2b-30-34")); + jsonObject.put("2a+2b-35+", getIndicatorTotal("2a-35+") + getIndicatorTotal("2b-35+")); + jsonObject.put("2a+2b-jumla", getIndicatorTotal("2a") + getIndicatorTotal("2b")); + + jsonObject.put("2a+2b+2c-10-14", getIndicatorTotal("2a-10-14") + getIndicatorTotal("2b-10-14") + getIndicatorTotal("2c-10-14")); + jsonObject.put("2a+2b+2c-15-19", getIndicatorTotal("2a-15-19") + getIndicatorTotal("2b-15-19") + getIndicatorTotal("2c-15-19")); + jsonObject.put("2a+2b+2c-20-24", getIndicatorTotal("2a-20-24") + getIndicatorTotal("2b-20-24") + getIndicatorTotal("2c-20-24")); + jsonObject.put("2a+2b+2c-25-29", getIndicatorTotal("2a-25-29") + getIndicatorTotal("2b-25-29") + getIndicatorTotal("2c-25-29")); + jsonObject.put("2a+2b+2c-30-34", getIndicatorTotal("2a-30-34") + getIndicatorTotal("2b-30-34") + getIndicatorTotal("2c-30-34")); + jsonObject.put("2a+2b+2c-35+", getIndicatorTotal("2a-35+") + getIndicatorTotal("2b-35+") + getIndicatorTotal("2c-35+")); + jsonObject.put("2a+2b+2c-jumla", getIndicatorTotal("2a") + getIndicatorTotal("2b") + getIndicatorTotal("2c")); + return jsonObject; + } + + private int getIndicatorTotal(String indicator) { + int total = 0; + for (String indicatorCode : indicatorCodesWithAgeGroups) { + if (indicatorCode.startsWith(indicator)) { + total += ReportDao.getReportPerIndicatorCode(indicatorCode, reportDate); + } + } + return total; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/cbhs_reports/CbhsMonthlyReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/cbhs_reports/CbhsMonthlyReportObject.java new file mode 100644 index 000000000..0d9a56bd0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/cbhs_reports/CbhsMonthlyReportObject.java @@ -0,0 +1,101 @@ +package org.smartregister.chw.hf.domain.cbhs_reports; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class CbhsMonthlyReportObject extends ReportObject { + private Date reportDate; + private final List indicatorCodesWithAgeGroups = new ArrayList<>(); + private final String[] indicatorCodesArray = new String[]{"cbhs-1a", "cbhs-1b", "cbhs-2a", "cbhs-2b-1", "cbhs-2b-2", + "cbhs-2b-3", "cbhs-2b-4", "cbhs-2b-5", "cbhs-2b-6", "cbhs-2b-7", "cbhs-2b-8", "cbhs-2b-9", "cbhs-2b-10", "cbhs-2b-11", "cbhs-2c-1", "cbhs-2c-2", + "cbhs-2c-3", "cbhs-2c-4", "cbhs-2d-1", "cbhs-2d-2", "cbhs-2d-3", "cbhs-2d-4", "cbhs-2d-5", "cbhs-2d-6", "cbhs-2d-7", "cbhs-2d-8", "cbhs-2d-9", "cbhs-2d-10", "cbhs-2d-11"}; + private final String[] indicatorGenderGroups = new String[]{"jumla-me", "jumla-ke"}; + private final String[] indicatorAgeGroups = new String[] + {"1-me", "1-ke", + "1-5-me", "1-5-ke", "6-9-me", "6-9-ke", "10-14-me", "10-14-ke", "15-19-me", "15-19-ke", + "20-24-me", "20-24-ke", "25-49-me", "25-49-ke", "50-59-me", "50-59-ke", "60-me", "60-ke"}; + + public CbhsMonthlyReportObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + setIndicatorCodesWithAgeGroups(indicatorCodesWithAgeGroups); + } + + public void setIndicatorCodesWithAgeGroups(List indicatorCodesWithAgeGroups) { + for (String indicatorCode : indicatorCodesArray) { + for (String indicatorKey : indicatorGenderGroups) { + indicatorCodesWithAgeGroups.add(indicatorCode + "-" + indicatorKey); + } + } + + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorGenderGroups[0]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorGenderGroups[1]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[0]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[1]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[2]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[3]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[4]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[5]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[6]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[7]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[8]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[9]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[10]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[11]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[12]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[13]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[14]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[15]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[16]); + indicatorCodesWithAgeGroups.add("cbhs-2a-" + indicatorAgeGroups[17]); + + indicatorCodesWithAgeGroups.add("cbhs-5-jumla"); + indicatorCodesWithAgeGroups.add("cbhs-5-deseased"); + indicatorCodesWithAgeGroups.add("cbhs-5-continue-with-clinic-from-elsewhere"); + indicatorCodesWithAgeGroups.add("cbhs-5-moved"); + indicatorCodesWithAgeGroups.add("cbhs-5-absconded"); + indicatorCodesWithAgeGroups.add("cbhs-5-completed_and_qualified_from_the_services"); + + indicatorCodesWithAgeGroups.add("cbhs-6-kisheria"); + indicatorCodesWithAgeGroups.add("cbhs-6-vikundi"); + indicatorCodesWithAgeGroups.add("cbhs-6-huduma-zingine"); + + indicatorCodesWithAgeGroups.add("cbhs-7-kisheria"); + indicatorCodesWithAgeGroups.add("cbhs-7-vikundi"); + indicatorCodesWithAgeGroups.add("cbhs-7-huduma-zingine"); + + indicatorCodesWithAgeGroups.add("cbhs-8-jumla"); + + + indicatorCodesWithAgeGroups.remove("cbhs--2b-3-jumla-ke"); + indicatorCodesWithAgeGroups.remove("cbhs-2b-4-jumla-me"); + + indicatorCodesWithAgeGroups.remove("cbhs-2b-10-jumla-me"); + indicatorCodesWithAgeGroups.remove("cbhs-2b-11-jumla-me"); + } + + @Override + public JSONObject getIndicatorData() throws JSONException { + JSONObject jsonObject = new JSONObject(); + for (String indicatorCode : indicatorCodesWithAgeGroups) { + jsonObject.put(indicatorCode, ReportDao.getReportPerIndicatorCode(indicatorCode, reportDate)); + } + + jsonObject.put("cbhs-3-jumla-me", getIndicatorTotal("cbhs-1a-jumla-me") + getIndicatorTotal("cbhs-2a-jumla-me")); + jsonObject.put("cbhs-3-jumla-ke", getIndicatorTotal("cbhs-1a-jumla-ke") + getIndicatorTotal("cbhs-2a-jumla-ke")); + jsonObject.put("cbhs-4-jumla-me", getIndicatorTotal("cbhs-1b-jumla-me") + getIndicatorTotal("cbhs-2a-jumla-me")); + jsonObject.put("cbhs-4-jumla-ke", getIndicatorTotal("cbhs-1b-jumla-ke") + getIndicatorTotal("cbhs-2a-jumla-ke")); + + return jsonObject; + } + + private int getIndicatorTotal(String indicator) { + return ReportDao.getReportPerIndicatorCode(indicator, reportDate); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/cdp_reports/CdpIssuingAtFacilityReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/cdp_reports/CdpIssuingAtFacilityReportObject.java new file mode 100644 index 000000000..97596d9c6 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/cdp_reports/CdpIssuingAtFacilityReportObject.java @@ -0,0 +1,105 @@ +package org.smartregister.chw.hf.domain.cdp_reports; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class CdpIssuingAtFacilityReportObject extends ReportObject { + private Date reportDate; + + public CdpIssuingAtFacilityReportObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + } + + @Override + public JSONObject getIndicatorData() throws JSONException { + JSONArray dataArray = new JSONArray(); + List> getHfCdpStockissuingLogList = ReportDao.getHfIssuingCdpStockLog(reportDate); + + for (int i=0; i getHfCdpStockLog : getHfCdpStockissuingLogList) { + JSONObject reportJsonObject = new JSONObject(); + reportJsonObject.put("id", ++i); + + if (getCdpClientDetails(getHfCdpStockLog, "point_of_service").equals("other")){ + reportJsonObject.put("point-of-service", getCdpClientDetails(getHfCdpStockLog, "other_point_of_service")); + reportJsonObject.put("male-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "male_condoms_offset")); + reportJsonObject.put("female-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "female_condoms_offset")); + flag_count_male+=Integer.parseInt(getCdpClientDetails(getHfCdpStockLog, "male_condoms_offset")); + flag_count_female+=Integer.parseInt(getCdpClientDetails(getHfCdpStockLog, "female_condoms_offset")); + } + + else if (!getCdpClientDetails(getHfCdpStockLog, "point_of_service").equals("other")){ + reportJsonObject.put("point-of-service", getCdpClientDetails(getHfCdpStockLog, "point_of_service")); + reportJsonObject.put("male-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "male_condoms_offset")); + reportJsonObject.put("female-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "female_condoms_offset")); + flag_count_male+=Integer.parseInt(getCdpClientDetails(getHfCdpStockLog, "male_condoms_offset")); + flag_count_female+=Integer.parseInt(getCdpClientDetails(getHfCdpStockLog, "female_condoms_offset")); + } + + + // ==> oustside + if (getCdpClientDetails(getHfCdpStockLog, "condom_type").equals("male_condom")){ + reportJsonObject.put("point-of-service", getCdpClientDetails(getHfCdpStockLog, "requester")); + reportJsonObject.put("male-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "quantity_response")); + reportJsonObject.put("female-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "0")); + flag_count_male+=Integer.parseInt(getCdpClientDetails(getHfCdpStockLog, "quantity_response")); + } + + if(getCdpClientDetails(getHfCdpStockLog, "condom_type").equals("female_condom")){ + reportJsonObject.put("point-of-service", getCdpClientDetails(getHfCdpStockLog, "requester")); + reportJsonObject.put("male-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "0")); + reportJsonObject.put("female-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "quantity_response")); + flag_count_female+=Integer.parseInt(getCdpClientDetails(getHfCdpStockLog, "quantity_response")); + } + + dataArray.put(reportJsonObject); + } + + //finally go display total of all + if (flag_count_male > 0 || flag_count_female > 0 ){ + JSONObject reportJsonObject = new JSONObject(); + reportJsonObject.put("total-id",i+1); + reportJsonObject.put("total","TOTAL NUMBER OF CONDOMS RECEIVED"); + reportJsonObject.put("total-male-condoms",flag_count_male); + reportJsonObject.put("total-female-condoms",flag_count_female); + dataArray.put(reportJsonObject); + } + + JSONObject resultJsonObject = new JSONObject(); + resultJsonObject.put("reportData", dataArray); + + return resultJsonObject; + } + + private String getCdpClientDetails(Map chwRegistrationFollowupClient, String key) { + String details = chwRegistrationFollowupClient.get(key); + assert details != null; + if (!details.isEmpty()) { + return details; + }else { + if (key.equals("0") || key.equals("male_condoms_offset") || key.equals("female_condoms_offset")){ + return "0"; + }else + return "-"; + } + + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/cdp_reports/CdpIssuingFromFacilityReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/cdp_reports/CdpIssuingFromFacilityReportObject.java new file mode 100644 index 000000000..b0f4cbf4f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/cdp_reports/CdpIssuingFromFacilityReportObject.java @@ -0,0 +1,105 @@ +package org.smartregister.chw.hf.domain.cdp_reports; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class CdpIssuingFromFacilityReportObject extends ReportObject { + private Date reportDate; + + public CdpIssuingFromFacilityReportObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + } + + @Override + public JSONObject getIndicatorData() throws JSONException { + JSONArray dataArray = new JSONArray(); + List> getHfCdpStockissuingLogList = ReportDao.getHfIssuingCdpStockLog(reportDate); + + for (int i=0; i getHfCdpStockLog : getHfCdpStockissuingLogList) { + JSONObject reportJsonObject = new JSONObject(); + reportJsonObject.put("id", ++i); + + if (getCdpClientDetails(getHfCdpStockLog, "point_of_service").equals("other")){ + reportJsonObject.put("point-of-service", getCdpClientDetails(getHfCdpStockLog, "other_point_of_service")); + reportJsonObject.put("male-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "male_condoms_offset")); + reportJsonObject.put("female-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "female_condoms_offset")); + flag_count_male+=Integer.parseInt(getCdpClientDetails(getHfCdpStockLog, "male_condoms_offset")); + flag_count_female+=Integer.parseInt(getCdpClientDetails(getHfCdpStockLog, "female_condoms_offset")); + } + + else if (!getCdpClientDetails(getHfCdpStockLog, "point_of_service").equals("other")){ + reportJsonObject.put("point-of-service", getCdpClientDetails(getHfCdpStockLog, "point_of_service")); + reportJsonObject.put("male-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "male_condoms_offset")); + reportJsonObject.put("female-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "female_condoms_offset")); + flag_count_male+=Integer.parseInt(getCdpClientDetails(getHfCdpStockLog, "male_condoms_offset")); + flag_count_female+=Integer.parseInt(getCdpClientDetails(getHfCdpStockLog, "female_condoms_offset")); + } + + + // ==> oustside + if (getCdpClientDetails(getHfCdpStockLog, "condom_type").equals("male_condom")){ + reportJsonObject.put("point-of-service", getCdpClientDetails(getHfCdpStockLog, "requester")); + reportJsonObject.put("male-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "quantity_response")); + reportJsonObject.put("female-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "0")); + flag_count_male+=Integer.parseInt(getCdpClientDetails(getHfCdpStockLog, "quantity_response")); + } + + if(getCdpClientDetails(getHfCdpStockLog, "condom_type").equals("female_condom")){ + reportJsonObject.put("point-of-service", getCdpClientDetails(getHfCdpStockLog, "requester")); + reportJsonObject.put("male-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "0")); + reportJsonObject.put("female-condoms-offset", getCdpClientDetails(getHfCdpStockLog, "quantity_response")); + flag_count_female+=Integer.parseInt(getCdpClientDetails(getHfCdpStockLog, "quantity_response")); + } + + dataArray.put(reportJsonObject); + } + + //finally go display total of all + if (flag_count_male > 0 || flag_count_female > 0 ){ + JSONObject reportJsonObject = new JSONObject(); + reportJsonObject.put("total-id",i+1); + reportJsonObject.put("total","TOTAL NUMBER OF CONDOMS RECEIVED"); + reportJsonObject.put("total-male-condoms",flag_count_male); + reportJsonObject.put("total-female-condoms",flag_count_female); + dataArray.put(reportJsonObject); + } + + JSONObject resultJsonObject = new JSONObject(); + resultJsonObject.put("reportData", dataArray); + + return resultJsonObject; + } + + private String getCdpClientDetails(Map chwRegistrationFollowupClient, String key) { + String details = chwRegistrationFollowupClient.get(key); + assert details != null; + if (!details.isEmpty()) { + return details; + }else { + if (key.equals("0") || key.equals("male_condoms_offset") || key.equals("female_condoms_offset")){ + return "0"; + }else + return "-"; + } + + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/cdp_reports/CdpReceivingReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/cdp_reports/CdpReceivingReportObject.java new file mode 100644 index 000000000..073f526be --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/cdp_reports/CdpReceivingReportObject.java @@ -0,0 +1,72 @@ +package org.smartregister.chw.hf.domain.cdp_reports; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +public class CdpReceivingReportObject extends ReportObject { + + private Date reportDate; + + public CdpReceivingReportObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + } + + + @Override + public JSONObject getIndicatorData() throws JSONException { + JSONArray dataArray = new JSONArray(); + List> getHfCdpStockLogList = ReportDao.getHfCdpStockLog(reportDate); + + int i = 0; + int flag_count_female=0; + int flag_count_male=0; + + for (Map getHfCdpStockLog : getHfCdpStockLogList) { + JSONObject reportJsonObject = new JSONObject(); + reportJsonObject.put("id", ++i); + + reportJsonObject.put("source", getCbhsClientDetails(getHfCdpStockLog, "issuing_organization")); + reportJsonObject.put("male-condom-brand", getCbhsClientDetails(getHfCdpStockLog, "male_condom_brand")); + reportJsonObject.put("female-condom-brand", getCbhsClientDetails(getHfCdpStockLog, "female_condom_brand")); + reportJsonObject.put("number-of-male-condom", getCbhsClientDetails(getHfCdpStockLog, "male_condoms_offset")); + reportJsonObject.put("number-of-female-condom", getCbhsClientDetails(getHfCdpStockLog, "female_condoms_offset")); + flag_count_male+=Integer.parseInt(getCbhsClientDetails(getHfCdpStockLog, "male_condoms_offset")); + flag_count_female+=Integer.parseInt(getCbhsClientDetails(getHfCdpStockLog, "female_condoms_offset")); + dataArray.put(reportJsonObject); + } + + if (flag_count_male > 0 || flag_count_female > 0){ + JSONObject reportJsonObject = new JSONObject(); + reportJsonObject.put("total-id",i+1); + reportJsonObject.put("total","TOTAL NUMBER OF CONDOMS RECEIVED"); + reportJsonObject.put("total-female-brand",""); + reportJsonObject.put("total-male-brand",""); + reportJsonObject.put("total-male-condoms",flag_count_male); + reportJsonObject.put("total-female-condoms",flag_count_female); + dataArray.put(reportJsonObject); + } + + JSONObject resultJsonObject = new JSONObject(); + resultJsonObject.put("reportData", dataArray); + + return resultJsonObject; + } + + private String getCbhsClientDetails(Map chwRegistrationFollowupClient, String key) { + String details = chwRegistrationFollowupClient.get(key); + if (StringUtils.isNotBlank(details)) { + return details; + } + return "-"; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/kvp_reports/KvpMonthlyReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/kvp_reports/KvpMonthlyReportObject.java new file mode 100644 index 000000000..44b718944 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/kvp_reports/KvpMonthlyReportObject.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.domain.kvp_reports; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.util.Date; + +public class KvpMonthlyReportObject extends ReportObject { + + + private final String[] kvpQuestionsGroups = new String[]{"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","18","19","20","21","22", + "17-a","17-b","17-c","17-d" + }; + private final String[] kvpAgeGroups = new String[]{ + "<10","10-14","15-19","20-24","25-29","30-34","35-39","40-44","45-49",">50" + }; + private final String[] kvpGroups = new String[]{ + "pwid","pwud","fsw","msm","agyw","mobile_population","serodiscordant_couple","other_vulnerable_population" + }; + private final String[] kvpGenderGroups = new String[]{ + "ME","KE" + }; + + private final Date reportDate; + private JSONObject jsonObject ; + + public KvpMonthlyReportObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + } + + @Override + public JSONObject getIndicatorData() throws JSONException { + jsonObject = new JSONObject(); + for (String questionGroup : kvpQuestionsGroups) { //rows + for (String ageGroup : kvpAgeGroups) { //columns + for (String kvpGroup : kvpGroups) { + for (String genderGroup : kvpGenderGroups) { //concstenate rows columns and gendergroup + jsonObject.put("kvp" + "-" + questionGroup + "-" + ageGroup + "-" + kvpGroup + "-" + genderGroup, + ReportDao.getReportPerIndicatorCode("kvp" + "-" + questionGroup + "-" + ageGroup +"-" + kvpGroup + "-" + genderGroup, reportDate)); + } + } + } + } + // get total of all Male & Female in Qn 2 & 7 + //and the whole total for both of them + funcGetTotal(); + + return jsonObject; + } + + private int getTotalPerEachIndicator(String question,String kvpgroup) throws JSONException { + int totalOfGenderGiven = 0; + int returnedValue = 0; + for (String age: kvpAgeGroups){ + totalOfGenderGiven += (ReportDao.getReportPerIndicatorCode("kvp" + "-" + + question + "-" + age + "-" + kvpgroup + "-" + "ME", reportDate) + +ReportDao.getReportPerIndicatorCode("kvp" + "-" + + question + "-" + age + "-" + kvpgroup + "-" + "KE", reportDate)); + jsonObject.put("kvp"+"-"+question+"-"+kvpgroup+"-jumla-both-ME-KE",totalOfGenderGiven); //display the total for both gender + returnedValue = totalOfGenderGiven; + } + return returnedValue; + } + + + private void funcGetTotal() throws JSONException { + int totalofthewholekvpgroup = 0; + for (String question: kvpQuestionsGroups) { + for (String kvpGroup : kvpGroups) { + totalofthewholekvpgroup+=getTotalPerEachIndicator(question,kvpGroup); + jsonObject.put("kvp"+"-"+question+"-jumla-kuu",totalofthewholekvpgroup); //total for all kvp groups + } + totalofthewholekvpgroup = 0; + } + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/ld_reports/LdMonthlyReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/ld_reports/LdMonthlyReportObject.java new file mode 100644 index 000000000..194234a97 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/ld_reports/LdMonthlyReportObject.java @@ -0,0 +1,135 @@ +package org.smartregister.chw.hf.domain.ld_reports; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class LdMonthlyReportObject extends ReportObject { + private final Date reportDate; + private final List indicatorCodesWithAgeGroups = new ArrayList<>(); + private final String[] indicatorCodesArray = new String[]{"2a", "2b", "2c", "2d", "2e", "3a", "4a", "4b", "4c", "4d", "5a", "5b", "5c", "5d", "5e", "5f", "5g", "5h", "5i", "6a", "6b", "6c", "6d", "6e", "6f", "6g", "6h", "7a", "7b", "7c", "7d", "7e", "7f", "8a", "8b", "8c", "8d", "8e", "9a", "9b", "9c", "9d", "9e", "9f", "9g", "10a", "10b", "10c", "10d", "10e", "10f", "10g", "10h", "11a", "11b", "11c", "11d", "11e", "11f", "11g", "11h", "12a", "12b", "12c", "13a", "13b", "13c", "14a", "15a", "15b", "15c", "15d", "15e"}; + private final String[] indicatorAgeGroups = new String[]{"10-14", "15-19", "20-24", "25-29", "30-34", "35+"}; + + + public LdMonthlyReportObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + setIndicatorCodesWithAgeGroups(indicatorCodesWithAgeGroups); + } + + + public void setIndicatorCodesWithAgeGroups(List indicatorCodesWithAgeGroups) { + for (String indicatorCode : indicatorCodesArray) { + for (String indicatorKey : indicatorAgeGroups) { + indicatorCodesWithAgeGroups.add(indicatorCode + "-" + indicatorKey); + } + } + indicatorCodesWithAgeGroups.add("16a-10-14-ME"); + indicatorCodesWithAgeGroups.add("16a-10-14-KE"); + indicatorCodesWithAgeGroups.add("16a-15-19-ME"); + indicatorCodesWithAgeGroups.add("16a-15-19-KE"); + indicatorCodesWithAgeGroups.add("16a-20-24-ME"); + indicatorCodesWithAgeGroups.add("16a-20-24-KE"); + indicatorCodesWithAgeGroups.add("16a-25-29-ME"); + indicatorCodesWithAgeGroups.add("16a-25-29-KE"); + indicatorCodesWithAgeGroups.add("16a-30-34-ME"); + indicatorCodesWithAgeGroups.add("16a-30-34-KE"); + indicatorCodesWithAgeGroups.add("16a-35+-ME"); + indicatorCodesWithAgeGroups.add("16a-35+-KE"); + } + + @Override + public JSONObject getIndicatorData() throws JSONException { + JSONObject jsonObject = new JSONObject(); + for (String indicatorCode : indicatorCodesWithAgeGroups) { + jsonObject.put(indicatorCode, ReportDao.getReportPerIndicatorCode("ld-" + indicatorCode, reportDate)); + } + for (String indicator : indicatorCodesArray) { + jsonObject.put(indicator + "-jumla", getIndicatorTotal(indicator)); + } + + jsonObject.put("2a+2b+2c+2d-10-14", getIndicatorTotal("2a-10-14") + getIndicatorTotal("2b-10-14") + getIndicatorTotal("2c-10-14")); + jsonObject.put("2a+2b+2c+2d-15-19", getIndicatorTotal("2a-15-19") + getIndicatorTotal("2b-15-19") + getIndicatorTotal("2c-15-19")); + jsonObject.put("2a+2b+2c+2d-20-24", getIndicatorTotal("2a-20-24") + getIndicatorTotal("2b-20-24") + getIndicatorTotal("2c-20-24")); + jsonObject.put("2a+2b+2c+2d-25-29", getIndicatorTotal("2a-25-29") + getIndicatorTotal("2b-25-29") + getIndicatorTotal("2c-25-29")); + jsonObject.put("2a+2b+2c+2d-30-34", getIndicatorTotal("2a-30-34") + getIndicatorTotal("2b-30-34") + getIndicatorTotal("2c-30-34")); + jsonObject.put("2a+2b+2c+2d-35+", getIndicatorTotal("2a-35+") + getIndicatorTotal("2b-35+") + getIndicatorTotal("2c-35+")); + jsonObject.put("2a+2b+2c+2d-jumla", getIndicatorTotal("2a") + getIndicatorTotal("2b") + getIndicatorTotal("2b")); + + jsonObject.put("4a+4b+4c+4d-10-14", getIndicatorTotal("4a-10-14") + getIndicatorTotal("4b-10-14") + getIndicatorTotal("4c-10-14") + getIndicatorTotal("4d-10-14")); + jsonObject.put("4a+4b+4c+4d-15-19", getIndicatorTotal("4a-15-19") + getIndicatorTotal("4b-15-19") + getIndicatorTotal("4c-15-19") + getIndicatorTotal("4d-15-19")); + jsonObject.put("4a+4b+4c+4d-20-24", getIndicatorTotal("4a-20-24") + getIndicatorTotal("4b-20-24") + getIndicatorTotal("4c-20-24") + getIndicatorTotal("4d-20-24")); + jsonObject.put("4a+4b+4c+4d-25-29", getIndicatorTotal("4a-25-29") + getIndicatorTotal("4b-25-29") + getIndicatorTotal("4c-25-29") + getIndicatorTotal("4d-25-29")); + jsonObject.put("4a+4b+4c+4d-30-34", getIndicatorTotal("4a-30-34") + getIndicatorTotal("4b-30-34") + getIndicatorTotal("4c-30-34") + getIndicatorTotal("4d-30-34")); + jsonObject.put("4a+4b+4c+4d-35+", getIndicatorTotal("4a-35+") + getIndicatorTotal("4b-35+") + getIndicatorTotal("4c-35+") + getIndicatorTotal("4d-35+")); + jsonObject.put("4a+4b+4c+4d-jumla", getIndicatorTotal("4a") + getIndicatorTotal("4b") + getIndicatorTotal("4c") + getIndicatorTotal("4d")); + + jsonObject.put("5a+5b+5c+5d+5e+5f+5g+5h-10-14", getIndicatorTotal("5a-10-14") + getIndicatorTotal("5b-10-14") + getIndicatorTotal("5c-10-14") + getIndicatorTotal("5d-10-14") + getIndicatorTotal("5e-10-14") + getIndicatorTotal("5f-10-14") + getIndicatorTotal("5g-10-14") + getIndicatorTotal("5h-10-14")); + jsonObject.put("5a+5b+5c+5d+5e+5f+5g+5h-15-19", getIndicatorTotal("5a-15-19") + getIndicatorTotal("5b-15-19") + getIndicatorTotal("5c-15-19") + getIndicatorTotal("5d-15-19") + getIndicatorTotal("5e-15-19") + getIndicatorTotal("5f-15-19") + getIndicatorTotal("5g-15-19") + getIndicatorTotal("5h-15-19")); + jsonObject.put("5a+5b+5c+5d+5e+5f+5g+5h-20-24", getIndicatorTotal("5a-20-24") + getIndicatorTotal("5b-20-24") + getIndicatorTotal("5c-20-24") + getIndicatorTotal("5d-20-24") + getIndicatorTotal("5e-20-24") + getIndicatorTotal("5f-20-24") + getIndicatorTotal("5g-20-24") + getIndicatorTotal("5h-20-24")); + jsonObject.put("5a+5b+5c+5d+5e+5f+5g+5h-25-29", getIndicatorTotal("5a-25-29") + getIndicatorTotal("5b-25-29") + getIndicatorTotal("5c-25-29") + getIndicatorTotal("5d-25-29") + getIndicatorTotal("5e-25-29") + getIndicatorTotal("5f-25-29") + getIndicatorTotal("5g-25-29") + getIndicatorTotal("5h-25-29")); + jsonObject.put("5a+5b+5c+5d+5e+5f+5g+5h-30-34", getIndicatorTotal("5a-30-34") + getIndicatorTotal("5b-30-34") + getIndicatorTotal("5c-30-34") + getIndicatorTotal("5d-30-34") + getIndicatorTotal("5e-30-34") + getIndicatorTotal("5f-30-34") + getIndicatorTotal("5g-30-34") + getIndicatorTotal("5h-30-34")); + jsonObject.put("5a+5b+5c+5d+5e+5f+5g+5h-35+", getIndicatorTotal("5a-35+") + getIndicatorTotal("5b-35+") + getIndicatorTotal("5c-35+") + getIndicatorTotal("5d-35+") + getIndicatorTotal("5e-35+") + getIndicatorTotal("5f-35+") + getIndicatorTotal("5g-35+") + getIndicatorTotal("5h-35+")); + jsonObject.put("5a+5b+5c+5d+5e+5f+5g+5h-jumla", getIndicatorTotal("5a") + getIndicatorTotal("5b") + getIndicatorTotal("5c") + getIndicatorTotal("5d") + getIndicatorTotal("5e") + getIndicatorTotal("5f") + getIndicatorTotal("5g") + getIndicatorTotal("5h")); + + + jsonObject.put("6a+6b+6c+6d+6e+6f+6g+6h-10-14", getIndicatorTotal("6a-10-14") + getIndicatorTotal("6b-10-14") + getIndicatorTotal("6c-10-14") + getIndicatorTotal("6d-10-14") + getIndicatorTotal("6e-10-14") + getIndicatorTotal("6f-10-14") + getIndicatorTotal("6g-10-14") + getIndicatorTotal("6h-10-14")); + jsonObject.put("6a+6b+6c+6d+6e+6f+6g+6h-15-19", getIndicatorTotal("6a-15-19") + getIndicatorTotal("6b-15-19") + getIndicatorTotal("6c-15-19") + getIndicatorTotal("6d-15-19") + getIndicatorTotal("6e-15-19") + getIndicatorTotal("6f-15-19") + getIndicatorTotal("6g-15-19") + getIndicatorTotal("6h-15-19")); + jsonObject.put("6a+6b+6c+6d+6e+6f+6g+6h-20-24", getIndicatorTotal("6a-20-24") + getIndicatorTotal("6b-20-24") + getIndicatorTotal("6c-20-24") + getIndicatorTotal("6d-20-24") + getIndicatorTotal("6e-20-24") + getIndicatorTotal("6f-20-24") + getIndicatorTotal("6g-20-24") + getIndicatorTotal("6h-20-24")); + jsonObject.put("6a+6b+6c+6d+6e+6f+6g+6h-25-29", getIndicatorTotal("6a-25-29") + getIndicatorTotal("6b-25-29") + getIndicatorTotal("6c-25-29") + getIndicatorTotal("6d-25-29") + getIndicatorTotal("6e-25-29") + getIndicatorTotal("6f-25-29") + getIndicatorTotal("6g-25-29") + getIndicatorTotal("6h-25-29")); + jsonObject.put("6a+6b+6c+6d+6e+6f+6g+6h-30-34", getIndicatorTotal("6a-30-34") + getIndicatorTotal("6b-30-34") + getIndicatorTotal("6c-30-34") + getIndicatorTotal("6d-30-34") + getIndicatorTotal("6e-30-34") + getIndicatorTotal("6f-30-34") + getIndicatorTotal("6g-30-34") + getIndicatorTotal("6h-30-34")); + jsonObject.put("6a+6b+6c+6d+6e+6f+6g+6h-35+", getIndicatorTotal("6a-35+") + getIndicatorTotal("6b-35+") + getIndicatorTotal("6c-35+") + getIndicatorTotal("6d-35+") + getIndicatorTotal("6e-35+") + getIndicatorTotal("6f-35+") + getIndicatorTotal("6g-35+") + getIndicatorTotal("6h-35+")); + jsonObject.put("6a+6b+6c+6d+6e+6f+6g+6h-jumla", getIndicatorTotal("6a") + getIndicatorTotal("6b") + getIndicatorTotal("6c") + getIndicatorTotal("6d") + getIndicatorTotal("6e") + getIndicatorTotal("6f") + getIndicatorTotal("6g") + getIndicatorTotal("6h")); + + jsonObject.put("9b+9d-10-14", getIndicatorTotal("9b-10-14") + getIndicatorTotal("9d-10-14")); + jsonObject.put("9b+9d-15-19", getIndicatorTotal("9b-15-19") + getIndicatorTotal("9d-15-19")); + jsonObject.put("9b+9d-20-24", getIndicatorTotal("9b-20-24") + getIndicatorTotal("9d-20-24")); + jsonObject.put("9b+9d-25-29", getIndicatorTotal("9b-25-29") + getIndicatorTotal("9d-25-29")); + jsonObject.put("9b+9d-30-34", getIndicatorTotal("9b-30-34") + getIndicatorTotal("9d-30-34")); + jsonObject.put("9b+9d-35+", getIndicatorTotal("9b-35+") + getIndicatorTotal("9d-35+")); + jsonObject.put("9b+9d-jumla", getIndicatorTotal("9b") + getIndicatorTotal("9d")); + + jsonObject.put("10a+10d+10e-10-14", getIndicatorTotal("10a-10-14") + getIndicatorTotal("10d-10-14") + getIndicatorTotal("10e-10-14")); + jsonObject.put("10a+10d+10e-15-19", getIndicatorTotal("10a-15-19") + getIndicatorTotal("10d-15-19") + getIndicatorTotal("10e-15-19")); + jsonObject.put("10a+10d+10e-20-24", getIndicatorTotal("10a-20-24") + getIndicatorTotal("10d-20-24") + getIndicatorTotal("10e-20-24")); + jsonObject.put("10a+10d+10e-25-29", getIndicatorTotal("10a-25-29") + getIndicatorTotal("10d-25-29") + getIndicatorTotal("10e-25-29")); + jsonObject.put("10a+10d+10e-30-34", getIndicatorTotal("10a-30-34") + getIndicatorTotal("10d-30-34") + getIndicatorTotal("10e-30-34")); + jsonObject.put("10a+10d+10e-35+", getIndicatorTotal("10a-35+") + getIndicatorTotal("10d-35+") + getIndicatorTotal("10e-35+")); + jsonObject.put("10a+10d+10e-jumla", getIndicatorTotal("10a") + getIndicatorTotal("10d") + getIndicatorTotal("10e")); + + jsonObject.put("11a+11d+11e-10-14", getIndicatorTotal("11a-10-14") + getIndicatorTotal("11d-10-14") + getIndicatorTotal("11e-10-14")); + jsonObject.put("11a+11d+11e-15-19", getIndicatorTotal("11a-15-19") + getIndicatorTotal("11d-15-19") + getIndicatorTotal("11e-15-19")); + jsonObject.put("11a+11d+11e-20-24", getIndicatorTotal("11a-20-24") + getIndicatorTotal("11d-20-24") + getIndicatorTotal("11e-20-24")); + jsonObject.put("11a+11d+11e-25-29", getIndicatorTotal("11a-25-29") + getIndicatorTotal("11d-25-29") + getIndicatorTotal("11e-25-29")); + jsonObject.put("11a+11d+11e-30-34", getIndicatorTotal("11a-30-34") + getIndicatorTotal("11d-30-34") + getIndicatorTotal("11e-30-34")); + jsonObject.put("11a+11d+11e-35+", getIndicatorTotal("11a-35+") + getIndicatorTotal("11d-35+") + getIndicatorTotal("11e-35+")); + jsonObject.put("11a+11d+11e-jumla", getIndicatorTotal("11a") + getIndicatorTotal("11d") + getIndicatorTotal("11e")); + jsonObject.put("16a-jumla-ME", getIndicatorTotalSpecific("16a", "ME")); + jsonObject.put("16a-jumla-KE", getIndicatorTotalSpecific("16a", "KE")); + + return jsonObject; + } + + private int getIndicatorTotal(String indicator) { + int total = 0; + for (String indicatorCode : indicatorCodesWithAgeGroups) { + if (indicatorCode.startsWith(indicator)) { + total += ReportDao.getReportPerIndicatorCode("ld-" + indicatorCode, reportDate); + } + } + return total; + } + + public int getIndicatorTotalSpecific(String indicator, String postfix){ + int total = 0; + for(String ageGroup : indicatorAgeGroups){ + total += ReportDao.getReportPerIndicatorCode("ld-" + indicator + "-" +ageGroup + "-" + postfix, reportDate); + } + return total; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/ltfu_summary/LTFUSummaryObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/ltfu_summary/LTFUSummaryObject.java new file mode 100644 index 000000000..4884d971a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/ltfu_summary/LTFUSummaryObject.java @@ -0,0 +1,116 @@ +package org.smartregister.chw.hf.domain.ltfu_summary; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class LTFUSummaryObject extends ReportObject { + private Date reportDate; + private final List indicatorCodesWithGroups = new ArrayList<>(); + private final String[] indicatorCodesArray = new String[]{"ltfu-less-2-me", "ltfu-less-2-ke", + "ltfu-2-14-me", "ltfu-2-14-ke", "ltfu-15-24-me", "ltfu-15-24-ke", + "ltfu-25-49-me", "ltfu-25-49-ke", "ltfu-50-me", "ltfu-50-ke"}; + private final String[] indicatorGroups = new String[] + {"ctc","prep", "pmtct", "tb", "wajidunga", "arv-yes", "arv-no", + "a1", "b1", "c1", "d1", "e1", "f1", "g1", "h1", + "a2", "b2", "c2", "d2", "e2", "f2", "g2", "h2", "i2", "j2", "k2"}; + + public LTFUSummaryObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + setIndicatorCodesWithAgeGroups(indicatorCodesWithGroups); + } + + public void setIndicatorCodesWithAgeGroups(List indicatorCodesWithAgeGroups) { + for (String indicatorCode : indicatorCodesArray) { + for (String indicatorKey : indicatorGroups) { + indicatorCodesWithAgeGroups.add(indicatorCode + "-" + indicatorKey); + } + } + } + + @Override + public JSONObject getIndicatorData() throws JSONException { + JSONObject jsonObject = new JSONObject(); + //vertical totals + int jumlaWateja = 0; + int jumlaWaliopatikana =0; + + for (String indicatorCode : indicatorCodesWithGroups) { + jsonObject.put(indicatorCode, ReportDao.getReportPerIndicatorCode(indicatorCode, reportDate)); + } + + for (String indicatorGroup : indicatorGroups) { + jsonObject.put("ltfu-jumla" + "-" + indicatorGroup, getTotalPerGroup(indicatorGroup)); + } + for(String indicatorCode: indicatorCodesArray){ + jumlaWateja = getJumlaWateja(jsonObject, jumlaWateja, indicatorCode); + jumlaWaliopatikana = getJumlaWaliopatikana(jsonObject, jumlaWaliopatikana, indicatorCode); + } + + jsonObject.put("ltfu-jumla-jumla-wateja", jumlaWateja); + jsonObject.put("ltfu-jumla-jumla-waliopatikana", jumlaWaliopatikana); + + return jsonObject; + } + + private int getJumlaWateja(JSONObject jsonObject, int jumlaWateja, String indicatorCode) throws JSONException { + //gets the vertical total and adds the horizontal total to the jsonObject + int totalPerClinicForIndicator = getTotalForClinicPerGroup(indicatorCode); + jumlaWateja += totalPerClinicForIndicator; + jsonObject.put(indicatorCode + "-jumla-wateja", totalPerClinicForIndicator); + return jumlaWateja; + } + + private int getJumlaWaliopatikana(JSONObject jsonObject, int jumlaWaliopatikana, String indicatorCode) throws JSONException { + //gets the vertical total and adds the horizontal total to the jsonObject + int totalFoundClientsPerCode = getTotalFoundClients(indicatorCode); + jumlaWaliopatikana += totalFoundClientsPerCode; + jsonObject.put(indicatorCode +"-jumla-waliopatikana", totalFoundClientsPerCode); + return jumlaWaliopatikana; + } + + private int getIndicatorTotal(String indicator) { + int total = 0; + for (String indicatorCode : indicatorCodesWithGroups) { + if (indicatorCode.startsWith(indicator)) { + total += ReportDao.getReportPerIndicatorCode(indicatorCode, reportDate); + } + } + return total; + } + + private int getTotalForClinicPerGroup(String indicator) { + final String[] clinics = new String[]{"ctc", "prep", "pmtct", "tb", "wajidunga"}; + int total = 0; + for(String clinic : clinics) { + total += getIndicatorTotal(indicator + "-" + clinic); + } + return total; + } + + private int getTotalFoundClients(String indicator){ + final String[] foundClientsGroup = new String[]{"a1", "b1", "d1", "e1", "f1", "g1"}; + int total = 0; + for (String foundClientGroup : foundClientsGroup) { + total += getIndicatorTotal(indicator + "-" + foundClientGroup); + } + return total; + } + + private int getTotalPerGroup(String indicatorGroup) { + + return getIndicatorTotal("ltfu-less-2-me" + "-" + indicatorGroup) + + getIndicatorTotal("ltfu-less-2-ke" + "-" + indicatorGroup) + getIndicatorTotal("ltfu-2-14-me" + "-" + indicatorGroup) + + getIndicatorTotal("ltfu-2-14-ke" + "-" + indicatorGroup) + getIndicatorTotal("ltfu-15-24-me" + "-" + indicatorGroup) + + getIndicatorTotal("ltfu-15-24-ke" + "-" + indicatorGroup) + getIndicatorTotal("ltfu-25-49-me" + "-" + indicatorGroup) + + getIndicatorTotal("ltfu-25-49-ke" + "-" + indicatorGroup) + getIndicatorTotal("ltfu-50-me" + "-" + indicatorGroup) + + getIndicatorTotal("ltfu-50-ke" + "-" + indicatorGroup); + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/mother_champion_repots/MotherChampionReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/mother_champion_repots/MotherChampionReportObject.java new file mode 100644 index 000000000..50c217af6 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/mother_champion_repots/MotherChampionReportObject.java @@ -0,0 +1,48 @@ +package org.smartregister.chw.hf.domain.mother_champion_repots; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +public class MotherChampionReportObject extends ReportObject { + final Date reportDate; + private final String[] indicatorCodes = new String[]{"b-1", "b-2", "b-3", "b-4", "b-5", "b-6", "b-7"}; + + public MotherChampionReportObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + } + + + @Override + public JSONObject getIndicatorData() throws JSONException { + JSONArray dataArray = new JSONArray(); + + List> motherChampionsList = ReportDao.getMotherChampions(reportDate); + + int i = 0; + for (Map motherChampion : motherChampionsList) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("id", ++i); + jsonObject.put("majina_mama_vinara", motherChampion.get("chw_name")); + jsonObject.put("jina_lililosajiliwa", motherChampion.get("provider_id")); + dataArray.put(jsonObject); + } + + + JSONObject jsonObject = new JSONObject(); + jsonObject.put("reportData", dataArray); + for (String indicatorCode : indicatorCodes) { + jsonObject.put(indicatorCode, ReportDao.getReportPerIndicatorCode(indicatorCode, reportDate)); + } + + return jsonObject; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pmtct_reports/Pmtct12MonthsReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pmtct_reports/Pmtct12MonthsReportObject.java new file mode 100644 index 000000000..b476c2602 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pmtct_reports/Pmtct12MonthsReportObject.java @@ -0,0 +1,76 @@ +package org.smartregister.chw.hf.domain.pmtct_reports; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class Pmtct12MonthsReportObject extends ReportObject { + DecimalFormat df = new DecimalFormat(); + ; + private List indicatorCodes = new ArrayList<>(); + private Date reportDate; + + public Pmtct12MonthsReportObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + setIndicatorCodes(indicatorCodes); + } + + public void setIndicatorCodes(List indicatorCodes) { + indicatorCodes.add("A12"); + indicatorCodes.add("B12"); + indicatorCodes.add("C12"); + indicatorCodes.add("D12"); + indicatorCodes.add("E12"); + indicatorCodes.add("F12"); + indicatorCodes.add("G12"); + indicatorCodes.add("H12"); + indicatorCodes.add("I12"); + indicatorCodes.add("J12"); + indicatorCodes.add("K12"); + indicatorCodes.add("L12"); + indicatorCodes.add("M12"); + indicatorCodes.add("N12"); + indicatorCodes.add("O12"); + indicatorCodes.add("P12"); + indicatorCodes.add("Q12a"); + indicatorCodes.add("Q12b"); + } + + @Override + public JSONObject getIndicatorData() throws JSONException { + JSONObject indicatorDataObject = new JSONObject(); + for (String indicatorCode : indicatorCodes) { + indicatorDataObject.put(indicatorCode, ReportDao.getReportPerIndicatorCode(indicatorCode, reportDate)); + } + df.setMaximumFractionDigits(2); + + indicatorDataObject.put("D12", getIndicatorD12()); + indicatorDataObject.put("K12", df.format(getIndicatorK12()) + "%"); + + return indicatorDataObject; + } + + private int getIndicatorD12() { + //D12 = A12 + B12 - C12 + return ReportDao.getReportPerIndicatorCode("A12", reportDate) + + ReportDao.getReportPerIndicatorCode("B12", reportDate) + - ReportDao.getReportPerIndicatorCode("C12", reportDate); + } + + private float getIndicatorK12() { + int denominator = (getIndicatorD12() - ReportDao.getReportPerIndicatorCode("J12", reportDate)); + if (denominator > 0) { + return ((ReportDao.getReportPerIndicatorCode("E12", reportDate) * 1f) / denominator) * 100; + } + return 0; + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pmtct_reports/Pmtct24MonthsReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pmtct_reports/Pmtct24MonthsReportObject.java new file mode 100644 index 000000000..f2763dcf2 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pmtct_reports/Pmtct24MonthsReportObject.java @@ -0,0 +1,89 @@ +package org.smartregister.chw.hf.domain.pmtct_reports; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class Pmtct24MonthsReportObject extends ReportObject { + DecimalFormat df = new DecimalFormat(); + private List indicatorCodes = new ArrayList<>(); + private Date reportDate; + + public Pmtct24MonthsReportObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + setIndicatorCodes(indicatorCodes); + } + + public void setIndicatorCodes(List indicatorCodes) { + indicatorCodes.add("A24"); + indicatorCodes.add("B24"); + indicatorCodes.add("C24"); + indicatorCodes.add("D24"); + indicatorCodes.add("E24"); + indicatorCodes.add("F24"); + indicatorCodes.add("G24"); + indicatorCodes.add("H24"); + indicatorCodes.add("I24"); + indicatorCodes.add("J24"); + indicatorCodes.add("K24"); + indicatorCodes.add("L24"); + indicatorCodes.add("M24"); + indicatorCodes.add("N24"); + indicatorCodes.add("O24"); + indicatorCodes.add("P24"); + indicatorCodes.add("Q24"); + indicatorCodes.add("R24"); + } + + @Override + public JSONObject getIndicatorData() throws JSONException { + JSONObject indicatorDataObject = new JSONObject(); + for (String indicatorCode : indicatorCodes) { + indicatorDataObject.put(indicatorCode, ReportDao.getReportPerIndicatorCode(indicatorCode, reportDate)); + } + df.setMaximumFractionDigits(2); + + indicatorDataObject.put("D24", getIndicatorD24()); + indicatorDataObject.put("I24", df.format(getIndicatorI24()) + "%"); + indicatorDataObject.put("L24", getIndicatorL24()); + indicatorDataObject.put("R24", df.format(getIndicatorR24()) + "%"); + + return indicatorDataObject; + } + + private int getIndicatorD24() { + //D24 = A24 + B24 - C24 + return ReportDao.getReportPerIndicatorCode("A24", reportDate) + + ReportDao.getReportPerIndicatorCode("B24", reportDate) + - ReportDao.getReportPerIndicatorCode("C24", reportDate); + } + + private float getIndicatorI24() { + //I24 = H24/D24 * 100 + if (getIndicatorD24() > 0) { + return ((ReportDao.getReportPerIndicatorCode("H24", reportDate) * 1f) / getIndicatorD24()) * 100; + } + return 0; + } + + private int getIndicatorL24() { + //L24 = J24 - K24 + return ReportDao.getReportPerIndicatorCode("J24", reportDate) - ReportDao.getReportPerIndicatorCode("K24", reportDate); + } + + private float getIndicatorR24() { + //R24 = (M24 + N24)/L24 * 100 + if (getIndicatorL24() > 0) { + return ((ReportDao.getReportPerIndicatorCode("M24", reportDate) + ReportDao.getReportPerIndicatorCode("N24", reportDate)) * 1f) / getIndicatorL24() * 100; + } + return 0; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pmtct_reports/Pmtct3MonthsReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pmtct_reports/Pmtct3MonthsReportObject.java new file mode 100644 index 000000000..9d076a9ef --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pmtct_reports/Pmtct3MonthsReportObject.java @@ -0,0 +1,93 @@ +package org.smartregister.chw.hf.domain.pmtct_reports; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class Pmtct3MonthsReportObject extends ReportObject { + DecimalFormat df = new DecimalFormat(); + private List indicatorCodes = new ArrayList<>(); + private Date reportDate; + + public Pmtct3MonthsReportObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + setIndicatorCodes(indicatorCodes); + } + + public void setIndicatorCodes(List indicatorCodes) { + indicatorCodes.add("B3a"); + indicatorCodes.add("B3b"); + indicatorCodes.add("B3c"); + indicatorCodes.add("B3d"); + indicatorCodes.add("C3a"); + indicatorCodes.add("C3b"); + indicatorCodes.add("D3"); + indicatorCodes.add("E3"); + indicatorCodes.add("G3"); + indicatorCodes.add("H3"); + indicatorCodes.add("I3"); + indicatorCodes.add("J3"); + } + + @Override + public JSONObject getIndicatorData() throws JSONException { + JSONObject indicatorDataObject = new JSONObject(); + for (String indicatorCode : indicatorCodes) { + indicatorDataObject.put(indicatorCode, ReportDao.getReportPerIndicatorCode(indicatorCode, reportDate)); + } + df.setMaximumFractionDigits(2); + //F3 = A3 + D3 - E3 + indicatorDataObject.put("F3", getIndicatorA3() + getIndicatorD3() - getIndicatorE3()); + indicatorDataObject.put("K3", df.format(getIndicatorK3()) + "%"); + return indicatorDataObject; + } + + private int getIndicatorA3() { + // A3 = B3a + B3b + B3c + B3d + return ReportDao.getReportPerIndicatorCode("B3a", reportDate) + + ReportDao.getReportPerIndicatorCode("B3b", reportDate) + + ReportDao.getReportPerIndicatorCode("B3c", reportDate) + + ReportDao.getReportPerIndicatorCode("B3d", reportDate); + } + + private int getIndicatorD3() { + return ReportDao.getReportPerIndicatorCode("D3", reportDate); + } + + private int getIndicatorE3() { + return ReportDao.getReportPerIndicatorCode("E3", reportDate); + } + + private float getIndicatorK3() { + //if F3 - J3 < 0 return 0 + //else K3 = G3 /(F3 - J3) * 100 to 2 decimal places + int denominator = getIndicatorF3() - getIndicatorJ3(); + float numerator = getIndicatorG3() * 1f; + if (denominator > 0) { + return ((numerator) / (denominator)) * 100; + } + return 0; + + } + + private int getIndicatorF3() { + return getIndicatorA3() + getIndicatorD3() - getIndicatorE3(); + } + + private int getIndicatorJ3() { + return ReportDao.getReportPerIndicatorCode("J3", reportDate); + } + + private int getIndicatorG3() { + return ReportDao.getReportPerIndicatorCode("G3", reportDate); + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pmtct_reports/PmtctEIDMonthlyReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pmtct_reports/PmtctEIDMonthlyReportObject.java new file mode 100644 index 000000000..2873c090e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pmtct_reports/PmtctEIDMonthlyReportObject.java @@ -0,0 +1,62 @@ +package org.smartregister.chw.hf.domain.pmtct_reports; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class PmtctEIDMonthlyReportObject extends ReportObject { + DecimalFormat df = new DecimalFormat(); + private List indicatorCodes = new ArrayList<>(); + private Date reportDate; + + public PmtctEIDMonthlyReportObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + setIndicatorCodes(indicatorCodes); + } + + public void setIndicatorCodes(List indicatorCodes) { + indicatorCodes.add("A"); + indicatorCodes.add("B"); + indicatorCodes.add("C"); + indicatorCodes.add("D"); + indicatorCodes.add("E"); + indicatorCodes.add("A1"); + indicatorCodes.add("B1"); + indicatorCodes.add("C1"); + indicatorCodes.add("D1"); + indicatorCodes.add("E1"); + indicatorCodes.add("F"); + indicatorCodes.add("G"); + indicatorCodes.add("H"); + indicatorCodes.add("I"); + indicatorCodes.add("J"); + indicatorCodes.add("H1"); + indicatorCodes.add("I1"); + indicatorCodes.add("J1"); + indicatorCodes.add("K"); + } + + @Override + public JSONObject getIndicatorData() throws JSONException { + JSONObject indicatorDataObject = new JSONObject(); + for (String indicatorCode : indicatorCodes) { + indicatorDataObject.put(indicatorCode, ReportDao.getReportPerIndicatorCode(indicatorCode, reportDate)); + } + df.setMaximumFractionDigits(2); + indicatorDataObject.put("E", df.format(getIndicatorE())); + return indicatorDataObject; + } + + private int getIndicatorE() { + //E = B + C + D + return ReportDao.getReportPerIndicatorCode("B", reportDate) + ReportDao.getReportPerIndicatorCode("C", reportDate) + ReportDao.getReportPerIndicatorCode("D", reportDate); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pnc_reports/PncMonthlyReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pnc_reports/PncMonthlyReportObject.java new file mode 100644 index 000000000..6bd0048ea --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/pnc_reports/PncMonthlyReportObject.java @@ -0,0 +1,84 @@ +package org.smartregister.chw.hf.domain.pnc_reports; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class PncMonthlyReportObject extends ReportObject { + private final Date reportDate; + private final List indicatorCodes = new ArrayList<>(); + private final String[] indicatorCodesArrayForMother = new String[]{"pnc-1a", "pnc-1b", "pnc-2a", "pnc-3", "pnc-4", "pnc-5", "pnc-6", "pnc-7", "pnc-8a", "pnc-8b", "pnc-8c", "pnc-9a", "pnc-9b", "pnc-9c", "pnc-9d1", "pnc-9d2", "pnc-9e", "pnc-9f","pnc-9g", "pnc-10a", "pnc-10b", "pnc-10c", "pnc-10d", "pnc-10e"}; + private final String[] indicatorAgeGroupsArray = new String[]{"10-14", "15-19", "20-24", "25-29", "30-34", "35+"}; + private final String[] indicatorCodesArrayForChild = new String[]{"pnc-11a", "pnc-11b", "pnc-11c", "pnc-12a", "pnc-12b", "pnc-12c", "pnc-12d", "pnc-12e", "pnc-12f", "pnc-13a", "pnc-13b", "pnc-13c", "pnc-13d", "pnc-14", "pnc-15", "pnc-16a", "pnc-16b", "pnc-16c"}; + private final String[] indicatorSexCodeArray = new String[]{"ME", "KE"}; + + public PncMonthlyReportObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + setIndicatorCodes(indicatorCodes); + } + + public void setIndicatorCodes(List indicatorCodes) { + addIndicatorsForMother(indicatorCodes); + addIndicatorsForChild(indicatorCodes); + } + + @Override + public JSONObject getIndicatorData() throws JSONException { + JSONObject indicatorObject = new JSONObject(); + for (String indicatorCode : indicatorCodes) { + indicatorObject.put(indicatorCode, ReportDao.getReportPerIndicatorCode(indicatorCode, reportDate)); + } + //for mother + for (String indicatorCode : indicatorCodesArrayForMother) { + indicatorObject.put(indicatorCode + "-jumla", getIndicatorTotal(indicatorCode)); + } + //for child + for (String indicatorCode : indicatorCodesArrayForChild) { + indicatorObject.put(indicatorCode + "-jumla", getIndicatorTotal(indicatorCode)); + } + indicatorObject.put("pnc-1a+1b-10-14", getIndicatorTotal("pnc-1a-10-14") + getIndicatorTotal("pnc-1b-10-14")); + indicatorObject.put("pnc-1a+1b-15-19", getIndicatorTotal("pnc-1a-15-19") + getIndicatorTotal("pnc-1b-15-19")); + indicatorObject.put("pnc-1a+1b-20-24", getIndicatorTotal("pnc-1a-20-24") + getIndicatorTotal("pnc-1b-20-24")); + indicatorObject.put("pnc-1a+1b-25-29", getIndicatorTotal("pnc-1a-25-29") + getIndicatorTotal("pnc-1b-25-29")); + indicatorObject.put("pnc-1a+1b-30-34", getIndicatorTotal("pnc-1a-30-34") + getIndicatorTotal("pnc-1b-30-34")); + indicatorObject.put("pnc-1a+1b-35+", getIndicatorTotal("pnc-1a-35+") + getIndicatorTotal("pnc-1b-35+")); + indicatorObject.put("pnc-1a+1b-jumla", getIndicatorTotal("pnc-1a") + getIndicatorTotal("pnc-1b")); + indicatorObject.put("pnc-11a+11b-ME", getIndicatorTotal("pnc-11a-ME") + getIndicatorTotal("pnc-11b-ME")); + indicatorObject.put("pnc-11a+11b-KE", getIndicatorTotal("pnc-11a-KE") + getIndicatorTotal("pnc-11b-KE")); + indicatorObject.put("pnc-11a+11b-jumla", getIndicatorTotal("pnc-11a") + getIndicatorTotal("pnc-11b")); + return indicatorObject; + } + + private void addIndicatorsForMother(List indicatorCodes) { + for (String indicatorCode : indicatorCodesArrayForMother) { + for (String indicatorAgeGroup : indicatorAgeGroupsArray) { + indicatorCodes.add(indicatorCode + "-" + indicatorAgeGroup); + } + } + } + + private void addIndicatorsForChild(List indicatorCodes) { + for (String indicatorCode : indicatorCodesArrayForChild) { + for (String indicatorSexCode : indicatorSexCodeArray) { + indicatorCodes.add(indicatorCode + "-" + indicatorSexCode); + } + } + } + + private int getIndicatorTotal(String indicator) { + int total = 0; + for (String indicatorCode : indicatorCodes) { + if (indicatorCode.startsWith(indicator)) { + total += ReportDao.getReportPerIndicatorCode(indicatorCode, reportDate); + } + } + return total; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/self_testing_reports/SelfTestingMonthlyReportObject.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/self_testing_reports/SelfTestingMonthlyReportObject.java new file mode 100644 index 000000000..8c5132fae --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/domain/self_testing_reports/SelfTestingMonthlyReportObject.java @@ -0,0 +1,81 @@ +package org.smartregister.chw.hf.domain.self_testing_reports; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.ReportDao; +import org.smartregister.chw.hf.domain.ReportObject; + +import java.util.Date; + +public class SelfTestingMonthlyReportObject extends ReportObject { + + + private final String[] questionsGroups = new String[]{ + "2","2-i","2-ii","2-iii","2-iv","2-v","2-vi", + "3","3-i","3-ii","3-iii","3-iv","3-v","3-vi", + "7","7-i","7-ii","7-iii","7-iv","7-v","7-vi", + "8","8-i","8-ii","8-iii","8-iv","8-v","8-vi", + "9","9-i","9-ii","9-iii","9-iv","9-v","9-vi" + }; + private final String[] ageGroups = new String[]{ + "18-19","20-24","25-29","30-34","35-39","40-44","45-49",">50" + }; + private final String[] genderGroups = new String[]{ + "ME","KE" + }; + + private final Date reportDate; + private JSONObject jsonObject ; + + public SelfTestingMonthlyReportObject(Date reportDate) { + super(reportDate); + this.reportDate = reportDate; + } + + @Override + public JSONObject getIndicatorData() throws JSONException { + jsonObject = new JSONObject(); + for (String questionGroup : questionsGroups) { //rows + for (String ageGroup : ageGroups) { //columns + for (String genderGroup : genderGroups) { //concstenate rows columns and gendergroup + jsonObject.put("hivst"+"-"+questionGroup+"-"+ageGroup+"-"+genderGroup, + ReportDao.getReportPerIndicatorCode("hivst"+"-"+questionGroup+"-"+ageGroup+"-"+genderGroup, reportDate)); + } + } + } + jsonObject.put("hivst-4-a", ReportDao.getReportPerIndicatorCode("hivst-4-a", reportDate)); + jsonObject.put("hivst-5-a", ReportDao.getReportPerIndicatorCode("hivst-5-a", reportDate)); + jsonObject.put("hivst-6-a", ReportDao.getReportPerIndicatorCode("hivst-6-a", reportDate)); + jsonObject.put("hivst-4-b", ReportDao.getReportPerIndicatorCode("hivst-4-b", reportDate)); + jsonObject.put("hivst-5-b", ReportDao.getReportPerIndicatorCode("hivst-5-b", reportDate)); + jsonObject.put("hivst-6-b", ReportDao.getReportPerIndicatorCode("hivst-6-b", reportDate)); + + // get total of all Male & Female in Qn 2 & 7 + //and the whole total for both of them + funcGetTotal(); + + return jsonObject; + } + + private int getTotalPerEachIndicator(String total_indicatorCode, String question, String gender) throws JSONException { + int totalOfGenderGiven = 0; + for (String agegroup: ageGroups){ + totalOfGenderGiven += ReportDao.getReportPerIndicatorCode(total_indicatorCode+"-"+agegroup+"-"+gender, reportDate); + jsonObject.put("hivst"+"-"+question+"-jumla-"+gender,totalOfGenderGiven); //display the total for specified gender + } + return totalOfGenderGiven; + } + + + + private void funcGetTotal() throws JSONException { + for (String question: questionsGroups) { //rows + int totalOfBothMaleAndFemale = getTotalPerEachIndicator("hivst"+"-"+question,question,"ME") + + getTotalPerEachIndicator("hivst"+"-"+question,question,"KE"); + jsonObject.put("hivst"+"-"+question+"-jumla-both-ME",totalOfBothMaleAndFemale); + jsonObject.put("hivst"+"-"+question+"-jumla-both-KE",totalOfBothMaleAndFemale); + } + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AdvancedSearchFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AdvancedSearchFragment.java new file mode 100644 index 000000000..1dc350715 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AdvancedSearchFragment.java @@ -0,0 +1,358 @@ +package org.smartregister.chw.hf.fragment; + +import static androidx.core.content.ContextCompat.getSystemService; + +import android.net.ConnectivityManager; +import android.net.NetworkInfo; +import android.os.Bundle; +import android.text.Editable; +import android.text.TextUtils; +import android.text.TextWatcher; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageButton; +import android.widget.ListView; +import android.widget.TextView; + +import com.google.android.material.textfield.TextInputEditText; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.AllClientsRegisterActivity; +import org.smartregister.chw.hf.adapter.FamilyMemberAdapter; +import org.smartregister.chw.hf.contract.AdvancedSearchContract; +import org.smartregister.chw.hf.domain.Entity; +import org.smartregister.chw.hf.model.AdvancedSearchFragmentModel; +import org.smartregister.chw.hf.presenter.AdvancedSearchFragmentPresenter; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.util.Utils; +import org.smartregister.view.activity.BaseRegisterActivity; +import org.smartregister.view.fragment.BaseRegisterFragment; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AdvancedSearchFragment extends BaseRegisterFragment implements AdvancedSearchContract.View { + + protected AdvancedSearchTextWatcher advancedSearchTextwatcher = new AdvancedSearchTextWatcher(); + protected Map advancedFormSearchableFields = new HashMap<>(); + private View listViewLayout; + private View advancedSearchForm; + private ImageButton backButton; + private Button searchButton; + private TextView searchCriteria; + private TextView matchingResults; + private TextInputEditText firstName; + private TextInputEditText lastName; + private final boolean isLocal; + private boolean listMode = false; + + public AdvancedSearchFragment(boolean isLocal) { + this.isLocal = isLocal; + } + + public AdvancedSearchFragment() { + // doesn't do anything special + isLocal = false; + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + + View view = inflater.inflate(R.layout.fragment_advanced_search, container, false); + + rootView = view;//handle to the root + + setupViews(view); + onResumption(); + return view; + } + + @Override + protected void initializePresenter() { + + if (getActivity() == null) { + return; + } + + String viewConfigurationIdentifier = ((AllClientsRegisterActivity) getActivity()).getViewIdentifiers().get(0); + presenter = new AdvancedSearchFragmentPresenter(this, new AdvancedSearchFragmentModel(), viewConfigurationIdentifier); + + } + + @Override + public void setAdvancedSearchFormData(HashMap hashMap) { + + } + + @Override + protected String getMainCondition() { + return ((AdvancedSearchFragmentPresenter) presenter).getMainCondition(); + } + + @Override + protected String getDefaultSortQuery() { + return ((AdvancedSearchFragmentPresenter) presenter).getDefaultSortQuery(); + } + + + @Override + public void setupViews(View view) { + super.setupViews(view); + + if (titleLabelView != null) { + if (isLocal) { + titleLabelView.setText(getString(R.string.search)); + } else { + titleLabelView.setText(getString(R.string.global_search)); + } + } + + listViewLayout = view.findViewById(R.id.advanced_search_list); + listViewLayout.setVisibility(View.GONE); + + advancedSearchForm = view.findViewById(R.id.advanced_search_form); + backButton = view.findViewById(R.id.back_button); + backButton.setOnClickListener(registerActionHandler); + + + searchCriteria = view.findViewById(R.id.search_criteria); + matchingResults = view.findViewById(R.id.matching_results); + searchButton = view.findViewById(R.id.advanced_form_search_btn); + Button retryButton = view.findViewById(R.id.retry_connection_button); + + retryButton.setOnClickListener(v -> updateOnNetworkChange(view)); + + updateOnNetworkChange(view); + + setUpSearchButtons(); + + populateSearchableFields(view); + + resetForm(); + + } + + + private void updateOnNetworkChange(View view){ + if(isNetworkConnected()){ + view.findViewById(R.id.advanced_search_form).setVisibility(View.VISIBLE); + view.findViewById(R.id.advanced_search_offline).setVisibility(View.GONE); + }else{ + view.findViewById(R.id.advanced_search_form).setVisibility(View.GONE); + view.findViewById(R.id.advanced_search_offline).setVisibility(View.VISIBLE); + } + } + + private boolean isNetworkConnected() { + ConnectivityManager connectivityManager + = getSystemService(requireContext(), ConnectivityManager.class); + NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); + + return activeNetworkInfo != null && activeNetworkInfo.isConnected(); + } + + public void populateSearchableFields(View view) { + + firstName = view.findViewById(R.id.first_name); + firstName.addTextChangedListener(advancedSearchTextwatcher); + + lastName = view.findViewById(R.id.last_name); + lastName.addTextChangedListener(advancedSearchTextwatcher); + + advancedFormSearchableFields.put(Constants.DB.FIRST_NAME, firstName); + advancedFormSearchableFields.put(Constants.DB.LAST_NAME, lastName); + } + + private void resetForm() { + clearSearchCriteria(); + clearMatchingResults(); + } + + private void clearSearchCriteria() { + if (searchCriteria != null) { + searchCriteria.setVisibility(View.GONE); + searchCriteria.setText(""); + } + } + + private void clearMatchingResults() { + if (matchingResults != null) { + matchingResults.setVisibility(View.GONE); + matchingResults.setText(""); + } + } + + + public void updateMatchingResults(int count) { + if (matchingResults != null) { + matchingResults.setText(String.format(getString(R.string.matching_results), String.valueOf(count))); + matchingResults.setVisibility(View.VISIBLE); + } + } + + private void setUpSearchButtons() { + searchButton.setEnabled(false); + searchButton.setTextColor(getResources().getColor(R.color.contact_complete_grey_border)); + searchButton.setOnClickListener(registerActionHandler); + } + + private boolean anySearchableFieldHasValue() { + + for (Map.Entry entry : advancedFormSearchableFields.entrySet()) { + + if (entry.getValue() instanceof TextView && !TextUtils.isEmpty(((TextView) entry.getValue()).getText())) { + return true; + } + } + return false; + + } + + private void checkTextFields() { + if (anySearchableFieldHasValue()) { + + searchButton.setEnabled(true); + searchButton.setTextColor(getResources().getColor(R.color.white)); + } else { + + searchButton.setEnabled(false); + searchButton.setTextColor(getResources().getColor(R.color.contact_complete_grey_border)); + } + } + + private class AdvancedSearchTextWatcher implements TextWatcher { + + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + //Todo later + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + checkTextFields(); + } + + @Override + public void afterTextChanged(Editable s) { + checkTextFields(); + } + } + + @Override + public void setUniqueID(String s) { + if (getSearchView() != null) { + getSearchView().setText(s); + } + } + + @Override + protected void startRegistration() { + ((BaseRegisterActivity) getActivity()).startRegistration(); + } + + @Override + public void onViewClicked(View view) { + if (view.getId() == R.id.advanced_form_search_btn) { + search(); + } else if (view.getId() == R.id.back_button) { + switchViews(false); + } + } + + private void search() { + showProgressView(); + + Map editMap = getSearchMap(isLocal); + ((AdvancedSearchContract.Presenter) presenter).search(editMap, isLocal); + } + + protected Map getSearchMap(boolean isLocal) { + + Map searchParams = new HashMap<>(); + + String fn = firstName.getText().toString().trim(); + + String ln = lastName.getText().toString().trim(); + + if (!TextUtils.isEmpty(fn)) { + searchParams.put(Constants.DB.FIRST_NAME, fn); + } + + if (!TextUtils.isEmpty(ln)) { + searchParams.put(Constants.DB.LAST_NAME, ln); + } + + return searchParams; + } + + @Override + public void showNotFoundPopup(String opensrpID) { + //Todo implement this + } + + public void showResults(List members, boolean isLocal) { + FamilyMemberAdapter adapter = new FamilyMemberAdapter(getView().getContext(), members, isLocal); + ListView listView = rootView.findViewById(R.id.family_member_list); + listView.setAdapter(adapter); + updateMatchingResults(members.size()); + switchViews(true); + } + + public void switchViews(boolean showList) { + if (showList) { + Utils.hideKeyboard(getActivity()); + + advancedSearchForm.setVisibility(View.GONE); + listViewLayout.setVisibility(View.VISIBLE); + clientsView.setVisibility(View.VISIBLE); + backButton.setVisibility(View.VISIBLE); + searchButton.setVisibility(View.GONE); + + if (titleLabelView != null) { + titleLabelView.setText(getString(R.string.search_results)); + } + + hideProgressView(); + listMode = true; + } else { + if (clientsView.getVisibility() == View.INVISIBLE) { + ((BaseRegisterActivity) getActivity()).switchToFragment(0); + return; + } + + clearSearchCriteria(); + advancedSearchForm.setVisibility(View.VISIBLE); + listViewLayout.setVisibility(View.GONE); + clientsView.setVisibility(View.INVISIBLE); + searchButton.setVisibility(View.VISIBLE); + + if (titleLabelView != null) { + if (isLocal) { + titleLabelView.setText(getString(R.string.search)); + } else { + titleLabelView.setText(getString(R.string.global_search)); + } + } + listMode = false; + } + } + + @Override + public boolean onBackPressed() { + goBack(); + return true; + } + + @Override + protected void goBack() { + if (listMode) { + switchViews(false); + } else { + ((BaseRegisterActivity) getActivity()).switchToFragment(0); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AllClientsRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AllClientsRegisterFragment.java index 6ee31a7ed..ca6ad45d3 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AllClientsRegisterFragment.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AllClientsRegisterFragment.java @@ -1,10 +1,13 @@ package org.smartregister.chw.hf.fragment; +import static org.smartregister.chw.hf.utils.HfReferralUtils.REGISTER_TYPE; + import android.view.View; import androidx.annotation.NonNull; import org.smartregister.chw.core.fragment.CoreAllClientsRegisterFragment; +import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.chw.hf.R; import org.smartregister.chw.hf.provider.HfOpdRegisterProvider; import org.smartregister.chw.hf.utils.AllClientsUtils; @@ -22,7 +25,26 @@ public void setupViews(View view) { @Override protected void goToClientDetailActivity(@NonNull CommonPersonObjectClient commonPersonObjectClient) { - AllClientsUtils.goToClientProfile(this.getActivity(), commonPersonObjectClient); + String registerType = commonPersonObjectClient.getDetails().get(REGISTER_TYPE); + + if(registerType != null){ + switch (registerType){ + case CoreConstants.REGISTER_TYPE.HIV: + AllClientsUtils.goToHivProfile(this.getActivity(),commonPersonObjectClient); + break; + case CoreConstants.REGISTER_TYPE.HTS: + AllClientsUtils.goToHTsProfile(this.getActivity(),commonPersonObjectClient); + break; + case CoreConstants.REGISTER_TYPE.TB: + AllClientsUtils.goToTbProfile(this.getActivity(),commonPersonObjectClient); + break; + default: + AllClientsUtils.goToClientProfile(this.getActivity(),commonPersonObjectClient); + break; + } + }else { + AllClientsUtils.goToClientProfile(this.getActivity(), commonPersonObjectClient); + } } @Override diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AllMaleClientsRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AllMaleClientsRegisterFragment.java new file mode 100644 index 000000000..b69f10628 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AllMaleClientsRegisterFragment.java @@ -0,0 +1,86 @@ +package org.smartregister.chw.hf.fragment; + +import static org.smartregister.chw.hf.utils.HfReferralUtils.REGISTER_TYPE; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; + +import org.smartregister.chw.core.fragment.CoreAllClientsRegisterFragment; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.configs.AllClientsRegisterRowOptions; +import org.smartregister.chw.hf.provider.HfAllMaleClientsQueryProvider; +import org.smartregister.chw.hf.provider.HfMaleClientRegisterProvider; +import org.smartregister.chw.hf.utils.AllClientsUtils; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.commonregistry.CommonRepository; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; +import org.smartregister.opd.configuration.OpdConfiguration; +import org.smartregister.opd.utils.ConfigurationInstancesHelper; + +public class AllMaleClientsRegisterFragment extends CoreAllClientsRegisterFragment { + + @Nullable + @Override + public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + super.onCreateView(inflater, container, savedInstanceState); + OpdConfiguration opdConfiguration = new OpdConfiguration.Builder(HfAllMaleClientsQueryProvider.class) + .setBottomNavigationEnabled(true) + .setOpdRegisterRowOptions(AllClientsRegisterRowOptions.class) + .build(); + + setOpdRegisterQueryProvider(ConfigurationInstancesHelper.newInstance(opdConfiguration.getOpdRegisterQueryProvider())); + return rootView; + } + + @Override + public void setupViews(View view) { + super.setupViews(view); + View dueOnlyLayout = view.findViewById(R.id.due_only_layout); + Toolbar toolbar = view.findViewById(org.smartregister.R.id.register_toolbar); + toolbar.setVisibility(View.INVISIBLE); + ViewGroup.LayoutParams layoutParams = toolbar.getLayoutParams(); + layoutParams.height = 20; + toolbar.setLayoutParams(layoutParams); + + dueOnlyLayout.setVisibility(View.GONE); + } + + @Override + protected void goToClientDetailActivity(@NonNull CommonPersonObjectClient commonPersonObjectClient) { + String registerType = commonPersonObjectClient.getDetails().get(REGISTER_TYPE); + + if (registerType != null) { + switch (registerType) { + case CoreConstants.REGISTER_TYPE.HIV: + case CoreConstants.REGISTER_TYPE.HTS: + AllClientsUtils.goToHivProfile(this.getActivity(), commonPersonObjectClient); + break; + case CoreConstants.REGISTER_TYPE.TB: + AllClientsUtils.goToTbProfile(this.getActivity(), commonPersonObjectClient); + break; + default: + AllClientsUtils.goToClientProfile(this.getActivity(), commonPersonObjectClient); + break; + } + } else { + AllClientsUtils.goToClientProfile(this.getActivity(), commonPersonObjectClient); + } + } + + @Override + public void initializeAdapter() { + HfMaleClientRegisterProvider maleClientRegisterProvider = new HfMaleClientRegisterProvider(getActivity(), registerActionHandler, paginationViewHandler); + CommonRepository commonRepository = context().commonrepository(this.tablename); + clientAdapter = new RecyclerViewPaginatedAdapter(null, maleClientRegisterProvider, commonRepository); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } +} + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AncReferralListRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AncReferralListRegisterFragment.java new file mode 100644 index 000000000..080c37492 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AncReferralListRegisterFragment.java @@ -0,0 +1,170 @@ +package org.smartregister.chw.hf.fragment; + +import android.database.Cursor; +import android.os.Bundle; +import android.widget.TextView; + +import androidx.loader.content.CursorLoader; +import androidx.loader.content.Loader; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.core.fragment.CoreAncRegisterFragment; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreReferralUtils; +import org.smartregister.chw.core.utils.Utils; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.PregnancyConfirmationViewActivity; +import org.smartregister.chw.hf.model.AncReferralListRegisterRegisterFragmentModel; +import org.smartregister.chw.hf.presenter.HfAncReferralListRegisterFragmentPresenter; +import org.smartregister.chw.hf.provider.HfAncReferralListRegisterProvider; +import org.smartregister.commonregistry.CommonPersonObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.commonregistry.CommonRepository; +import org.smartregister.configurableviews.model.View; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.domain.Task; +import org.smartregister.family.util.DBConstants; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import timber.log.Timber; + +public class AncReferralListRegisterFragment extends CoreAncRegisterFragment { + + @Override + public void setupViews(android.view.View view) { + super.setupViews(view); + ((TextView) view.findViewById(R.id.txt_title_label)).setText(getString(R.string.action_pregnancy_confirmation_referrals)); + view.findViewById(R.id.due_only_layout).setVisibility(android.view.View.GONE); + } + + @Override + public void initializeAdapter(Set visibleColumns) { + HfAncReferralListRegisterProvider provider = new HfAncReferralListRegisterProvider(getActivity(), commonRepository(), visibleColumns, registerActionHandler, paginationViewHandler); + clientAdapter = new RecyclerViewPaginatedAdapter(null, provider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + presenter = new HfAncReferralListRegisterFragmentPresenter(this, new AncReferralListRegisterRegisterFragmentModel(), null); + } + + @Override + protected void openProfile(CommonPersonObjectClient client) { + Map details = fetchCareGiverDetails(Utils.getValue(client.getColumnmaps(), "primary_caregiver", false)); + String taskId = Utils.getValue(client.getColumnmaps(), "_id", false); + PregnancyConfirmationViewActivity.startPregnancyConfirmationViewActivity(getActivity(), client, getTask(taskId), CoreConstants.REGISTERED_ACTIVITIES.REFERRALS_REGISTER_ACTIVITY, details); + } + + private Task getTask(String taskId) { + return HealthFacilityApplication.getInstance().getTaskRepository().getTaskByIdentifier(taskId); + } + + @Override + protected void openHomeVisit(CommonPersonObjectClient client) { + //Not needed on HF + } + + @Override + public String getDueCondition() { + return ""; + } + + private Map fetchCareGiverDetails(String careGiverId) { + Map details = new HashMap<>(); + + String query = CoreReferralUtils.mainCareGiverSelect(CoreConstants.TABLE_NAME.FAMILY_MEMBER, careGiverId); + Timber.d("The caregiver query %s", query); + try (Cursor cursor = getCommonRepository(CoreConstants.TABLE_NAME.FAMILY_MEMBER).rawCustomQueryForAdapter(query)) { + if (cursor != null && cursor.moveToFirst()) { + CommonPersonObject personObject = getCommonRepository(CoreConstants.TABLE_NAME.FAMILY_MEMBER).readAllcommonforCursorAdapter(cursor); + details = personObject.getColumnmaps(); + //pClient.getColumnmaps().putAll(personObject.getColumnmaps()); + } + } catch (Exception e) { + Timber.e(e, "AncRegisterFragment --> fetchCareGiverDetails"); + } + + return details; + } + + private CommonRepository getCommonRepository(String tableName) { + return Utils.context().commonrepository(tableName); + } + + private String defaultFilterAndSortQuery() { + SmartRegisterQueryBuilder sqb = new SmartRegisterQueryBuilder(mainSelect); + + String query = ""; + String customFilter = getFilterString(); + try { + sqb.addCondition(customFilter); + query = sqb.orderbyCondition(Sortqueries); + query = sqb.Endquery(sqb.addlimitandOffset(query, clientAdapter.getCurrentlimit(), clientAdapter.getCurrentoffset())); + } catch (Exception e) { + Timber.e(e); + } + + return query; + } + + @Override + public Loader onCreateLoader(int id, final Bundle args) { + if (id == LOADER_ID) { + return new CursorLoader(getActivity()) { + @Override + public Cursor loadInBackground() { + // Count query + final String COUNT = "count_execute"; + if (args != null && args.getBoolean(COUNT)) { + countExecute(); + } + String query = defaultFilterAndSortQuery(); + return commonRepository().rawCustomQueryForAdapter(query); + } + }; + } + return super.onCreateLoader(id, args); + } + + @Override + public void countExecute() { + Cursor cursor = null; + try { + + String query = "select count(*) from " + presenter().getMainTable() + + " INNER JOIN " + CoreConstants.TABLE_NAME.TASK + " ON " + presenter().getMainTable() + "." + org.smartregister.family.util.DBConstants.KEY.BASE_ENTITY_ID + " = " + CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.FOR + " COLLATE NOCASE " + + " INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY + " ON " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + org.smartregister.family.util.DBConstants.KEY.RELATIONAL_ID + " = " + CoreConstants.TABLE_NAME.FAMILY + "." + org.smartregister.family.util.DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE " + + " LEFT JOIN " + CoreConstants.TABLE_NAME.ANC_MEMBER + " ON " + CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.FOR + " = " + CoreConstants.TABLE_NAME.ANC_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE " + + " where " + presenter().getMainCondition(); + + if (StringUtils.isNotBlank(filters)) + query = query + getFilterString(); + + cursor = commonRepository().rawCustomQueryForAdapter(query); + cursor.moveToFirst(); + clientAdapter.setTotalcount(cursor.getInt(0)); + Timber.v("total count here %d", clientAdapter.getTotalcount()); + + clientAdapter.setCurrentlimit(20); + clientAdapter.setCurrentoffset(0); + + + } catch (Exception e) { + Timber.e(e); + } finally { + if (cursor != null) { + cursor.close(); + } + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AncRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AncRegisterFragment.java index 9f49a0bb5..d8fa9e330 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AncRegisterFragment.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/AncRegisterFragment.java @@ -1,29 +1,55 @@ package org.smartregister.chw.hf.fragment; +import static org.smartregister.chw.hf.utils.Constants.FILTERS_ENABLED; +import static org.smartregister.chw.hf.utils.Constants.FILTER_APPOINTMENT_DATE; +import static org.smartregister.chw.hf.utils.Constants.FILTER_HIV_STATUS; +import static org.smartregister.chw.hf.utils.Constants.FILTER_IS_REFERRED; +import static org.smartregister.chw.hf.utils.Constants.REQUEST_FILTERS; + +import android.app.Activity; +import android.content.Intent; import android.database.Cursor; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffColorFilter; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.widget.TextView; + +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; +import androidx.loader.content.CursorLoader; +import androidx.loader.content.Loader; +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.anc.util.DBConstants; import org.smartregister.chw.core.fragment.CoreAncRegisterFragment; -import org.smartregister.chw.core.presenter.AncRegisterFragmentPresenter; import org.smartregister.chw.core.utils.CoreConstants; -import org.smartregister.chw.core.utils.CoreReferralUtils; -import org.smartregister.chw.core.utils.Utils; +import org.smartregister.chw.core.utils.QueryBuilder; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.AncFilterActivity; import org.smartregister.chw.hf.activity.AncMemberProfileActivity; import org.smartregister.chw.hf.model.AncRegisterFragmentModel; +import org.smartregister.chw.hf.presenter.HfAncRegisterFragmentPresenter; import org.smartregister.chw.hf.provider.HfAncRegisterProvider; import org.smartregister.chw.hf.utils.HfReferralUtils; -import org.smartregister.commonregistry.CommonPersonObject; import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.commonregistry.CommonRepository; import org.smartregister.configurableviews.model.View; import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; -import java.util.HashMap; -import java.util.Map; +import java.text.MessageFormat; +import java.util.List; import java.util.Set; import timber.log.Timber; -public class AncRegisterFragment extends CoreAncRegisterFragment { +public class AncRegisterFragment extends CoreAncRegisterFragment implements android.view.View.OnClickListener { + private String filterHivStatus; + private boolean filterIsReferred = false; + private String appointmentDate; + private boolean filterEnabled = false; + private TextView filterSortTextView; @Override public void initializeAdapter(Set visibleColumns) { @@ -38,7 +64,34 @@ protected void initializePresenter() { if (getActivity() == null) { return; } - presenter = new AncRegisterFragmentPresenter(this, new AncRegisterFragmentModel(), null); + presenter = new HfAncRegisterFragmentPresenter(this, new AncRegisterFragmentModel(), null); + } + + @Override + public void setupViews(android.view.View view) { + super.setupViews(view); + + android.view.View sortFilterBarLayout = view.findViewById(org.smartregister.chw.core.R.id.register_sort_filter_bar_layout); + sortFilterBarLayout.setVisibility(android.view.View.GONE); + + android.view.View dueOnlyLayout = view.findViewById(org.smartregister.chw.core.R.id.due_only_layout); + dueOnlyLayout.setVisibility(android.view.View.GONE); + + android.view.View filterSortLayout = view.findViewById(org.smartregister.chw.core.R.id.filter_sort_layout); + filterSortTextView = view.findViewById(org.smartregister.chw.core.R.id.filter_text_view); + filterSortTextView.setText(R.string.filter); + + filterSortLayout.setVisibility(android.view.View.VISIBLE); + filterSortLayout.setOnClickListener(this); + + } + + private void setTextViewDrawableColor(TextView textView, int color) { + for (Drawable drawable : textView.getCompoundDrawablesRelative()) { + if (drawable != null) { + drawable.setColorFilter(new PorterDuffColorFilter(ContextCompat.getColor(textView.getContext(), color), PorterDuff.Mode.SRC_IN)); + } + } } @Override @@ -58,25 +111,102 @@ public String getDueCondition() { + ")"; } - private Map fetchCareGiverDetails(String careGiverId) { - Map details = new HashMap<>(); + @Override + public void onClick(android.view.View view) { + if (view.getId() == R.id.filter_sort_layout) { + Intent intent = new Intent(getContext(), AncFilterActivity.class); + intent.putExtra(FILTERS_ENABLED, filterEnabled); + intent.putExtra(FILTER_HIV_STATUS, filterHivStatus); + intent.putExtra(FILTER_IS_REFERRED, filterIsReferred); + intent.putExtra(FILTER_APPOINTMENT_DATE, appointmentDate); + ((Activity) getContext()).startActivityForResult(intent, REQUEST_FILTERS); + } + + } + + public void onFiltersUpdated(int requestCode, @Nullable Intent data) { + if (requestCode == REQUEST_FILTERS) { + if (data != null) { + filterEnabled = data.getBooleanExtra(FILTERS_ENABLED, false); + if (filterEnabled) { + setTextViewDrawableColor(filterSortTextView, R.color.hf_accent_yellow); + filterSortTextView.setText(R.string.filter_applied); + filterHivStatus = data.getStringExtra(FILTER_HIV_STATUS); + filterIsReferred = data.getBooleanExtra(FILTER_IS_REFERRED, false); + appointmentDate = data.getStringExtra(FILTER_APPOINTMENT_DATE); + + filter(searchText(), "", ((HfAncRegisterFragmentPresenter) presenter()).getDueFilterCondition(filterHivStatus, appointmentDate, filterIsReferred, getContext())); + } else { + setTextViewDrawableColor(filterSortTextView, R.color.grey); + filterSortTextView.setText(R.string.filter); + } + } + } + } + + @Override + public Loader onCreateLoader(int id, final Bundle args) { + if (id == LOADER_ID) { + return new CursorLoader(getActivity()) { + @Override + public Cursor loadInBackground() { + // Count query + final String COUNT = "count_execute"; + if (args != null && args.getBoolean(COUNT)) { + countExecute(); + } + String query = defaultFilterAndSortQuery(); + return commonRepository().rawCustomQueryForAdapter(query); + } + }; + } + return super.onCreateLoader(id, args); + } + + + private String defaultFilterAndSortQuery() { + SmartRegisterQueryBuilder sqb = new SmartRegisterQueryBuilder(mainSelect); + + String query = ""; + StringBuilder customFilter = new StringBuilder(); + if (StringUtils.isNotBlank(filters)) { + customFilter.append(MessageFormat.format(" and ( {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.FIRST_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.LAST_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.MIDDLE_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ) ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.UNIQUE_ID, filters)); + + } + if (filterEnabled) { + customFilter.append(((HfAncRegisterFragmentPresenter) presenter()).getDueFilterCondition(filterHivStatus, appointmentDate, filterIsReferred, getContext())); + } + try { + if (isValidFilterForFts(commonRepository())) { + + String myquery = QueryBuilder.getQuery(joinTables, mainCondition, tablename, customFilter.toString(), clientAdapter, Sortqueries); + List ids = commonRepository().findSearchIds(myquery); + query = sqb.toStringFts(ids, tablename, CommonRepository.ID_COLUMN, + Sortqueries); + query = sqb.Endquery(query); + } else { + sqb.addCondition(customFilter.toString()); + query = sqb.orderbyCondition(Sortqueries); + query = sqb.Endquery(sqb.addlimitandOffset(query, clientAdapter.getCurrentlimit(), clientAdapter.getCurrentoffset())); - String query = CoreReferralUtils.mainCareGiverSelect(CoreConstants.TABLE_NAME.FAMILY_MEMBER, careGiverId); - Timber.d("The caregiver query %s", query); - try (Cursor cursor = getCommonRepository(CoreConstants.TABLE_NAME.FAMILY_MEMBER).rawCustomQueryForAdapter(query)) { - if (cursor != null && cursor.moveToFirst()) { - CommonPersonObject personObject = getCommonRepository(CoreConstants.TABLE_NAME.FAMILY_MEMBER).readAllcommonforCursorAdapter(cursor); - details = personObject.getColumnmaps(); - //pClient.getColumnmaps().putAll(personObject.getColumnmaps()); } } catch (Exception e) { - Timber.e(e, "AncRegisterFragment --> fetchCareGiverDetails"); + Timber.e(e); } - return details; + return query; } - private CommonRepository getCommonRepository(String tableName) { - return Utils.context().commonrepository(tableName); + private String searchText() { + String searchTextInput; + if (this.getSearchView() == null) { + searchTextInput = ""; + } else { + searchTextInput = this.getSearchView().getText().toString(); + } + return searchTextInput; } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/Cd4ResultsFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/Cd4ResultsFragment.java new file mode 100644 index 000000000..77f0a4fbd --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/Cd4ResultsFragment.java @@ -0,0 +1,114 @@ +package org.smartregister.chw.hf.fragment; + +import static org.smartregister.chw.pmtct.util.DBConstants.KEY.FORM_SUBMISSION_ID; +import static org.smartregister.util.JsonFormUtils.FIELDS; +import static org.smartregister.util.JsonFormUtils.STEP1; + +import android.os.Bundle; +import android.widget.TextView; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.activity.Cd4ResultsViewActivity; +import org.smartregister.chw.hf.model.Cd4ResultsFragmentModel; +import org.smartregister.chw.hf.presenter.Cd4ResultsFragmentPresenter; +import org.smartregister.chw.hf.provider.Cd4ResultsViewProvider; +import org.smartregister.chw.pmtct.fragment.BaseHvlResultsFragment; +import org.smartregister.chw.pmtct.util.DBConstants; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.configurableviews.model.View; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; +import org.smartregister.util.Utils; + +import java.util.Set; + +public class Cd4ResultsFragment extends BaseHvlResultsFragment { + + public static final String BASE_ENTITY_ID = "BASE_ENTITY_ID"; + private String baseEntityId; + + public static Cd4ResultsFragment newInstance(String baseEntityId) { + Cd4ResultsFragment cd4ResultsFragment = new Cd4ResultsFragment(); + Bundle b = new Bundle(); + b.putString(BASE_ENTITY_ID, baseEntityId); + cd4ResultsFragment.setArguments(b); + return cd4ResultsFragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + if (getArguments() != null) { + this.baseEntityId = getArguments().getString(BASE_ENTITY_ID); + } + super.onCreate(savedInstanceState); + } + + @Override + public void initializeAdapter(Set visibleColumns) { + Cd4ResultsViewProvider resultsViewProvider = new Cd4ResultsViewProvider(getActivity(), paginationViewHandler, registerActionHandler, visibleColumns); + clientAdapter = new RecyclerViewPaginatedAdapter(null, resultsViewProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + presenter = new Cd4ResultsFragmentPresenter(baseEntityId, this, new Cd4ResultsFragmentModel(), null); + } + + @Override + protected void onViewClicked(android.view.View view) { + if (getActivity() == null || !(view.getTag() instanceof CommonPersonObjectClient)) { + return; + } + CommonPersonObjectClient client = (CommonPersonObjectClient) view.getTag(); + if (view.getTag(org.smartregister.pmtct.R.id.VIEW_ID) == CLICK_VIEW_NORMAL) { + if (((TextView) view).getText().toString().equalsIgnoreCase("edit")) { + CommonPersonObjectClient pc = (CommonPersonObjectClient) view.getTag(); + if (pc != null) { + openEditResultsForm(client); + } else + openResultsForm(client); + } else { + openResultsForm(client); + } + } + } + + @Override + public void openResultsForm(CommonPersonObjectClient client) { + String sampleId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.CD4_SAMPLE_ID, false); + String baseEntityId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.BASE_ENTITY_ID, false); + String formSubmissionId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.ENTITY_ID, false); + try { + JSONObject jsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets(requireContext(), org.smartregister.chw.hf.utils.Constants.JsonForm.getCd4TestResultsForm()); + assert jsonObject != null; + jsonObject.getJSONObject(STEP1).getJSONArray(FIELDS).getJSONObject(0).put("value", sampleId); + Cd4ResultsViewActivity.startResultsForm(getContext(), jsonObject.toString(), baseEntityId, formSubmissionId); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + private void openEditResultsForm(CommonPersonObjectClient client) { + String baseEntityId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.BASE_ENTITY_ID, false); + String formSubmissionId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.ENTITY_ID, false); + try { + JSONObject jsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets(requireContext(), org.smartregister.chw.hf.utils.Constants.JsonForm.getCd4TestResultsForm()); + assert jsonObject != null; + CoreJsonFormUtils.populateJsonForm(jsonObject, client.getColumnmaps()); + + jsonObject.put(FORM_SUBMISSION_ID, Utils.getValue(client.getColumnmaps(), FORM_SUBMISSION_ID, false)); + Cd4ResultsViewActivity.startResultsForm(getContext(), jsonObject.toString(), baseEntityId, formSubmissionId); + } catch (JSONException e) { + e.printStackTrace(); + } + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/CdpReceiveFromOrganizationsRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/CdpReceiveFromOrganizationsRegisterFragment.java new file mode 100644 index 000000000..88561e386 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/CdpReceiveFromOrganizationsRegisterFragment.java @@ -0,0 +1,15 @@ +package org.smartregister.chw.hf.fragment; + +import android.content.Intent; + +import org.json.JSONObject; +import org.smartregister.chw.core.fragment.CoreCdpReceiveMsdRegisterFragment; +import org.smartregister.family.util.JsonFormUtils; + +public class CdpReceiveFromOrganizationsRegisterFragment extends CoreCdpReceiveMsdRegisterFragment { + @Override + public void startFormActivity(JSONObject form) { + Intent intent = org.smartregister.chw.core.utils.Utils.formActivityIntent(requireActivity(), form.toString()); + requireActivity().startActivityForResult(intent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HeiHivResultsFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HeiHivResultsFragment.java new file mode 100644 index 000000000..d28780fde --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HeiHivResultsFragment.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.fragment; + +import static org.smartregister.util.JsonFormUtils.FIELDS; +import static org.smartregister.util.JsonFormUtils.STEP1; + +import android.os.Bundle; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.activity.HeiHivResultsViewActivity; +import org.smartregister.chw.hf.model.HeiHivResultsFragmentModel; +import org.smartregister.chw.hf.presenter.HeiHivResultsFragmentPresenter; +import org.smartregister.chw.hf.provider.HeiHivResultsViewProvider; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.fragment.BaseHvlResultsFragment; +import org.smartregister.chw.pmtct.util.DBConstants; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.configurableviews.model.View; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; +import org.smartregister.util.Utils; + +import java.util.Set; + +public class HeiHivResultsFragment extends BaseHvlResultsFragment { + + public static final String BASE_ENTITY_ID = "BASE_ENTITY_ID"; + private String baseEntityId; + + public static HeiHivResultsFragment newInstance(String baseEntityId) { + HeiHivResultsFragment heiHivResultsFragment = new HeiHivResultsFragment(); + Bundle b = new Bundle(); + b.putString(BASE_ENTITY_ID, baseEntityId); + heiHivResultsFragment.setArguments(b); + return heiHivResultsFragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + if (getArguments() != null) { + this.baseEntityId = getArguments().getString(BASE_ENTITY_ID); + } + super.onCreate(savedInstanceState); + } + + + @Override + public void initializeAdapter(Set visibleColumns) { + HeiHivResultsViewProvider resultsViewProvider = new HeiHivResultsViewProvider(getActivity(), paginationViewHandler, registerActionHandler, visibleColumns); + clientAdapter = new RecyclerViewPaginatedAdapter(null, resultsViewProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + presenter = new HeiHivResultsFragmentPresenter(baseEntityId, this, new HeiHivResultsFragmentModel(), null); + } + + @Override + public void openResultsForm(CommonPersonObjectClient client) { + String sampleId = Utils.getValue(client.getColumnmaps(), Constants.DBConstants.HEI_HIV_SAMPLE_ID, false); + String baseEntityId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.BASE_ENTITY_ID, false); + String formSubmissionId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.ENTITY_ID, false); + try { + JSONObject jsonForm = (new FormUtils()).getFormJsonFromRepositoryOrAssets(requireContext(), org.smartregister.chw.hf.utils.Constants.JsonForm.getHeiHivTestResults()); + if (jsonForm != null) { + jsonForm.getJSONObject(STEP1).getJSONArray(FIELDS).getJSONObject(0).put("value", sampleId); + HeiHivResultsViewActivity.startResultsForm(getContext(), jsonForm.toString(), baseEntityId, formSubmissionId); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HeiRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HeiRegisterFragment.java new file mode 100644 index 000000000..ace54c24d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HeiRegisterFragment.java @@ -0,0 +1,289 @@ +package org.smartregister.chw.hf.fragment; + +import android.database.Cursor; +import android.os.Bundle; +import android.util.Log; +import android.view.View; +import android.widget.LinearLayout; + +import androidx.appcompat.widget.Toolbar; +import androidx.loader.content.CursorLoader; +import androidx.loader.content.Loader; + +import com.google.android.material.tabs.TabLayout; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.Utils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.HeiProfileActivity; +import org.smartregister.chw.hf.custom_view.FacilityMenu; +import org.smartregister.chw.hf.model.HeiRegisterFragmentModel; +import org.smartregister.chw.hf.presenter.HeiRegisterFragmentPresenter; +import org.smartregister.chw.hf.provider.HeiRegisterProvider; +import org.smartregister.chw.pmtct.fragment.BasePmtctRegisterFragment; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.view.activity.BaseRegisterActivity; +import org.smartregister.view.customcontrols.CustomFontTextView; + +import java.text.MessageFormat; +import java.util.Set; + +import timber.log.Timber; + +public class HeiRegisterFragment extends BasePmtctRegisterFragment { + String customGroupFilter; + private View view; + + @Override + public void initializeAdapter(Set visibleColumns) { + HeiRegisterProvider heiRegisterProvider = new HeiRegisterProvider(getActivity(), paginationViewHandler, registerActionHandler, visibleColumns); + clientAdapter = new RecyclerViewPaginatedAdapter(null, heiRegisterProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + public void setupViews(View view) { + initializePresenter(); + super.setupViews(view); + this.view = view; + + Toolbar toolbar = view.findViewById(org.smartregister.R.id.register_toolbar); + toolbar.setContentInsetsAbsolute(0, 0); + toolbar.setContentInsetsRelative(0, 0); + toolbar.setContentInsetStartWithNavigation(0); + + try { + FacilityMenu.getInstance(getActivity(), null, toolbar); + } catch (NullPointerException e) { + Timber.e(e); + } + View navbarContainer = view.findViewById(org.smartregister.chw.core.R.id.register_nav_bar_container); + navbarContainer.setFocusable(false); + + CustomFontTextView titleView = view.findViewById(org.smartregister.chw.core.R.id.txt_title_label); + if (titleView != null) { + titleView.setText(getString(R.string.menu_hei)); + titleView.setPadding(0, titleView.getTop(), titleView.getPaddingRight(), titleView.getPaddingBottom()); + } + + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); + View searchBarLayout = view.findViewById(org.smartregister.chw.core.R.id.search_bar_layout); + searchBarLayout.setLayoutParams(params); + searchBarLayout.setBackgroundResource(org.smartregister.chw.core.R.color.chw_primary); + searchBarLayout.setPadding(searchBarLayout.getPaddingLeft(), searchBarLayout.getPaddingTop(), searchBarLayout.getPaddingRight(), (int) Utils.convertDpToPixel(10, getActivity())); + + View topLeftLayout = view.findViewById(org.smartregister.chw.core.R.id.top_left_layout); + topLeftLayout.setVisibility(View.GONE); + + View topRightLayout = view.findViewById(org.smartregister.chw.core.R.id.top_right_layout); + topRightLayout.setVisibility(View.VISIBLE); + + View sortFilterBarLayout = view.findViewById(org.smartregister.chw.core.R.id.register_sort_filter_bar_layout); + sortFilterBarLayout.setVisibility(View.GONE); + + View filterSortLayout = view.findViewById(org.smartregister.chw.core.R.id.filter_sort_layout); + filterSortLayout.setVisibility(View.GONE); + + View dueOnlyLayout = view.findViewById(org.smartregister.chw.core.R.id.due_only_layout); + dueOnlyLayout.setVisibility(View.GONE); + dueOnlyLayout.setOnClickListener(registerActionHandler); + if (getSearchView() != null) { + getSearchView().setBackgroundResource(org.smartregister.family.R.color.white); + getSearchView().setCompoundDrawablesWithIntrinsicBounds(org.smartregister.family.R.drawable.ic_action_search, 0, 0, 0); + getSearchView().setTextColor(getResources().getColor(org.smartregister.chw.core.R.color.text_black)); + } + + setUpTabLayout(view, true); + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + String viewConfigurationIdentifier = null; + try { + viewConfigurationIdentifier = ((BaseRegisterActivity) getActivity()).getViewIdentifiers().get(0); + } catch (NullPointerException e) { + Timber.e(e); + } + presenter = new HeiRegisterFragmentPresenter(this, new HeiRegisterFragmentModel(), viewConfigurationIdentifier); + } + + + @Override + public void onResume() { + super.onResume(); + + Toolbar toolbar = view.findViewById(org.smartregister.R.id.register_toolbar); + toolbar.setContentInsetsAbsolute(0, 0); + toolbar.setContentInsetsRelative(0, 0); + toolbar.setContentInsetStartWithNavigation(0); + FacilityMenu.getInstance(getActivity(), null, toolbar); + } + + private String defaultFilterAndSortQuery() { + SmartRegisterQueryBuilder sqb = new SmartRegisterQueryBuilder(mainSelect); + + String query = ""; + StringBuilder customFilter = new StringBuilder(); + if (StringUtils.isNotBlank(filters)) { + customFilter.append(MessageFormat.format(" and ( {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, org.smartregister.family.util.DBConstants.KEY.FIRST_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, org.smartregister.family.util.DBConstants.KEY.LAST_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, org.smartregister.family.util.DBConstants.KEY.MIDDLE_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ) ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, org.smartregister.family.util.DBConstants.KEY.UNIQUE_ID, filters)); + } + if (StringUtils.isNotBlank(customGroupFilter)) { + customFilter.append(MessageFormat.format((" and ( {0} ) "), customGroupFilter)); + } + try { + sqb.addCondition(customFilter.toString()); + query = sqb.orderbyCondition(Sortqueries); + query = sqb.Endquery(sqb.addlimitandOffset(query, clientAdapter.getCurrentlimit(), clientAdapter.getCurrentoffset())); + } catch (Exception e) { + Log.e(getClass().getName(), e.toString(), e); + } + return query; + } + + @Override + public HeiRegisterFragmentPresenter presenter() { + return new HeiRegisterFragmentPresenter(this, new HeiRegisterFragmentModel(), null); + } + + @Override + public void countExecute() { + Cursor c = null; + try { + + String query = "select count(*) from " + presenter().getMainTable() + " inner join " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + + " on " + presenter().getMainTable() + "." + DBConstants.KEY.BASE_ENTITY_ID + " = " + + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + + " where " + presenter().getMainCondition(); + + if (StringUtils.isNotBlank(filters)) { + query = query + " and ( " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME + "like ''%" + filters + "%'' "; + query = query + " or " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME + "like ''%" + filters + "%'' "; + query = query + " or " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME + "like ''%" + filters + "%'' "; + query = query + " 0r " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID + "like ''%" + filters + "%'' )"; + + } + + + if (StringUtils.isNotBlank(customGroupFilter)) { + query = query + " and ( " + customGroupFilter + " ) "; + } + + + c = commonRepository().rawCustomQueryForAdapter(query); + c.moveToFirst(); + clientAdapter.setTotalcount(c.getInt(0)); + Timber.v("total count here %s", clientAdapter.getTotalcount()); + + clientAdapter.setCurrentlimit(20); + clientAdapter.setCurrentoffset(0); + + } catch (Exception e) { + Timber.e(e); + } finally { + if (c != null) { + c.close(); + } + } + } + + @Override + public Loader onCreateLoader(int id, final Bundle args) { + if (id == LOADER_ID) { + return new CursorLoader(getActivity()) { + @Override + public Cursor loadInBackground() { + // Count query + final String COUNT = "count_execute"; + if (args != null && args.getBoolean(COUNT)) { + countExecute(); + } + String query = defaultFilterAndSortQuery(); + return commonRepository().rawCustomQueryForAdapter(query); + } + }; + } + return super.onCreateLoader(id, args); + } + + @Override + protected void openProfile(String baseEntityId) { + HeiProfileActivity.startProfile(requireActivity(), baseEntityId); + } + + @Override + protected int getLayout() { + return R.layout.fragment_hei_register; + } + + protected void setUpTabLayout(View view, boolean enabled) { + TabLayout tabLayout = view.findViewById(R.id.tab_layout); + if (enabled) { + tabLayout.setVisibility(View.VISIBLE); + tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { + @Override + public void onTabSelected(TabLayout.Tab tab) { + switch (tab.getPosition()) { + case 0: + customGroupFilter = ""; + filterandSortExecute(); + break; + case 1: + customGroupFilter = getDueTomorrow(); + filterandSortExecute(); + break; + case 2: + customGroupFilter = getMissed(); + filterandSortExecute(); + break; + default: + break; + } + } + + @Override + public void onTabUnselected(TabLayout.Tab tab) { + //do something + } + + @Override + public void onTabReselected(TabLayout.Tab tab) { + //do something + } + }); + } + + } + + protected String getDueTomorrow() { + return "CASE\n" + + " WHEN next_visit_date is not null\n" + + " THEN date(substr(next_visit_date, 7, 4) || '-' || substr(next_visit_date, 4, 2) || '-' || substr(next_visit_date, 1, 2)) = date('now', '+1 day')\n" + + " ELSE\n" + + " date(ec_hei.dob) = date('now', '+1 day')\n" + + " END"; + } + + protected String getMissed() { + return "CASE\n" + + " WHEN next_visit_date is not null\n" + + " THEN date(substr(next_visit_date, 7, 4) || '-' || substr(next_visit_date, 4, 2) || '-' || substr(next_visit_date, 1, 2)) < date('now')\n" + + " ELSE\n" + + " date(ec_hei.dob) < date('now')\n" + + " END"; + } + + @Override + protected String getDefaultSortQuery() { + return "(coalesce(next_visit_date, ec_hei.dob))"; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HfJsonFormFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HfJsonFormFragment.java new file mode 100644 index 000000000..33416e5e3 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HfJsonFormFragment.java @@ -0,0 +1,60 @@ +package org.smartregister.chw.hf.fragment; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.fragments.JsonWizardFormFragment; + +import org.json.JSONArray; +import org.json.JSONObject; +import org.smartregister.chw.hf.utils.Constants; + +import timber.log.Timber; + +public class HfJsonFormFragment extends JsonWizardFormFragment { + private static final String RECEIVING_ORDER_FACILITY = "receiving_order_facility"; + + public static HfJsonFormFragment getFormFragment(String stepName) { + HfJsonFormFragment jsonFormFragment = new HfJsonFormFragment(); + Bundle bundle = new Bundle(); + bundle.putString("stepName", stepName); + jsonFormFragment.setArguments(bundle); + return jsonFormFragment; + } + + @Override + public void finishWithResult(Intent returnIntent) { + try { + JSONObject jsonObject = new JSONObject(returnIntent.getStringExtra(JsonFormConstants.JSON_FORM_KEY.JSON)); + JSONArray fields = jsonObject.getJSONObject(Constants.JsonFormConstants.STEP1) + .getJSONArray(org.smartregister.chw.referral.util.JsonFormConstants.FIELDS); + + //Removing not required options that might lead to unnecessarily large response json object + JSONObject receivingOrderFacility = org.smartregister.family.util.JsonFormUtils.getFieldJSONObject(fields, RECEIVING_ORDER_FACILITY); + if (receivingOrderFacility != null) { + receivingOrderFacility.put("options", new JSONArray()); + } + + JSONObject referralHealthFacilities = org.smartregister.family.util.JsonFormUtils.getFieldJSONObject(fields, Constants.JsonFormConstants.NAME_OF_HF); + if (referralHealthFacilities != null) { + referralHealthFacilities.put("options", new JSONArray()); + } + + Intent newReturnIntent = new Intent(); + newReturnIntent.putExtra("json", jsonObject.toString()); + + newReturnIntent.putExtra(JsonFormConstants.SKIP_VALIDATION, + "true"); + + + getActivity().setResult(Activity.RESULT_OK, newReturnIntent); + getActivity().finish(); + } catch (Exception e) { + Timber.e(e); + getActivity().setResult(Activity.RESULT_OK, returnIntent); + getActivity().finish(); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivFollowupFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivFollowupFragment.java new file mode 100644 index 000000000..2de909802 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivFollowupFragment.java @@ -0,0 +1,69 @@ +package org.smartregister.chw.hf.fragment; + +import android.widget.TextView; + +import org.jetbrains.annotations.Nullable; +import org.smartregister.chw.core.fragment.CoreHivCommunityFollowupRegisterFragment; +import org.smartregister.chw.core.provider.CoreHivProvider; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.HivProfileActivity; +import org.smartregister.chw.hf.activity.HivRegisterActivity; +import org.smartregister.chw.hf.model.HivFollowupFragmentModel; +import org.smartregister.chw.hf.presenter.HivFollowupFragmentPresenter; +import org.smartregister.chw.hf.provider.HfHivFollowupProvider; +import org.smartregister.chw.hiv.dao.HivDao; +import org.smartregister.chw.hiv.domain.HivMemberObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.configurableviews.model.View; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; + +import java.util.Objects; +import java.util.Set; + +import timber.log.Timber; + +public class HivFollowupFragment extends CoreHivCommunityFollowupRegisterFragment { + + @Override + public void initializeAdapter(@Nullable Set visibleColumns) { + CoreHivProvider hivRegisterProvider = new HfHivFollowupProvider(getActivity(), visibleColumns, registerActionHandler, paginationViewHandler); + clientAdapter = new RecyclerViewPaginatedAdapter(null, hivRegisterProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + public void setupViews(android.view.View view) { + super.setupViews(view); + TextView dueOnlyTextView = view.findViewById(R.id.due_only_text_view); + dueOnlyTextView.setText(getString(R.string.feedback_due_only)); + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + String viewConfigurationIdentifier = null; + try { + viewConfigurationIdentifier = ((HivRegisterActivity) getActivity()).getViewIdentifiers().get(0); + } catch (NullPointerException e) { + Timber.e(e); + } + presenter = new HivFollowupFragmentPresenter(this, new HivFollowupFragmentModel(), viewConfigurationIdentifier); + } + + @Override + protected void openProfile(CommonPersonObjectClient client) { + if (getActivity() != null) + HivProfileActivity.startHivProfileActivity(getActivity(), Objects.requireNonNull(HivDao.getCommunityFollowupMember(client.getCaseId()))); + } + + + @Override + protected void openFollowUpVisit(@Nullable HivMemberObject hivMemberObject) { + + } +} + + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivIndexContactsRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivIndexContactsRegisterFragment.java new file mode 100644 index 000000000..802b32b96 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivIndexContactsRegisterFragment.java @@ -0,0 +1,79 @@ +package org.smartregister.chw.hf.fragment; + +import android.widget.TextView; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.jetbrains.annotations.Nullable; +import org.json.JSONException; +import org.smartregister.chw.core.fragment.CoreHivIndexContactsRegisterFragment; +import org.smartregister.chw.core.provider.CoreHivIndexContactsProvider; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.HivIndexContactProfileActivity; +import org.smartregister.chw.hf.activity.HivIndexContactsContactsRegisterActivity; +import org.smartregister.chw.hf.model.HivIndexContactsRegisterFragmentModel; +import org.smartregister.chw.hf.presenter.HivIndexContactsContactsRegisterFragmentPresenter; +import org.smartregister.chw.hf.provider.HfHivIndexContactsRegisterProvider; +import org.smartregister.chw.hiv.dao.HivIndexDao; +import org.smartregister.chw.hiv.domain.HivMemberObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.configurableviews.model.View; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; + +import java.util.Objects; +import java.util.Set; + +import timber.log.Timber; + +public class HivIndexContactsRegisterFragment extends CoreHivIndexContactsRegisterFragment { + + @Override + public void initializeAdapter(@Nullable Set visibleColumns) { + CoreHivIndexContactsProvider hivRegisterProvider = new HfHivIndexContactsRegisterProvider(getActivity(), visibleColumns, registerActionHandler, paginationViewHandler); + clientAdapter = new RecyclerViewPaginatedAdapter(null, hivRegisterProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + @Override + public void setupViews(android.view.View view) { + super.setupViews(view); + TextView dueOnlyTextView = view.findViewById(R.id.due_only_text_view); + dueOnlyTextView.setText(getString(R.string.feedback_due_only)); + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + String viewConfigurationIdentifier = null; + try { + viewConfigurationIdentifier = ((HivIndexContactsContactsRegisterActivity) getActivity()).getViewIdentifiers().get(0); + } catch (NullPointerException e) { + Timber.e(e); + } + presenter = new HivIndexContactsContactsRegisterFragmentPresenter(this, new HivIndexContactsRegisterFragmentModel(), viewConfigurationIdentifier); + } + + @Override + protected void openProfile(CommonPersonObjectClient client) { + if (getActivity() != null) { + HivIndexContactProfileActivity.startHivIndexContactProfileActivity(getActivity(), Objects.requireNonNull(HivIndexDao.getMember(client.getCaseId()))); + } + } + + + @Override + protected void openFollowUpVisit(@Nullable HivMemberObject hivMemberObject) { + if (getActivity() != null) { + try { + HivIndexContactsContactsRegisterActivity.startHIVFormActivity(getActivity(), hivMemberObject.getBaseEntityId(), CoreConstants.JSON_FORM.getHivIndexContactFollowupVisit(), (new FormUtils()).getFormJsonFromRepositoryOrAssets(getActivity(), CoreConstants.JSON_FORM.getHivIndexContactFollowupVisit()).toString()); + } catch (JSONException e) { + Timber.e(e); + } + } + } +} + + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivRegisterFragment.java new file mode 100644 index 000000000..af2788034 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivRegisterFragment.java @@ -0,0 +1,60 @@ +package org.smartregister.chw.hf.fragment; + +import org.jetbrains.annotations.Nullable; +import org.smartregister.chw.core.fragment.CoreHivRegisterFragment; +import org.smartregister.chw.core.provider.CoreHivProvider; +import org.smartregister.chw.hf.activity.HivProfileActivity; +import org.smartregister.chw.hf.activity.HivRegisterActivity; +import org.smartregister.chw.hf.model.HivRegisterFragmentModel; +import org.smartregister.chw.hf.presenter.HivRegisterFragmentPresenter; +import org.smartregister.chw.hf.provider.HfHivRegisterProvider; +import org.smartregister.chw.hiv.dao.HivDao; +import org.smartregister.chw.hiv.domain.HivMemberObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.configurableviews.model.View; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; + +import java.util.Objects; +import java.util.Set; + +import timber.log.Timber; + +public class HivRegisterFragment extends CoreHivRegisterFragment { + + @Override + public void initializeAdapter(@Nullable Set visibleColumns) { + CoreHivProvider hivRegisterProvider = new HfHivRegisterProvider(getActivity(), visibleColumns, registerActionHandler, paginationViewHandler); + clientAdapter = new RecyclerViewPaginatedAdapter(null, hivRegisterProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + String viewConfigurationIdentifier = null; + try { + viewConfigurationIdentifier = ((HivRegisterActivity) getActivity()).getViewIdentifiers().get(0); + } catch (NullPointerException e) { + Timber.e(e); + } + presenter = new HivRegisterFragmentPresenter(this, new HivRegisterFragmentModel(), viewConfigurationIdentifier); + } + + @Override + protected void openProfile(CommonPersonObjectClient client) { + if (getActivity() != null) + HivProfileActivity.startHivProfileActivity(getActivity(), Objects.requireNonNull(HivDao.getMember(client.getCaseId()))); + } + + + @Override + protected void openFollowUpVisit(@Nullable HivMemberObject hivMemberObject) { + + } + +} + + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivstMobilizationFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivstMobilizationFragment.java new file mode 100644 index 000000000..ea8bff25b --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivstMobilizationFragment.java @@ -0,0 +1,36 @@ +package org.smartregister.chw.hf.fragment; + +import android.view.View; + +import org.json.JSONObject; +import org.smartregister.chw.core.custom_views.NavigationMenu; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.JsonFormUtils; +import org.smartregister.chw.hivst.fragment.BaseHivstMobilizationRegisterFragment; + +import timber.log.Timber; + +public class HivstMobilizationFragment extends BaseHivstMobilizationRegisterFragment { + + @Override + public void setupViews(View view) { + super.setupViews(view); + try { + NavigationMenu.getInstance(getActivity(), null, toolbar); + } catch (NullPointerException e) { + Timber.e(e); + } + } + + @Override + protected void onResumption() { + super.onResumption(); + NavigationMenu.getInstance(getActivity(), null, toolbar); + } + + + @Override + protected void startForm(JSONObject form) { + requireActivity().startActivityForResult(org.smartregister.chw.core.utils.FormUtils.getStartFormActivity(form, requireActivity().getString(R.string.hivst_mobilization), requireActivity()), JsonFormUtils.REQUEST_CODE_GET_JSON); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivstRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivstRegisterFragment.java new file mode 100644 index 000000000..95ff631ce --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivstRegisterFragment.java @@ -0,0 +1,12 @@ +package org.smartregister.chw.hf.fragment; + +import org.smartregister.chw.core.fragment.CoreHivstRegisterFragment; +import org.smartregister.chw.hf.activity.HivstProfileActivity; + +public class HivstRegisterFragment extends CoreHivstRegisterFragment { + + @Override + protected void openProfile(String baseEntityId) { + HivstProfileActivity.startProfile(requireActivity(), baseEntityId); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivstResultsViewFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivstResultsViewFragment.java new file mode 100644 index 000000000..3b4f4076e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HivstResultsViewFragment.java @@ -0,0 +1,44 @@ +package org.smartregister.chw.hf.fragment; + +import android.os.Bundle; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.activity.HivstResultViewActivity; +import org.smartregister.chw.hivst.fragment.BaseHivstResultViewFragment; +import org.smartregister.chw.hivst.util.Constants; +import org.smartregister.chw.hivst.util.DBConstants; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.util.Utils; + +public class HivstResultsViewFragment extends BaseHivstResultViewFragment { + + + public static HivstResultsViewFragment newInstance(String baseEntityId) { + HivstResultsViewFragment hivstResultsViewFragment = new HivstResultsViewFragment(); + Bundle b = new Bundle(); + b.putString(Constants.ACTIVITY_PAYLOAD.BASE_ENTITY_ID, baseEntityId); + hivstResultsViewFragment.setArguments(b); + return hivstResultsViewFragment; + } + + @Override + public void openResultsForm(CommonPersonObjectClient client) { + String baseEntityId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.BASE_ENTITY_ID, false); + String entityId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.ENTITY_ID, false); + String kitFor = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.KIT_FOR, false); + String clientTestingApproach = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.CLIENT_TESTING_APPROACH, false); + try { + JSONObject jsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets(requireContext(), Constants.FORMS.HIVST_RECORD_RESULTS); + JSONObject global = jsonObject.getJSONObject("global"); + global.putOpt("kit_for", kitFor); + global.putOpt("client_testing_approach", clientTestingApproach); + HivstResultViewActivity.startResultsForm(getContext(), jsonObject.toString(), baseEntityId, entityId); + } catch (JSONException e) { + e.printStackTrace(); + } + + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HtsRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HtsRegisterFragment.java new file mode 100644 index 000000000..733a25267 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HtsRegisterFragment.java @@ -0,0 +1,139 @@ +package org.smartregister.chw.hf.fragment; + +import android.database.Cursor; +import android.os.Bundle; + +import androidx.annotation.NonNull; +import androidx.loader.content.CursorLoader; +import androidx.loader.content.Loader; + +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.Nullable; +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.chw.core.fragment.CoreHivRegisterFragment; +import org.smartregister.chw.core.provider.CoreHivProvider; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.QueryBuilder; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.HivProfileActivity; +import org.smartregister.chw.hf.activity.HtsRegisterActivity; +import org.smartregister.chw.hf.dao.HfHtsDao; +import org.smartregister.chw.hf.model.HtsRegisterFragmentModel; +import org.smartregister.chw.hf.presenter.HtsRegisterFragmentPresenter; +import org.smartregister.chw.hf.provider.HfHivRegisterProvider; +import org.smartregister.chw.hiv.domain.HivMemberObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.commonregistry.CommonRepository; +import org.smartregister.configurableviews.model.View; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.view.customcontrols.CustomFontTextView; + +import java.text.MessageFormat; +import java.util.List; +import java.util.Objects; +import java.util.Set; + +import timber.log.Timber; + +public class HtsRegisterFragment extends CoreHivRegisterFragment { + @Override + public void setupViews(android.view.View view) { + super.setupViews(view); + ((CustomFontTextView) view.findViewById(R.id.txt_title_label)).setText(getString(R.string.hts_clients)); + } + + @Override + public void initializeAdapter(@Nullable Set visibleColumns) { + CoreHivProvider hivRegisterProvider = new HfHivRegisterProvider(getActivity(), visibleColumns, registerActionHandler, paginationViewHandler); + clientAdapter = new RecyclerViewPaginatedAdapter(null, hivRegisterProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + String viewConfigurationIdentifier = null; + try { + viewConfigurationIdentifier = ((HtsRegisterActivity) getActivity()).getViewIdentifiers().get(0); + } catch (NullPointerException e) { + Timber.e(e); + } + presenter = new HtsRegisterFragmentPresenter(this, new HtsRegisterFragmentModel(), viewConfigurationIdentifier); + } + + + @NonNull + @Override + public Loader onCreateLoader(int id, final Bundle args) { + if (id == LOADER_ID) { + return new CursorLoader(getActivity()) { + @Override + public Cursor loadInBackground() { + // Count query + final String COUNT = "count_execute"; + if (args != null && args.getBoolean(COUNT)) { + countExecute(); + } + String query = defaultFilterAndSortQuery(); + return commonRepository().rawCustomQueryForAdapter(query); + } + }; + } + return super.onCreateLoader(id, args); + } + + + private String defaultFilterAndSortQuery() { + SmartRegisterQueryBuilder sqb = new SmartRegisterQueryBuilder(mainSelect); + + String query = ""; + StringBuilder customFilter = new StringBuilder(); + if (StringUtils.isNotBlank(filters)) { + customFilter.append(MessageFormat.format(" and ( {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.FIRST_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.LAST_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.MIDDLE_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ) ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.UNIQUE_ID, filters)); + + } + if (dueFilterActive) { + customFilter.append(MessageFormat.format(" and ( {0}) ", presenter().getDueFilterCondition())); + } + try { + if (isValidFilterForFts(commonRepository())) { + + String myquery = QueryBuilder.getQuery(joinTables, mainCondition, tablename, customFilter.toString(), clientAdapter, Sortqueries); + List ids = commonRepository().findSearchIds(myquery); + query = sqb.toStringFts(ids, tablename, CommonRepository.ID_COLUMN, + Sortqueries); + query = sqb.Endquery(query); + } else { + sqb.addCondition(customFilter.toString()); + query = sqb.orderbyCondition(Sortqueries); + query = sqb.Endquery(sqb.addlimitandOffset(query, clientAdapter.getCurrentlimit(), clientAdapter.getCurrentoffset())); + + } + } catch (Exception e) { + Timber.e(e); + } + + return query; + } + + @Override + protected void openProfile(CommonPersonObjectClient client) { + if (getActivity() != null) + HivProfileActivity.startHivProfileActivity(getActivity(), Objects.requireNonNull(HfHtsDao.getMember(client.getCaseId())), R.string.hts_return_to_previous_page); + } + + + @Override + protected void openFollowUpVisit(@Nullable HivMemberObject hivMemberObject) { + + } +} + + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HvlResultsFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HvlResultsFragment.java new file mode 100644 index 000000000..8fd62b98a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/HvlResultsFragment.java @@ -0,0 +1,128 @@ +package org.smartregister.chw.hf.fragment; + +import static com.vijay.jsonwizard.rules.RuleConstant.CALCULATION; +import static org.smartregister.chw.pmtct.util.DBConstants.KEY.FORM_SUBMISSION_ID; +import static org.smartregister.util.JsonFormUtils.FIELDS; +import static org.smartregister.util.JsonFormUtils.STEP1; + +import android.os.Bundle; +import android.os.SystemClock; +import android.view.View; +import android.widget.TextView; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.activity.HvlResultsViewActivity; +import org.smartregister.chw.hf.dao.HfPmtctDao; +import org.smartregister.chw.hf.model.HvlResultsFragmentModel; +import org.smartregister.chw.hf.presenter.HvlResultsFragmentPresenter; +import org.smartregister.chw.pmtct.fragment.BaseHvlResultsFragment; +import org.smartregister.chw.pmtct.util.DBConstants; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.util.Utils; + +import timber.log.Timber; + +public class HvlResultsFragment extends BaseHvlResultsFragment { + + public static final String BASE_ENTITY_ID = "BASE_ENTITY_ID"; + private long mLastClickTime = 0; + private String baseEntityId; + + public static HvlResultsFragment newInstance(String baseEntityId) { + HvlResultsFragment hvlResultsFragment = new HvlResultsFragment(); + Bundle b = new Bundle(); + b.putString(BASE_ENTITY_ID, baseEntityId); + hvlResultsFragment.setArguments(b); + return hvlResultsFragment; + } + + @Override + public void onCreate(Bundle savedInstanceState) { + if (getArguments() != null) { + this.baseEntityId = getArguments().getString(BASE_ENTITY_ID); + } + super.onCreate(savedInstanceState); + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + presenter = new HvlResultsFragmentPresenter(baseEntityId, this, new HvlResultsFragmentModel(), null); + } + + @Override + protected void onViewClicked(View view) { + // mis-clicking prevention, using threshold of 5000 ms + if (SystemClock.elapsedRealtime() - mLastClickTime < 5000){ + return; + } + mLastClickTime = SystemClock.elapsedRealtime(); + if (getActivity() == null || !(view.getTag() instanceof CommonPersonObjectClient)) { + return; + } + CommonPersonObjectClient client = (CommonPersonObjectClient) view.getTag(); + if (view.getTag(org.smartregister.pmtct.R.id.VIEW_ID) == CLICK_VIEW_NORMAL) { + if (((TextView) view).getText().toString().equalsIgnoreCase("edit")) { + CommonPersonObjectClient pc = (CommonPersonObjectClient) view.getTag(); + if (pc != null) { + openEditResultsForm(client); + } else + openResultsForm(client); + } else { + openResultsForm(client); + } + } + } + + @Override + public void openResultsForm(CommonPersonObjectClient client) { + String sampleId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.HVL_SAMPLE_ID, false); + String baseEntityId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.BASE_ENTITY_ID, false); + String formSubmissionId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.ENTITY_ID, false); + try { + JSONObject jsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets(requireContext(), org.smartregister.chw.hf.utils.Constants.JsonForm.getHvlTestResultsForm()); + assert jsonObject != null; + jsonObject.getJSONObject(STEP1).getJSONArray(FIELDS).getJSONObject(0).put("value", sampleId); + JSONObject global = jsonObject.getJSONObject("global"); + global.put("is_after_eac", HfPmtctDao.isAfterEAC(baseEntityId)); + HvlResultsViewActivity.startResultsForm(getContext(), jsonObject.toString(), baseEntityId, formSubmissionId); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + + private void openEditResultsForm(CommonPersonObjectClient client) { + String baseEntityId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.BASE_ENTITY_ID, false); + String formSubmissionId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.ENTITY_ID, false); + try { + JSONObject jsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets(requireContext(), org.smartregister.chw.hf.utils.Constants.JsonForm.getHvlTestResultsForm()); + assert jsonObject != null; + JSONObject global = jsonObject.getJSONObject("global"); + global.put("is_after_eac", HfPmtctDao.wasPreviousResultsAfterEAC(baseEntityId)); + + try { + JSONObject hvlResultDateObject = org.smartregister.util.JsonFormUtils.getFieldJSONObject(jsonObject.getJSONObject(STEP1).getJSONArray(FIELDS), "hvl_result_date"); + assert hvlResultDateObject != null; + hvlResultDateObject.remove(CALCULATION); + } catch (Exception e) { + Timber.e(e); + } + + jsonObject.put(FORM_SUBMISSION_ID, Utils.getValue(client.getColumnmaps(), FORM_SUBMISSION_ID, false)); + + CoreJsonFormUtils.populateJsonForm(jsonObject, client.getColumnmaps()); + + HvlResultsViewActivity.startResultsForm(getContext(), jsonObject.toString(), baseEntityId, formSubmissionId); + } catch (JSONException e) { + e.printStackTrace(); + } + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/IndividualProfileRemoveFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/IndividualProfileRemoveFragment.java new file mode 100644 index 000000000..97731c547 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/IndividualProfileRemoveFragment.java @@ -0,0 +1,171 @@ +package org.smartregister.chw.hf.fragment; + +import static org.smartregister.chw.core.utils.CoreReferralUtils.getCommonRepository; + +import android.content.Intent; +import android.os.Bundle; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONObject; +import org.smartregister.chw.core.activity.CoreAncRegisterActivity; +import org.smartregister.chw.core.activity.CoreFamilyRegisterActivity; +import org.smartregister.chw.core.fragment.CoreFamilyProfileChangeDialog; +import org.smartregister.chw.core.fragment.CoreIndividualProfileRemoveFragment; +import org.smartregister.chw.core.fragment.FamilyRemoveMemberConfirmDialog; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.Utils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.AllClientsRegisterActivity; +import org.smartregister.chw.hf.activity.AncRegisterActivity; +import org.smartregister.chw.hf.activity.FamilyRegisterActivity; +import org.smartregister.chw.hf.activity.IndividualProfileRemoveActivity; +import org.smartregister.chw.hf.dao.HeiDao; +import org.smartregister.chw.hf.model.FamilyRemoveMemberModel; +import org.smartregister.chw.hf.presenter.FamilyRemoveMemberPresenter; +import org.smartregister.chw.hf.provider.HfFamilyRemoveMemberProvider; +import org.smartregister.chw.hf.utils.HeiVisitUtils; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.commonregistry.CommonPersonObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.family.util.Constants; +import org.smartregister.family.util.DBConstants; + +import java.util.Set; + +public class IndividualProfileRemoveFragment extends CoreIndividualProfileRemoveFragment { + + public static IndividualProfileRemoveFragment newInstance(Bundle bundle) { + Bundle args = bundle; + IndividualProfileRemoveFragment fragment = new IndividualProfileRemoveFragment(); + if (args == null) { + args = new Bundle(); + } + fragment.setArguments(args); + return fragment; + } + + @Override + protected void setRemoveMemberProvider(Set visibleColumns, String familyHead, String primaryCaregiver) { + this.removeMemberProvider = new HfFamilyRemoveMemberProvider(familyBaseEntityId, this.getActivity(), + this.commonRepository(), visibleColumns, null, null, familyHead, primaryCaregiver); + } + + @Override + protected void setPresenter(String familyHead, String primaryCareGiver) { + this.presenter = new FamilyRemoveMemberPresenter(this, new FamilyRemoveMemberModel(), null, familyBaseEntityId, familyHead, primaryCareGiver); + } + + @Override + public void onMemberRemoved(String removalType) { + if (getActivity() != null) { + if (CoreConstants.EventType.REMOVE_FAMILY.equalsIgnoreCase(removalType)) { + Intent intent = new Intent(getActivity(), FamilyRegisterActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(intent); + getActivity().finish(); + } else { + if (getActivity() != null && getActivity() instanceof IndividualProfileRemoveActivity) { + getActivity().finish(); + Intent intent = new Intent(getActivity(), AllClientsRegisterActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + if (familyBaseEntityId != null) { //Independent clients don't belong to family + + // Checking if the removed client was a child and enrolled into HEI. + if (removalType.equals(CoreConstants.EventType.REMOVE_CHILD)) { + MemberObject memberObject = HeiDao.getMember(pc.getCaseId()); + if (memberObject != null) { + //The child was enrolled in HEI, and the mother should exit PMTCT if she only had this single child + HeiVisitUtils.closePmtctForDeceasedHei(memberObject.getBaseEntityId()); + } + } + + CommonPersonObject personObject = getCommonRepository(Utils.metadata().familyRegister.tableName).findByBaseEntityId(familyBaseEntityId); + if (personObject != null) { + CommonPersonObjectClient pClient = new CommonPersonObjectClient(personObject.getCaseId(), + personObject.getDetails(), ""); + pClient.setColumnmaps(personObject.getColumnmaps()); + + goToPatientDetailActivity(pClient); + } else { + startActivity(intent); + } + } else { + startActivity(intent); + } + } + } + } + } + + protected void goToPatientDetailActivity(CommonPersonObjectClient patient) { + String entityType = patient.getColumnmaps().get(DBConstants.KEY.ENTITY_TYPE); + Intent intent; + if (CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT.equalsIgnoreCase(entityType)) { + intent = new Intent(getActivity(), AllClientsRegisterActivity.class); + } else { + intent = new Intent(getActivity(), Utils.metadata().profileActivity); + intent.putExtra(Constants.INTENT_KEY.FAMILY_BASE_ENTITY_ID, patient.getCaseId()); + intent.putExtra(Constants.INTENT_KEY.FAMILY_HEAD, Utils.getValue(patient.getColumnmaps(), DBConstants.KEY.FAMILY_HEAD, false)); + intent.putExtra(Constants.INTENT_KEY.PRIMARY_CAREGIVER, Utils.getValue(patient.getColumnmaps(), DBConstants.KEY.PRIMARY_CAREGIVER, false)); + intent.putExtra(Constants.INTENT_KEY.VILLAGE_TOWN, Utils.getValue(patient.getColumnmaps(), DBConstants.KEY.VILLAGE_TOWN, false)); + intent.putExtra(Constants.INTENT_KEY.FAMILY_NAME, Utils.getValue(patient.getColumnmaps(), DBConstants.KEY.FIRST_NAME, false)); + intent.putExtra(Constants.INTENT_KEY.GO_TO_DUE_PAGE, false); + } + startActivity(intent); + } + + + @Override + public void onEveryoneRemoved() { + if (getActivity() != null && getActivity() instanceof IndividualProfileRemoveActivity) { + IndividualProfileRemoveActivity p = (IndividualProfileRemoveActivity) getActivity(); + p.onRemoveMember(); + } + } + + @Override + protected Class getFamilyRegisterActivityClass() { + return FamilyRegisterActivity.class; + } + + @Override + protected CoreFamilyProfileChangeDialog getChangeFamilyCareGiverDialog() { + return FamilyProfileChangeDialog.newInstance(getContext(), familyBaseEntityId, + CoreConstants.PROFILE_CHANGE_ACTION.PRIMARY_CARE_GIVER); + } + + @Override + protected CoreFamilyProfileChangeDialog getChangeFamilyHeadDialog() { + return FamilyProfileChangeDialog.newInstance(getContext(), familyBaseEntityId, + CoreConstants.PROFILE_CHANGE_ACTION.HEAD_OF_FAMILY); + } + + @Override + public void confirmRemove(final JSONObject form) { + if (StringUtils.isNotBlank(memberName) && getFragmentManager() != null) { + FamilyRemoveMemberConfirmDialog dialog = FamilyRemoveMemberConfirmDialog.newInstance( + String.format(getString(R.string.confirm_remove_text), memberName) + ); + dialog.show(getFragmentManager(), FamilyRemoveMemberFragment.DIALOG_TAG); + dialog.setOnRemove(() -> { + getPresenter().processRemoveForm(form); + }); + dialog.setOnRemoveActivity(() -> { + if (getActivity() != null) { + getActivity().finish(); + } + }); + } + } + + @Override + protected String getRemoveFamilyMemberDialogTag() { + return FamilyRemoveMemberFragment.DIALOG_TAG; + } + + @Override + protected Class getAncRegisterActivityClass() { + return AncRegisterActivity.class; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/IssuedReferralsRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/IssuedReferralsRegisterFragment.java new file mode 100644 index 000000000..97b42e920 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/IssuedReferralsRegisterFragment.java @@ -0,0 +1,91 @@ +package org.smartregister.chw.hf.fragment; + +import android.os.Handler; + +import org.smartregister.chw.core.fragment.BaseReferralRegisterFragment; +import org.smartregister.chw.core.utils.Utils; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.ReferralsDetailsViewActivity; +import org.smartregister.chw.hf.model.IssuedReferralsModel; +import org.smartregister.chw.hf.presenter.ReferralFragmentPresenter; +import org.smartregister.chw.hf.provider.ReferralsRegisterProvider; +import org.smartregister.chw.referral.domain.MemberObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.configurableviews.model.View; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; +import org.smartregister.domain.Task; +import org.smartregister.family.util.DBConstants; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.Set; + +public class IssuedReferralsRegisterFragment extends BaseReferralRegisterFragment { + + public Handler handler = new Handler(); + private ReferralFragmentPresenter referralFragmentPresenter; + private CommonPersonObjectClient commonPersonObjectClient; + + @Override + public void setClient(CommonPersonObjectClient commonPersonObjectClient) { + setCommonPersonObjectClient(commonPersonObjectClient); + } + + @Override + protected String getMainCondition() { + AllSharedPreferences allSharedPreferences = Utils.getAllSharedPreferences(); + String anm = allSharedPreferences.fetchRegisteredANM(); + return " ec_family_member_search.date_removed is null and task.owner = '" + anm + "' and task.business_status <> 'Complete' COLLATE NOCASE "; + } + + @Override + public void initializeAdapter(Set visibleColumns, String tableName) { + ReferralsRegisterProvider referralRegisterProvider = new ReferralsRegisterProvider(getActivity(), registerActionHandler, paginationViewHandler); + clientAdapter = new RecyclerViewPaginatedAdapter(null, referralRegisterProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + protected int getToolBarTitle() { + return R.string.issued_referrals; + } + + @Override + public CommonPersonObjectClient getCommonPersonObjectClient() { + return commonPersonObjectClient; + } + + @Override + public void setCommonPersonObjectClient(CommonPersonObjectClient commonPersonObjectClient) { + this.commonPersonObjectClient = commonPersonObjectClient; + } + + @Override + protected void initializePresenter() { + referralFragmentPresenter = new ReferralFragmentPresenter(this, new IssuedReferralsModel()); + presenter = referralFragmentPresenter; + + } + + @Override + protected void onViewClicked(android.view.View view) { + CommonPersonObjectClient client = (CommonPersonObjectClient) view.getTag(); + referralFragmentPresenter.setBaseEntityId(Utils.getValue(client.getColumnmaps(), DBConstants.KEY.BASE_ENTITY_ID, false)); + referralFragmentPresenter.fetchClient(); + + Task task = getTask(Utils.getValue(client.getColumnmaps(), "_id", false)); + referralFragmentPresenter.setTasksFocus(task.getFocus()); + goToReferralsDetails(client); + + } + + private Task getTask(String taskId) { + return HealthFacilityApplication.getInstance().getTaskRepository().getTaskByIdentifier(taskId); + } + + private void goToReferralsDetails(CommonPersonObjectClient client) { + handler.postDelayed(() -> ReferralsDetailsViewActivity.startReferralsDetailsViewActivity(getActivity(), new MemberObject(client), client), 100); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/KvpRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/KvpRegisterFragment.java new file mode 100644 index 000000000..40f16635e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/KvpRegisterFragment.java @@ -0,0 +1,28 @@ +package org.smartregister.chw.hf.fragment; + +import org.smartregister.chw.core.fragment.CoreKvpRegisterFragment; +import org.smartregister.chw.core.model.CoreKvpRegisterFragmentModel; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.KvpProfileActivity; +import org.smartregister.chw.hf.presenter.KvpRegisterFragmentPresenter; + +public class KvpRegisterFragment extends CoreKvpRegisterFragment { + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + presenter = new KvpRegisterFragmentPresenter(this, new CoreKvpRegisterFragmentModel(), null); + } + + @Override + protected void openProfile(String baseEntityId) { + KvpProfileActivity.startProfile(requireActivity(), baseEntityId); + } + + @Override + protected int getTitleString() { + return R.string.menu_kvp; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/LDAmtslSummary.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/LDAmtslSummary.java new file mode 100644 index 000000000..6ffa297c9 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/LDAmtslSummary.java @@ -0,0 +1,61 @@ +package org.smartregister.chw.hf.fragment; + +import android.os.Bundle; + +import androidx.fragment.app.Fragment; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import org.smartregister.chw.hf.R; + +public class LDAmtslSummary extends Fragment { + private TextView uterotonic; + private TextView method_used_to_remove_the_placenta; + private TextView placenta_and_membrane_expulsion; + private TextView type_of_incomplete_placenta; + private TextView placenta_removed_by_hand; + private TextView conducted_mva; + private TextView administered_antibiotics; + private TextView removal_date; + private TextView removal_duration; + private TextView estimated_blood_loss; + private TextView provided_blood_transfusion; + private TextView name_of_the_provider_who_removed_the_placenta; + private TextView uterus_massage_after_delivery; + private TextView reason_for_not_massaging_uterus_after_delivery; + private TextView has_signs_of_eclampsia; + private TextView administered_magnesium_sulphate; + private TextView reason_for_not_administering_magnesium_sulphate; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View rootView = inflater.inflate(R.layout.fragment_ld_amtsl_summary, container, false); + uterotonic = rootView.findViewById(R.id.amtsl_uterotonic); + method_used_to_remove_the_placenta = rootView.findViewById(R.id.amtsl_method_used_to_remove_the_placenta); + placenta_and_membrane_expulsion = rootView.findViewById(R.id.amtsl_placenta_and_membrane_expulsion); + type_of_incomplete_placenta = rootView.findViewById(R.id.amtsl_type_of_incomplete_placenta); + placenta_removed_by_hand = rootView.findViewById(R.id.amtsl_placenta_removed_by_hand); + conducted_mva = rootView.findViewById(R.id.amtsl_conducted_mva); + administered_antibiotics = rootView.findViewById(R.id.amtsl_administered_antibiotics); + removal_date = rootView.findViewById(R.id.amtsl_removal_date); + removal_duration = rootView.findViewById(R.id.amtsl_removal_duration); + estimated_blood_loss = rootView.findViewById(R.id.amtsl_estimated_blood_loss); + provided_blood_transfusion = rootView.findViewById(R.id.amtsl_provided_blood_transfusion); + name_of_the_provider_who_removed_the_placenta = rootView.findViewById(R.id.amtsl_name_of_the_provider_who_removed_the_placenta); + uterus_massage_after_delivery = rootView.findViewById(R.id.amtsl_uterus_massage_after_delivery); + reason_for_not_massaging_uterus_after_delivery = rootView.findViewById(R.id.amtsl_reason_for_not_massaging_uterus_after_delivery); + has_signs_of_eclampsia = rootView.findViewById(R.id.amtsl_has_signs_of_eclampsia); + administered_magnesium_sulphate = rootView.findViewById(R.id.amtsl_administered_magnesium_sulphate); + reason_for_not_administering_magnesium_sulphate = rootView.findViewById(R.id.amtsl_reason_for_not_administering_magnesium_sulphate); + return rootView; + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/LDDischargedRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/LDDischargedRegisterFragment.java new file mode 100644 index 000000000..c451b2c5b --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/LDDischargedRegisterFragment.java @@ -0,0 +1,173 @@ +package org.smartregister.chw.hf.fragment; + +import android.database.Cursor; +import android.os.Bundle; +import android.view.View; +import android.widget.LinearLayout; + +import androidx.annotation.NonNull; +import androidx.appcompat.widget.Toolbar; +import androidx.loader.content.CursorLoader; +import androidx.loader.content.Loader; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.chw.core.custom_views.NavigationMenu; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.QueryBuilder; +import org.smartregister.chw.core.utils.Utils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.LDProfileActivity; +import org.smartregister.chw.hf.model.LDRegisterFragmentModel; +import org.smartregister.chw.hf.presenter.LDDischargedRegisterFragmentPresenter; +import org.smartregister.chw.hf.provider.HfLDRegisterProvider; +import org.smartregister.chw.ld.fragment.BaseLDRegisterFragment; +import org.smartregister.chw.ld.provider.LDRegisterProvider; +import org.smartregister.commonregistry.CommonRepository; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.view.customcontrols.CustomFontTextView; + +import java.text.MessageFormat; +import java.util.List; +import java.util.Set; + +import timber.log.Timber; + +public class LDDischargedRegisterFragment extends BaseLDRegisterFragment { + private Toolbar toolbar; + + @Override + public void initializeAdapter(Set visibleColumns) { + LDRegisterProvider LDRegisterProvider = new HfLDRegisterProvider(getActivity(), paginationViewHandler, registerActionHandler, visibleColumns); + clientAdapter = new RecyclerViewPaginatedAdapter(null, LDRegisterProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + public void setupViews(View view) { + initializePresenter(); + super.setupViews(view); + + toolbar = view.findViewById(org.smartregister.R.id.register_toolbar); + toolbar.setContentInsetsAbsolute(0, 0); + toolbar.setContentInsetsRelative(0, 0); + toolbar.setContentInsetStartWithNavigation(0); + + + View navbarContainer = view.findViewById(org.smartregister.chw.core.R.id.register_nav_bar_container); + navbarContainer.setFocusable(false); + + CustomFontTextView titleView = view.findViewById(org.smartregister.chw.core.R.id.txt_title_label); + if (titleView != null) { + titleView.setPadding(0, titleView.getTop(), titleView.getPaddingRight(), titleView.getPaddingBottom()); + } + titleView.setText(R.string.discharged_clients); + + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); + View searchBarLayout = view.findViewById(org.smartregister.chw.core.R.id.search_bar_layout); + searchBarLayout.setLayoutParams(params); + searchBarLayout.setBackgroundResource(org.smartregister.chw.core.R.color.chw_primary); + searchBarLayout.setPadding(searchBarLayout.getPaddingLeft(), searchBarLayout.getPaddingTop(), searchBarLayout.getPaddingRight(), (int) Utils.convertDpToPixel(10, getActivity())); + + View topLeftLayout = view.findViewById(org.smartregister.chw.core.R.id.top_left_layout); + topLeftLayout.setVisibility(View.GONE); + + View topRightLayout = view.findViewById(org.smartregister.chw.core.R.id.top_right_layout); + topRightLayout.setVisibility(View.VISIBLE); + + View sortFilterBarLayout = view.findViewById(org.smartregister.chw.core.R.id.register_sort_filter_bar_layout); + sortFilterBarLayout.setVisibility(View.GONE); + + View filterSortLayout = view.findViewById(org.smartregister.chw.core.R.id.filter_sort_layout); + filterSortLayout.setVisibility(View.GONE); + + View dueOnlyLayout = view.findViewById(org.smartregister.chw.core.R.id.due_only_layout); + dueOnlyLayout.setVisibility(View.GONE); + dueOnlyLayout.setOnClickListener(registerActionHandler); + + if (getSearchView() != null) { + getSearchView().setBackgroundResource(org.smartregister.family.R.color.white); + getSearchView().setCompoundDrawablesWithIntrinsicBounds(org.smartregister.family.R.drawable.ic_action_search, 0, 0, 0); + getSearchView().setTextColor(getResources().getColor(org.smartregister.chw.core.R.color.text_black)); + } + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + presenter = new LDDischargedRegisterFragmentPresenter(this, new LDRegisterFragmentModel(), null); + } + + + @NonNull + @Override + public Loader onCreateLoader(int id, final Bundle args) { + if (id == LOADER_ID) { + return new CursorLoader(getActivity()) { + @Override + public Cursor loadInBackground() { + // Count query + final String COUNT = "count_execute"; + if (args != null && args.getBoolean(COUNT)) { + countExecute(); + } + String query = defaultFilterAndSortQuery(); + return commonRepository().rawCustomQueryForAdapter(query); + } + }; + } + return super.onCreateLoader(id, args); + } + + private String defaultFilterAndSortQuery() { + SmartRegisterQueryBuilder sqb = new SmartRegisterQueryBuilder(mainSelect); + + String query = ""; + StringBuilder customFilter = new StringBuilder(); + if (StringUtils.isNotBlank(filters)) { + customFilter.append(MessageFormat.format(" and ( {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.FIRST_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.LAST_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.MIDDLE_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ) ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.UNIQUE_ID, filters)); + + } + + try { + if (isValidFilterForFts(commonRepository())) { + + String myquery = QueryBuilder.getQuery(joinTables, mainCondition, tablename, customFilter.toString(), clientAdapter, Sortqueries); + List ids = commonRepository().findSearchIds(myquery); + query = sqb.toStringFts(ids, tablename, CommonRepository.ID_COLUMN, + Sortqueries); + query = sqb.Endquery(query); + } else { + sqb.addCondition(customFilter.toString()); + query = sqb.orderbyCondition(Sortqueries); + query = sqb.Endquery(sqb.addlimitandOffset(query, clientAdapter.getCurrentlimit(), clientAdapter.getCurrentoffset())); + + } + } catch (Exception e) { + Timber.e(e); + } + + return query; + } + + protected void openProfile(String baseEntityId) { + LDProfileActivity.startProfileActivity(getActivity(), baseEntityId); + } + + @Override + protected void onResumption() { + super.onResumption(); + try { + NavigationMenu.getInstance(getActivity(), null, toolbar); + } catch (NullPointerException e) { + Timber.e(e); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/LDRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/LDRegisterFragment.java new file mode 100644 index 000000000..93a31085f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/LDRegisterFragment.java @@ -0,0 +1,171 @@ +package org.smartregister.chw.hf.fragment; + +import android.database.Cursor; +import android.os.Bundle; +import android.view.View; +import android.widget.LinearLayout; + +import androidx.annotation.NonNull; +import androidx.appcompat.widget.Toolbar; +import androidx.loader.content.CursorLoader; +import androidx.loader.content.Loader; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.chw.core.custom_views.NavigationMenu; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.QueryBuilder; +import org.smartregister.chw.core.utils.Utils; +import org.smartregister.chw.hf.activity.LDProfileActivity; +import org.smartregister.chw.hf.model.LDRegisterFragmentModel; +import org.smartregister.chw.hf.presenter.LDRegisterFragmentPresenter; +import org.smartregister.chw.hf.provider.HfLDRegisterProvider; +import org.smartregister.chw.ld.fragment.BaseLDRegisterFragment; +import org.smartregister.chw.ld.provider.LDRegisterProvider; +import org.smartregister.commonregistry.CommonRepository; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.view.customcontrols.CustomFontTextView; + +import java.text.MessageFormat; +import java.util.List; +import java.util.Set; + +import timber.log.Timber; + +public class LDRegisterFragment extends BaseLDRegisterFragment { + private Toolbar toolbar; + + @Override + public void initializeAdapter(Set visibleColumns) { + LDRegisterProvider LDRegisterProvider = new HfLDRegisterProvider(getActivity(), paginationViewHandler, registerActionHandler, visibleColumns); + clientAdapter = new RecyclerViewPaginatedAdapter(null, LDRegisterProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + public void setupViews(View view) { + initializePresenter(); + super.setupViews(view); + + toolbar = view.findViewById(org.smartregister.R.id.register_toolbar); + toolbar.setContentInsetsAbsolute(0, 0); + toolbar.setContentInsetsRelative(0, 0); + toolbar.setContentInsetStartWithNavigation(0); + + + View navbarContainer = view.findViewById(org.smartregister.chw.core.R.id.register_nav_bar_container); + navbarContainer.setFocusable(false); + + CustomFontTextView titleView = view.findViewById(org.smartregister.chw.core.R.id.txt_title_label); + if (titleView != null) { + titleView.setPadding(0, titleView.getTop(), titleView.getPaddingRight(), titleView.getPaddingBottom()); + } + + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); + View searchBarLayout = view.findViewById(org.smartregister.chw.core.R.id.search_bar_layout); + searchBarLayout.setLayoutParams(params); + searchBarLayout.setBackgroundResource(org.smartregister.chw.core.R.color.chw_primary); + searchBarLayout.setPadding(searchBarLayout.getPaddingLeft(), searchBarLayout.getPaddingTop(), searchBarLayout.getPaddingRight(), (int) Utils.convertDpToPixel(10, getActivity())); + + View topLeftLayout = view.findViewById(org.smartregister.chw.core.R.id.top_left_layout); + topLeftLayout.setVisibility(View.GONE); + + View topRightLayout = view.findViewById(org.smartregister.chw.core.R.id.top_right_layout); + topRightLayout.setVisibility(View.VISIBLE); + + View sortFilterBarLayout = view.findViewById(org.smartregister.chw.core.R.id.register_sort_filter_bar_layout); + sortFilterBarLayout.setVisibility(View.GONE); + + View filterSortLayout = view.findViewById(org.smartregister.chw.core.R.id.filter_sort_layout); + filterSortLayout.setVisibility(View.GONE); + + View dueOnlyLayout = view.findViewById(org.smartregister.chw.core.R.id.due_only_layout); + dueOnlyLayout.setVisibility(View.GONE); + dueOnlyLayout.setOnClickListener(registerActionHandler); + + if (getSearchView() != null) { + getSearchView().setBackgroundResource(org.smartregister.family.R.color.white); + getSearchView().setCompoundDrawablesWithIntrinsicBounds(org.smartregister.family.R.drawable.ic_action_search, 0, 0, 0); + getSearchView().setTextColor(getResources().getColor(org.smartregister.chw.core.R.color.text_black)); + } + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + presenter = new LDRegisterFragmentPresenter(this, new LDRegisterFragmentModel(), null); + } + + + @NonNull + @Override + public Loader onCreateLoader(int id, final Bundle args) { + if (id == LOADER_ID) { + return new CursorLoader(getActivity()) { + @Override + public Cursor loadInBackground() { + // Count query + final String COUNT = "count_execute"; + if (args != null && args.getBoolean(COUNT)) { + countExecute(); + } + String query = defaultFilterAndSortQuery(); + return commonRepository().rawCustomQueryForAdapter(query); + } + }; + } + return super.onCreateLoader(id, args); + } + + private String defaultFilterAndSortQuery() { + SmartRegisterQueryBuilder sqb = new SmartRegisterQueryBuilder(mainSelect); + + String query = ""; + StringBuilder customFilter = new StringBuilder(); + if (StringUtils.isNotBlank(filters)) { + customFilter.append(MessageFormat.format(" and ( {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.FIRST_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.LAST_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.MIDDLE_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ) ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.UNIQUE_ID, filters)); + + } + + try { + if (isValidFilterForFts(commonRepository())) { + + String myquery = QueryBuilder.getQuery(joinTables, mainCondition, tablename, customFilter.toString(), clientAdapter, Sortqueries); + List ids = commonRepository().findSearchIds(myquery); + query = sqb.toStringFts(ids, tablename, CommonRepository.ID_COLUMN, + Sortqueries); + query = sqb.Endquery(query); + } else { + sqb.addCondition(customFilter.toString()); + query = sqb.orderbyCondition(Sortqueries); + query = sqb.Endquery(sqb.addlimitandOffset(query, clientAdapter.getCurrentlimit(), clientAdapter.getCurrentoffset())); + + } + } catch (Exception e) { + Timber.e(e); + } + + return query; + } + + protected void openProfile(String baseEntityId) { + LDProfileActivity.startProfileActivity(getActivity(), baseEntityId); + } + + @Override + protected void onResumption() { + super.onResumption(); + try { + NavigationMenu.getInstance(getActivity(), null, toolbar); + } catch (NullPointerException e) { + Timber.e(e); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/LTFUReferralsRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/LTFUReferralsRegisterFragment.java new file mode 100644 index 000000000..f49849d7b --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/LTFUReferralsRegisterFragment.java @@ -0,0 +1,92 @@ +package org.smartregister.chw.hf.fragment; + +import android.os.Handler; +import android.view.View; + +import org.smartregister.chw.core.fragment.BaseReferralRegisterFragment; +import org.smartregister.chw.core.utils.Utils; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.ReferralsDetailsViewActivity; +import org.smartregister.chw.hf.model.LTFUModel; +import org.smartregister.chw.hf.presenter.ReferralFragmentPresenter; +import org.smartregister.chw.hf.provider.ReferralsRegisterProvider; +import org.smartregister.chw.referral.domain.MemberObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; +import org.smartregister.domain.Task; +import org.smartregister.family.util.DBConstants; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.Set; + +public class LTFUReferralsRegisterFragment extends BaseReferralRegisterFragment { + + public Handler handler = new Handler(); + private ReferralFragmentPresenter referralFragmentPresenter; + private CommonPersonObjectClient commonPersonObjectClient; + + @Override + public void setClient(CommonPersonObjectClient commonPersonObjectClient) { + setCommonPersonObjectClient(commonPersonObjectClient); + } + + @Override + protected String getMainCondition() { + AllSharedPreferences allSharedPreferences = Utils.getAllSharedPreferences(); + String anm = allSharedPreferences.fetchRegisteredANM(); + String currentLoaction = allSharedPreferences.fetchUserLocalityId(anm); + return " ec_family_member_search.date_removed is null and task.location = '" + currentLoaction + "' and task.business_status <> 'Complete' COLLATE NOCASE "; + } + + @Override + public void initializeAdapter(Set visibleColumns, String tableName) { + ReferralsRegisterProvider referralRegisterProvider = new ReferralsRegisterProvider(getActivity(), registerActionHandler, paginationViewHandler); + clientAdapter = new RecyclerViewPaginatedAdapter(null, referralRegisterProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + protected int getToolBarTitle() { + return R.string.ltfu_title; + } + + @Override + public CommonPersonObjectClient getCommonPersonObjectClient() { + return commonPersonObjectClient; + } + + @Override + public void setCommonPersonObjectClient(CommonPersonObjectClient commonPersonObjectClient) { + this.commonPersonObjectClient = commonPersonObjectClient; + } + + @Override + protected void initializePresenter() { + referralFragmentPresenter = new ReferralFragmentPresenter(this, new LTFUModel()); + presenter = referralFragmentPresenter; + + } + + @Override + protected void onViewClicked(View view) { + CommonPersonObjectClient client = (CommonPersonObjectClient) view.getTag(); + referralFragmentPresenter.setBaseEntityId(Utils.getValue(client.getColumnmaps(), DBConstants.KEY.BASE_ENTITY_ID, false)); + referralFragmentPresenter.fetchClient(); + + Task task = getTask(Utils.getValue(client.getColumnmaps(), "_id", false)); + referralFragmentPresenter.setTasksFocus(task.getFocus()); + goToReferralsDetails(client); + + } + + private Task getTask(String taskId) { + return HealthFacilityApplication.getInstance().getTaskRepository().getTaskByIdentifier(taskId); + } + + private void goToReferralsDetails(CommonPersonObjectClient client) { + handler.postDelayed(() -> ReferralsDetailsViewActivity.startReferralsDetailsViewActivity(getActivity(), new MemberObject(client), client), 100); + } + +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/OrdersRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/OrdersRegisterFragment.java new file mode 100644 index 000000000..6c035c213 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/OrdersRegisterFragment.java @@ -0,0 +1,66 @@ +package org.smartregister.chw.hf.fragment; + +import static org.smartregister.chw.core.utils.CoreConstants.JSON_FORM.isMultiPartForm; + +import android.content.Intent; + +import com.vijay.jsonwizard.constants.JsonFormConstants; +import com.vijay.jsonwizard.domain.Form; + +import org.json.JSONObject; +import org.smartregister.chw.cdp.util.Constants; +import org.smartregister.chw.core.fragment.CoreOrdersRegisterFragment; +import org.smartregister.chw.hf.activity.HfJsonWizardFormActivity; +import org.smartregister.chw.hf.activity.OrderDetailsActivity; +import org.smartregister.chw.hf.domain.JSONObjectHolder; +import org.smartregister.chw.hf.presenter.OrdersRegisterFragmentPresenter; +import org.smartregister.chw.hf.utils.JsonFormUtils; +import org.smartregister.commonregistry.CommonPersonObjectClient; + +public class OrdersRegisterFragment extends CoreOrdersRegisterFragment { + + @Override + protected void initializePresenter() { + presenter = new OrdersRegisterFragmentPresenter(this, model()); + } + + @Override + public void showDetails(CommonPersonObjectClient cp) { + OrderDetailsActivity.startMe(requireActivity(), cp); + } + + @Override + public void startOrderForm() { + try { + JSONObject jsonForm = model().getOrderFormAsJson(Constants.FORMS.CDP_CONDOM_ORDER_FACILITY); + + // Set the large JSONObject in JSONObjectHolder + JSONObjectHolder.getInstance().setLargeJSONObject(jsonForm); + + Intent startFormIntent = new Intent(requireActivity(), HfJsonWizardFormActivity.class); + startFormIntent.putExtra(JsonFormConstants.JSON_FORM_KEY.FORM, getOrderForm(jsonForm)); + + getActivity().startActivityForResult(startFormIntent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } catch (Exception e) { + e.printStackTrace(); + } + } + + private Form getOrderForm(JSONObject jsonForm) { + Form form = new Form(); + form.setActionBarBackground(org.smartregister.chw.core.R.color.family_actionbar); + form.setWizard(false); + form.setHomeAsUpIndicator(org.smartregister.chw.core.R.mipmap.ic_cross_white); + form.setSaveLabel(getResources().getString(org.smartregister.chw.core.R.string.submit)); + + if (isMultiPartForm(jsonForm)) { + form.setWizard(true); + form.setNavigationBackground(org.smartregister.chw.core.R.color.family_navigation); + form.setNextLabel(getResources().getString(org.smartregister.chw.core.R.string.next)); + form.setPreviousLabel(getResources().getString(org.smartregister.chw.core.R.string.back)); + } + + return form; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PmtctRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PmtctRegisterFragment.java new file mode 100644 index 000000000..26e3c2a9b --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PmtctRegisterFragment.java @@ -0,0 +1,227 @@ +package org.smartregister.chw.hf.fragment; + +import android.database.Cursor; +import android.os.Bundle; +import android.util.Log; + +import androidx.loader.content.CursorLoader; +import androidx.loader.content.Loader; + +import com.google.android.material.tabs.TabLayout; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.core.fragment.CorePmtctRegisterFragment; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.PmtctProfileActivity; +import org.smartregister.chw.hf.activity.PmtctRegisterActivity; +import org.smartregister.chw.hf.model.PmtctRegisterFragmentModel; +import org.smartregister.chw.hf.presenter.PmtctRegisterFragmentPresenter; +import org.smartregister.chw.hf.provider.HfPmtctRegisterProvider; +import org.smartregister.configurableviews.model.View; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.text.MessageFormat; +import java.util.Set; + +import timber.log.Timber; + +public class PmtctRegisterFragment extends CorePmtctRegisterFragment { + + String customGroupFilter; + + @Override + public void initializeAdapter(Set visibleColumns) { + HfPmtctRegisterProvider pmtctRegisterProvider = new HfPmtctRegisterProvider(getActivity(), paginationViewHandler, registerActionHandler, visibleColumns); + clientAdapter = new RecyclerViewPaginatedAdapter(null, pmtctRegisterProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + String viewConfigurationIdentifier = null; + try { + viewConfigurationIdentifier = ((PmtctRegisterActivity) getActivity()).getViewIdentifiers().get(0); + } catch (Exception e) { + Timber.e(e); + } + + presenter = new PmtctRegisterFragmentPresenter(this, new PmtctRegisterFragmentModel(), viewConfigurationIdentifier); + + } + + @Override + public Loader onCreateLoader(int id, final Bundle args) { + if (id == LOADER_ID) { + return new CursorLoader(getActivity()) { + @Override + public Cursor loadInBackground() { + // Count query + final String COUNT = "count_execute"; + if (args != null && args.getBoolean(COUNT)) { + countExecute(); + } + String query = defaultFilterAndSortQuery(); + return commonRepository().rawCustomQueryForAdapter(query); + } + }; + } + return super.onCreateLoader(id, args); + } + + private String defaultFilterAndSortQuery() { + SmartRegisterQueryBuilder sqb = new SmartRegisterQueryBuilder(mainSelect); + + String query = ""; + StringBuilder customFilter = new StringBuilder(); + if (StringUtils.isNotBlank(filters)) { + customFilter.append(MessageFormat.format(" and ( {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.FIRST_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.LAST_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.MIDDLE_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ) ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.UNIQUE_ID, filters)); + } + + + if (StringUtils.isNotBlank(customGroupFilter)) { + customFilter.append(MessageFormat.format((" and ( {0} ) "), customGroupFilter)); + } + try { + sqb.addCondition(customFilter.toString()); + query = sqb.orderbyCondition(Sortqueries); + query = sqb.Endquery(sqb.addlimitandOffset(query, clientAdapter.getCurrentlimit(), clientAdapter.getCurrentoffset())); + } catch (Exception e) { + Log.e(getClass().getName(), e.toString(), e); + } + return query; + } + + @Override + public void countExecute() { + Cursor c = null; + try { + + String query = "select count(*) from " + presenter().getMainTable() + " inner join " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + + " on " + presenter().getMainTable() + "." + org.smartregister.chw.anc.util.DBConstants.KEY.BASE_ENTITY_ID + " = " + + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + org.smartregister.chw.anc.util.DBConstants.KEY.BASE_ENTITY_ID + + " where " + presenter().getMainCondition(); + + if (StringUtils.isNotBlank(filters)) { + query = query + " and ( " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME + "like ''%" + filters + "%'' "; + query = query + " or " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME + "like ''%" + filters + "%'' "; + query = query + " or " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME + "like ''%" + filters + "%'' "; + query = query + " 0r " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID + "like ''%" + filters + "%'' )"; + + } + + + if (StringUtils.isNotBlank(customGroupFilter)) { + query = query + " and ( " + customGroupFilter + " ) "; + } + + + c = commonRepository().rawCustomQueryForAdapter(query); + c.moveToFirst(); + clientAdapter.setTotalcount(c.getInt(0)); + Timber.v("total count here %s", clientAdapter.getTotalcount()); + + clientAdapter.setCurrentlimit(20); + clientAdapter.setCurrentoffset(0); + + } catch (Exception e) { + Timber.e(e); + } finally { + if (c != null) { + c.close(); + } + } + } + + @Override + public void setupViews(android.view.View view) { + super.setupViews(view); + setUpTabLayout(view, true); + } + + @Override + protected void openProfile(String baseEntityId) { + PmtctProfileActivity.startPmtctActivity(getActivity(), baseEntityId); + } + + @Override + protected void openFollowUpVisit(String baseEntityId) { + // PmtctFollowUpVisitActivity.startPmtctFollowUpActivity(getActivity(),baseEntityId); + } + + protected void setUpTabLayout(android.view.View view, boolean enabled) { + TabLayout tabLayout = view.findViewById(R.id.tab_layout); + if (enabled) { + tabLayout.setVisibility(android.view.View.VISIBLE); + tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { + @Override + public void onTabSelected(TabLayout.Tab tab) { + switch (tab.getPosition()) { + case 0: + customGroupFilter = ""; + filterandSortExecute(); + break; + case 1: + customGroupFilter = getDueTomorrow(); + filterandSortExecute(); + break; + case 2: + customGroupFilter = getMissed(); + filterandSortExecute(); + break; + default: + break; + } + } + + @Override + public void onTabUnselected(TabLayout.Tab tab) { + //do something + } + + @Override + public void onTabReselected(TabLayout.Tab tab) { + //do something + } + }); + } + + } + + @Override + protected int getLayout() { + return R.layout.fragment_hei_register; + } + + protected String getDueTomorrow() { + return "CASE\n" + + " WHEN next_facility_visit_date is not null\n" + + " THEN date(substr(next_facility_visit_date, 7, 4) || '-' || substr(next_facility_visit_date, 4, 2) || '-' || substr(next_facility_visit_date, 1, 2)) = date('now', '+1 day')\n" + + " ELSE\n" + + " date(substr(pmtct_register_date, 7, 4) || '-' || substr(pmtct_register_date, 4, 2) || '-' || substr(pmtct_register_date, 1, 2)) = date('now', '+1 day')\n" + + " END"; + } + + protected String getMissed() { + return "CASE\n" + + " WHEN next_facility_visit_date is not null\n" + + " THEN date(substr(next_facility_visit_date, 7, 4) || '-' || substr(next_facility_visit_date, 4, 2) || '-' || substr(next_facility_visit_date, 1, 2)) < date('now')\n" + + " ELSE\n" + + " date(substr(pmtct_register_date, 7, 4) || '-' || substr(pmtct_register_date, 4, 2) || '-' || substr(pmtct_register_date, 1, 2)) < date('now')\n" + + " END"; + } + + @Override + protected String getDefaultSortQuery() { + return "(coalesce(next_facility_visit_date, pmtct_register_date))"; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PncNoMotherCallDialogFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PncNoMotherCallDialogFragment.java new file mode 100644 index 000000000..f9cfcc2ba --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PncNoMotherCallDialogFragment.java @@ -0,0 +1,84 @@ +package org.smartregister.chw.hf.fragment; + +import static android.view.View.GONE; +import static org.smartregister.util.Utils.getName; + +import android.app.Activity; +import android.app.Fragment; +import android.app.FragmentTransaction; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.anc.fragment.BaseAncWomanCallDialogFragment; +import org.smartregister.chw.anc.listener.BaseAncWomanCallWidgetDialogListener; +import org.smartregister.chw.hf.R; + +public class PncNoMotherCallDialogFragment extends BaseAncWomanCallDialogFragment { + + private static String pncCaregiverNumber; + private static String pncCaregiverName; + private View.OnClickListener listener = null; + + public static PncNoMotherCallDialogFragment launchDialog(Activity activity, String caregiverName, String caregiverPhone) { + PncNoMotherCallDialogFragment dialogFragment = PncNoMotherCallDialogFragment.newInstance(); + FragmentTransaction ft = activity.getFragmentManager().beginTransaction(); + Fragment prev = activity.getFragmentManager().findFragmentByTag(DIALOG_TAG); + pncCaregiverNumber = caregiverPhone; + pncCaregiverName = caregiverName; + if (prev != null) { + ft.remove(prev); + } + ft.addToBackStack(null); + + dialogFragment.show(ft, DIALOG_TAG); + return dialogFragment; + + } + + public static PncNoMotherCallDialogFragment newInstance() { + return new PncNoMotherCallDialogFragment(); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + ViewGroup dialogView = (ViewGroup) inflater.inflate(org.smartregister.chw.opensrp_chw_anc.R.layout.anc_member_call_widget_dialog_fragment, container, false); + setUpPosition(); + TextView callTittleTextView = dialogView.findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.call_title); + TextView callTitle = dialogView.findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.call_anc_woman_title); + + callTittleTextView.setText(R.string.call_child_caregiver); + callTitle.setText(R.string.call_child_caregiver); + + if (listener == null) { + listener = new BaseAncWomanCallWidgetDialogListener(this); + } + + initUI(dialogView); + return dialogView; + } + + private void initUI(ViewGroup rootView) { + + if (StringUtils.isNotBlank(pncCaregiverNumber)) { + TextView ancWomanNameTextView = rootView.findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.call_anc_woman_name); + ancWomanNameTextView.setText(pncCaregiverName); + + TextView ancCallAncWomanPhone = rootView.findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.call_anc_woman_phone); + ancCallAncWomanPhone.setTag(pncCaregiverNumber); + ancCallAncWomanPhone.setText(getName(getCurrentContext().getString(org.smartregister.chw.opensrp_chw_anc.R.string.anc_call), pncCaregiverNumber)); + ancCallAncWomanPhone.setOnClickListener(listener); + } else { + + rootView.findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.layout_anc_woman).setVisibility(GONE); + } + + rootView.findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.anc_layout_family_head).setVisibility(GONE); + rootView.findViewById(org.smartregister.chw.opensrp_chw_anc.R.id.anc_call_close).setOnClickListener(listener); + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PncNoMotherRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PncNoMotherRegisterFragment.java new file mode 100644 index 000000000..949f1d267 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PncNoMotherRegisterFragment.java @@ -0,0 +1,48 @@ +package org.smartregister.chw.hf.fragment; + +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.core.provider.ChwPncRegisterProvider; +import org.smartregister.chw.hf.activity.PncNoMotherProfileActivity; +import org.smartregister.chw.hf.model.PncNoMotherRegisterFragmentModel; +import org.smartregister.chw.hf.presenter.PncNoMotherRegisterFragmentPresenter; +import org.smartregister.chw.hf.provider.HfPncNoMotherRegisterProvider; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.configurableviews.model.View; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; + +import java.util.Set; + +public class PncNoMotherRegisterFragment extends PncRegisterFragment { + + @Override + public String getDueCondition() { + return ""; + } + + @Override + protected String getMainCondition() { + return ""; + } + + @Override + public void initializeAdapter(Set visibleColumns) { + ChwPncRegisterProvider provider = new HfPncNoMotherRegisterProvider(getActivity(), commonRepository(), visibleColumns, registerActionHandler, paginationViewHandler); + clientAdapter = new RecyclerViewPaginatedAdapter(null, provider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + presenter = new PncNoMotherRegisterFragmentPresenter(this, new PncNoMotherRegisterFragmentModel(), null); + } + + @Override + protected void openPncMemberProfile(CommonPersonObjectClient client) { + MemberObject memberObject = new MemberObject(client); + PncNoMotherProfileActivity.startMe(getActivity(), memberObject.getBaseEntityId(), memberObject, client); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PncRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PncRegisterFragment.java index cd06b2209..2f367464b 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PncRegisterFragment.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PncRegisterFragment.java @@ -1,20 +1,184 @@ package org.smartregister.chw.hf.fragment; +import static org.smartregister.chw.hf.utils.Constants.FILTERS_ENABLED; +import static org.smartregister.chw.hf.utils.Constants.FILTER_APPOINTMENT_DATE; +import static org.smartregister.chw.hf.utils.Constants.FILTER_HIV_STATUS; +import static org.smartregister.chw.hf.utils.Constants.FILTER_IS_REFERRED; +import static org.smartregister.chw.hf.utils.Constants.REQUEST_FILTERS; + +import android.app.Activity; +import android.content.Intent; +import android.database.Cursor; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffColorFilter; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.widget.TextView; + +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; +import androidx.loader.content.CursorLoader; +import androidx.loader.content.Loader; + +import org.apache.commons.lang3.StringUtils; import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.util.DBConstants; import org.smartregister.chw.core.fragment.CorePncRegisterFragment; -import org.smartregister.chw.core.model.PncRegisterFragmentModel; import org.smartregister.chw.core.provider.ChwPncRegisterProvider; import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.QueryBuilder; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.AncFilterActivity; import org.smartregister.chw.hf.activity.PncMemberProfileActivity; +import org.smartregister.chw.hf.model.HfPncRegisterFragmentModel; +import org.smartregister.chw.hf.presenter.PncRegisterFragmentPresenter; import org.smartregister.chw.hf.presenter.PncRegisterFragmentPresenter; import org.smartregister.chw.hf.provider.HfPncRegisterProvider; import org.smartregister.chw.hf.utils.HfReferralUtils; import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.commonregistry.CommonRepository; import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import java.text.MessageFormat; +import java.util.List; import java.util.Set; -public class PncRegisterFragment extends CorePncRegisterFragment { +import timber.log.Timber; + +public class PncRegisterFragment extends CorePncRegisterFragment implements android.view.View.OnClickListener { + private String filterHivStatus; + private boolean filterIsReferred = false; + private String appointmentDate; + private boolean filterEnabled = false; + private TextView filterSortTextView; + + @Override + public void setupViews(android.view.View view) { + super.setupViews(view); + + android.view.View sortFilterBarLayout = view.findViewById(org.smartregister.chw.core.R.id.register_sort_filter_bar_layout); + sortFilterBarLayout.setVisibility(android.view.View.GONE); + + android.view.View dueOnlyLayout = view.findViewById(org.smartregister.chw.core.R.id.due_only_layout); + dueOnlyLayout.setVisibility(android.view.View.GONE); + + android.view.View filterSortLayout = view.findViewById(org.smartregister.chw.core.R.id.filter_sort_layout); + filterSortTextView = view.findViewById(org.smartregister.chw.core.R.id.filter_text_view); + filterSortTextView.setText(R.string.filter); + + filterSortLayout.setVisibility(android.view.View.VISIBLE); + filterSortLayout.setOnClickListener(this); + + } + + + private void setTextViewDrawableColor(TextView textView, int color) { + for (Drawable drawable : textView.getCompoundDrawablesRelative()) { + if (drawable != null) { + drawable.setColorFilter(new PorterDuffColorFilter(ContextCompat.getColor(textView.getContext(), color), PorterDuff.Mode.SRC_IN)); + } + } + } + + @Override + public void onClick(android.view.View view) { + if (view.getId() == R.id.filter_sort_layout) { + Intent intent = new Intent(getContext(), AncFilterActivity.class); + intent.putExtra(FILTERS_ENABLED, filterEnabled); + intent.putExtra(FILTER_HIV_STATUS, filterHivStatus); + intent.putExtra(FILTER_IS_REFERRED, filterIsReferred); + intent.putExtra(FILTER_APPOINTMENT_DATE, appointmentDate); + ((Activity) getContext()).startActivityForResult(intent, REQUEST_FILTERS); + } + + } + + public void onFiltersUpdated(int requestCode, @Nullable Intent data) { + if (requestCode == REQUEST_FILTERS) { + if (data != null) { + filterEnabled = data.getBooleanExtra(FILTERS_ENABLED, false); + if (filterEnabled) { + setTextViewDrawableColor(filterSortTextView, R.color.hf_accent_yellow); + filterSortTextView.setText(R.string.filter_applied); + filterHivStatus = data.getStringExtra(FILTER_HIV_STATUS); + filterIsReferred = data.getBooleanExtra(FILTER_IS_REFERRED, false); + appointmentDate = data.getStringExtra(FILTER_APPOINTMENT_DATE); + + filter(searchText(), "", ((PncRegisterFragmentPresenter) presenter()).getDueFilterCondition(filterHivStatus, appointmentDate, filterIsReferred, getContext())); + } else { + setTextViewDrawableColor(filterSortTextView, R.color.grey); + filterSortTextView.setText(R.string.filter); + } + } + } + } + + @Override + public Loader onCreateLoader(int id, final Bundle args) { + if (id == LOADER_ID) { + return new CursorLoader(getActivity()) { + @Override + public Cursor loadInBackground() { + // Count query + final String COUNT = "count_execute"; + if (args != null && args.getBoolean(COUNT)) { + countExecute(); + } + String query = defaultFilterAndSortQuery(); + return commonRepository().rawCustomQueryForAdapter(query); + } + }; + } + return super.onCreateLoader(id, args); + } + + + private String defaultFilterAndSortQuery() { + SmartRegisterQueryBuilder sqb = new SmartRegisterQueryBuilder(mainSelect); + + String query = ""; + StringBuilder customFilter = new StringBuilder(); + if (StringUtils.isNotBlank(filters)) { + customFilter.append(MessageFormat.format(" and ( {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.FIRST_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.LAST_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.MIDDLE_NAME, filters)); + customFilter.append(MessageFormat.format(" or {0}.{1} like ''%{2}%'' ) ", CoreConstants.TABLE_NAME.FAMILY_MEMBER, DBConstants.KEY.UNIQUE_ID, filters)); + + } + if (filterEnabled) { + customFilter.append(((PncRegisterFragmentPresenter) presenter()).getDueFilterCondition(filterHivStatus, appointmentDate, filterIsReferred, getContext())); + } + try { + if (isValidFilterForFts(commonRepository())) { + + String myquery = QueryBuilder.getQuery(joinTables, mainCondition, tablename, customFilter.toString(), clientAdapter, Sortqueries); + List ids = commonRepository().findSearchIds(myquery); + query = sqb.toStringFts(ids, tablename, CommonRepository.ID_COLUMN, + Sortqueries); + query = sqb.Endquery(query); + } else { + sqb.addCondition(customFilter.toString()); + query = sqb.orderbyCondition(Sortqueries); + query = sqb.Endquery(sqb.addlimitandOffset(query, clientAdapter.getCurrentlimit(), clientAdapter.getCurrentoffset())); + + } + } catch (Exception e) { + Timber.e(e); + } + + return query; + } + + private String searchText() { + String searchTextInput; + if (this.getSearchView() == null) { + searchTextInput = ""; + } else { + searchTextInput = this.getSearchView().getText().toString(); + } + return searchTextInput; + } @Override public String getDueCondition() { @@ -35,7 +199,7 @@ protected void initializePresenter() { if (getActivity() == null) { return; } - presenter = new PncRegisterFragmentPresenter(this, new PncRegisterFragmentModel(), null); + presenter = new PncRegisterFragmentPresenter(this, new HfPncRegisterFragmentModel(), null); } @Override @@ -46,6 +210,6 @@ protected void openHomeVisit(CommonPersonObjectClient client) { @Override protected void openPncMemberProfile(CommonPersonObjectClient client) { MemberObject memberObject = new MemberObject(client); - PncMemberProfileActivity.startMe(getActivity(), memberObject.getBaseEntityId()); + PncMemberProfileActivity.startMe(getActivity(), memberObject.getBaseEntityId(), memberObject); } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PrEPRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PrEPRegisterFragment.java new file mode 100644 index 000000000..5b846fcb1 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/PrEPRegisterFragment.java @@ -0,0 +1,28 @@ +package org.smartregister.chw.hf.fragment; + +import org.smartregister.chw.core.fragment.CoreKvpRegisterFragment; +import org.smartregister.chw.core.model.CoreKvpRegisterFragmentModel; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.PrEPProfileActivity; +import org.smartregister.chw.hf.presenter.PrEPRegisterFragmentPresenter; + +public class PrEPRegisterFragment extends CoreKvpRegisterFragment { + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + presenter = new PrEPRegisterFragmentPresenter(this, new CoreKvpRegisterFragmentModel(), null); + } + + @Override + protected int getTitleString() { + return R.string.menu_prep; + } + + @Override + protected void openProfile(String baseEntityId) { + PrEPProfileActivity.startProfile(requireActivity(), baseEntityId); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/ReferralRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/ReferralRegisterFragment.java index 6001b96e4..3dc3cb45f 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/ReferralRegisterFragment.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/ReferralRegisterFragment.java @@ -7,11 +7,14 @@ import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.chw.core.utils.Utils; import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.R; import org.smartregister.chw.hf.activity.ReferralTaskViewActivity; +import org.smartregister.chw.hf.model.ReferralModel; import org.smartregister.chw.hf.presenter.ReferralFragmentPresenter; import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.domain.Task; import org.smartregister.family.util.DBConstants; +import org.smartregister.repository.AllSharedPreferences; public class ReferralRegisterFragment extends BaseReferralRegisterFragment { @@ -26,7 +29,15 @@ public void setClient(CommonPersonObjectClient commonPersonObjectClient) { @Override protected String getMainCondition() { - return "task.business_status = '" + CoreConstants.BUSINESS_STATUS.REFERRED + "' and ec_family_member_search.date_removed is null"; + AllSharedPreferences allSharedPreferences = Utils.getAllSharedPreferences(); + String anm = allSharedPreferences.fetchRegisteredANM(); + String currentLoaction = allSharedPreferences.fetchUserLocalityId(anm); + return "task.business_status = '" + CoreConstants.BUSINESS_STATUS.REFERRED + "' and ec_family_member_search.date_removed is null and task.location <> '" + currentLoaction + "' AND task.focus <> 'LTFU' "; + } + + @Override + protected int getToolBarTitle() { + return R.string.received_referrals; } @Override @@ -41,7 +52,7 @@ public void setCommonPersonObjectClient(CommonPersonObjectClient commonPersonObj @Override protected void initializePresenter() { - referralFragmentPresenter = new ReferralFragmentPresenter(this); + referralFragmentPresenter = new ReferralFragmentPresenter(this, new ReferralModel()); presenter = referralFragmentPresenter; } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/RequestOrdersRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/RequestOrdersRegisterFragment.java new file mode 100644 index 000000000..3efd9a613 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/RequestOrdersRegisterFragment.java @@ -0,0 +1,78 @@ +package org.smartregister.chw.hf.fragment; + +import android.content.Intent; +import android.view.View; + +import com.google.android.material.tabs.TabLayout; + +import org.json.JSONObject; +import org.smartregister.chw.cdp.provider.BaseReceivedOrdersRegisterProvider; +import org.smartregister.chw.cdp.util.Constants; +import org.smartregister.chw.core.fragment.CoreOrdersRegisterFragment; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.OrderRequestDetailsActivity; +import org.smartregister.chw.hf.presenter.RequestOrdersRegisterFragmentPresenter; +import org.smartregister.chw.hf.utils.JsonFormUtils; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; + +import static org.smartregister.chw.core.utils.FormUtils.getStartFormActivity; + +public class RequestOrdersRegisterFragment extends CoreOrdersRegisterFragment { + + @Override + protected int getFragmentTitle() { + return R.string.menu_issue_condoms; + } + + @Override + protected TabLayout getTabLayout(View view) { + TabLayout tabs = view.findViewById(R.id.requests_tab_layout); + tabs.setVisibility(View.VISIBLE); + return tabs; + } + + @Override + protected void refreshSyncProgressSpinner() { + if (syncProgressBar != null) { + syncProgressBar.setVisibility(View.GONE); + } + if (syncButton != null) { + syncButton.setVisibility(View.VISIBLE); + syncButton.setPadding(0, 0, 10, 0); + syncButton.setImageDrawable(context().getDrawable(org.smartregister.cdp.R.drawable.ic_add_white_24)); + syncButton.setOnClickListener(view -> { + startDistributionForm(); + }); + } + } + + private void startDistributionForm() { + try { + JSONObject form = model().getDistributionFormAsJson(Constants.FORMS.CDP_CONDOM_DISTRIBUTION_WITHIN); + Intent startFormIntent = getStartFormActivity(form, null, requireActivity()); + requireActivity().startActivityForResult(startFormIntent, JsonFormUtils.REQUEST_CODE_GET_JSON); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + protected void initializePresenter() { + presenter = new RequestOrdersRegisterFragmentPresenter(this, model()); + } + + @Override + public void showDetails(CommonPersonObjectClient cp) { + OrderRequestDetailsActivity.startMe(requireActivity(), cp); + } + + + @Override + public void initializeAdapter(String tableName) { + BaseReceivedOrdersRegisterProvider registerProvider = new BaseReceivedOrdersRegisterProvider(getActivity(), registerActionHandler, paginationViewHandler); + clientAdapter = new RecyclerViewPaginatedAdapter(null, registerProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/SuccessfulReferralsRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/SuccessfulReferralsRegisterFragment.java new file mode 100644 index 000000000..92be7d775 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/SuccessfulReferralsRegisterFragment.java @@ -0,0 +1,94 @@ +package org.smartregister.chw.hf.fragment; + +import android.os.Handler; +import android.view.View; + +import org.smartregister.chw.core.fragment.BaseReferralRegisterFragment; +import org.smartregister.chw.core.utils.Utils; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.ReferralsDetailsViewActivity; +import org.smartregister.chw.hf.model.LTFUSuccessfulModel; +import org.smartregister.chw.hf.presenter.ReferralFragmentPresenter; +import org.smartregister.chw.hf.provider.ReferralsRegisterProvider; +import org.smartregister.chw.referral.domain.MemberObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; +import org.smartregister.domain.Task; +import org.smartregister.family.util.DBConstants; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.Set; + +public class SuccessfulReferralsRegisterFragment extends BaseReferralRegisterFragment { + + public Handler handler = new Handler(); + private ReferralFragmentPresenter referralFragmentPresenter; + private CommonPersonObjectClient commonPersonObjectClient; + private String taskId; + + @Override + public void setClient(CommonPersonObjectClient commonPersonObjectClient) { + setCommonPersonObjectClient(commonPersonObjectClient); + } + + @Override + protected String getMainCondition() { + AllSharedPreferences allSharedPreferences = Utils.getAllSharedPreferences(); + String anm = allSharedPreferences.fetchRegisteredANM(); + String currentLoaction = allSharedPreferences.fetchUserLocalityId(anm); + return " ec_family_member_search.date_removed is null and task.location = '" + currentLoaction + "' and task.business_status = 'Complete' COLLATE NOCASE "; + } + + @Override + public void initializeAdapter(Set visibleColumns, String tableName) { + ReferralsRegisterProvider referralRegisterProvider = new ReferralsRegisterProvider(getActivity(), registerActionHandler, paginationViewHandler); + clientAdapter = new RecyclerViewPaginatedAdapter(null, referralRegisterProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + protected int getToolBarTitle() { + return R.string.issued_referrals; + } + + @Override + public CommonPersonObjectClient getCommonPersonObjectClient() { + return commonPersonObjectClient; + } + + @Override + public void setCommonPersonObjectClient(CommonPersonObjectClient commonPersonObjectClient) { + this.commonPersonObjectClient = commonPersonObjectClient; + } + + @Override + protected void initializePresenter() { + referralFragmentPresenter = new ReferralFragmentPresenter(this, new LTFUSuccessfulModel()); + presenter = referralFragmentPresenter; + + } + + @Override + protected void onViewClicked(View view) { + CommonPersonObjectClient client = (CommonPersonObjectClient) view.getTag(); + referralFragmentPresenter.setBaseEntityId(Utils.getValue(client.getColumnmaps(), DBConstants.KEY.BASE_ENTITY_ID, false)); + referralFragmentPresenter.fetchClient(); + + Task task = getTask(Utils.getValue(client.getColumnmaps(), "_id", false)); + taskId = task.getIdentifier(); + referralFragmentPresenter.setTasksFocus(task.getFocus()); + goToReferralsDetails(client); + + } + + private Task getTask(String taskId) { + return HealthFacilityApplication.getInstance().getTaskRepository().getTaskByIdentifier(taskId); + } + + private void goToReferralsDetails(CommonPersonObjectClient client) { + handler.postDelayed(() -> ReferralsDetailsViewActivity.startSuccessfulReferralDetailsViewActivity(getActivity(), new MemberObject(client), client, getTask(taskId)), 100); + } + +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/TbFollowupFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/TbFollowupFragment.java new file mode 100644 index 000000000..67384b358 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/TbFollowupFragment.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.fragment; + +import android.widget.TextView; + +import androidx.annotation.Nullable; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.json.JSONException; +import org.smartregister.chw.core.fragment.CoreTbCommunityFollowupRegisterFragment; +import org.smartregister.chw.core.provider.CoreTbProvider; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.TbProfileActivity; +import org.smartregister.chw.hf.activity.TbRegisterActivity; +import org.smartregister.chw.hf.model.TbFollowupFragmentModel; +import org.smartregister.chw.hf.presenter.TbFollowupFragmentPresenter; +import org.smartregister.chw.hf.provider.HfTbFollowupProvider; +import org.smartregister.chw.tb.dao.TbDao; +import org.smartregister.chw.tb.domain.TbMemberObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.configurableviews.model.View; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; + +import java.util.Objects; +import java.util.Set; + +import timber.log.Timber; + +public class TbFollowupFragment extends CoreTbCommunityFollowupRegisterFragment { + + @Override + public void initializeAdapter(@org.jetbrains.annotations.Nullable Set visibleColumns) { + CoreTbProvider tbRegisterProvider = new HfTbFollowupProvider(getActivity(), visibleColumns, registerActionHandler, paginationViewHandler); + clientAdapter = new RecyclerViewPaginatedAdapter(null, tbRegisterProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + public void setupViews(android.view.View view) { + super.setupViews(view); + TextView dueOnlyTextView = view.findViewById(R.id.due_only_text_view); + dueOnlyTextView.setText(getString(R.string.feedback_due_only)); + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + String viewConfigurationIdentifier = null; + try { + viewConfigurationIdentifier = ((TbRegisterActivity) getActivity()).getViewIdentifiers().get(0); + } catch (NullPointerException e) { + Timber.e(e); + } + presenter = new TbFollowupFragmentPresenter(this, new TbFollowupFragmentModel(), viewConfigurationIdentifier); + } + + @Override + protected void openProfile(CommonPersonObjectClient client) { + if (getActivity() != null) + TbProfileActivity.startTbProfileActivity(getActivity(), Objects.requireNonNull(TbDao.getCommunityFollowupMember(client.getCaseId()))); + } + + @Override + protected void openFollowUpVisit(@Nullable TbMemberObject tbMemberObject) { + if (getActivity() != null) { + try { + TbRegisterActivity.startTbFormActivity(getActivity(), tbMemberObject.getBaseEntityId(), CoreConstants.JSON_FORM.getTbFollowupVisit(), (new FormUtils()).getFormJsonFromRepositoryOrAssets(getActivity(), CoreConstants.JSON_FORM.getTbFollowupVisit()).toString()); + } catch (JSONException e) { + Timber.e(e); + } + } + } + +} + + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/TbRegisterFragment.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/TbRegisterFragment.java new file mode 100644 index 000000000..afa5dec5e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/fragment/TbRegisterFragment.java @@ -0,0 +1,70 @@ +package org.smartregister.chw.hf.fragment; + +import androidx.annotation.Nullable; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.json.JSONException; +import org.smartregister.chw.core.fragment.CoreTbRegisterFragment; +import org.smartregister.chw.core.provider.CoreTbProvider; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.activity.TbProfileActivity; +import org.smartregister.chw.hf.activity.TbRegisterActivity; +import org.smartregister.chw.hf.model.TbRegisterFragmentModel; +import org.smartregister.chw.hf.presenter.TbRegisterFragmentPresenter; +import org.smartregister.chw.hf.provider.HfTbRegisterProvider; +import org.smartregister.chw.tb.dao.TbDao; +import org.smartregister.chw.tb.domain.TbMemberObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.configurableviews.model.View; +import org.smartregister.cursoradapter.RecyclerViewPaginatedAdapter; + +import java.util.Objects; +import java.util.Set; + +import timber.log.Timber; + +public class TbRegisterFragment extends CoreTbRegisterFragment { + + @Override + public void initializeAdapter(@org.jetbrains.annotations.Nullable Set visibleColumns) { + CoreTbProvider tbRegisterProvider = new HfTbRegisterProvider(getActivity(), visibleColumns, registerActionHandler, paginationViewHandler); + clientAdapter = new RecyclerViewPaginatedAdapter(null, tbRegisterProvider, context().commonrepository(this.tablename)); + clientAdapter.setCurrentlimit(20); + clientsView.setAdapter(clientAdapter); + } + + @Override + protected void initializePresenter() { + if (getActivity() == null) { + return; + } + String viewConfigurationIdentifier = null; + try { + viewConfigurationIdentifier = ((TbRegisterActivity) getActivity()).getViewIdentifiers().get(0); + } catch (NullPointerException e) { + Timber.e(e); + } + presenter = new TbRegisterFragmentPresenter(this, new TbRegisterFragmentModel(), viewConfigurationIdentifier); + } + + @Override + protected void openProfile(CommonPersonObjectClient client) { + if (getActivity() != null) + TbProfileActivity.startTbProfileActivity(getActivity(), Objects.requireNonNull(TbDao.getMember(client.getCaseId()))); + } + + @Override + protected void openFollowUpVisit(@Nullable TbMemberObject tbMemberObject) { + if (getActivity() != null) { + try { + TbRegisterActivity.startTbFormActivity(getActivity(), tbMemberObject.getBaseEntityId(), CoreConstants.JSON_FORM.getTbFollowupVisit(), (new FormUtils()).getFormJsonFromRepositoryOrAssets(getActivity(), CoreConstants.JSON_FORM.getTbFollowupVisit()).toString()); + } catch (JSONException e) { + Timber.e(e); + } + } + } + +} + + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/holder/IssuedReferralViewHolder.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/holder/IssuedReferralViewHolder.java new file mode 100644 index 000000000..436d53e33 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/holder/IssuedReferralViewHolder.java @@ -0,0 +1,34 @@ +package org.smartregister.chw.hf.holder; + +import android.view.View; +import android.widget.TextView; + +import androidx.annotation.NonNull; + +import org.smartregister.chw.core.holders.ReferralViewHolder; +import org.smartregister.chw.hf.R; + +public class IssuedReferralViewHolder extends ReferralViewHolder { + public TextView patientName; + public TextView textViewVillage; + public TextView textViewGender; + public TextView textReferralStatus; + public TextView textViewService; + public TextView textViewReferralClinic; + public View patientColumn; + public View registerColumns; + public View dueWrapper; + + public IssuedReferralViewHolder(@NonNull View itemView) { + super(itemView); + patientName = itemView.findViewById(R.id.patient_name_age); + textViewVillage = itemView.findViewById(R.id.text_view_village); + textViewGender = itemView.findViewById(R.id.text_view_gender); + textReferralStatus = itemView.findViewById(R.id.text_view_referral_status); + patientColumn = itemView.findViewById(R.id.patient_column); + textViewService = itemView.findViewById(R.id.text_view_service); + textViewReferralClinic = itemView.findViewById(R.id.text_view_referral_clinic); + registerColumns = itemView.findViewById(R.id.register_columns); + dueWrapper = itemView.findViewById(R.id.due_button_wrapper); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AdvancedSearchInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AdvancedSearchInteractor.java new file mode 100644 index 000000000..df536b438 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AdvancedSearchInteractor.java @@ -0,0 +1,156 @@ +package org.smartregister.chw.hf.interactor; + +import android.util.Log; + +import androidx.annotation.VisibleForTesting; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONObject; +import org.smartregister.CoreLibrary; +import org.smartregister.DristhiConfiguration; +import org.smartregister.chw.hf.contract.AdvancedSearchContract; +import org.smartregister.chw.hf.dao.FamilyDao; +import org.smartregister.chw.hf.domain.Entity; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.domain.Response; +import org.smartregister.family.util.AppExecutors; +import org.smartregister.service.HTTPAgent; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AdvancedSearchInteractor implements AdvancedSearchContract.Interactor { + public static final String SEARCH_URL = "/rest/search/search"; + private AppExecutors appExecutors; + private HTTPAgent httpAgent; + private DristhiConfiguration dristhiConfiguration; + + public AdvancedSearchInteractor() { + this(new AppExecutors()); + } + + @VisibleForTesting + AdvancedSearchInteractor(AppExecutors appExecutors) { + this.appExecutors = appExecutors; + } + + @Override + public void search(final Map editMap, boolean isLocal, final AdvancedSearchContract.InteractorCallBack callBack) { + Runnable runnable = new Runnable() { + @Override + public void run() { + final List response; + + if (isLocal) { + String searchText = editMap.get(Constants.DB.FIRST_NAME); + response = localSearch(searchText); + } else { + response = globalSearch(editMap); + } + + appExecutors.mainThread().execute(new Runnable() { + @Override + public void run() { + callBack.onResultsFound(response, isLocal); + } + }); + } + }; + + appExecutors.networkIO().execute(runnable); + } + + private List localSearch(String searchText) { + return FamilyDao.search(searchText); + } + + private List globalSearch(Map map) { + String baseUrl = getDristhiConfiguration().dristhiBaseURL(); + String paramString = ""; + if (!map.isEmpty()) { + for (Map.Entry entry : map.entrySet()) { + String key = entry.getKey(); + String value = entry.getValue(); + + if (StringUtils.isNotBlank(key) && StringUtils.isNotBlank(value)) { + value = urlEncode(value); + String param = key.trim() + "=" + value.trim(); + if (StringUtils.isBlank(paramString)) { + paramString = "?" + param; + } else { + paramString += "&" + param; + } + } + } + } + String uri = baseUrl + SEARCH_URL + paramString; + + Log.d(AdvancedSearchInteractor.class.getCanonicalName(), uri); + Response response = getHttpAgent().fetch(uri); + + GsonBuilder builder = new GsonBuilder(); +// builder.registerTypeAdapter(Date.class, new JsonDeserializer() { +// public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { +// return new Date(json.getAsJsonPrimitive().getAsLong()); +// } +// }); + Gson gson = builder.create(); + + List members = new ArrayList<>(); + try { + JSONArray jsonArray = new JSONArray(response.payload()); + for (int i = 0; i < jsonArray.length(); i++) { + JSONObject objectInArray = jsonArray.getJSONObject(i); + String opensrpId = objectInArray.getJSONObject("identifiers").getString("opensrp_id"); + if (!opensrpId.contains("family")) { + Entity member = gson.fromJson(objectInArray.toString(), Entity.class); + members.add(member); + } + } + } catch (Exception e) { + Timber.e(e); + } + + return members; + } + + public DristhiConfiguration getDristhiConfiguration() { + if (this.dristhiConfiguration == null) { + this.dristhiConfiguration = CoreLibrary.getInstance().context().configuration(); + } + return this.dristhiConfiguration; + } + + public void setDristhiConfiguration(DristhiConfiguration dristhiConfiguration) { + this.dristhiConfiguration = dristhiConfiguration; + } + + private String urlEncode(String value) { + try { + return URLEncoder.encode(value, "UTF-8"); + } catch (UnsupportedEncodingException e) { + return value; + } + } + + public HTTPAgent getHttpAgent() { + if (this.httpAgent == null) { + this.httpAgent = CoreLibrary.getInstance().context().getHttpAgent(); + } + return this.httpAgent; + + } + + public void setHttpAgent(HTTPAgent httpAgent) { + this.httpAgent = httpAgent; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncFirstFacilityVisitInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncFirstFacilityVisitInteractor.java new file mode 100644 index 000000000..c336dc183 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncFirstFacilityVisitInteractor.java @@ -0,0 +1,61 @@ +package org.smartregister.chw.hf.interactor; + +import org.smartregister.chw.anc.contract.BaseAncHomeVisitContract; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.interactor.CoreAncHomeVisitInteractor; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.VisitUtils; + +import java.util.LinkedHashMap; +import java.util.Map; + +import timber.log.Timber; + +public class AncFirstFacilityVisitInteractor extends CoreAncHomeVisitInteractor { + private Flavor flavor; + + public AncFirstFacilityVisitInteractor() { + setFlavor(new AncFirstFacilityVisitInteractorFlv()); + flavor = new AncFirstFacilityVisitInteractorFlv(); + } + + @Override + protected String getEncounterType() { + return Constants.Events.ANC_FIRST_FACILITY_VISIT; + } + + @Override + protected String getTableName() { + return Constants.TableName.ANC_FIRST_FACILITY_VISIT; + } + + @Override + public void calculateActions(BaseAncHomeVisitContract.View view, MemberObject memberObject, BaseAncHomeVisitContract.InteractorCallBack callBack) { + // update the local database incase of manual date adjustment + try { + VisitUtils.processVisits(); + } catch (Exception e) { + Timber.e(e); + } + + final Runnable runnable = () -> { + final LinkedHashMap actionList = new LinkedHashMap<>(); + + try { + + for (Map.Entry entry : flavor.calculateActions(view, memberObject, callBack).entrySet()) { + actionList.put(entry.getKey(), entry.getValue()); + } + } catch (BaseAncHomeVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncFirstFacilityVisitInteractorFlv.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncFirstFacilityVisitInteractorFlv.java new file mode 100644 index 000000000..3081a7e55 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncFirstFacilityVisitInteractorFlv.java @@ -0,0 +1,550 @@ +package org.smartregister.chw.hf.interactor; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormat; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.contract.BaseAncHomeVisitContract; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.anc.util.JsonFormUtils; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.actionhelper.AncBaselineInvestigationAction; +import org.smartregister.chw.hf.actionhelper.AncBirthReviewAction; +import org.smartregister.chw.hf.actionhelper.AncCounsellingAction; +import org.smartregister.chw.hf.actionhelper.AncMalariaInvestigationAction; +import org.smartregister.chw.hf.actionhelper.AncNextFollowupVisitAction; +import org.smartregister.chw.hf.actionhelper.AncObstetricExaminationAction; +import org.smartregister.chw.hf.actionhelper.AncPharmacyAction; +import org.smartregister.chw.hf.actionhelper.AncTbScreeningAction; +import org.smartregister.chw.hf.actionhelper.AncTtVaccinationAction; +import org.smartregister.chw.hf.dao.HfAncDao; +import org.smartregister.chw.hf.repository.HfLocationRepository; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.ContactUtil; +import org.smartregister.chw.hf.utils.HfAncJsonFormUtils; +import org.smartregister.chw.hiv.dao.HivDao; +import org.smartregister.chw.referral.util.JsonFormConstants; +import org.smartregister.domain.Location; +import org.smartregister.domain.LocationTag; + +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import timber.log.Timber; + +public class AncFirstFacilityVisitInteractorFlv implements AncFirstFacilityVisitInteractor.Flavor { + private boolean editMode; + LinkedHashMap actionList = new LinkedHashMap<>(); + + public static JSONObject initializeHealthFacilitiesList(JSONObject form) { + HfLocationRepository locationRepository = new HfLocationRepository(); + List locations = locationRepository.getAllLocationsWithTags(); + if (locations != null && form != null) { + + try { + + JSONArray fields = form.getJSONObject(Constants.JsonFormConstants.STEP1) + .getJSONArray(JsonFormConstants.FIELDS); + + JSONObject referralHealthFacilities = org.smartregister.family.util.JsonFormUtils.getFieldJSONObject(fields, Constants.JsonFormConstants.NAME_OF_HF); + + JSONArray options = referralHealthFacilities.getJSONArray("options"); + String healthFacilityTagName = "Facility"; + for (Location location : locations) { + Set locationTags = location.getLocationTags(); + if (locationTags.iterator().next().getName().equalsIgnoreCase(healthFacilityTagName)) { + JSONObject optionNode = new JSONObject(); + optionNode.put("text", StringUtils.capitalize(location.getProperties().getName())); + optionNode.put("key", StringUtils.capitalize(location.getProperties().getName())); + JSONObject propertyObject = new JSONObject(); + propertyObject.put("presumed-id", location.getProperties().getUid()); + propertyObject.put("confirmed-id", location.getProperties().getUid()); + optionNode.put("property", propertyObject); + + options.put(optionNode); + } + } + } catch (JSONException e) { + Timber.e(e); + } + } + return form; + } + + private static JSONObject setMinFundalHeight(JSONObject form, String baseEntityId, Context context) { + String fundalHeight = HfAncDao.getFundalHeight(baseEntityId); + try { + JSONArray fields = form.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + JSONObject fundalHeightQnObj = null; + for (int i = 0; i < fields.length(); i++) { + if (fields.getJSONObject(i).getString(JsonFormConstants.KEY).equals("fundal_height")) { + fundalHeightQnObj = fields.getJSONObject(i); + break; + } + } + + assert fundalHeightQnObj != null; + JSONObject v_min = fundalHeightQnObj.getJSONObject("v_min"); + v_min.put("value", fundalHeight); + v_min.put("err", context.getString(R.string.anc_fundal_height_min_err) + " " + fundalHeight + " CM"); + + + } catch (JSONException e) { + Timber.e(e); + } + return form; + } + + private static JSONObject firstPregnancyAboveThirtyFive(JSONObject form, MemberObject memberObject, Context context) throws JSONException { + + JSONArray fields = form.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + JSONObject medicalSurgicalHistory = null; + for (int i = 0; i < fields.length(); i++) { + if (fields.getJSONObject(i).getString(JsonFormConstants.KEY).equals("medical_surgical_history")) { + medicalSurgicalHistory = fields.getJSONObject(i); + break; + } + } + + JSONArray options = medicalSurgicalHistory.getJSONArray("options"); + + JSONObject pregnantAtAboveThirtyFive = new JSONObject(); + pregnantAtAboveThirtyFive.put("key", "first_pregnancy_at_or_above_thirty_five"); + pregnantAtAboveThirtyFive.put("text", context.getString(R.string.first_pregnancy_option)); + pregnantAtAboveThirtyFive.put("value", false); + pregnantAtAboveThirtyFive.put("openmrs_entity", "concept"); + pregnantAtAboveThirtyFive.put("openmrs_entity_id", "first_pregnancy_at_or_above_thirty_five"); + + JSONObject none = new JSONObject(); + none.put("key", "none"); + none.put("text", context.getString(R.string.none_option_for_medical_surgical_history)); + none.put("value", false); + none.put("openmrs_entity", "concept"); + none.put("openmrs_entity_id", "none"); + + if (memberObject.getAge() >= 35) { + options.put(pregnantAtAboveThirtyFive); + } + + options.put(none); + + return form; + } + + @Override + public LinkedHashMap calculateActions(BaseAncHomeVisitContract.View view, MemberObject memberObject, BaseAncHomeVisitContract.InteractorCallBack callBack) throws BaseAncHomeVisitAction.ValidationException { + + Context context = view.getContext(); + this.editMode = view.getEditMode(); + + Map> details = null; + // get the preloaded data + if (editMode) { + Visit lastVisit = AncLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), Constants.Events.ANC_FIRST_FACILITY_VISIT); + if (lastVisit != null) { + details = VisitUtils.getVisitGroups(AncLibrary.getInstance().visitDetailsRepository().getVisits(lastVisit.getVisitId())); + } + } + + // get contact + LocalDate lastContact = new DateTime(memberObject.getDateCreated()).toLocalDate(); + boolean isFirst = (StringUtils.isBlank(memberObject.getLastContactVisit())); + LocalDate lastMenstrualPeriod = new LocalDate(); + try { + lastMenstrualPeriod = DateTimeFormat.forPattern("dd-MM-yyyy").parseLocalDate(memberObject.getLastMenstrualPeriod()); + } catch (Exception e) { + Timber.e(e); + } + + + if (StringUtils.isNotBlank(memberObject.getLastContactVisit())) { + lastContact = DateTimeFormat.forPattern("dd-MM-yyyy").parseLocalDate(memberObject.getLastContactVisit()); + } + + Map dateMap = new LinkedHashMap<>(); + + // today is the due date for the very first visit + if (isFirst) { + dateMap.put(0, LocalDate.now()); + } + + dateMap.putAll(ContactUtil.getContactWeeks(isFirst, lastContact, lastMenstrualPeriod)); + + evaluateMedicalAndSurgicalHistory(actionList, details, memberObject, context, callBack); + + return actionList; + } + + private void evaluateMedicalAndSurgicalHistory(LinkedHashMap actionList, + Map> details, + final MemberObject memberObject, + final Context context, + BaseAncHomeVisitContract.InteractorCallBack callBack + ) throws BaseAncHomeVisitAction.ValidationException { + JSONObject obstetricForm = null; + try { + obstetricForm = setMinFundalHeight(FormUtils.getFormUtils().getFormJson(Constants.JsonForm.AncFirstVisit.OBSTETRIC_EXAMINATION), memberObject.getBaseEntityId(), context); + obstetricForm.getJSONObject("global").put("last_menstrual_period", memberObject.getLastMenstrualPeriod()); + if (details != null && !details.isEmpty()) { + HfAncJsonFormUtils.populateForm(obstetricForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + + JSONObject medicalSurgicalHistoryForm = null; + try { + medicalSurgicalHistoryForm = firstPregnancyAboveThirtyFive(FormUtils.getFormUtils().getFormJson(Constants.JsonForm.AncFirstVisit.getMedicalAndSurgicalHistory()), memberObject, context); + + if (HivDao.isRegisteredForHiv(memberObject.getBaseEntityId())) { + JSONArray fields = medicalSurgicalHistoryForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + + JSONObject questionField = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "medical_surgical_history"); + JSONArray options = org.smartregister.util.JsonFormUtils.getJSONArray(questionField, "options"); + JSONObject knownOnArtOption = org.smartregister.util.JsonFormUtils.getFieldJSONObject(options, "known_on_art"); + knownOnArtOption.put(JsonFormUtils.VALUE, true); + + JSONObject ctcNumber = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "ctc_number"); + ctcNumber.put(JsonFormUtils.VALUE, HivDao.getMember(memberObject.getBaseEntityId()).getCtcNumber()); + ctcNumber.put("read_only", true); + } + + if (memberObject.getGravida() != null && !HfAncDao.getParity(memberObject.getBaseEntityId()).isEmpty()) { + JSONArray fields = medicalSurgicalHistoryForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + JSONObject gravida = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "gravida_text"); + JSONObject parity = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "parity_text"); + gravida.put(JsonFormUtils.VALUE, memberObject.getGravida()); + parity.put(JsonFormUtils.VALUE, HfAncDao.getParity(memberObject.getBaseEntityId())); + + if (!HfAncDao.getNumberOfSurvivingChildren(memberObject.getBaseEntityId()).isEmpty()) { + JSONObject no_surv_children = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "no_surv_children_text"); + no_surv_children.put(JsonFormUtils.VALUE, HfAncDao.getNumberOfSurvivingChildren(memberObject.getBaseEntityId())); + } + } + + if (details != null && !details.isEmpty()) { + HfAncJsonFormUtils.populateForm(medicalSurgicalHistoryForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + + BaseAncHomeVisitAction medicalAndSurgicalHistory = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_first_visit_medical_and_surgical_history)) + .withOptional(false) + .withDetails(details) + .withJsonPayload(medicalSurgicalHistoryForm.toString()) + .withFormName(Constants.JsonForm.AncFirstVisit.getMedicalAndSurgicalHistory()) + .withHelper(new AncMedicalAndSurgicalHistoryAction(memberObject, details, callBack)) + .build(); + actionList.put(context.getString(R.string.anc_first_visit_medical_and_surgical_history), medicalAndSurgicalHistory); + + BaseAncHomeVisitAction obstetricExaminationAction = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_first_visit_obstetric_examination)) + .withOptional(true) + .withDetails(details) + .withJsonPayload(obstetricForm.toString()) + .withFormName(Constants.JsonForm.AncFirstVisit.getObstetricExamination()) + .withHelper(new AncObstetricExaminationAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.anc_first_visit_obstetric_examination), obstetricExaminationAction); + + + JSONObject counsellingForm = null; + try { + counsellingForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getCounselling()); + + if (details != null && !details.isEmpty()) { + HfAncJsonFormUtils.populateForm(counsellingForm, details); + } + } catch (Exception e) { + Timber.e(e); + } + + evaluateBaselineInvestigation(memberObject, context, details, false); + + try { + BaseAncHomeVisitAction TbScreening = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.tb_screening_title)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.AncFirstVisit.getTbScreening()) + .withHelper(new AncTbScreeningAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.tb_screening_title), TbScreening); + + } catch ( + BaseAncHomeVisitAction.ValidationException e) { + e.printStackTrace(); + } + JSONObject malariaInvestigationForm = null; + try { + malariaInvestigationForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.AncFirstVisit.getMalariaInvestigation()); + malariaInvestigationForm.getJSONObject("global").put("gestational_age", memberObject.getGestationAge()); + + if (editMode) { + malariaInvestigationForm.getJSONObject("global").put("malaria_preventive_therapy_ipt1", HfAncDao.previousMalariaIptDosage("malaria_preventive_therapy_ipt1", memberObject.getBaseEntityId())); + malariaInvestigationForm.getJSONObject("global").put("malaria_preventive_therapy_ipt2", HfAncDao.previousMalariaIptDosage("malaria_preventive_therapy_ipt2", memberObject.getBaseEntityId())); + malariaInvestigationForm.getJSONObject("global").put("malaria_preventive_therapy_ipt3", HfAncDao.previousMalariaIptDosage("malaria_preventive_therapy_ipt3", memberObject.getBaseEntityId())); + malariaInvestigationForm.getJSONObject("global").put("malaria_preventive_therapy_ipt4", HfAncDao.previousMalariaIptDosage("malaria_preventive_therapy_ipt4", memberObject.getBaseEntityId())); + } else { + malariaInvestigationForm.getJSONObject("global").put("malaria_preventive_therapy_ipt1", HfAncDao.malariaIptDosage("malaria_preventive_therapy_ipt1", memberObject.getBaseEntityId())); + malariaInvestigationForm.getJSONObject("global").put("malaria_preventive_therapy_ipt2", HfAncDao.malariaIptDosage("malaria_preventive_therapy_ipt2", memberObject.getBaseEntityId())); + malariaInvestigationForm.getJSONObject("global").put("malaria_preventive_therapy_ipt3", HfAncDao.malariaIptDosage("malaria_preventive_therapy_ipt3", memberObject.getBaseEntityId())); + malariaInvestigationForm.getJSONObject("global").put("malaria_preventive_therapy_ipt4", HfAncDao.malariaIptDosage("malaria_preventive_therapy_ipt4", memberObject.getBaseEntityId())); + } + if (details != null && !details.isEmpty()) { + HfAncJsonFormUtils.populateForm(malariaInvestigationForm, details); + } + } catch (JSONException e) { + e.printStackTrace(); + } + + try { + BaseAncHomeVisitAction malariaInvestigation = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_visit_malaria_investigation)) + .withOptional(true) + .withDetails(details) + .withJsonPayload(malariaInvestigationForm.toString()) + .withFormName(Constants.JsonForm.AncFirstVisit.getMalariaInvestigation()) + .withHelper(new AncMalariaInvestigationAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.anc_visit_malaria_investigation), malariaInvestigation); + } catch (BaseAncHomeVisitAction.ValidationException e) { + e.printStackTrace(); + } + + JSONObject pharmacyForm = null; + try { + pharmacyForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.AncRecurringVisit.getPharmacy()); + pharmacyForm.getJSONObject("global").put("gestational_age", memberObject.getGestationAge()); + + if (editMode) { + pharmacyForm.getJSONObject("global").put("deworming_given", HfAncDao.wasDewormingGivenPreviously(memberObject.getBaseEntityId())); + } else { + pharmacyForm.getJSONObject("global").put("deworming_given", HfAncDao.isDewormingGiven(memberObject.getBaseEntityId())); + } + if (details != null && !details.isEmpty()) { + HfAncJsonFormUtils.populateForm(pharmacyForm, details); + } + } catch (JSONException e) { + e.printStackTrace(); + } + + try { + BaseAncHomeVisitAction pharmacy = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_recuring_visit_pharmacy)) + .withOptional(true) + .withDetails(details) + .withJsonPayload(pharmacyForm.toString()) + .withFormName(Constants.JsonForm.AncRecurringVisit.getPharmacy()) + .withHelper(new AncPharmacyAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.anc_recuring_visit_pharmacy), pharmacy); + } catch (BaseAncHomeVisitAction.ValidationException e) { + e.printStackTrace(); + } + + + JSONObject ttVaccinationForm = null; + try { + ttVaccinationForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.AncFirstVisit.getTtVaccination()); + if (details != null && !details.isEmpty()) { + HfAncJsonFormUtils.populateForm(ttVaccinationForm, details); + } + } catch (Exception e) { + Timber.e(e); + } + if (HfAncDao.isEligibleForTtVaccination(memberObject.getBaseEntityId())) { + BaseAncHomeVisitAction vaccinationAction = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_first_visit_tt_vaccination)) + .withOptional(true) + .withDetails(details) + .withJsonPayload(ttVaccinationForm.toString()) + .withFormName(Constants.JsonForm.AncFirstVisit.getTtVaccination()) + .withHelper(new AncTtVaccinationAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.anc_first_visit_tt_vaccination), vaccinationAction); + } + + BaseAncHomeVisitAction counsellingAction = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_first_and_recurring_visit_counselling)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getCounselling()) + .withJsonPayload(counsellingForm.toString()) + .withHelper(new AncCounsellingAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.anc_first_and_recurring_visit_counselling), counsellingAction); + + + JSONObject birthReviewForm = initializeHealthFacilitiesList(FormUtils.getFormUtils().getFormJson(Constants.JsonForm.AncRecurringVisit.BIRTH_REVIEW_AND_EMERGENCY_PLAN)); + BaseAncHomeVisitAction birthReview = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_recuring_visit_review_birth_and_emergency_plan)) + .withOptional(true) + .withDetails(details) + .withJsonPayload(birthReviewForm.toString()) + .withFormName(Constants.JsonForm.AncRecurringVisit.getBirthReviewAndEmergencyPlan()) + .withHelper(new AncBirthReviewAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.anc_recuring_visit_review_birth_and_emergency_plan), birthReview); + + BaseAncHomeVisitAction nextFollowupVisitDate = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.next_visit)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getNextFacilityVisitForm()) + .withHelper(new AncNextFollowupVisitAction()) + .build(); + actionList.put(context.getString(R.string.next_visit), nextFollowupVisitDate); + } + + private void evaluateBaselineInvestigation(MemberObject memberObject, Context context, Map> details, boolean isKnownOnART) throws BaseAncHomeVisitAction.ValidationException { + BaseAncHomeVisitAction baselineInvestigationAction = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_first_visit_baseline_investigation)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.AncFirstVisit.getBaselineInvestigation()) + .withHelper(new AncBaselineInvestigationAction(memberObject, isKnownOnART)) + .build(); + actionList.put(context.getString(R.string.anc_first_visit_baseline_investigation), baselineInvestigationAction); + + //Refreshing the baseline Investigation form from details when the action form is recreated during update/edit + if (details != null && details.containsKey("known_on_art")) { + List knownOnArt = details.get("known_on_art"); + if (knownOnArt != null && knownOnArt.size() > 0 && knownOnArt.get(0).getDetails().equals("true")) + refreshBaselineInvestigation(context, true); + } + } + + private class AncMedicalAndSurgicalHistoryAction extends org.smartregister.chw.hf.actionhelper.AncMedicalAndSurgicalHistoryAction { + private final Map> details; + BaseAncHomeVisitContract.InteractorCallBack callBack; + private String medical_and_surgical_history_present; + private HashMap checkObject = new HashMap<>(); + private String visitNumber; + private Context context; + + public AncMedicalAndSurgicalHistoryAction(MemberObject memberObject, Map> details, BaseAncHomeVisitContract.InteractorCallBack callBack) { + super(memberObject); + this.details = details; + this.callBack = callBack; + } + + @Override + public void onJsonFormLoaded(String s, Context context, Map> map) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + checkObject.clear(); + medical_and_surgical_history_present = HfAncJsonFormUtils.getCheckBoxValue(jsonObject, "medical_surgical_history"); + checkObject.put("medical_surgical_history", StringUtils.isNotBlank(medical_and_surgical_history_present)); + checkObject.put("gravida", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "gravida"))); + checkObject.put("parity", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "parity"))); + checkObject.put("no_surv_children", StringUtils.isNotBlank(CoreJsonFormUtils.getValue(jsonObject, "no_surv_children"))); + visitNumber = CoreJsonFormUtils.getValue(jsonObject, "visit_number"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BaseAncHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonPayload); + JSONArray fields = org.smartregister.family.util.JsonFormUtils.fields(jsonObject); + JSONObject medicalSurgicalHistoryCompletionStatus = org.smartregister.family.util.JsonFormUtils.getFieldJSONObject(fields, "medical_surgical_history_completion_status"); + assert medicalSurgicalHistoryCompletionStatus != null; + medicalSurgicalHistoryCompletionStatus.put(com.vijay.jsonwizard.constants.JsonFormConstants.VALUE, org.smartregister.chw.hf.utils.VisitUtils.getActionStatus(checkObject)); + } catch (JSONException e) { + Timber.e(e); + } + + if (actionList.containsKey(context.getString(R.string.anc_first_visit_baseline_investigation))) { + boolean isClientOnArt = isClientOnArt(); + refreshBaselineInvestigation(context, isClientOnArt); + } + + if (jsonObject != null) { + return jsonObject.toString(); + } + return null; + } + + private boolean isClientOnArt() { + if (!StringUtils.isBlank(medical_and_surgical_history_present)) { + return medical_and_surgical_history_present.contains("On ART") || medical_and_surgical_history_present.contains("Mteja yupo kwenye ART tayari"); + } + return false; + } + + @Override + public String evaluateSubTitle() { + String status = org.smartregister.chw.hf.utils.VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(org.smartregister.chw.hf.utils.VisitUtils.Complete)) + return context.getString(R.string.medical_and_surgical_filled); + return ""; + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + String status = org.smartregister.chw.hf.utils.VisitUtils.getActionStatus(checkObject); + if (status.equalsIgnoreCase(org.smartregister.chw.hf.utils.VisitUtils.Complete)) { + return BaseAncHomeVisitAction.Status.COMPLETED; + } + if (status.equalsIgnoreCase(org.smartregister.chw.hf.utils.VisitUtils.Ongoing)) { + return BaseAncHomeVisitAction.Status.PARTIALLY_COMPLETED; + } + return BaseAncHomeVisitAction.Status.PENDING; + } + + @Override + public void onPayloadReceived(BaseAncHomeVisitAction baseAncHomeVisitAction) { + Timber.v("onPayloadReceived"); + } + } + + private void refreshBaselineInvestigation(Context context, boolean isClientOnArt) { + if (actionList.containsKey(context.getString(R.string.anc_first_visit_baseline_investigation))) { + BaseAncHomeVisitAction baselineInvestigation = actionList.get(context.getString(R.string.anc_first_visit_baseline_investigation)); + String baselineInvestigationJsonPayload = baselineInvestigation.getJsonPayload(); + + JSONObject baselineInvestigationJsonPayloadObject = null; + try { + baselineInvestigationJsonPayloadObject = new JSONObject(baselineInvestigationJsonPayload); + baselineInvestigationJsonPayloadObject.getJSONObject("global").put("known_positive", isClientOnArt); + baselineInvestigation.setJsonPayload(baselineInvestigationJsonPayloadObject.toString()); + baselineInvestigation.evaluateStatus(); + } catch (JSONException e) { + e.printStackTrace(); + } + } + } + +} + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncMedicalHistoryInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncMedicalHistoryInteractor.java new file mode 100644 index 000000000..bbcfe39d7 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncMedicalHistoryInteractor.java @@ -0,0 +1,62 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.anc.util.VisitUtils.getVisitDetailsOnly; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitGroups; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitsOnly; + +import android.content.Context; + +import org.smartregister.chw.anc.contract.BaseAncMedicalHistoryContract; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.core.CoreBaseAncMedicalHistoryInteractor; +import org.smartregister.chw.hf.utils.Constants; + +import java.util.ArrayList; +import java.util.List; + +public class AncMedicalHistoryInteractor extends CoreBaseAncMedicalHistoryInteractor { + @Override + public void getMemberHistory(final String memberID, final Context context, final BaseAncMedicalHistoryContract.InteractorCallBack callBack) { + final Runnable runnable = () -> { + + String[] eventTypes = new String[2]; + eventTypes[0] = Constants.Events.ANC_FIRST_FACILITY_VISIT; + eventTypes[1] = Constants.Events.ANC_RECURRING_FACILITY_VISIT; + List visits = getVisits(memberID, eventTypes); + final List all_visits = new ArrayList<>(visits); + + for (Visit visit : visits) { + List child_visits = VisitUtils.getChildVisits(visit.getVisitId()); + all_visits.addAll(child_visits); + } + appExecutors.mainThread().execute(() -> callBack.onDataFetched(all_visits)); + }; + + appExecutors.diskIO().execute(runnable); + } + + public static List getVisits(String memberID, String... eventTypes) { + + List visits = new ArrayList<>(); + if (eventTypes != null && eventTypes.length > 0) { + for (String eventType : eventTypes) { + List visit = getVisitsOnly(memberID, eventType); + visits.addAll(visit); + } + } else { + getVisitsOnly(memberID, Constants.Events.ANC_FIRST_FACILITY_VISIT); + } + + int x = 0; + while (visits.size() > x) { + Visit visit = visits.get(x); + List detailList = getVisitDetailsOnly(visit.getVisitId()); + visits.get(x).setVisitDetails(getVisitGroups(detailList)); + x++; + } + + return visits; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncMemberProfileInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncMemberProfileInteractor.java new file mode 100644 index 000000000..068415670 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncMemberProfileInteractor.java @@ -0,0 +1,78 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.client.utils.constants.JsonFormConstants.STEP1; + +import android.content.Context; + +import org.json.JSONObject; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.util.JsonFormUtils; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.core.dao.ChwNotificationDao; +import org.smartregister.chw.core.interactor.CoreAncMemberProfileInteractor; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.CoreReferralUtils; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.Date; + +import timber.log.Timber; + +public class AncMemberProfileInteractor extends CoreAncMemberProfileInteractor { + + public AncMemberProfileInteractor(Context context) { + super(context); + } + + @Override + protected Date getLastVisitDate(MemberObject memberObject) { + Date lastVisitDate = null; + Visit lastVisit; + lastVisit = AncLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), Constants.Events.ANC_RECURRING_FACILITY_VISIT); + if (lastVisit != null) { + lastVisitDate = lastVisit.getDate(); + } else { + lastVisit = AncLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), Constants.Events.ANC_FIRST_FACILITY_VISIT); + if (lastVisit != null) { + lastVisitDate = lastVisit.getDate(); + } + } + + return lastVisitDate; + } + + public void createPartnerFollowupReferralEvent(AllSharedPreferences allSharedPreferences, String jsonString, String entityID) throws Exception { + Event baseEvent = JsonFormUtils.processJsonForm(allSharedPreferences, CoreReferralUtils.setEntityId(jsonString, entityID), CoreConstants.TABLE_NAME.ANC_DANGER_SIGNS_OUTCOME); + JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + + try { + JSONObject chwLocation = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), STEP1, "chw_location"); + //update sync location to send the referral to the correct targeted chw, + // this is needed for the case of global search client who have moved or clients that may have moved village + if(chwLocation != null){ + String locationId = CoreJsonFormUtils.getSyncLocationUUIDFromDropdown(chwLocation); + baseEvent.setLocationId(locationId); + } + }catch (Exception e){ + Timber.e(e); + } + + String syncLocationId = ChwNotificationDao.getSyncLocationId(baseEvent.getBaseEntityId()); + if (syncLocationId != null) { + // Allows setting the ID for sync purposes + baseEvent.setLocationId(syncLocationId); + } + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(JsonFormUtils.gson.toJson(baseEvent))); + } + + public void createTestingEvent(AllSharedPreferences allSharedPreferences, String jsonString, String entityID) throws Exception { + Event baseEvent = JsonFormUtils.processJsonForm(allSharedPreferences, CoreReferralUtils.setEntityId(jsonString, entityID), CoreConstants.TABLE_NAME.ANC_MEMBER); + JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(JsonFormUtils.gson.toJson(baseEvent))); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncPartnerTestingHistoryInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncPartnerTestingHistoryInteractor.java new file mode 100644 index 000000000..56e5b3533 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncPartnerTestingHistoryInteractor.java @@ -0,0 +1,61 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.anc.util.VisitUtils.getVisitDetailsOnly; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitGroups; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitsOnly; + +import android.content.Context; + +import org.smartregister.chw.anc.contract.BaseAncMedicalHistoryContract; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.core.CoreBaseAncMedicalHistoryInteractor; +import org.smartregister.chw.core.utils.CoreConstants; + +import java.util.ArrayList; +import java.util.List; + +public class AncPartnerTestingHistoryInteractor extends CoreBaseAncMedicalHistoryInteractor { + public static List getVisits(String memberID, String... eventTypes) { + + List visits = new ArrayList<>(); + if (eventTypes != null && eventTypes.length > 0) { + for (String eventType : eventTypes) { + List visit = getVisitsOnly(memberID, eventType); + visits.addAll(visit); + } + } else { + getVisitsOnly(memberID, CoreConstants.EventType.ANC_PARTNER_TESTING); + } + + int x = 0; + while (visits.size() > x) { + Visit visit = visits.get(x); + List detailList = getVisitDetailsOnly(visit.getVisitId()); + visits.get(x).setVisitDetails(getVisitGroups(detailList)); + x++; + } + + return visits; + } + + @Override + public void getMemberHistory(final String memberID, final Context context, final BaseAncMedicalHistoryContract.InteractorCallBack callBack) { + final Runnable runnable = () -> { + + String[] eventTypes = new String[1]; + eventTypes[0] = CoreConstants.EventType.ANC_PARTNER_TESTING; + List visits = getVisits(memberID, eventTypes); + final List all_visits = new ArrayList<>(visits); + + for (Visit visit : visits) { + List child_visits = VisitUtils.getChildVisits(visit.getVisitId()); + all_visits.addAll(child_visits); + } + appExecutors.mainThread().execute(() -> callBack.onDataFetched(all_visits)); + }; + + appExecutors.diskIO().execute(runnable); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncRecurringFacilityVisitInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncRecurringFacilityVisitInteractor.java new file mode 100644 index 000000000..abc6a6f65 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncRecurringFacilityVisitInteractor.java @@ -0,0 +1,58 @@ +package org.smartregister.chw.hf.interactor; + +import org.smartregister.chw.anc.contract.BaseAncHomeVisitContract; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.interactor.CoreAncHomeVisitInteractor; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.VisitUtils; + +import java.util.LinkedHashMap; +import java.util.Map; + +import timber.log.Timber; + +public class AncRecurringFacilityVisitInteractor extends CoreAncHomeVisitInteractor { + private Flavor flavor; + public AncRecurringFacilityVisitInteractor(String baseEntityId) { + setFlavor(new AncRecurringFacilityVisitInteractorFlv(baseEntityId)); + flavor = new AncRecurringFacilityVisitInteractorFlv(baseEntityId); + } + + @Override + protected String getEncounterType() { + return Constants.Events.ANC_RECURRING_FACILITY_VISIT; + } + + @Override + protected String getTableName() { + return Constants.TableName.ANC_RECURRING_FACILITY_VISIT; + } + + @Override + public void calculateActions(BaseAncHomeVisitContract.View view, MemberObject memberObject, BaseAncHomeVisitContract.InteractorCallBack callBack) { + // update the local database incase of manual date adjustment + try { + VisitUtils.processVisits(); + } catch (Exception e) { + Timber.e(e); + } + + final Runnable runnable = () -> { + final LinkedHashMap actionList = new LinkedHashMap<>(); + + try { + + for (Map.Entry entry : flavor.calculateActions(view, memberObject, callBack).entrySet()) { + actionList.put(entry.getKey(), entry.getValue()); + } + } catch (BaseAncHomeVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncRecurringFacilityVisitInteractorFlv.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncRecurringFacilityVisitInteractorFlv.java new file mode 100644 index 000000000..93b94989d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncRecurringFacilityVisitInteractorFlv.java @@ -0,0 +1,510 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.hf.interactor.AncFirstFacilityVisitInteractorFlv.initializeHealthFacilitiesList; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormat; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.contract.BaseAncHomeVisitContract; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.anc.util.AppExecutors; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.actionhelper.AncBirthReviewAction; +import org.smartregister.chw.hf.actionhelper.AncConsultationAction; +import org.smartregister.chw.hf.actionhelper.AncCounsellingAction; +import org.smartregister.chw.hf.actionhelper.AncLabTestAction; +import org.smartregister.chw.hf.actionhelper.AncMalariaInvestigationAction; +import org.smartregister.chw.hf.actionhelper.AncNextFollowupVisitAction; +import org.smartregister.chw.hf.actionhelper.AncPharmacyAction; +import org.smartregister.chw.hf.actionhelper.AncTriageAction; +import org.smartregister.chw.hf.actionhelper.AncTtVaccinationAction; +import org.smartregister.chw.hf.dao.HfAncBirthEmergencyPlanDao; +import org.smartregister.chw.hf.dao.HfAncDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.ContactUtil; +import org.smartregister.chw.hf.utils.HfAncJsonFormUtils; +import org.smartregister.chw.referral.util.JsonFormConstants; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncRecurringFacilityVisitInteractorFlv implements AncFirstFacilityVisitInteractor.Flavor { + String baseEntityId; + LinkedHashMap actionList = new LinkedHashMap<>(); + private JSONObject birthReviewForm; + private boolean editMode; + + public AncRecurringFacilityVisitInteractorFlv(String baseEntityId) { + this.baseEntityId = baseEntityId; + } + + private static String getPregnancyStatusString(String pregnancyStatus, Context context) { + switch (pregnancyStatus) { + case "intrauterine_fetal_death": + return context.getString(R.string.anc_pregnacy_status_fetal_death); + case "spontaneous_abortion": + return context.getString(R.string.anc_pregnacy_status_spontaneous_abortion); + case "viable": + return context.getString(R.string.anc_pregnacy_status_viable); + default: + return ""; + } + } + + private static JSONObject setMinFundalHeight(JSONObject form, String baseEntityId) { + String fundalHeight = HfAncDao.getFundalHeight(baseEntityId); + try { + JSONArray fields = form.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + JSONObject fundalHeightQnObj = null; + for (int i = 0; i < fields.length(); i++) { + if (fields.getJSONObject(i).getString(JsonFormConstants.KEY).equals("fundal_height")) { + fundalHeightQnObj = fields.getJSONObject(i); + break; + } + } + + assert fundalHeightQnObj != null; + JSONObject v_min = fundalHeightQnObj.getJSONObject("v_min"); + v_min.put("value", fundalHeight); + v_min.put("err", "Fundal height must be equal or greater than " + fundalHeight + "CM"); + + + } catch (JSONException e) { + Timber.e(e); + } + return form; + } + + @Override + public LinkedHashMap calculateActions(BaseAncHomeVisitContract.View view, MemberObject memberObject, BaseAncHomeVisitContract.InteractorCallBack callBack) throws BaseAncHomeVisitAction.ValidationException { + Map> details = null; + + this.editMode = view.getEditMode(); + + // get the preloaded data + if (editMode) { + Visit lastVisit = AncLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), Constants.Events.ANC_RECURRING_FACILITY_VISIT); + if (lastVisit != null) { + details = VisitUtils.getVisitGroups(AncLibrary.getInstance().visitDetailsRepository().getVisits(lastVisit.getVisitId())); + } + } + + // get contact + LocalDate lastContact = new DateTime(memberObject.getDateCreated()).toLocalDate(); + boolean isFirst = (StringUtils.isBlank(memberObject.getLastContactVisit())); + LocalDate lastMenstrualPeriod = new LocalDate(); + try { + lastMenstrualPeriod = DateTimeFormat.forPattern("dd-MM-yyyy").parseLocalDate(memberObject.getLastMenstrualPeriod()); + } catch (Exception e) { + Timber.e(e); + } + + + if (StringUtils.isNotBlank(memberObject.getLastContactVisit())) { + lastContact = DateTimeFormat.forPattern("dd-MM-yyyy").parseLocalDate(memberObject.getLastContactVisit()); + } + + Map dateMap = new LinkedHashMap<>(); + + // today is the due date for the very first visit + if (isFirst) { + dateMap.put(0, LocalDate.now()); + } + + dateMap.putAll(ContactUtil.getContactWeeks(isFirst, lastContact, lastMenstrualPeriod)); + + birthReviewForm = initializeHealthFacilitiesList(FormUtils.getFormUtils().getFormJson(Constants.JsonForm.AncRecurringVisit.BIRTH_REVIEW_AND_EMERGENCY_PLAN)); + evaluatePregnancyStatus(view, memberObject, callBack, details); + + return actionList; + } + + private void evaluatePregnancyStatus(BaseAncHomeVisitContract.View view, MemberObject memberObject, BaseAncHomeVisitContract.InteractorCallBack callBack, Map> details + ) throws BaseAncHomeVisitAction.ValidationException { + + Context context = view.getContext(); + + BaseAncHomeVisitAction pregnancyStatus = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_recuring_visit_pregnancy_status)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.AncRecurringVisit.getPregnancyStatus()) + .withHelper(new AncPregnancyStatusAction(view, memberObject, callBack, details)) + .build(); + actionList.put(context.getString(R.string.anc_recuring_visit_pregnancy_status), pregnancyStatus); + + //Refreshing the last menstrual period from from details when the action form is recreated during update/edit + if (details != null && details.containsKey("last_menstrual_period")) { + List lastMenstrualPeriod = details.get("last_menstrual_period"); + if (lastMenstrualPeriod != null && lastMenstrualPeriod.size() > 0) + refreshConsultation(context, lastMenstrualPeriod.get(0).getDetails()); + } + + } + + private class AncPregnancyStatusAction extends org.smartregister.chw.hf.actionhelper.AncPregnancyStatusAction { + Map> details; + BaseAncHomeVisitContract.View view; + MemberObject memberObject; + BaseAncHomeVisitContract.InteractorCallBack callBack; + + + public AncPregnancyStatusAction(BaseAncHomeVisitContract.View view, MemberObject memberObject, BaseAncHomeVisitContract.InteractorCallBack callBack, Map> details) { + super(memberObject); + this.details = details; + this.view = view; + this.memberObject = memberObject; + this.callBack = callBack; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(pregnancy_status)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(view.getContext().getString(R.string.anc_pregnacy_status)); + stringBuilder.append(" "); + stringBuilder.append(getPregnancyStatusString(pregnancy_status, view.getContext())); + + return stringBuilder.toString(); + } + + @Override + public BaseAncHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(pregnancy_status)) + return BaseAncHomeVisitAction.Status.PENDING; + else if (pregnancy_status.equals("viable")) { + return BaseAncHomeVisitAction.Status.COMPLETED; + } else { + return BaseAncHomeVisitAction.Status.PARTIALLY_COMPLETED; + } + } + + @Override + public String postProcess(String s) { + Context context = view.getContext(); + if (pregnancy_status.equals("viable")) { + JSONObject triageForm = null; + try { + triageForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.AncRecurringVisit.TRIAGE); + triageForm.getJSONObject("global").put("last_menstrual_period", memberObject.getLastMenstrualPeriod()); + triageForm.getJSONObject("global").put("current_visit_number", HfAncDao.getVisitNumber(baseEntityId)); + JSONArray fields = triageForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + JSONObject gest_age = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "gest_age"); + if (gest_age != null) { + gest_age.put("value", memberObject.getGestationAge()); + } + if (details != null && !details.isEmpty()) { + HfAncJsonFormUtils.populateForm(triageForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + + JSONObject consultationForm = null; + try { + consultationForm = setMinFundalHeight(FormUtils.getFormUtils().getFormJson(Constants.JsonForm.AncRecurringVisit.CONSULTATION), memberObject.getBaseEntityId()); + consultationForm.getJSONObject("global").put("last_menstrual_period", memberObject.getLastMenstrualPeriod()); + consultationForm.getJSONObject("global").put("client_age", memberObject.getAge()); + String height = HfAncDao.getClientHeight(memberObject.getBaseEntityId()); + consultationForm.getJSONObject("global").put("client_height", height); + if (details != null && !details.isEmpty()) { + HfAncJsonFormUtils.populateForm(consultationForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + + JSONObject pharmacyForm = null; + try { + pharmacyForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.AncRecurringVisit.getPharmacy()); + pharmacyForm.getJSONObject("global").put("gestational_age", memberObject.getGestationAge()); + + if (editMode) { + pharmacyForm.getJSONObject("global").put("deworming_given", HfAncDao.wasDewormingGivenPreviously(memberObject.getBaseEntityId())); + } else { + pharmacyForm.getJSONObject("global").put("deworming_given", HfAncDao.isDewormingGiven(memberObject.getBaseEntityId())); + } + if (details != null && !details.isEmpty()) { + HfAncJsonFormUtils.populateForm(pharmacyForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + + JSONObject malariaInvestigationForm = null; + try { + malariaInvestigationForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.AncRecurringVisit.getMalariaInvestigation()); + malariaInvestigationForm.getJSONObject("global").put("gestational_age", memberObject.getGestationAge()); + malariaInvestigationForm.getJSONObject("global").put("llin_provided", HfAncDao.isLLINProvided(baseEntityId)); + + if (editMode) { + String mpt = "null"; + if (HfAncDao.previousMalariaIptDosage("malaria_preventive_therapy_ipt4", memberObject.getBaseEntityId()).equalsIgnoreCase("null")) { + mpt = HfAncDao.previousMalariaIptDosage("malaria_preventive_therapy_ipt4", memberObject.getBaseEntityId()); + } else if (HfAncDao.previousMalariaIptDosage("malaria_preventive_therapy_ipt3", memberObject.getBaseEntityId()).equalsIgnoreCase("null")) { + mpt = HfAncDao.previousMalariaIptDosage("malaria_preventive_therapy_ipt3", memberObject.getBaseEntityId()); + } else if (HfAncDao.previousMalariaIptDosage("malaria_preventive_therapy_ipt2", memberObject.getBaseEntityId()).equalsIgnoreCase("null")) { + mpt = HfAncDao.previousMalariaIptDosage("malaria_preventive_therapy_ipt2", memberObject.getBaseEntityId()); + } else if (HfAncDao.previousMalariaIptDosage("malaria_preventive_therapy_ipt1", memberObject.getBaseEntityId()).equalsIgnoreCase("null")) { + mpt = HfAncDao.previousMalariaIptDosage("malaria_preventive_therapy_ipt1", memberObject.getBaseEntityId()); + } + malariaInvestigationForm.getJSONObject("global").put("malaria_preventive_therapy", mpt); + } else { + malariaInvestigationForm.getJSONObject("global").put("malaria_preventive_therapy", HfAncDao.malariaLastIptDose(memberObject.getBaseEntityId())); + } + if (details != null && !details.isEmpty()) { + HfAncJsonFormUtils.populateForm(malariaInvestigationForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + + JSONObject labTestForm = null; + try { + String hivStatus = HfAncDao.getHivStatus(baseEntityId); + labTestForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.AncRecurringVisit.LAB_TESTS); + labTestForm.getJSONObject("global").put("gestational_age", memberObject.getGestationAge()); + labTestForm.getJSONObject("global").put("hepatitis_test_complete", HfAncDao.isTestConducted(Constants.DBConstants.ANC_HEPATITIS, baseEntityId)); + labTestForm.getJSONObject("global").put("malaria_test_complete", HfAncDao.isTestConducted(Constants.DBConstants.ANC_MRDT_FOR_MALARIA, baseEntityId)); + labTestForm.getJSONObject("global").put("syphilis_test_complete", HfAncDao.isTestConducted(Constants.DBConstants.ANC_SYPHILIS, baseEntityId)); + labTestForm.getJSONObject("global").put("hiv_test_complete", hivStatus.equals("positive") || HfAncDao.isTestConducted(Constants.DBConstants.ANC_HIV, baseEntityId)); + labTestForm.getJSONObject("global").put("hiv_test_at_32_complete", HfAncDao.isHivTestConductedAtWk32(baseEntityId)); + labTestForm.getJSONObject("global").put("blood_group_complete", HfAncDao.isBloodGroupTestConducted(baseEntityId)); + labTestForm.getJSONObject("global").put("hiv_status", hivStatus); + JSONArray fields = labTestForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + JSONObject hivTestNumberField = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "hiv_test_number"); + hivTestNumberField.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getNextHivTestNumber(memberObject.getBaseEntityId())); + if (HfAncDao.getNextHivTestNumber(memberObject.getBaseEntityId()) == 2) { + JSONObject renameSecondHivAt32 = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "hiv"); + renameSecondHivAt32.put("label", context.getString(R.string.second_hiv_test_results_woman)); + } + if (details != null && !details.isEmpty()) { + HfAncJsonFormUtils.populateForm(labTestForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + + JSONObject counsellingForm = null; + try { + counsellingForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getCounselling()); + + if (details != null && !details.isEmpty()) { + HfAncJsonFormUtils.populateForm(counsellingForm, details); + } + } catch (Exception e) { + Timber.e(e); + } + + JSONObject ttVaccinationForm = null; + try { + ttVaccinationForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.AncFirstVisit.TT_VACCINATION); + if (details != null && !details.isEmpty()) { + HfAncJsonFormUtils.populateForm(ttVaccinationForm, details); + } + } catch (Exception e) { + Timber.e(e); + } + + if (pregnancy_status != null) { + try { + BaseAncHomeVisitAction triage = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_recuring_visit_triage)) + .withOptional(true) + .withDetails(details) + .withJsonPayload(triageForm.toString()) + .withFormName(Constants.JsonForm.AncRecurringVisit.getTriage()) + .withHelper(new MyAncTriageAction(memberObject, context)) + .build(); + actionList.put(context.getString(R.string.anc_recuring_visit_triage), triage); + } catch (BaseAncHomeVisitAction.ValidationException e) { + Timber.e(e); + } + try { + BaseAncHomeVisitAction consultation = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_recuring_visit_cunsultation)) + .withOptional(true) + .withDetails(details) + .withJsonPayload(consultationForm.toString()) + .withFormName(Constants.JsonForm.AncRecurringVisit.getConsultation()) + .withHelper(new AncConsultationAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.anc_recuring_visit_cunsultation), consultation); + } catch (BaseAncHomeVisitAction.ValidationException e) { + Timber.e(e); + } + try { + BaseAncHomeVisitAction malariaInvestigation = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_visit_malaria_investigation)) + .withOptional(true) + .withDetails(details) + .withJsonPayload(malariaInvestigationForm.toString()) + .withFormName(Constants.JsonForm.AncRecurringVisit.getMalariaInvestigation()) + .withHelper(new AncMalariaInvestigationAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.anc_visit_malaria_investigation), malariaInvestigation); + } catch (BaseAncHomeVisitAction.ValidationException e) { + Timber.e(e); + } + try { + BaseAncHomeVisitAction labTests = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_recuring_visit_lab_tests)) + .withOptional(true) + .withDetails(details) + .withJsonPayload(labTestForm.toString()) + .withFormName(Constants.JsonForm.AncRecurringVisit.getLabTests()) + .withHelper(new AncLabTestAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.anc_recuring_visit_lab_tests), labTests); + } catch (BaseAncHomeVisitAction.ValidationException e) { + Timber.e(e); + } + try { + if (HfAncDao.isEligibleForTtVaccination(memberObject.getBaseEntityId())) { + BaseAncHomeVisitAction vaccinationAction = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_first_visit_tt_vaccination)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.AncFirstVisit.getTtVaccination()) + .withJsonPayload(ttVaccinationForm.toString()) + .withHelper(new AncTtVaccinationAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.anc_first_visit_tt_vaccination), vaccinationAction); + } + } catch (BaseAncHomeVisitAction.ValidationException e) { + Timber.e(e); + } + + + try { + BaseAncHomeVisitAction pharmacy = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_recuring_visit_pharmacy)) + .withOptional(true) + .withDetails(details) + .withJsonPayload(pharmacyForm.toString()) + .withFormName(Constants.JsonForm.AncRecurringVisit.getPharmacy()) + .withHelper(new AncPharmacyAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.anc_recuring_visit_pharmacy), pharmacy); + } catch (BaseAncHomeVisitAction.ValidationException e) { + Timber.e(e); + } + + try { + BaseAncHomeVisitAction counselling = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_first_and_recurring_visit_counselling)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getCounselling()) + .withJsonPayload(counsellingForm.toString()) + .withHelper(new AncCounsellingAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.anc_first_and_recurring_visit_counselling), counselling); + } catch (BaseAncHomeVisitAction.ValidationException e) { + Timber.e(e); + } + + if (!HfAncBirthEmergencyPlanDao.isAllFilled(baseEntityId)) { + try { + birthReviewForm.getJSONObject("global").put("delivery_place_identified", HfAncBirthEmergencyPlanDao.isDeliveryPlaceIdentified(baseEntityId)); + birthReviewForm.getJSONObject("global").put("transport_identified", HfAncBirthEmergencyPlanDao.isTransportMethodIdentified(baseEntityId)); + birthReviewForm.getJSONObject("global").put("birth_companion_identified", HfAncBirthEmergencyPlanDao.isBirthCompanionIdentified(baseEntityId)); + birthReviewForm.getJSONObject("global").put("emergency_funds_identified", HfAncBirthEmergencyPlanDao.areEmergencyFundsPrepared(baseEntityId)); + birthReviewForm.getJSONObject("global").put("household_support_identified", HfAncBirthEmergencyPlanDao.isHouseholdSupportIdentified(baseEntityId)); + birthReviewForm.getJSONObject("global").put("blood_donor_identified", HfAncBirthEmergencyPlanDao.isBloodDonorIdentified(baseEntityId)); + } catch (JSONException e) { + Timber.e(e); + } + try { + BaseAncHomeVisitAction birthReview = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.anc_recuring_visit_review_birth_and_emergency_plan)) + .withOptional(true) + .withDetails(details) + .withJsonPayload(birthReviewForm.toString()) + .withFormName(Constants.JsonForm.AncRecurringVisit.getBirthReviewAndEmergencyPlan()) + .withHelper(new AncBirthReviewAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.anc_recuring_visit_review_birth_and_emergency_plan), birthReview); + } catch (BaseAncHomeVisitAction.ValidationException e) { + Timber.e(e); + } + } + + try { + BaseAncHomeVisitAction nextFollowupVisitDate = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.next_visit)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getNextFacilityVisitForm()) + .withHelper(new AncNextFollowupVisitAction()) + .build(); + actionList.put(context.getString(R.string.next_visit), nextFollowupVisitDate); + } catch (BaseAncHomeVisitAction.ValidationException e) { + Timber.e(e); + } + } + } else { + actionList.remove(context.getString(R.string.anc_recuring_visit_triage)); + actionList.remove(context.getString(R.string.anc_recuring_visit_cunsultation)); + actionList.remove(context.getString(R.string.anc_recuring_visit_lab_tests)); + actionList.remove(context.getString(R.string.anc_recuring_visit_pharmacy)); + actionList.remove(context.getString(R.string.anc_first_and_recurring_visit_counselling)); + actionList.remove(context.getString(R.string.anc_visit_malaria_investigation)); + actionList.remove(context.getString(R.string.anc_recuring_visit_review_birth_and_emergency_plan)); + actionList.remove(context.getString(R.string.anc_first_visit_tt_vaccination)); + actionList.remove(context.getString(R.string.next_visit)); + } + new AppExecutors().mainThread().execute(() -> callBack.preloadActions(actionList)); + return super.postProcess(s); + } + } + + private class MyAncTriageAction extends AncTriageAction { + private Context context; + + public MyAncTriageAction(MemberObject memberObject, Context context) { + super(memberObject); + this.context = context; + } + + @Override + public String postProcess(String jsonPayload) { + JSONObject jsonObject = null; + try { + jsonObject = new JSONObject(jsonPayload); + String lastMenstrualPeriod = CoreJsonFormUtils.getValue(jsonObject, "last_menstrual_period"); + refreshConsultation(context, lastMenstrualPeriod); + } catch (Exception e) { + Timber.e(e); + } + return super.postProcess(jsonPayload); + } + } + + private void refreshConsultation(Context context, String lastMenstrualPeriod) { + if (actionList.containsKey(context.getString(R.string.anc_recuring_visit_cunsultation))) { + BaseAncHomeVisitAction consultation = actionList.get(context.getString(R.string.anc_recuring_visit_cunsultation)); + String consultationJsonPayload = consultation.getJsonPayload(); + + JSONObject consultationJsonPayloadObject = null; + try { + consultationJsonPayloadObject = new JSONObject(consultationJsonPayload); + consultationJsonPayloadObject.getJSONObject("global").put("last_menstrual_period", lastMenstrualPeriod); + consultation.setJsonPayload(consultationJsonPayloadObject.toString()); + consultation.evaluateStatus(); + } catch (JSONException e) { + Timber.e(e); + } + } + } + +} + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncRegisterInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncRegisterInteractor.java new file mode 100644 index 000000000..14e57ec57 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncRegisterInteractor.java @@ -0,0 +1,285 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.anc.util.Constants.TABLES.EC_CHILD; +import static org.smartregister.chw.anc.util.DBConstants.KEY.DELIVERY_DATE; +import static org.smartregister.chw.anc.util.DBConstants.KEY.DOB; +import static org.smartregister.chw.anc.util.DBConstants.KEY.LAST_NAME; +import static org.smartregister.chw.anc.util.DBConstants.KEY.MOTHER_ENTITY_ID; +import static org.smartregister.chw.anc.util.DBConstants.KEY.RELATIONAL_ID; +import static org.smartregister.chw.anc.util.DBConstants.KEY.UNIQUE_ID; +import static org.smartregister.chw.anc.util.JsonFormUtils.updateFormField; +import static org.smartregister.chw.hf.utils.Constants.Events.HEI_REGISTRATION; +import static org.smartregister.chw.hf.utils.Constants.HIV_STATUS.POSITIVE; +import static org.smartregister.chw.hf.utils.Constants.JSON_FORM_EXTRA.HIV_STATUS; +import static org.smartregister.chw.hf.utils.Constants.JSON_FORM_EXTRA.RISK_CATEGORY; +import static org.smartregister.chw.hf.utils.Constants.TableName.HEI; +import static org.smartregister.chw.hf.utils.JsonFormUtils.ENCOUNTER_TYPE; +import static org.smartregister.util.JsonFormUtils.getFieldJSONObject; + +import com.vijay.jsonwizard.constants.JsonFormConstants; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.contract.BaseAncRegisterContract; +import org.smartregister.chw.anc.interactor.BaseAncRegisterInteractor; +import org.smartregister.chw.anc.util.Constants; +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.chw.anc.util.JsonFormUtils; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.core.dao.ChwNotificationDao; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.immunization.ImmunizationLibrary; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class AncRegisterInteractor extends BaseAncRegisterInteractor { + private String locationID; + + public static JSONObject populatePNCForm(JSONObject form, JSONArray fields, String familyBaseEntityId, String motherBaseId, String childRiskCategory, String uniqueChildID, String dob, String lastName) { + try { + if (form != null) { + form.put(RELATIONAL_ID, familyBaseEntityId); + form.put(MOTHER_ENTITY_ID, motherBaseId); + JSONObject stepOne = form.getJSONObject(JsonFormUtils.STEP1); + JSONArray jsonArray = stepOne.getJSONArray(JsonFormUtils.FIELDS); + + + JSONObject preLoadObject; + JSONObject jsonObject; + updateFormField(jsonArray, MOTHER_ENTITY_ID, motherBaseId); + updateFormField(jsonArray, RISK_CATEGORY, childRiskCategory); + updateFormField(jsonArray, UNIQUE_ID, uniqueChildID); + updateFormField(jsonArray, DOB, dob); + updateFormField(jsonArray, DELIVERY_DATE, dob); + updateFormField(jsonArray, LAST_NAME, lastName); + for (int i = 0; i < jsonArray.length(); i++) { + jsonObject = jsonArray.getJSONObject(i); + preLoadObject = getFieldJSONObject(fields, jsonObject.optString(JsonFormUtils.KEY)); + if (preLoadObject != null) { + jsonObject.put(JsonFormUtils.VALUE, preLoadObject.opt(JsonFormUtils.VALUE)); + + String type = preLoadObject.getString(JsonFormConstants.TYPE); + if (type.equals(JsonFormConstants.CHECK_BOX)) { + // replace the options + jsonObject.put(JsonFormConstants.OPTIONS_FIELD_NAME, preLoadObject.opt(JsonFormConstants.OPTIONS_FIELD_NAME)); + } + } + } + + return form; + } + } catch (Exception e) { + Timber.e(e); + } + + return null; + } + + @Override + protected String getLocationID() { + if (locationID != null) { + return locationID; + } else { + return super.getLocationID(); + } + + } + + @Override + public void saveRegistration(final String jsonString, final boolean isEditMode, final BaseAncRegisterContract.InteractorCallBack callBack, final String table) { + Runnable runnable = () -> { + // save it + String encounterType = ""; + boolean hasChildren = false; + + try { + JSONObject form = new JSONObject(jsonString); + encounterType = form.optString(Constants.JSON_FORM_EXTRA.ENCOUNTER_TYPE); + String motherBaseId = form.optString(Constants.JSON_FORM_EXTRA.ENTITY_TYPE); + + if (encounterType.equalsIgnoreCase(Constants.EVENT_TYPE.PREGNANCY_OUTCOME) || encounterType.equalsIgnoreCase(org.smartregister.chw.hf.utils.Constants.Events.PMTCT_POST_PNC_REGISTRATION)) { + String tableName = CoreConstants.TABLE_NAME.ANC_PREGNANCY_OUTCOME; + saveRegistration(form.toString(), tableName, motherBaseId); + + JSONArray fields = org.smartregister.util.JsonFormUtils.fields(form); + + JSONObject deliveryDate = getFieldJSONObject(fields, DELIVERY_DATE); + JSONObject famNameObject = getFieldJSONObject(fields, DBConstants.KEY.FAM_NAME); + JSONObject riskCategoryObject = getFieldJSONObject(fields, RISK_CATEGORY); + JSONObject hivStatusObject = getFieldJSONObject(fields, HIV_STATUS); + + String familyName = famNameObject != null ? famNameObject.optString(JsonFormUtils.VALUE) : ""; + + String hivStatus = hivStatusObject != null ? hivStatusObject.optString(JsonFormUtils.VALUE) : ""; + String riskCategory = riskCategoryObject != null ? riskCategoryObject.optString(JsonFormUtils.VALUE) : ""; + + String dob = deliveryDate.optString(JsonFormUtils.VALUE); + hasChildren = StringUtils.isNotBlank(deliveryDate.optString(JsonFormUtils.VALUE)); + + JSONObject familyIdObject = getFieldJSONObject(fields, DBConstants.KEY.RELATIONAL_ID); + String familyBaseEntityId = familyIdObject.getString(JsonFormUtils.VALUE); + + Map> jsonObjectMap = getChildFieldMaps(fields); + + generateAndSaveFormsForEachChild(jsonObjectMap, motherBaseId, hivStatus, riskCategory, familyBaseEntityId, dob, familyName); + + } else if (encounterType.equalsIgnoreCase(Constants.EVENT_TYPE.ANC_REGISTRATION)) { + + JSONArray fields = org.smartregister.util.JsonFormUtils.fields(form); + JSONObject lmp = getFieldJSONObject(fields, DBConstants.KEY.LAST_MENSTRUAL_PERIOD); + boolean hasLmp = StringUtils.isNotBlank(lmp.optString(JsonFormUtils.VALUE)); + + if (!hasLmp) { + JSONObject eddJson = getFieldJSONObject(fields, DBConstants.KEY.EDD); + DateTimeFormatter dateTimeFormat = DateTimeFormat.forPattern("dd-MM-yyyy"); + + LocalDate lmpDate = dateTimeFormat.parseLocalDate(eddJson.optString(JsonFormUtils.VALUE)).plusDays(-280); + lmp.put(JsonFormUtils.VALUE, dateTimeFormat.print(lmpDate)); + } + + saveRegistration(form.toString(), table, motherBaseId); + } else { + saveRegistration(jsonString, table, motherBaseId); + } + } catch (Exception e) { + Timber.e(e); + } + + String finalEncounterType = encounterType; + boolean finalHasChildren = hasChildren; + appExecutors.mainThread().execute(() -> { + try { + callBack.onRegistrationSaved(finalEncounterType, isEditMode, finalHasChildren); + } catch (Exception e) { + e.printStackTrace(); + } + }); + }; + appExecutors.diskIO().execute(runnable); + } + + private Map> getChildFieldMaps(JSONArray fields) { + Map> jsonObjectMap = new HashMap(); + + for (int i = 0; i < fields.length(); i++) { + try { + JSONObject jsonObject = fields.getJSONObject(i); + String key = jsonObject.getString(JsonFormUtils.KEY); + String keySplit = key.substring(key.lastIndexOf("_")); + if (keySplit.matches(".*\\d.*")) { + + String formattedKey = keySplit.replaceAll("[^\\d.]", ""); + if (formattedKey.length() < 10) + continue; + List jsonObjectList = jsonObjectMap.get(formattedKey); + + if (jsonObjectList == null) + jsonObjectList = new ArrayList<>(); + + jsonObjectList.add(jsonObject); + jsonObjectMap.put(formattedKey, jsonObjectList); + } + } catch (Exception e) { + Timber.e(e); + } + } + return jsonObjectMap; + } + + private void saveRegistration(final String jsonString, String table, String motherBaseId) throws Exception { + AllSharedPreferences allSharedPreferences = AncLibrary.getInstance().context().allSharedPreferences(); + Event baseEvent = JsonFormUtils.processJsonForm(allSharedPreferences, jsonString, table); + JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + String syncLocationId = ChwNotificationDao.getSyncLocationId(motherBaseId); + if (syncLocationId != null) { + // Allows setting the ID for sync purposes + baseEvent.setLocationId(syncLocationId); + locationID = syncLocationId; + } + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(baseEvent))); + } + + protected void generateAndSaveFormsForEachChild(Map> jsonObjectMap, String motherBaseId, String motherHivStatus, String childRiskCategory, String familyBaseEntityId, String dob, String familyName) { + + AllSharedPreferences allSharedPreferences = ImmunizationLibrary.getInstance().context().allSharedPreferences(); + + JSONArray childFields; + for (Map.Entry> entry : jsonObjectMap.entrySet()) { + if (entry.getValue().size() > 1) { + childFields = new JSONArray(); + for (JSONObject jsonObject : entry.getValue()) { + try { + String replaceString = jsonObject.getString(JsonFormUtils.KEY); + + JSONObject childField = new JSONObject(jsonObject.toString().replaceAll(replaceString, replaceString.substring(0, replaceString.lastIndexOf("_")))); + + childFields.put(childField); + } catch (JSONException e) { + e.printStackTrace(); + } + } + saveChild(childFields, motherBaseId, motherHivStatus, childRiskCategory, allSharedPreferences, familyBaseEntityId, dob, familyName); + } + } + } + + private void saveChild(JSONArray childFields, String motherBaseId, String motherHivStatus, String childRiskCategory, AllSharedPreferences + allSharedPreferences, String familyBaseEntityId, String dob, String familyName) { + String uniqueChildID = AncLibrary.getInstance().getUniqueIdRepository().getNextUniqueId().getOpenmrsId(); + + if (StringUtils.isNotBlank(uniqueChildID)) { + String childBaseEntityId = JsonFormUtils.generateRandomUUIDString(); + try { + + JSONObject surNameObject = getFieldJSONObject(childFields, DBConstants.KEY.SUR_NAME); + String surName = surNameObject != null ? surNameObject.optString(JsonFormUtils.VALUE) : null; + + String lastName = sameASFamilyNameCheck(childFields) ? familyName : surName; + JSONObject pncForm = getModel().getFormAsJson( + AncLibrary.getInstance().context().applicationContext(), + Constants.FORMS.PNC_CHILD_REGISTRATION, + childBaseEntityId, + getLocationID() + ); + pncForm = populatePNCForm(pncForm, childFields, familyBaseEntityId, motherBaseId, childRiskCategory, uniqueChildID, dob, lastName); + processPncChild(childFields, allSharedPreferences, childBaseEntityId, familyBaseEntityId, motherBaseId, uniqueChildID, lastName, dob); + if (pncForm != null) { + saveRegistration(pncForm.toString(), EC_CHILD, motherBaseId); + saveVaccineEvents(childFields, childBaseEntityId, dob); + } + if (motherHivStatus.equals(POSITIVE) && pncForm != null) { + pncForm.put(ENCOUNTER_TYPE, HEI_REGISTRATION); + saveRegistration(pncForm.toString(), HEI, motherBaseId); + } + + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + private boolean sameASFamilyNameCheck(JSONArray childFields) { + if (childFields.length() > 0) { + JSONObject sameAsFamNameCheck = getFieldJSONObject(childFields, DBConstants.KEY.SAME_AS_FAM_NAME_CHK); + sameAsFamNameCheck = sameAsFamNameCheck != null ? sameAsFamNameCheck : getFieldJSONObject(childFields, DBConstants.KEY.SAME_AS_FAM_NAME); + JSONObject sameAsFamNameObject = sameAsFamNameCheck.optJSONArray(DBConstants.KEY.OPTIONS).optJSONObject(0); + if (sameAsFamNameCheck != null) { + return sameAsFamNameObject.optBoolean(JsonFormUtils.VALUE); + } + } + return false; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncRegistrationDetailsInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncRegistrationDetailsInteractor.java new file mode 100644 index 000000000..34422d9cf --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/AncRegistrationDetailsInteractor.java @@ -0,0 +1,62 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.anc.util.VisitUtils.getVisitDetailsOnly; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitGroups; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitsOnly; + +import android.content.Context; + +import org.smartregister.chw.anc.contract.BaseAncMedicalHistoryContract; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.core.CoreBaseAncMedicalHistoryInteractor; +import org.smartregister.chw.core.utils.CoreConstants; + +import java.util.ArrayList; +import java.util.List; + +public class AncRegistrationDetailsInteractor extends CoreBaseAncMedicalHistoryInteractor { + public static List getVisits(String memberID, String... eventTypes) { + + List visits = new ArrayList<>(); + if (eventTypes != null && eventTypes.length > 0) { + for (String eventType : eventTypes) { + List visit = getVisitsOnly(memberID, eventType); + visits.addAll(visit); + } + } else { + getVisitsOnly(memberID, CoreConstants.EventType.ANC_PREGNANCY_CONFIRMATION); + } + + int x = 0; + while (visits.size() > x) { + Visit visit = visits.get(x); + List detailList = getVisitDetailsOnly(visit.getVisitId()); + visits.get(x).setVisitDetails(getVisitGroups(detailList)); + x++; + } + + return visits; + } + + @Override + public void getMemberHistory(final String memberID, final Context context, final BaseAncMedicalHistoryContract.InteractorCallBack callBack) { + final Runnable runnable = () -> { + + String[] eventTypes = new String[2]; + eventTypes[0] = CoreConstants.EventType.ANC_PREGNANCY_CONFIRMATION; + eventTypes[1] = CoreConstants.EventType.ANC_FOLLOWUP_CLIENT_REGISTRATION; + List visits = getVisits(memberID, eventTypes); + final List all_visits = new ArrayList<>(visits); + + for (Visit visit : visits) { + List child_visits = VisitUtils.getChildVisits(visit.getVisitId()); + all_visits.addAll(child_visits); + } + appExecutors.mainThread().execute(() -> callBack.onDataFetched(all_visits)); + }; + + appExecutors.diskIO().execute(runnable); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/EacFirstVisitInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/EacFirstVisitInteractor.java new file mode 100644 index 000000000..6eb5a4183 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/EacFirstVisitInteractor.java @@ -0,0 +1,60 @@ +package org.smartregister.chw.hf.interactor; + +import org.smartregister.chw.core.interactor.CorePmtctHomeVisitInteractor; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.PmtctVisitUtils; +import org.smartregister.chw.pmtct.contract.BasePmtctHomeVisitContract; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.LinkedHashMap; +import java.util.Map; + +import timber.log.Timber; + +public class EacFirstVisitInteractor extends CorePmtctHomeVisitInteractor { + private final Flavor flavor; + public EacFirstVisitInteractor(){ + setFlavor(new EacFirstVisitInteractorFlv()); + flavor = new EacFirstVisitInteractorFlv(); + } + + + @Override + protected String getEncounterType() { + return Constants.Events.PMTCT_FIRST_EAC_VISIT; + } + + @Override + protected String getTableName() { + return Constants.TableName.PMTCT_EAC_VISIT; + } + + @Override + public void calculateActions(BasePmtctHomeVisitContract.View view, org.smartregister.chw.pmtct.domain.MemberObject memberObject, BasePmtctHomeVisitContract.InteractorCallBack callBack) { + super.calculateActions(view, memberObject, callBack); + try { + PmtctVisitUtils.processVisits(); + } catch (Exception e) { + Timber.e(e); + } + + final Runnable runnable = () -> { + final LinkedHashMap actionList = new LinkedHashMap<>(); + + try { + + for (Map.Entry entry : flavor.calculateActions(view, memberObject, callBack).entrySet()) { + actionList.put(entry.getKey(), entry.getValue()); + } + } catch (BasePmtctHomeVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/EacFirstVisitInteractorFlv.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/EacFirstVisitInteractorFlv.java new file mode 100644 index 000000000..0991d1a54 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/EacFirstVisitInteractorFlv.java @@ -0,0 +1,224 @@ +package org.smartregister.chw.hf.interactor; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.interactor.CorePmtctHomeVisitInteractor; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.actionhelper.PmtctVisitAction; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.PmtctLibrary; +import org.smartregister.chw.pmtct.contract.BasePmtctHomeVisitContract; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.Visit; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; +import org.smartregister.chw.pmtct.util.JsonFormUtils; +import org.smartregister.chw.pmtct.util.VisitUtils; + +import java.text.MessageFormat; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class EacFirstVisitInteractorFlv implements CorePmtctHomeVisitInteractor.Flavor { + @Override + public LinkedHashMap calculateActions(BasePmtctHomeVisitContract.View view, MemberObject memberObject, BasePmtctHomeVisitContract.InteractorCallBack interactorCallBack) throws BasePmtctHomeVisitAction.ValidationException { + LinkedHashMap actionList = new LinkedHashMap<>(); + + Context context = view.getContext(); + + Map> details = null; + // get the preloaded data + if (view.getEditMode()) { + Visit lastVisit = PmtctLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), Constants.Events.PMTCT_FIRST_EAC_VISIT); + if (lastVisit != null) { + details = VisitUtils.getVisitGroups(PmtctLibrary.getInstance().visitDetailsRepository().getVisits(lastVisit.getVisitId())); + } + } + + evaluateEacActions(actionList, details, memberObject, context); + + return actionList; + } + + private void evaluateEacActions(LinkedHashMap actionList, Map> details, MemberObject memberObject, Context context) throws BasePmtctHomeVisitAction.ValidationException { + JSONObject firstEacVisitForm = null; + JSONObject secondEacVisitForm = null; + JSONObject thirdEacVisitForm = null; + + try{ + firstEacVisitForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.EacVisits.PMTCT_EAC_VISIT); + firstEacVisitForm.getJSONObject("global").put("type_of_visit","eac_day_1"); + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(firstEacVisitForm, details); + } + }catch (JSONException e){ + Timber.e(e); + } + try{ + secondEacVisitForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.EacVisits.PMTCT_EAC_VISIT); + secondEacVisitForm.getJSONObject("global").put("type_of_visit","eac_day_2"); + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(secondEacVisitForm, details); + } + }catch (JSONException e){ + Timber.e(e); + } + try{ + thirdEacVisitForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.EacVisits.PMTCT_EAC_VISIT); + thirdEacVisitForm.getJSONObject("global").put("type_of_visit","eac_day_3"); + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(thirdEacVisitForm, details); + } + }catch (JSONException e){ + Timber.e(e); + } + + BasePmtctHomeVisitAction EACFirstVisit = new BasePmtctHomeVisitAction.Builder(context, "EAC Visit - Day One") + .withOptional(false) + .withDetails(details) + .withJsonPayload(firstEacVisitForm.toString()) + .withFormName(Constants.JsonForm.EacVisits.getPmtctEacVisit()) + .withHelper(new EACFirstVisitAction(memberObject)) + .build(); + actionList.put("EAC Visit - Day One", EACFirstVisit); + + BasePmtctHomeVisitAction EACSecondVisit = new BasePmtctHomeVisitAction.Builder(context, "EAC Visit - Day Two") + .withOptional(true) + .withDetails(details) + .withJsonPayload(secondEacVisitForm.toString()) + .withFormName(Constants.JsonForm.EacVisits.getPmtctEacVisit()) + .withHelper(new EACSecondVisitAction(memberObject)) + .build(); + actionList.put("EAC Visit - Day Two", EACSecondVisit); + + BasePmtctHomeVisitAction EACThirdVisit = new BasePmtctHomeVisitAction.Builder(context, "EAC Visit - Day Three") + .withOptional(true) + .withDetails(details) + .withJsonPayload(thirdEacVisitForm.toString()) + .withFormName(Constants.JsonForm.EacVisits.getPmtctEacVisit()) + .withHelper(new EACThirdVisitAction(memberObject)) + .build(); + actionList.put("EAC Visit - Day Three", EACThirdVisit); + } + + private class EACFirstVisitAction extends PmtctVisitAction { + protected MemberObject memberObject; + private String first_visit; + + public EACFirstVisitAction(MemberObject memberObject) { + super(memberObject); + this.memberObject = memberObject; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try{ + JSONObject jsonObject = new JSONObject(jsonPayload); + first_visit = CoreJsonFormUtils.getValue(jsonObject, "eac_day_1"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(first_visit)) + return null; + + return MessageFormat.format("Visit Date: {0}", first_visit); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(first_visit)) { + return BasePmtctHomeVisitAction.Status.PENDING; + } else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + } + + private class EACSecondVisitAction extends PmtctVisitAction { + protected MemberObject memberObject; + private String second_visit; + + public EACSecondVisitAction(MemberObject memberObject) { + super(memberObject); + this.memberObject = memberObject; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try{ + JSONObject jsonObject = new JSONObject(jsonPayload); + second_visit = CoreJsonFormUtils.getValue(jsonObject, "eac_day_2"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(second_visit)) + return null; + + return MessageFormat.format("Visit Date: {0}", second_visit); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(second_visit)) { + return BasePmtctHomeVisitAction.Status.PENDING; + } else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + } + + private class EACThirdVisitAction extends PmtctVisitAction { + protected MemberObject memberObject; + private String third_visit; + + public EACThirdVisitAction(MemberObject memberObject) { + super(memberObject); + this.memberObject = memberObject; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try{ + JSONObject jsonObject = new JSONObject(jsonPayload); + third_visit = CoreJsonFormUtils.getValue(jsonObject, "eac_day_3"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(third_visit)) + return null; + + return MessageFormat.format("Visit Date: {0}", third_visit); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(third_visit)) { + return BasePmtctHomeVisitAction.Status.PENDING; + } else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/EacSecondVisitInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/EacSecondVisitInteractor.java new file mode 100644 index 000000000..b5b14e5a4 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/EacSecondVisitInteractor.java @@ -0,0 +1,60 @@ +package org.smartregister.chw.hf.interactor; + +import org.smartregister.chw.core.interactor.CorePmtctHomeVisitInteractor; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.PmtctVisitUtils; +import org.smartregister.chw.pmtct.contract.BasePmtctHomeVisitContract; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.LinkedHashMap; +import java.util.Map; + +import timber.log.Timber; + +public class EacSecondVisitInteractor extends CorePmtctHomeVisitInteractor { + private final Flavor flavor; + public EacSecondVisitInteractor(){ + setFlavor(new EacSecondVisitInteractorFlv()); + flavor = new EacSecondVisitInteractorFlv(); + } + + + @Override + protected String getEncounterType() { + return Constants.Events.PMTCT_SECOND_EAC_VISIT; + } + + @Override + protected String getTableName() { + return Constants.TableName.PMTCT_EAC_VISIT; + } + + @Override + public void calculateActions(BasePmtctHomeVisitContract.View view, org.smartregister.chw.pmtct.domain.MemberObject memberObject, BasePmtctHomeVisitContract.InteractorCallBack callBack) { + super.calculateActions(view, memberObject, callBack); + try { + PmtctVisitUtils.processVisits(); + } catch (Exception e) { + Timber.e(e); + } + + final Runnable runnable = () -> { + final LinkedHashMap actionList = new LinkedHashMap<>(); + + try { + + for (Map.Entry entry : flavor.calculateActions(view, memberObject, callBack).entrySet()) { + actionList.put(entry.getKey(), entry.getValue()); + } + } catch (BasePmtctHomeVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/EacSecondVisitInteractorFlv.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/EacSecondVisitInteractorFlv.java new file mode 100644 index 000000000..ee33dfe65 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/EacSecondVisitInteractorFlv.java @@ -0,0 +1,224 @@ +package org.smartregister.chw.hf.interactor; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.interactor.CorePmtctHomeVisitInteractor; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.actionhelper.PmtctVisitAction; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.PmtctLibrary; +import org.smartregister.chw.pmtct.contract.BasePmtctHomeVisitContract; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.Visit; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; +import org.smartregister.chw.pmtct.util.JsonFormUtils; +import org.smartregister.chw.pmtct.util.VisitUtils; + +import java.text.MessageFormat; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class EacSecondVisitInteractorFlv implements CorePmtctHomeVisitInteractor.Flavor { + @Override + public LinkedHashMap calculateActions(BasePmtctHomeVisitContract.View view, MemberObject memberObject, BasePmtctHomeVisitContract.InteractorCallBack interactorCallBack) throws BasePmtctHomeVisitAction.ValidationException { + LinkedHashMap actionList = new LinkedHashMap<>(); + + Context context = view.getContext(); + + Map> details = null; + // get the preloaded data + if (view.getEditMode()) { + Visit lastVisit = PmtctLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), Constants.Events.PMTCT_SECOND_EAC_VISIT); + if (lastVisit != null) { + details = VisitUtils.getVisitGroups(PmtctLibrary.getInstance().visitDetailsRepository().getVisits(lastVisit.getVisitId())); + } + } + + evaluateEacActions(actionList, details, memberObject, context); + + return actionList; + } + + private void evaluateEacActions(LinkedHashMap actionList, Map> details, MemberObject memberObject, Context context) throws BasePmtctHomeVisitAction.ValidationException { + JSONObject firstEacVisitForm = null; + JSONObject secondEacVisitForm = null; + JSONObject thirdEacVisitForm = null; + + try{ + firstEacVisitForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.EacVisits.PMTCT_EAC_VISIT); + firstEacVisitForm.getJSONObject("global").put("type_of_visit","eac_month_1"); + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(firstEacVisitForm, details); + } + }catch (JSONException e){ + Timber.e(e); + } + try{ + secondEacVisitForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.EacVisits.PMTCT_EAC_VISIT); + secondEacVisitForm.getJSONObject("global").put("type_of_visit","eac_month_2"); + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(secondEacVisitForm, details); + } + }catch (JSONException e){ + Timber.e(e); + } + try{ + thirdEacVisitForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.EacVisits.PMTCT_EAC_VISIT); + thirdEacVisitForm.getJSONObject("global").put("type_of_visit","eac_month_3"); + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(thirdEacVisitForm, details); + } + }catch (JSONException e){ + Timber.e(e); + } + + BasePmtctHomeVisitAction EACFirstVisit = new BasePmtctHomeVisitAction.Builder(context, "EAC Visit - Month One") + .withOptional(false) + .withDetails(details) + .withJsonPayload(firstEacVisitForm.toString()) + .withFormName(Constants.JsonForm.EacVisits.getPmtctEacVisit()) + .withHelper(new EACFirstVisitAction(memberObject)) + .build(); + actionList.put("EAC Visit - Month One", EACFirstVisit); + + BasePmtctHomeVisitAction EACSecondVisit = new BasePmtctHomeVisitAction.Builder(context, "EAC Visit - Month Two") + .withOptional(true) + .withDetails(details) + .withJsonPayload(secondEacVisitForm.toString()) + .withFormName(Constants.JsonForm.EacVisits.getPmtctEacVisit()) + .withHelper(new EACSecondVisitAction(memberObject)) + .build(); + actionList.put("EAC Visit - Month Two", EACSecondVisit); + + BasePmtctHomeVisitAction EACThirdVisit = new BasePmtctHomeVisitAction.Builder(context, "EAC Visit - Month Three") + .withOptional(true) + .withDetails(details) + .withJsonPayload(thirdEacVisitForm.toString()) + .withFormName(Constants.JsonForm.EacVisits.getPmtctEacVisit()) + .withHelper(new EACThirdVisitAction(memberObject)) + .build(); + actionList.put("EAC Visit - Month Three", EACThirdVisit); + } + + private class EACFirstVisitAction extends PmtctVisitAction { + protected MemberObject memberObject; + private String first_visit; + + public EACFirstVisitAction(MemberObject memberObject) { + super(memberObject); + this.memberObject = memberObject; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try{ + JSONObject jsonObject = new JSONObject(jsonPayload); + first_visit = CoreJsonFormUtils.getValue(jsonObject, "eac_month_1"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(first_visit)) + return null; + + return MessageFormat.format("Visit Date: {0}", first_visit); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(first_visit)) { + return BasePmtctHomeVisitAction.Status.PENDING; + } else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + } + + private class EACSecondVisitAction extends PmtctVisitAction { + protected MemberObject memberObject; + private String second_visit; + + public EACSecondVisitAction(MemberObject memberObject) { + super(memberObject); + this.memberObject = memberObject; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try{ + JSONObject jsonObject = new JSONObject(jsonPayload); + second_visit = CoreJsonFormUtils.getValue(jsonObject, "eac_month_2"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(second_visit)) + return null; + + return MessageFormat.format("Visit Date: {0}", second_visit); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(second_visit)) { + return BasePmtctHomeVisitAction.Status.PENDING; + } else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + } + + private class EACThirdVisitAction extends PmtctVisitAction { + protected MemberObject memberObject; + private String third_visit; + + public EACThirdVisitAction(MemberObject memberObject) { + super(memberObject); + this.memberObject = memberObject; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try{ + JSONObject jsonObject = new JSONObject(jsonPayload); + third_visit = CoreJsonFormUtils.getValue(jsonObject, "eac_month_3"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(third_visit)) + return null; + + return MessageFormat.format("Visit Date: {0}", third_visit); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(third_visit)) { + return BasePmtctHomeVisitAction.Status.PENDING; + } else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HeiFollowupVisitInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HeiFollowupVisitInteractor.java new file mode 100644 index 000000000..41e690404 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HeiFollowupVisitInteractor.java @@ -0,0 +1,67 @@ +package org.smartregister.chw.hf.interactor; + +import org.smartregister.chw.core.interactor.CorePmtctHomeVisitInteractor; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.dao.HeiDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.HeiVisitUtils; +import org.smartregister.chw.pmtct.contract.BasePmtctHomeVisitContract; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; + +import java.util.LinkedHashMap; +import java.util.Map; + +import timber.log.Timber; + +public class HeiFollowupVisitInteractor extends CorePmtctHomeVisitInteractor { + private final Flavor flavor; + + public HeiFollowupVisitInteractor() { + flavor = new HeiFollowupVisitInteractorFlv(); + setFlavor(new HeiFollowupVisitInteractorFlv()); + } + + + @Override + protected String getEncounterType() { + return Constants.Events.HEI_FOLLOWUP; + } + + @Override + protected String getTableName() { + return CoreConstants.TABLE_NAME.HEI; + } + + @Override + public void calculateActions(BasePmtctHomeVisitContract.View view, MemberObject memberObject, BasePmtctHomeVisitContract.InteractorCallBack callBack) { + super.calculateActions(view, memberObject, callBack); + try { + HeiVisitUtils.processVisits(); + } catch (Exception e) { + Timber.e(e); + } + + final Runnable runnable = () -> { + final LinkedHashMap actionList = new LinkedHashMap<>(); + + try { + + for (Map.Entry entry : flavor.calculateActions(view, memberObject, callBack).entrySet()) { + actionList.put(entry.getKey(), entry.getValue()); + } + } catch (BasePmtctHomeVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + @Override + public MemberObject getMemberClient(String memberID) { + return HeiDao.getMember(memberID); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HeiFollowupVisitInteractorFlv.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HeiFollowupVisitInteractorFlv.java new file mode 100644 index 000000000..fff32d375 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HeiFollowupVisitInteractorFlv.java @@ -0,0 +1,397 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.core.utils.Utils.getCommonPersonObjectClient; +import static org.smartregister.chw.core.utils.Utils.getDuration; +import static org.smartregister.chw.hf.interactor.AncFirstFacilityVisitInteractorFlv.initializeHealthFacilitiesList; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.util.AppExecutors; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.BuildConfig; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.actionhelper.HeiAntibodyTestAction; +import org.smartregister.chw.hf.actionhelper.HeiArvPrescriptionHighOrLowRiskInfantAction; +import org.smartregister.chw.hf.actionhelper.HeiArvPrescrptionHighRiskInfantAction; +import org.smartregister.chw.hf.actionhelper.HeiCtxAction; +import org.smartregister.chw.hf.actionhelper.HeiDnaPcrTestAction; +import org.smartregister.chw.hf.actionhelper.PmtctNextFollowupVisitAction; +import org.smartregister.chw.hf.dao.HeiDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.PmtctLibrary; +import org.smartregister.chw.pmtct.contract.BasePmtctHomeVisitContract; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.Visit; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; +import org.smartregister.chw.pmtct.util.JsonFormUtils; +import org.smartregister.chw.pmtct.util.VisitUtils; +import org.smartregister.chw.referral.util.JsonFormConstants; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.domain.Location; +import org.smartregister.domain.LocationTag; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import timber.log.Timber; + +public class HeiFollowupVisitInteractorFlv implements PmtctFollowupVisitInteractor.Flavor { + LinkedHashMap actionList = new LinkedHashMap<>(); + Map> details = null; + BasePmtctHomeVisitContract.InteractorCallBack callBack; + + private static JSONArray setChildNodes(List locations, String parentLocationId, String parentTagName) { + JSONArray nodes = new JSONArray(); + ArrayList locationHierarchyTags = new ArrayList<>(Arrays.asList(BuildConfig.LOCATION_HIERACHY)); + + for (Location location : locations) { + Set locationTags = location.getLocationTags(); + String childTagName = locationHierarchyTags.get(locationHierarchyTags.indexOf(parentTagName) + 1); + if (locationTags.iterator().next().getName().equalsIgnoreCase(childTagName) && location.getProperties().getParentId().equals(parentLocationId)) { + JSONObject childNode = new JSONObject(); + try { + childNode.put("name", StringUtils.capitalize(location.getProperties().getName())); + childNode.put("key", StringUtils.capitalize(location.getProperties().getName())); + + JSONArray childNodes = setChildNodes(locations, location.getId(), childTagName); + if (childNodes != null) + childNode.put("nodes", childNodes); + + nodes.put(childNode); + } catch (JSONException e) { + e.printStackTrace(); + } + } + } + if (nodes.length() > 0) { + return nodes; + } else return null; + + } + + @Override + public LinkedHashMap calculateActions(BasePmtctHomeVisitContract.View view, MemberObject memberObject, BasePmtctHomeVisitContract.InteractorCallBack interactorCallBack) throws BasePmtctHomeVisitAction.ValidationException { + this.callBack = interactorCallBack; + Context context = view.getContext(); + // get the preloaded data + if (view.getEditMode()) { + Visit lastVisit = PmtctLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), Constants.Events.HEI_FOLLOWUP); + if (lastVisit != null) { + details = VisitUtils.getVisitGroups(PmtctLibrary.getInstance().visitDetailsRepository().getVisits(lastVisit.getVisitId())); + } + } + + evaluateHEIActions(actionList, details, memberObject, context); + + return actionList; + } + + private void evaluateHEIActions(LinkedHashMap actionList, Map> details, MemberObject memberObject, Context context) throws BasePmtctHomeVisitAction.ValidationException { + + JSONObject baselineInvestigationForm = initializeHealthFacilitiesList(FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getHeiBaselineInvestigation())); + + JSONArray fields = null; + try { + fields = baselineInvestigationForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + //update visit number + JSONObject visitNumber = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "visit_number"); + visitNumber.put(JsonFormUtils.VALUE, HeiDao.getVisitNumber(memberObject.getBaseEntityId())); + } catch (JSONException e) { + Timber.e(e); + } + + evaluateBaselineInvestigationAction(actionList, details, memberObject, context, baselineInvestigationForm); + } + + private void evaluateBaselineInvestigationAction(LinkedHashMap actionList, Map> details, MemberObject memberObject, Context context, JSONObject baselineInvestigationForm) throws BasePmtctHomeVisitAction.ValidationException { + BasePmtctHomeVisitAction BaselineInvestigation = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.anc_first_visit_baseline_investigation)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.getHeiBaselineInvestigation()) + .withJsonPayload(baselineInvestigationForm.toString()) + .withHelper(new HeiBaselineInvestigationAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.anc_first_visit_baseline_investigation), BaselineInvestigation); + } + + private void evaluateDnaPcrAction(LinkedHashMap actionList, Map> details, MemberObject memberObject, Context context, JSONObject dnaPcrForm) throws BasePmtctHomeVisitAction.ValidationException { + BasePmtctHomeVisitAction DNAPCRTest = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.dna_pcr_sample_collection)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getHeiDnaPcrSampleCollection()) + .withJsonPayload(dnaPcrForm.toString()) + .withHelper(new HeiDnaPcrTestAction(memberObject)) + .build(); + if (HeiDao.isEligibleForDnaCprHivTest(memberObject.getBaseEntityId())) + actionList.put(context.getString(R.string.dna_pcr_sample_collection), DNAPCRTest); + } + + private void evaluateAntibodyTest(LinkedHashMap actionList, Map> details, MemberObject memberObject, Context context) throws BasePmtctHomeVisitAction.ValidationException { + BasePmtctHomeVisitAction AntibodyTest = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.antibody_test_result)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.getHeiHivTestResults()) + .withHelper(new HeiAntibodyTestAction(memberObject)) + .build(); + if (HeiDao.isEligibleForAntiBodiesHivTest(memberObject.getBaseEntityId())) + actionList.put(context.getString(R.string.antibody_test_result), AntibodyTest); + } + + private void evaluateCtxPrescription(LinkedHashMap actionList, Map> details, MemberObject memberObject, Context context, JSONObject ctxPrescriptionForm) throws BasePmtctHomeVisitAction.ValidationException { + BasePmtctHomeVisitAction CtxPrescription = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.ctx_prescription_title)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.getHeiCtxPrescription()) + .withJsonPayload(ctxPrescriptionForm.toString()) + .withHelper(new HeiCtxAction(memberObject)) + .build(); + if (HeiDao.isEligibleForCtx(memberObject.getBaseEntityId())) + actionList.put(context.getString(R.string.ctx_prescription_title), CtxPrescription); + } + + private void evaluateArvPrescriptionHighRisk(LinkedHashMap actionList, Map> details, MemberObject memberObject, Context context, JSONObject arvPrescriptionForHighRiskForm) throws BasePmtctHomeVisitAction.ValidationException { + BasePmtctHomeVisitAction ARVPrescriptionHighRisk = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.arv_prescription_azt_and_nvp)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.getHeiArvPrescriptionHighRiskInfant()) + .withJsonPayload(arvPrescriptionForHighRiskForm.toString()) + .withHelper(new HeiArvPrescrptionHighRiskInfantAction(memberObject)) + .build(); + if (HeiDao.isEligibleForArvPrescriptionForHighRisk(memberObject.getBaseEntityId())) + actionList.put(context.getString(R.string.arv_prescription_azt_and_nvp), ARVPrescriptionHighRisk); + } + + private void evaluateArvPrescription(LinkedHashMap actionList, Map> details, MemberObject memberObject, Context context, JSONObject arvPrescriptionForHighAndLowRiskForm) throws BasePmtctHomeVisitAction.ValidationException { + BasePmtctHomeVisitAction ARVPrescriptionHighAndLowRisk = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.arv_prescription_nvp)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.getHeiArvPrescriptionHighOrLowRiskInfant()) + .withJsonPayload(arvPrescriptionForHighAndLowRiskForm.toString()) + .withHelper(new HeiArvPrescriptionHighOrLowRiskInfantAction(memberObject)) + .build(); + if (HeiDao.isEligibleForArvPrescriptionForHighAndLowRisk(memberObject.getBaseEntityId())) + actionList.put(context.getString(R.string.arv_prescription_nvp), ARVPrescriptionHighAndLowRisk); + } + + private void evaluateNextVisitAction(LinkedHashMap actionList, Map> details, Context context, JSONObject nextVisitForm) throws BasePmtctHomeVisitAction.ValidationException { + BasePmtctHomeVisitAction NextFollowupVisitDate = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.next_visit)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.getNextFacilityVisitForm()) + .withJsonPayload(nextVisitForm.toString()) + .withHelper(new PmtctNextFollowupVisitAction()) + .build(); + actionList.put(context.getString(R.string.next_visit), NextFollowupVisitDate); + } + + private class HeiBaselineInvestigationAction implements BasePmtctHomeVisitAction.PmtctHomeVisitActionHelper { + protected MemberObject memberObject; + private String jsonPayload; + private String visit_type; + private Context context; + private String subTitle; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + + public HeiBaselineInvestigationAction(MemberObject memberObject) { + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (JSONException e) { + e.printStackTrace(); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + visit_type = CoreJsonFormUtils.getValue(jsonObject, "followup_status"); + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + if (!visit_type.equalsIgnoreCase("transfer_out") && !visit_type.equalsIgnoreCase("lost_to_followup")) { + JSONObject dnaPcrForm = null; + try { + dnaPcrForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getHeiDnaPcrSampleCollection()); + + JSONArray fields = dnaPcrForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + //update fields + JSONObject testAtAge = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "test_at_age"); + testAtAge.put(JsonFormUtils.VALUE, HeiDao.getNextHivTestAge(memberObject.getBaseEntityId())); + + JSONObject actualAge = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "actual_age"); + CommonPersonObjectClient client = getCommonPersonObjectClient(memberObject.getBaseEntityId()); + actualAge.put(JsonFormUtils.VALUE, getDuration(org.smartregister.family.util.Utils.getValue(client.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.DOB, false))); + + String heiNumber = HeiDao.getHeiNumber(memberObject.getBaseEntityId()); + if (!StringUtils.isBlank(heiNumber)) { + JSONObject sampleId = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "sample_id"); + sampleId.put(JsonFormUtils.VALUE, heiNumber); + sampleId.put("editable", false); + sampleId.put("read_only", true); + } + + //loads details to the form + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(dnaPcrForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + + + JSONObject arvPrescriptionForHighAndLowRiskForm = null; + try { + arvPrescriptionForHighAndLowRiskForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getHeiArvPrescriptionHighOrLowRiskInfant()); + + JSONArray fields = arvPrescriptionForHighAndLowRiskForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + //update visit number + JSONObject visitNumber = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "visit_number"); + visitNumber.put(JsonFormUtils.VALUE, HeiDao.getVisitNumber(memberObject.getBaseEntityId())); + + //loads details to the form + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(arvPrescriptionForHighAndLowRiskForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + + JSONObject arvPrescriptionForHighRiskForm = null; + try { + arvPrescriptionForHighRiskForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getHeiArvPrescriptionHighRiskInfant()); + + JSONArray fields = arvPrescriptionForHighRiskForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + //update visit number + JSONObject visitNumber = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "visit_number"); + visitNumber.put(JsonFormUtils.VALUE, HeiDao.getVisitNumber(memberObject.getBaseEntityId())); + + //loads details to the form + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(arvPrescriptionForHighRiskForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + + JSONObject ctxPrescriptionForm = null; + try { + ctxPrescriptionForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getHeiCtxPrescription()); + + JSONArray fields = ctxPrescriptionForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + //update visit number + JSONObject visitNumber = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "visit_number"); + visitNumber.put(JsonFormUtils.VALUE, HeiDao.getVisitNumber(memberObject.getBaseEntityId())); + + //loads details to the form + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(ctxPrescriptionForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + + JSONObject nextVisitForm = null; + try { + nextVisitForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getNextFacilityVisitForm()); + + JSONArray fields = nextVisitForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + //update visit number + JSONObject visitNumber = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "visit_number"); + visitNumber.put(JsonFormUtils.VALUE, HeiDao.getVisitNumber(memberObject.getBaseEntityId())); + + //loads details to the form + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(nextVisitForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + try { + evaluateDnaPcrAction(actionList, details, memberObject, context, dnaPcrForm); + evaluateAntibodyTest(actionList, details, memberObject, context); + evaluateCtxPrescription(actionList, details, memberObject, context, ctxPrescriptionForm); + evaluateArvPrescriptionHighRisk(actionList, details, memberObject, context, arvPrescriptionForHighRiskForm); + evaluateArvPrescription(actionList, details, memberObject, context, arvPrescriptionForHighAndLowRiskForm); + evaluateNextVisitAction(actionList, details, context, nextVisitForm); + } catch (Exception e) { + Timber.e(e); + } + } else { + actionList.remove(context.getString(R.string.dna_pcr_sample_collection)); + actionList.remove(context.getString(R.string.antibody_test_result)); + actionList.remove(context.getString(R.string.ctx_prescription_title)); + actionList.remove(context.getString(R.string.arv_prescription_azt_and_nvp)); + actionList.remove(context.getString(R.string.arv_prescription_nvp)); + actionList.remove(context.getString(R.string.next_visit)); + } + new AppExecutors().mainThread().execute(() -> callBack.preloadActions(actionList)); + return s; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(visit_type)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(context.getString(R.string.baseline_investigation_conducted)); + + return stringBuilder.toString(); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(visit_type)) + return BasePmtctHomeVisitAction.Status.PENDING; + else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } + } + + +} + + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HeiMedicalHistoryInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HeiMedicalHistoryInteractor.java new file mode 100644 index 000000000..90d948bef --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HeiMedicalHistoryInteractor.java @@ -0,0 +1,61 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.anc.util.VisitUtils.getVisitDetailsOnly; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitGroups; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitsOnly; + +import android.content.Context; + +import org.smartregister.chw.anc.contract.BaseAncMedicalHistoryContract; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.core.CoreBaseAncMedicalHistoryInteractor; +import org.smartregister.chw.hf.utils.Constants; + +import java.util.ArrayList; +import java.util.List; + +public class HeiMedicalHistoryInteractor extends CoreBaseAncMedicalHistoryInteractor { + public static List getVisits(String memberID, String... eventTypes) { + + List visits = new ArrayList<>(); + if (eventTypes != null && eventTypes.length > 0) { + for (String eventType : eventTypes) { + List visit = getVisitsOnly(memberID, eventType); + visits.addAll(visit); + } + } else { + getVisitsOnly(memberID, Constants.Events.HEI_FOLLOWUP); + } + + int x = 0; + while (visits.size() > x) { + Visit visit = visits.get(x); + List detailList = getVisitDetailsOnly(visit.getVisitId()); + visits.get(x).setVisitDetails(getVisitGroups(detailList)); + x++; + } + + return visits; + } + + @Override + public void getMemberHistory(final String memberID, final Context context, final BaseAncMedicalHistoryContract.InteractorCallBack callBack) { + final Runnable runnable = () -> { + + String[] eventTypes = new String[2]; + eventTypes[0] = Constants.Events.HEI_FOLLOWUP; + List visits = getVisits(memberID, eventTypes); + final List all_visits = new ArrayList<>(visits); + + for (Visit visit : visits) { + List child_visits = VisitUtils.getChildVisits(visit.getVisitId()); + all_visits.addAll(child_visits); + } + appExecutors.mainThread().execute(() -> callBack.onDataFetched(all_visits)); + }; + + appExecutors.diskIO().execute(runnable); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HeiProfileInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HeiProfileInteractor.java new file mode 100644 index 000000000..7bd5731e5 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HeiProfileInteractor.java @@ -0,0 +1,65 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.client.utils.constants.JsonFormConstants.STEP1; + +import org.json.JSONObject; +import org.smartregister.chw.anc.util.JsonFormUtils; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.core.dao.ChwNotificationDao; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.CoreReferralUtils; +import org.smartregister.chw.pmtct.contract.PmtctProfileContract; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.interactor.BasePmtctProfileInteractor; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.repository.AllSharedPreferences; + +import timber.log.Timber; + +public class HeiProfileInteractor extends BasePmtctProfileInteractor { + + @Override + public void refreshProfileInfo(MemberObject memberObject, PmtctProfileContract.InteractorCallBack callback) { + super.refreshProfileInfo(memberObject, callback); + } + + public void createHeiCommunityFollowupReferralEvent(AllSharedPreferences allSharedPreferences, String jsonString, String entityID) { + Event baseEvent = JsonFormUtils.processJsonForm(allSharedPreferences, CoreReferralUtils.setEntityId(jsonString, entityID), CoreConstants.TABLE_NAME.PMTCT_COMMUNITY_FOLLOWUP); + JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + try { + JSONObject motherChampionLocation = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), STEP1, "mother_champion_location"); + //update sync location to send the referral to the correct targeted chw, + // this is needed for the case of global search client who have moved or clients that may have moved village + if(motherChampionLocation != null){ + String locationId = CoreJsonFormUtils.getSyncLocationUUIDFromDropdown(motherChampionLocation); + baseEvent.setLocationId(locationId); + } + }catch (Exception e){ + Timber.e(e); + } + + try { + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(JsonFormUtils.gson.toJson(baseEvent))); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void createHeiNumberRegistrationEvent(AllSharedPreferences allSharedPreferences, String jsonString, String entityID) { + Event baseEvent = JsonFormUtils.processJsonForm(allSharedPreferences, CoreReferralUtils.setEntityId(jsonString, entityID), CoreConstants.TABLE_NAME.HEI); + JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + String syncLocationId = ChwNotificationDao.getSyncLocationId(baseEvent.getBaseEntityId()); + if (syncLocationId != null) { + // Allows setting the ID for sync purposes + baseEvent.setLocationId(syncLocationId); + } + + try { + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(JsonFormUtils.gson.toJson(baseEvent))); + } catch (Exception e) { + e.printStackTrace(); + } + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfAllClientsRegisterInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfAllClientsRegisterInteractor.java new file mode 100644 index 000000000..089f29c5a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfAllClientsRegisterInteractor.java @@ -0,0 +1,160 @@ +package org.smartregister.chw.hf.interactor; + +import androidx.annotation.NonNull; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Triple; +import org.jetbrains.annotations.NotNull; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.clientandeventmodel.Client; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.domain.UniqueId; +import org.smartregister.family.FamilyLibrary; +import org.smartregister.family.util.Constants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.family.util.Utils; +import org.smartregister.opd.contract.OpdRegisterActivityContract; +import org.smartregister.opd.interactor.BaseOpdRegisterActivityInteractor; +import org.smartregister.opd.pojo.OpdEventClient; +import org.smartregister.opd.pojo.RegisterParams; +import org.smartregister.opd.utils.OpdJsonFormUtils; +import org.smartregister.repository.AllSharedPreferences; +import org.smartregister.repository.EventClientRepository; +import org.smartregister.sync.helper.ECSyncHelper; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import timber.log.Timber; + +public class HfAllClientsRegisterInteractor extends BaseOpdRegisterActivityInteractor { + + @Override + public void getNextUniqueId(final Triple triple, final OpdRegisterActivityContract.InteractorCallBack callBack) { + Runnable runnable = () -> { + UniqueId uniqueId = getUniqueIdRepository().getNextUniqueId(); + final String entityId = uniqueId != null ? uniqueId.getOpenmrsId() : ""; + appExecutors.mainThread().execute(() -> { + if (StringUtils.isBlank(entityId)) { + callBack.onNoUniqueId(); + } else { + callBack.onUniqueIdFetched(triple, entityId); + } + }); + }; + + appExecutors.diskIO().execute(runnable); + } + + @Override + public void onDestroy(boolean isChangingConfiguration) { + //TODO set presenter or model to null + } + + @Override + public void saveRegistration(final List opdEventClientList, final String jsonString, + final RegisterParams registerParams, final OpdRegisterActivityContract.InteractorCallBack callBack) { + Runnable runnable = () -> { + saveRegistration(opdEventClientList, jsonString, registerParams); + appExecutors.mainThread().execute(() -> callBack.onRegistrationSaved(registerParams.isEditMode())); + }; + + appExecutors.diskIO().execute(runnable); + } + + + public void saveRegistration(@NonNull List allClientEventList, @NonNull String jsonString, + @NonNull RegisterParams params) { + try { + List currentFormSubmissionIds = new ArrayList<>(); + + for (int i = 0; i < allClientEventList.size(); i++) { + try { + + OpdEventClient allClientEvent = allClientEventList.get(i); + Client baseClient = allClientEvent.getClient(); + Event baseEvent = allClientEvent.getEvent(); + addClient(params, baseClient); + addEvent(params, currentFormSubmissionIds, baseEvent); + updateOpenSRPId(jsonString, params, baseClient); + addImageLocation(jsonString, baseClient, baseEvent); + } catch (Exception e) { + Timber.e(e, "ChwAllClientRegisterInteractor --> saveRegistration"); + } + } + + long lastSyncTimeStamp = getAllSharedPreferences().fetchLastUpdatedAtDate(0); + Date lastSyncDate = new Date(lastSyncTimeStamp); + getClientProcessorForJava().processClient(getSyncHelper().getEvents(currentFormSubmissionIds)); + getAllSharedPreferences().saveLastUpdatedAtDate(lastSyncDate.getTime()); + } catch (Exception e) { + Timber.e(e, "OpdRegisterInteractor --> saveRegistration"); + } + } + + private void addClient(@NonNull RegisterParams params, Client baseClient) throws JSONException { + JSONObject clientJson = new JSONObject(OpdJsonFormUtils.gson.toJson(baseClient)); + if (params.isEditMode()) { + try { + JsonFormUtils.mergeAndSaveClient(getSyncHelper(), baseClient); + } catch (Exception e) { + Timber.e(e, "ChwAllClientRegisterInteractor --> mergeAndSaveClient"); + } + } else { + getSyncHelper().addClient(baseClient.getBaseEntityId(), clientJson); + } + } + + private void addImageLocation(String jsonString, Client baseClient, Event baseEvent) { + if (baseClient != null || baseEvent != null) { + String imageLocation = OpdJsonFormUtils.getFieldValue(jsonString, Constants.KEY.PHOTO); + if (StringUtils.isNotBlank(imageLocation)) { + JsonFormUtils.saveImage(baseEvent.getProviderId(), baseClient.getBaseEntityId(), imageLocation); + } + } + } + + private void updateOpenSRPId(String jsonString, RegisterParams params, Client baseClient) { + if (params.isEditMode()) { + // UnAssign current OpenSRP ID + if (baseClient != null) { + String newOpenSrpId = baseClient.getIdentifier(Utils.metadata().uniqueIdentifierKey).replace("-", ""); + String currentOpenSrpId = JsonFormUtils.getString(jsonString, JsonFormUtils.CURRENT_OPENSRP_ID).replace("-", ""); + if (!newOpenSrpId.equals(currentOpenSrpId)) { + //OpenSRP ID was changed + getUniqueIdRepository().open(currentOpenSrpId); + } + } + + } else { + if (baseClient != null) { + String openSrpId = baseClient.getIdentifier(Utils.metadata().uniqueIdentifierKey); + if (StringUtils.isNotBlank(openSrpId) && !openSrpId.contains(Constants.IDENTIFIER.FAMILY_SUFFIX)) { + //Mark OpenSRP ID as used + getUniqueIdRepository().close(openSrpId); + } + } + } + } + + private void addEvent(RegisterParams params, List currentFormSubmissionIds, Event baseEvent) throws JSONException { + if (baseEvent != null) { + JSONObject eventJson = new JSONObject(OpdJsonFormUtils.gson.toJson(baseEvent)); + getSyncHelper().addEvent(baseEvent.getBaseEntityId(), eventJson, params.getStatus()); + currentFormSubmissionIds.add(eventJson.getString(EventClientRepository.event_column.formSubmissionId.toString())); + } + } + + @NotNull + public ECSyncHelper getSyncHelper() { + return FamilyLibrary.getInstance().getEcSyncHelper(); + } + + @NotNull + public AllSharedPreferences getAllSharedPreferences() { + return HealthFacilityApplication.getInstance().getContext().allSharedPreferences(); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfHivIndexContactProfileInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfHivIndexContactProfileInteractor.java new file mode 100644 index 000000000..52d7edbbb --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfHivIndexContactProfileInteractor.java @@ -0,0 +1,48 @@ +package org.smartregister.chw.hf.interactor; + +import android.content.Context; + +import org.apache.commons.lang3.tuple.Triple; +import org.smartregister.chw.core.interactor.CoreHivIndexContactProfileInteractor; +import org.smartregister.chw.hf.contract.HivIndexContactProfileContract; +import org.smartregister.chw.hf.dao.HivIndexFollowupFeedbackDao; +import org.smartregister.chw.hf.model.HivIndexFollowupFeedbackDetailsModel; +import org.smartregister.chw.hiv.domain.HivIndexContactObject; +import org.smartregister.opd.contract.OpdRegisterActivityContract; +import org.smartregister.opd.pojo.OpdEventClient; +import org.smartregister.opd.pojo.RegisterParams; + +import java.util.List; + +public class HfHivIndexContactProfileInteractor extends CoreHivIndexContactProfileInteractor implements HivIndexContactProfileContract.Interactor { + + private HfAllClientsRegisterInteractor hfAllClientsRegisterInteractor; + + public HfHivIndexContactProfileInteractor(Context context) { + hfAllClientsRegisterInteractor = new HfAllClientsRegisterInteractor(); + } + + @Override + public void getReferralTasks(String planId, String baseEntityId, HivIndexContactProfileContract.InteractorCallback callback) { + List indexFollowupFeedbackModel; + indexFollowupFeedbackModel = HivIndexFollowupFeedbackDao.getHivIndexFollowupFeedback(baseEntityId); + callback.getReferralAndFollowupFeedback(indexFollowupFeedbackModel); + } + + @Override + public void getNextUniqueId(final Triple triple, final OpdRegisterActivityContract.InteractorCallBack callBack) { + hfAllClientsRegisterInteractor.getNextUniqueId(triple, callBack); + } + + @Override + public void saveRegistration(final List opdEventClientList, final String jsonString, + final RegisterParams registerParams, final HivIndexContactObject hivIndexContactObject, final OpdRegisterActivityContract.InteractorCallBack callBack) { + for (OpdEventClient opdEventClient : opdEventClientList) { + if (!opdEventClient.getClient().getIdentifier("opensrp_id").contains("family")) { + //TODO implement saving registrations + } + } + hfAllClientsRegisterInteractor.saveRegistration(opdEventClientList, jsonString, registerParams, callBack); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfHivProfileInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfHivProfileInteractor.java new file mode 100644 index 000000000..7c8776405 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfHivProfileInteractor.java @@ -0,0 +1,138 @@ +package org.smartregister.chw.hf.interactor; + +import android.content.Context; + +import org.apache.commons.lang3.tuple.Triple; +import org.json.JSONObject; +import org.smartregister.chw.core.application.CoreChwApplication; +import org.smartregister.chw.core.interactor.CoreHivProfileInteractor; +import org.smartregister.chw.core.repository.ChwTaskRepository; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.BuildConfig; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.contract.HivProfileContract; +import org.smartregister.chw.hf.dao.HfFollowupFeedbackDao; +import org.smartregister.chw.hf.model.ChwFollowupFeedbackDetailsModel; +import org.smartregister.chw.hf.model.HivTbReferralTasksAndFollowupFeedbackModel; +import org.smartregister.chw.hiv.contract.BaseHivProfileContract; +import org.smartregister.chw.hiv.domain.HivMemberObject; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.clientandeventmodel.Obs; +import org.smartregister.domain.Task; +import org.smartregister.family.FamilyLibrary; +import org.smartregister.family.util.Utils; +import org.smartregister.opd.contract.OpdRegisterActivityContract; +import org.smartregister.opd.pojo.OpdEventClient; +import org.smartregister.opd.pojo.RegisterParams; +import org.smartregister.repository.AllSharedPreferences; +import org.smartregister.repository.BaseRepository; +import org.smartregister.repository.TaskRepository; +import org.smartregister.sync.helper.ECSyncHelper; +import org.smartregister.util.JsonFormUtils; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Set; + +import timber.log.Timber; + +public class HfHivProfileInteractor extends CoreHivProfileInteractor implements HivProfileContract.Interactor { + + private HfAllClientsRegisterInteractor hfAllClientsRegisterInteractor; + + public HfHivProfileInteractor(Context context) { + super(context); + hfAllClientsRegisterInteractor = new HfAllClientsRegisterInteractor(); + } + + @Override + public void getReferralTasks(String planId, String baseEntityId, HivProfileContract.InteractorCallback callback) { + List tasksAndFollowupFeedbackModels = new ArrayList<>(); + TaskRepository taskRepository = CoreChwApplication.getInstance().getTaskRepository(); + Set taskList = ((ChwTaskRepository) taskRepository).getReferralTasksForClientByStatus(planId, baseEntityId, CoreConstants.BUSINESS_STATUS.REFERRED); + + for (Task task : taskList) { + if(!task.getFocus().equalsIgnoreCase("LTFU")){ + HivTbReferralTasksAndFollowupFeedbackModel tasksAndFollowupFeedbackModel = new HivTbReferralTasksAndFollowupFeedbackModel(); + tasksAndFollowupFeedbackModel.setTask(task); + tasksAndFollowupFeedbackModel.setType("TASK"); + tasksAndFollowupFeedbackModels.add(tasksAndFollowupFeedbackModel); + } + } + + List followupFeedbackList = HfFollowupFeedbackDao.getHivFollowupFeedback(baseEntityId); + + for (ChwFollowupFeedbackDetailsModel followupFeedbackDetailsModel : followupFeedbackList) { + HivTbReferralTasksAndFollowupFeedbackModel tasksAndFollowupFeedbackModel = new HivTbReferralTasksAndFollowupFeedbackModel(); + tasksAndFollowupFeedbackModel.setFollowupFeedbackDetailsModel(followupFeedbackDetailsModel); + tasksAndFollowupFeedbackModel.setType("FOLLOWUP_FEEDBACK"); + tasksAndFollowupFeedbackModels.add(tasksAndFollowupFeedbackModel); + } + + + callback.updateReferralTasksAndFollowupFeedback(tasksAndFollowupFeedbackModels); + } + + @Override + public void getNextUniqueId(final Triple triple, final OpdRegisterActivityContract.InteractorCallBack callBack) { + hfAllClientsRegisterInteractor.getNextUniqueId(triple, callBack); + } + + @Override + public void saveRegistration(final List opdEventClientList, final String jsonString, + final RegisterParams registerParams, final HivMemberObject hivMemberObject, final OpdRegisterActivityContract.InteractorCallBack callBack) { + for (OpdEventClient opdEventClient : opdEventClientList) { + if (!opdEventClient.getClient().getIdentifier("opensrp_id").contains("family")) { + saveRegisterHivIndexEvent(opdEventClient,hivMemberObject.getBaseEntityId(), opdEventClient.getClient().getBaseEntityId(), opdEventClient.getEvent().getLocationId()); + } + } + hfAllClientsRegisterInteractor.saveRegistration(opdEventClientList, jsonString, registerParams, callBack); + } + + + @Override + public void updateProfileHivStatusInfo(HivMemberObject memberObject, BaseHivProfileContract.InteractorCallback callback) { + //overriding updateProfileHivStatusInfo + } + + private void saveRegisterHivIndexEvent(OpdEventClient opdEventClient, String hivClientBaseEntityId, String contactClientBaseEntityId, String locationId) { + try { + AllSharedPreferences sharedPreferences = Utils.getAllSharedPreferences(); + ECSyncHelper syncHelper = FamilyLibrary.getInstance().getEcSyncHelper(); + Event baseEvent = (Event) new Event() + .withBaseEntityId(contactClientBaseEntityId) + .withEventDate(new Date()) + .withEventType(CoreConstants.EventType.HIV_INDEX_CONTACT_REGISTRATION) + .withFormSubmissionId(JsonFormUtils.generateRandomUUIDString()) + .withEntityType(CoreConstants.TABLE_NAME.HIV_INDEX) + .withProviderId(sharedPreferences.fetchRegisteredANM()) + .withLocationId(locationId) + .withTeamId(sharedPreferences.fetchDefaultTeamId(sharedPreferences.fetchRegisteredANM())) + .withTeam(sharedPreferences.fetchDefaultTeam(sharedPreferences.fetchRegisteredANM())) + .withClientDatabaseVersion(BuildConfig.DATABASE_VERSION) + .withClientApplicationVersion(BuildConfig.VERSION_CODE) + .withDateCreated(new Date()); + + baseEvent.setObs(opdEventClient.getEvent().getObs()); + baseEvent.addObs((new Obs()).withFormSubmissionField(CoreConstants.FORM_CONSTANTS.FORM_SUBMISSION_FIELD.INDEX_CLIENT_BASE_ENTITY_ID).withValue(hivClientBaseEntityId) + .withFieldCode(CoreConstants.FORM_CONSTANTS.FORM_SUBMISSION_FIELD.INDEX_CLIENT_BASE_ENTITY_ID).withFieldType("formsubmissionField").withFieldDataType("text").withParentCode("").withHumanReadableValues(new ArrayList<>())); + + + org.smartregister.chw.hf.utils.JsonFormUtils.tagSyncMetadata(Utils.context().allSharedPreferences(), baseEvent);// tag docs + + //setting the location uuid of the referral initiator so that to allow the event to sync back to the chw app since it sync data by location. + baseEvent.setLocationId(locationId); + + JSONObject eventJson = new JSONObject(JsonFormUtils.gson.toJson(baseEvent)); + syncHelper.addEvent(hivClientBaseEntityId, eventJson); + long lastSyncTimeStamp = HealthFacilityApplication.getInstance().getContext().allSharedPreferences().fetchLastUpdatedAtDate(0); + Date lastSyncDate = new Date(lastSyncTimeStamp); + HealthFacilityApplication.getClientProcessor(HealthFacilityApplication.getInstance().getContext().applicationContext()).processClient(syncHelper.getEvents(lastSyncDate, BaseRepository.TYPE_Unprocessed)); + HealthFacilityApplication.getInstance().getContext().allSharedPreferences().saveLastUpdatedAtDate(lastSyncDate.getTime()); + } catch (Exception e) { + Timber.e(e, "HfHivProfileInteractor --> saveRegisterIndexClientEvent"); + } + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfNavigationInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfNavigationInteractor.java new file mode 100644 index 000000000..940214ce2 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfNavigationInteractor.java @@ -0,0 +1,351 @@ +package org.smartregister.chw.hf.interactor; + +import org.smartregister.chw.core.dao.NavigationDao; +import org.smartregister.chw.core.interactor.NavigationInteractor; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.Utils; +import org.smartregister.chw.referral.util.Constants; +import org.smartregister.repository.AllSharedPreferences; + +public class HfNavigationInteractor extends NavigationInteractor { + protected HfNavigationInteractor() { + super(); + } + + @Override + protected int getCount(String tableName) { + if (CoreConstants.TABLE_NAME.FAMILY_MEMBER.equals(tableName.toLowerCase().trim())) { + String allClients = " SELECT SUM(c) as count FROM (" + + "/*INDEPENDENT MEMBERS*/\n" + + "SELECT COUNT(ec_family_member.base_entity_id) AS c\n" + + "FROM ec_family_member\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " AND ec_family.entity_type = 'ec_independent_client'\n" + + " AND ec_family_member.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register where ec_anc_register.is_closed is 0 and ec_anc_register.confirmation_status = 'Confirmed'\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome where (ec_pregnancy_outcome.delivery_date is not null AND ec_pregnancy_outcome.is_closed is 0)\n" + + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_malaria_confirmation.base_entity_id AS base_entity_id\n" + + " FROM ec_malaria_confirmation\n" + + " UNION ALL\n" + + " SELECT ec_family_planning.base_entity_id AS base_entity_id\n" + + " FROM ec_family_planning\n" + + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null\n" + + " UNION ALL\n" + + " SELECT ec_hiv_index_hf.base_entity_id AS base_entity_id\n" + + " FROM ec_hiv_index_hf\n" + + " UNION ALL\n" + + " SELECT ec_hiv_register.base_entity_id AS base_entity_id\n" + + " FROM ec_hiv_register \n" + + " UNION ALL\n" + + " SELECT ec_hts_register.base_entity_id AS base_entity_id\n" + + " FROM ec_hts_register \n"+ + " WHERE ec_hts_register.is_closed is 0\n" + + " AND ec_hts_register.ctc_number is null \n " + + " AND ec_hts_register.chw_referral_service = 'Conventional HIV Test' \n"+ + " AND (ec_hts_register.client_hiv_status_after_testing IS NULL) \n"+ + " UNION ALL\n" + + " SELECT ec_ld_confirmation.base_entity_id AS base_entity_id\n" + + " FROM ec_ld_confirmation \n" + + " WHERE labour_confirmation = 'true' AND is_closed is 0\n" + + ")" + + "UNION ALL" + + "/* HIV REGISTER */\n" + + "\n" + + "SELECT COUNT(ec_family_member.base_entity_id) AS c\n" + + "FROM ec_hiv_register\n" + + " inner join ec_family_member on ec_family_member.base_entity_id = ec_hiv_register.base_entity_id\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " and ec_hiv_register.is_closed is 0\n" + + " AND (UPPER (ec_hiv_register.client_hiv_status_after_testing) LIKE UPPER('Positive')) \n"+ + " AND ec_hiv_register.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register where ec_anc_register.is_closed is 0\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome where (ec_pregnancy_outcome.delivery_date is not null AND ec_pregnancy_outcome.is_closed is 0)\n" + + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null\n" + + ")\n" + + "\n" + + "UNION ALL" + + "/* HTS REGISTER */\n" + + "\n" + + "SELECT COUNT( ec_family_member.base_entity_id) AS c\n" + + "FROM ec_hts_register\n" + + " inner join ec_family_member on ec_family_member.base_entity_id = ec_hts_register.base_entity_id\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " and ec_hts_register.is_closed is 0\n" + + " AND ec_hts_register.ctc_number is null \n " + + " AND ec_hts_register.chw_referral_service = 'Conventional HIV Test' \n"+ + " AND (ec_hts_register.client_hiv_status_after_testing IS NULL) \n"+ + " AND ec_hts_register.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome\n" + + " UNION ALL \n" + + " SELECT ec_hiv_index_hf.base_entity_id AS base_entity_id\n" + + " FROM ec_hiv_index_hf\n" + + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null\n" + + ")\n" + + "\n" + + "UNION ALL\n" + + "/*OTHER FAMILY MEMBERS*/\n" + + "SELECT COUNT( ec_family_member.base_entity_id) AS c\n" + + "FROM ec_family_member\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " AND (ec_family.entity_type = 'ec_family' OR ec_family.entity_type is null)\n" + + " AND ec_family_member.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register where ec_anc_register.is_closed is 0\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome where ec_pregnancy_outcome.delivery_date is not null\n" + + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_malaria_confirmation.base_entity_id AS base_entity_id\n" + + " FROM ec_malaria_confirmation\n" + + " UNION ALL\n" + + " SELECT ec_family_planning.base_entity_id AS base_entity_id\n" + + " FROM ec_family_planning\n" + + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null\n" + + " UNION ALL\n" + + " SELECT ec_hiv_register.base_entity_id AS base_entity_id\n" + + " FROM ec_hiv_register\n" + + ")\n" + + "UNION ALL\n" + + "/* ANC REGISTER */\n" + + "SELECT COUNT( ec_family_member.base_entity_id) AS c" + + "FROM ec_anc_register\n" + + " inner join ec_family_member on ec_family_member.base_entity_id = ec_anc_register.base_entity_id\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " and ec_anc_register.is_closed is 0\n" + + " and ec_anc_register.confirmation_status = 'Confirmed'\n" + + " and ec_anc_register.base_entity_id IN (%s)\n" + + "\n" + + "UNION ALL\n" + + "\n" + + "/* PNC REGISTER */\n" + + "\n" + + "SELECT ec_family_member.first_name AS first_name,\n" + + " ec_family_member.middle_name AS middle_name,\n" + + " ec_family_member.last_name AS last_name,\n" + + " ec_family_member.gender AS gender,\n" + + " ec_family_member.dob AS dob,\n" + + " ec_family_member.base_entity_id AS base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " 'PNC' AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " ec_pregnancy_outcome.last_interacted_with AS last_interacted_with,\n" + + " NULL AS mother_first_name,\n" + + " NULL AS mother_last_name,\n" + + " NULL AS mother_middle_name\n" + + "FROM ec_pregnancy_outcome\n" + + " inner join ec_family_member on ec_family_member.base_entity_id = ec_pregnancy_outcome.base_entity_id\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " and ec_pregnancy_outcome.is_closed is 0\n" + + " and ec_pregnancy_outcome.delivery_date is not null\n" + + " AND ec_pregnancy_outcome.base_entity_id NOT IN\n" + + " (SELECT base_entity_id FROM ec_anc_register WHERE ec_anc_register.is_closed IS 0)\n" + + " AND ec_pregnancy_outcome.base_entity_id IN (%s)\n" + + "\n" + + "UNION ALL\n" + + "/* CHILD REGISTER */\n" + + "\n" + + "SELECT COUNT( ec_family_member.base_entity_id) AS c\n" + + "FROM (SELECT ec_child.*,\n" + + " mother.first_name AS mother_first_name,\n" + + " mother.last_name AS mother_last_name,\n" + + " mother.middle_name AS mother_middle_name\n" + + " FROM ec_child\n" + + " inner join ec_family on ec_family.base_entity_id = ec_child.relational_id\n" + + " INNER JOIN ec_family_member AS mother ON ec_family.primary_caregiver = mother.base_entity_id\n" + + " ) ec_child\n" + + " inner join ec_family_member on ec_family_member.base_entity_id = ec_child.base_entity_id\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "WHERE ec_family_member.is_closed = '0'\n" + + " AND ec_family_member.date_removed is null\n" + + " AND cast(strftime('%Y-%m-%d %H:%M:%S', 'now') - strftime('%Y-%m-%d %H:%M:%S', ec_child.dob) as int) > 0\n" + + " AND ec_child.base_entity_id IN (%s)\n" + + "\n" + + "UNION ALL\n" + + "/* TB REGISTER */\n" + + "\n" + + "SELECT COUNT( ec_family_member.base_entity_id) AS c\n" + + "FROM ec_tb_register\n" + + " inner join ec_family_member on ec_family_member.base_entity_id = ec_tb_register.base_entity_id\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " and ec_tb_register.is_closed is 0\n" + + " and ec_tb_register.tb_case_closure_date is null\n" + + " AND ec_tb_register.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome\n" + + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + ")\n" + + "\n" + + "UNION ALL\n" + + "/*ONLY MALARIA PATIENTS*/\n" + + "SELECT COUNT( ec_family_member.base_entity_id) AS c\n" + + "FROM ec_family_member\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + " inner join ec_malaria_confirmation\n" + + " on ec_family_member.base_entity_id = ec_malaria_confirmation.base_entity_id\n" + + "where ec_family_member.date_removed is null\n" + + " AND ec_family_member.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome\n" + + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_family_planning.base_entity_id AS base_entity_id\n" + + " FROM ec_family_planning\n" + + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null\n" + + " UNION ALL\n" + + " SELECT ec_hiv_register.base_entity_id AS base_entity_id\n" + + " FROM ec_hiv_register\n" + + ")\n" + + "UNION ALL\n" + + "\n" + + "/*ONLY FAMILY PLANNING PATIENTS*/\n" + + "SELECT COUNT( ec_family_member.base_entity_id) AS c\n" + + "FROM ec_family_member\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + " inner join ec_family_planning\n" + + " on ec_family_member.base_entity_id = ec_family_planning.base_entity_id\n" + + "where ec_family_member.date_removed is null\n" + + " AND ec_family_planning.is_closed is 0\n" + + " AND ec_family_member.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome\n" + + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_malaria_confirmation.base_entity_id AS base_entity_id\n" + + " FROM ec_malaria_confirmation\n" + + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null\n" + + " UNION ALL\n" + + " SELECT ec_hiv_register.base_entity_id AS base_entity_id\n" + + " FROM ec_hiv_register\n" + + "UNION ALL\n" + + "\n" + + "/*ONLY LABOUR AND DELIVERY PATIENTS*/\n" + + "SELECT ec_family_member.first_name,\n" + + " ec_family_member.middle_name,\n" + + " ec_family_member.last_name,\n" + + " ec_family_member.gender,\n" + + " ec_family_member.dob,\n" + + " ec_family_member.base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " 'Labour & Delivery' AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " NULL AS mother_first_name,\n" + + " NULL AS mother_last_name,\n" + + " NULL AS mother_middle_name,\n" + + " ec_ld_confirmation.last_interacted_with AS last_interacted_with\n" + + "FROM ec_family_member\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + " inner join ec_ld_confirmation\n" + + " on ec_family_member.base_entity_id = ec_ld_confirmation.base_entity_id\n" + + "where ec_family_member.date_removed is null\n" + + " AND ec_ld_confirmation.is_closed is 0\n" + + " AND ec_family_member.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register where ec_anc_register.is_closed is 0\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome\n" + + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_malaria_confirmation.base_entity_id AS base_entity_id\n" + + " FROM ec_malaria_confirmation\n" + + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null)\n" + + ")\n" + + "ORDER BY last_interacted_with DESC)"; + + return NavigationDao.getQueryCount(allClients); + } else if (CoreConstants.TABLE_NAME.REFERRAL.equals(tableName.toLowerCase().trim())) { + AllSharedPreferences allSharedPreferences = Utils.getAllSharedPreferences(); + String anm = allSharedPreferences.fetchRegisteredANM(); + String currentLoaction = allSharedPreferences.fetchUserLocalityId(anm); + String sqlReferral = "select count(*) " + + "from " + Constants.Tables.REFERRAL + " p " + + "inner join ec_family_member m on p.entity_id = m.base_entity_id COLLATE NOCASE " + + "inner join ec_family f on f.base_entity_id = m.relational_id COLLATE NOCASE " + + "inner join task t on p.id = t.reason_reference COLLATE NOCASE " + + "where m.date_removed is null and t.business_status = '" + CoreConstants.BUSINESS_STATUS.REFERRED + "' " + + "AND t.location <> '" + currentLoaction + "' COLLATE NOCASE " + + "AND p.chw_referral_service <> 'LTFU' COLLATE NOCASE "; + return NavigationDao.getQueryCount(sqlReferral); + } + return super.getCount(tableName); + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfTbProfileInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfTbProfileInteractor.java new file mode 100644 index 000000000..7bbdf7a97 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HfTbProfileInteractor.java @@ -0,0 +1,57 @@ +package org.smartregister.chw.hf.interactor; + +import android.content.Context; + +import org.smartregister.chw.core.application.CoreChwApplication; +import org.smartregister.chw.core.interactor.CoreTbProfileInteractor; +import org.smartregister.chw.core.repository.ChwTaskRepository; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.contract.TbProfileContract; +import org.smartregister.chw.hf.dao.HfFollowupFeedbackDao; +import org.smartregister.chw.hf.model.ChwFollowupFeedbackDetailsModel; +import org.smartregister.chw.hf.model.HivTbReferralTasksAndFollowupFeedbackModel; +import org.smartregister.chw.tb.contract.BaseTbProfileContract; +import org.smartregister.chw.tb.domain.TbMemberObject; +import org.smartregister.domain.Task; +import org.smartregister.repository.TaskRepository; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +public class HfTbProfileInteractor extends CoreTbProfileInteractor implements TbProfileContract.Interactor { + + public HfTbProfileInteractor(Context context) { + super(context); + } + + @Override + public void getReferralTasks(String planId, String baseEntityId, TbProfileContract.InteractorCallback callback) { + TaskRepository taskRepository = CoreChwApplication.getInstance().getTaskRepository(); + Set taskList = ((ChwTaskRepository) taskRepository).getReferralTasksForClientByStatus(planId, baseEntityId, CoreConstants.BUSINESS_STATUS.REFERRED); + + List tasksAndFollowupFeedbackModels = new ArrayList<>(); + for (Task task : taskList) { + HivTbReferralTasksAndFollowupFeedbackModel tasksAndFollowupFeedbackModel = new HivTbReferralTasksAndFollowupFeedbackModel(); + tasksAndFollowupFeedbackModel.setTask(task); + tasksAndFollowupFeedbackModel.setType("TASK"); + tasksAndFollowupFeedbackModels.add(tasksAndFollowupFeedbackModel); + } + + List followupFeedbackList = HfFollowupFeedbackDao.getTbFollowupFeedback(baseEntityId); + + for (ChwFollowupFeedbackDetailsModel followupFeedbackDetailsModel : followupFeedbackList) { + HivTbReferralTasksAndFollowupFeedbackModel tasksAndFollowupFeedbackModel = new HivTbReferralTasksAndFollowupFeedbackModel(); + tasksAndFollowupFeedbackModel.setFollowupFeedbackDetailsModel(followupFeedbackDetailsModel); + tasksAndFollowupFeedbackModel.setType("FOLLOWUP_FEEDBACK"); + tasksAndFollowupFeedbackModels.add(tasksAndFollowupFeedbackModel); + } + + callback.updateReferralTasksAndFollowupFeedback(tasksAndFollowupFeedbackModels); + } + + @Override + public void updateProfileTbStatusInfo(TbMemberObject memberObject, BaseTbProfileContract.InteractorCallback callback) { + //overriding updateProfileHivStatusInfo + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HivFormsInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HivFormsInteractor.java new file mode 100644 index 000000000..004d3b5f1 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/HivFormsInteractor.java @@ -0,0 +1,53 @@ +package org.smartregister.chw.hf.interactor; + +import androidx.annotation.NonNull; + +import com.google.gson.Gson; +import com.nerdstone.neatformcore.domain.model.NFormViewData; + +import org.json.JSONObject; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.hiv.contract.BaseHivFormsContract; +import org.smartregister.chw.hiv.interactor.BaseHivFormsInteractor; +import org.smartregister.chw.hiv.util.Constants; +import org.smartregister.chw.hiv.util.JsonFormConstants; +import org.smartregister.chw.hiv.util.JsonFormUtils; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.repository.AllSharedPreferences; +import org.smartregister.util.Utils; + +import java.util.HashMap; + +import timber.log.Timber; + +public class HivFormsInteractor extends BaseHivFormsInteractor { + @Override + public void saveRegistration(@NonNull String baseEntityId, @NonNull HashMap valuesHashMap, @NonNull JSONObject jsonObject, @NonNull BaseHivFormsContract.InteractorCallBack callBack) { + try { + if (jsonObject.getString(JsonFormConstants.ENCOUNTER_TYPE).equals(Constants.EventType.HIV_INDEX_CONTACT_COMMUNITY_FOLLOWUP)) { + Event event = + JsonFormUtils.processJsonForm( + getHivLibrary(), baseEntityId, valuesHashMap, + jsonObject, jsonObject.getString(JsonFormConstants.ENCOUNTER_TYPE) + ); + + + AllSharedPreferences allSharedPreferences = Utils.getAllSharedPreferences(); + org.smartregister.chw.anc.util.JsonFormUtils.tagEvent(allSharedPreferences, event); + + NFormViewData syncLocation = (NFormViewData) valuesHashMap.get("chw_referral_hf").getValue(); + event.setLocationId(syncLocation.getMetadata().get("openmrs_entity_id").toString()); + + Timber.i("Event = %s", new Gson().toJson(event)); + NCUtils.processEvent( + event.getBaseEntityId(), new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(event))); + callBack.onRegistrationSaved(true, jsonObject.getString(JsonFormConstants.ENCOUNTER_TYPE)); + + } else { + super.saveRegistration(baseEntityId, valuesHashMap, jsonObject, callBack); + } + } catch (Exception e) { + Timber.e(e); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpBehavioralServiceInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpBehavioralServiceInteractor.java new file mode 100644 index 000000000..f1c367b2b --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpBehavioralServiceInteractor.java @@ -0,0 +1,86 @@ +package org.smartregister.chw.hf.interactor; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.actionhelper.kvp.KvpHealthEducationHelper; +import org.smartregister.chw.hf.actionhelper.kvp.KvpIecSbccActionHelper; +import org.smartregister.chw.kvp.contract.BaseKvpVisitContract; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.interactor.BaseKvpVisitInteractor; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; +import org.smartregister.chw.kvp.util.Constants; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class KvpBehavioralServiceInteractor extends BaseKvpVisitInteractor { + + String visitType; + + public KvpBehavioralServiceInteractor(String visitType) { + this.visitType = visitType; + } + + @Override + protected String getCurrentVisitType() { + if (StringUtils.isNotBlank(visitType)) { + return visitType; + } + return super.getCurrentVisitType(); + } + + @Override + protected void populateActionList(BaseKvpVisitContract.InteractorCallBack callBack) { + final Runnable runnable = () -> { + try { + evaluateIecSbcc(details); + evaluateHealthEducation(details); + } catch (BaseKvpVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + private void evaluateIecSbcc(Map> details) throws BaseKvpVisitAction.ValidationException { + + KvpIecSbccActionHelper actionHelper = new KvpIecSbccActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_iec_sbcc)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.KVP_BEHAVIORAL_SERVICE_FORMS.KVP_IEC_SBCC) + .build(); + + actionList.put(context.getString(R.string.kvp_iec_sbcc), action); + } + + private void evaluateHealthEducation(Map> details) throws BaseKvpVisitAction.ValidationException { + + KvpHealthEducationHelper actionHelper = new KvpHealthEducationHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_health_education)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.KVP_BEHAVIORAL_SERVICE_FORMS.KVP_HEALTH_EDUCATION) + .build(); + + actionList.put(context.getString(R.string.kvp_health_education), action); + } + + @Override + protected String getEncounterType() { + return Constants.EVENT_TYPE.KVP_BEHAVIORAL_SERVICE_VISIT; + } + + @Override + protected String getTableName() { + return Constants.TABLES.KVP_FOLLOW_UP; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpBioMedicalServiceInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpBioMedicalServiceInteractor.java new file mode 100644 index 000000000..910e58dd9 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpBioMedicalServiceInteractor.java @@ -0,0 +1,334 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.util.JsonFormUtils.VALUE; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.util.AppExecutors; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.actionhelper.kvp.KvpCervicalCancerScreeningActionHelper; +import org.smartregister.chw.hf.actionhelper.kvp.KvpCondomProvisionActionHelper; +import org.smartregister.chw.hf.actionhelper.kvp.KvpFamilyPlanningActionHelper; +import org.smartregister.chw.hf.actionhelper.kvp.KvpHepatitisActionHelper; +import org.smartregister.chw.hf.actionhelper.kvp.KvpMatActionHelper; +import org.smartregister.chw.hf.actionhelper.kvp.KvpPrepPepActionHelper; +import org.smartregister.chw.hf.actionhelper.kvp.KvpStiScreeningActionHelper; +import org.smartregister.chw.hf.actionhelper.kvp.KvpTbScreeningActionHelper; +import org.smartregister.chw.hf.actionhelper.kvp.KvpVmmcActionHelper; +import org.smartregister.chw.hf.dao.HfKvpDao; +import org.smartregister.chw.kvp.contract.BaseKvpVisitContract; +import org.smartregister.chw.kvp.dao.KvpDao; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.interactor.BaseKvpVisitInteractor; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; +import org.smartregister.chw.kvp.util.Constants; +import org.smartregister.chw.kvp.util.KvpJsonFormUtils; +import org.smartregister.chw.referral.util.JsonFormConstants; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class KvpBioMedicalServiceInteractor extends BaseKvpVisitInteractor { + + protected BaseKvpVisitContract.InteractorCallBack callBack; + private String visitType; + + public KvpBioMedicalServiceInteractor(String visitType) { + this.visitType = visitType; + } + + @Override + protected String getCurrentVisitType() { + if (StringUtils.isNotBlank(visitType)) { + return visitType; + } + + return super.getCurrentVisitType(); + } + + @Override + protected void populateActionList(BaseKvpVisitContract.InteractorCallBack callBack) { + this.callBack = callBack; + final Runnable runnable = () -> { + try { + evaluateClientStatus(details); + evaluateHts(details); + evaluateCondomProvision(details); + evaluateFamilyPlanning(details); + evaluateTbScreening(details); + evaluateStiScreening(details); + evaluateHepatitis(details); + if (memberObject.getGender().equalsIgnoreCase(Constants.MALE)) { + evaluateVmmc(details); + } else { + evaluateCervicalScreening(details); + } + if (shouldShowMat()) + evaluateMat(details); + } catch (Exception e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + private void evaluateClientStatus(Map> details) throws Exception { + + JSONObject clientStatusForm = FormUtils.getFormUtils().getFormJson(Constants.KVP_BIO_MEDICAL_SERVICE_FORMS.KVP_CLIENT_STATUS); + JSONArray fields = clientStatusForm.getJSONObject(org.smartregister.chw.hf.utils.Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + + //update client status + JSONObject client_status_object = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "client_status"); + if (StringUtils.isNotBlank(HfKvpDao.getClientStatus(memberObject.getBaseEntityId()))) { + KvpJsonFormUtils.removeOptionFromCheckboxListWithKey(client_status_object, "new_client"); + } else { + KvpJsonFormUtils.removeOptionFromCheckboxListWithKey(client_status_object, "return"); + } + + //update other_kvp_category + JSONObject other_kvp_category = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "other_kvp_category"); + KvpJsonFormUtils.removeOptionFromCheckboxListWithKey(other_kvp_category, KvpDao.getDominantKVPGroup(memberObject.getBaseEntityId())); + if (memberObject.getGender().equalsIgnoreCase(Constants.MALE)) { + //remove FSW, AGYW + //TODO: extract keys to constant + KvpJsonFormUtils.removeOptionFromCheckboxListWithKey(other_kvp_category, "fsw"); + KvpJsonFormUtils.removeOptionFromCheckboxListWithKey(other_kvp_category, "agyw"); + } + if (memberObject.getGender().equalsIgnoreCase(Constants.FEMALE)) { + //remove MSM + //TODO: extract keys to constant + KvpJsonFormUtils.removeOptionFromCheckboxListWithKey(other_kvp_category, "msm"); + } + + + KvpClientStatusActionHelper actionHelper = new KvpClientStatusActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_client_status)) + .withOptional(false) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.KVP_BIO_MEDICAL_SERVICE_FORMS.KVP_CLIENT_STATUS) + .withJsonPayload(clientStatusForm.toString()) + .build(); + + actionList.put(context.getString(R.string.kvp_client_status), action); + } + + private void evaluateHts(Map> details) throws BaseKvpVisitAction.ValidationException { + + KvpHtsActionHelper actionHelper = new KvpHtsActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_hts)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.KVP_BIO_MEDICAL_SERVICE_FORMS.KVP_HTS) + .build(); + + actionList.put(context.getString(R.string.kvp_hts), action); + } + + private void evaluatePrepPep(Map> details) throws BaseKvpVisitAction.ValidationException { + JSONObject kvpPrepPepJson = FormUtils.getFormUtils().getFormJson(Constants.KVP_BIO_MEDICAL_SERVICE_FORMS.KVP_PrEP_PEP); + try { + JSONArray fields = kvpPrepPepJson.getJSONObject(org.smartregister.chw.hf.utils.Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + //update enrolled_to_prep + JSONObject enrolled_to_prep_object = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "enrolled_to_prep"); + enrolled_to_prep_object.put(VALUE, KvpDao.getPrEPMember(memberObject.getBaseEntityId()) != null); + } catch (Exception e) { + Timber.e(e); + } + + KvpPrepPepActionHelper actionHelper = new KvpPrepPepActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_pep_assesment)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withJsonPayload(kvpPrepPepJson.toString()) + .withFormName(Constants.KVP_BIO_MEDICAL_SERVICE_FORMS.KVP_PrEP_PEP) + .build(); + + actionList.put(context.getString(R.string.kvp_pep_assesment), action); + } + + private void evaluateCondomProvision(Map> details) throws BaseKvpVisitAction.ValidationException { + + KvpCondomProvisionActionHelper actionHelper = new KvpCondomProvisionActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_condom_provision)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.KVP_BIO_MEDICAL_SERVICE_FORMS.KVP_CONDOM_PROVISION) + .build(); + + actionList.put(context.getString(R.string.kvp_condom_provision), action); + } + + private void evaluateFamilyPlanning(Map> details) throws BaseKvpVisitAction.ValidationException { + + String formName; + if (memberObject.getGender().equalsIgnoreCase("male")) + formName = Constants.KVP_BIO_MEDICAL_SERVICE_FORMS.KVP_MALE_FAMILY_PLANNING_SERVICES; + else + formName = Constants.KVP_BIO_MEDICAL_SERVICE_FORMS.KVP_FEMALE_FAMILY_PLANNING_SERVICES; + KvpFamilyPlanningActionHelper actionHelper = new KvpFamilyPlanningActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_family_planning)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(formName) + .build(); + + actionList.put(context.getString(R.string.kvp_family_planning), action); + } + + private void evaluateTbScreening(Map> details) throws BaseKvpVisitAction.ValidationException { + + KvpTbScreeningActionHelper actionHelper = new KvpTbScreeningActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_tb_screening)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.KVP_BIO_MEDICAL_SERVICE_FORMS.KVP_TB_INVESTIGATION) + .build(); + + actionList.put(context.getString(R.string.kvp_tb_screening), action); + } + + private void evaluateStiScreening(Map> details) throws BaseKvpVisitAction.ValidationException { + + KvpStiScreeningActionHelper actionHelper = new KvpStiScreeningActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_sti_screening)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.KVP_BIO_MEDICAL_SERVICE_FORMS.KVP_STI_SCREENING) + .build(); + + actionList.put(context.getString(R.string.kvp_sti_screening), action); + } + + private void evaluateHepatitis(Map> details) throws BaseKvpVisitAction.ValidationException { + + KvpHepatitisActionHelper actionHelper = new KvpHepatitisActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_heptitis_test)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.KVP_BIO_MEDICAL_SERVICE_FORMS.KVP_HEPATITIS) + .build(); + + actionList.put(context.getString(R.string.kvp_heptitis_test), action); + } + + private void evaluateVmmc(Map> details) throws BaseKvpVisitAction.ValidationException { + + KvpVmmcActionHelper actionHelper = new KvpVmmcActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_vmmc)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.KVP_BIO_MEDICAL_SERVICE_FORMS.KVP_VMMC_SERVICES) + .build(); + + actionList.put(context.getString(R.string.kvp_vmmc), action); + } + + private void evaluateCervicalScreening(Map> details) throws BaseKvpVisitAction.ValidationException { + + KvpCervicalCancerScreeningActionHelper actionHelper = new KvpCervicalCancerScreeningActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_cervical_screening)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.KVP_BIO_MEDICAL_SERVICE_FORMS.KVP_CERVICAL_CANCER_SCREENING) + .build(); + + actionList.put(context.getString(R.string.kvp_cervical_screening), action); + } + + private void evaluateMat(Map> details) throws BaseKvpVisitAction.ValidationException { + + KvpMatActionHelper actionHelper = new KvpMatActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_mat)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.KVP_BIO_MEDICAL_SERVICE_FORMS.KVP_MAT) + .build(); + + actionList.put(context.getString(R.string.kvp_mat), action); + } + + @Override + protected String getEncounterType() { + return Constants.EVENT_TYPE.KVP_BIO_MEDICAL_SERVICE_VISIT; + } + + @Override + protected String getTableName() { + return Constants.TABLES.KVP_FOLLOW_UP; + } + + private class KvpHtsActionHelper extends org.smartregister.chw.hf.actionhelper.kvp.KvpHtsActionHelper { + @Override + public String postProcess(String s) { + if (StringUtils.isBlank(hiv_status) || !(hiv_status.equalsIgnoreCase("positive") || hiv_status.equalsIgnoreCase("known_positive"))) { + try { + if (KvpDao.getPrEPMember(memberObject.getBaseEntityId()) == null) + evaluatePrepPep(details); + } catch (BaseKvpVisitAction.ValidationException e) { + e.printStackTrace(); + } + } else { + actionList.remove(context.getString(R.string.kvp_pep_assesment)); + } + new AppExecutors().mainThread().execute(() -> callBack.preloadActions(actionList)); + return super.postProcess(s); + } + } + + private class KvpClientStatusActionHelper extends org.smartregister.chw.hf.actionhelper.kvp.KvpClientStatusActionHelper { + private String other_kvp_category; + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + other_kvp_category = CoreJsonFormUtils.getValue(jsonObject, "other_kvp_category"); + } catch (JSONException e) { + e.printStackTrace(); + } + super.onPayloadReceived(jsonPayload); + } + + @Override + public String postProcess(String s) { + if ((other_kvp_category.contains("pwud") || other_kvp_category.contains("pwid")) && !shouldShowMat()) { + try { + evaluateMat(details); + } catch (Exception e) { + Timber.e(e); + } + } else if (!shouldShowMat()) { + actionList.remove(context.getString(R.string.kvp_mat)); + } + + new AppExecutors().mainThread().execute(() -> callBack.preloadActions(actionList)); + + return super.postProcess(s); + } + } + + private boolean shouldShowMat() { + return KvpDao.getDominantKVPGroup(memberObject.getBaseEntityId()).equalsIgnoreCase("pwud") || + KvpDao.getDominantKVPGroup(memberObject.getBaseEntityId()).equalsIgnoreCase("pwid"); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpMedicalHistoryInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpMedicalHistoryInteractor.java new file mode 100644 index 000000000..844fb2639 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpMedicalHistoryInteractor.java @@ -0,0 +1,74 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.anc.util.VisitUtils.getVisitDetailsOnly; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitGroups; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitsOnly; + +import android.content.Context; + +import com.google.gson.Gson; + +import org.smartregister.chw.anc.contract.BaseAncMedicalHistoryContract; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.core.CoreBaseAncMedicalHistoryInteractor; +import org.smartregister.chw.hf.domain.SortableVisit; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class KvpMedicalHistoryInteractor extends CoreBaseAncMedicalHistoryInteractor { + public static List getVisits(String memberID, String... eventTypes) { + + List visits = new ArrayList<>(); + if (eventTypes != null && eventTypes.length > 0) { + for (String eventType : eventTypes) { + List visit = getVisitsOnly(memberID, eventType); + visits.addAll(visit); + } + } + + int x = 0; + while (visits.size() > x) { + Visit visit = visits.get(x); + List detailList = getVisitDetailsOnly(visit.getVisitId()); + visits.get(x).setVisitDetails(getVisitGroups(detailList)); + x++; + } + + List sortableVisits = new ArrayList<>(); + for (Visit visit : visits) { + Gson gson = new Gson(); + SortableVisit sortableVisit = gson.fromJson(gson.toJson(visit), SortableVisit.class); + sortableVisits.add(sortableVisit); + } + + Collections.sort(sortableVisits); + + return sortableVisits; + } + + @Override + public void getMemberHistory(final String memberID, final Context context, final BaseAncMedicalHistoryContract.InteractorCallBack callBack) { + final Runnable runnable = () -> { + + String[] eventTypes = new String[]{ + org.smartregister.chw.kvp.util.Constants.EVENT_TYPE.KVP_BEHAVIORAL_SERVICE_VISIT, + org.smartregister.chw.kvp.util.Constants.EVENT_TYPE.KVP_BIO_MEDICAL_SERVICE_VISIT, + org.smartregister.chw.kvp.util.Constants.EVENT_TYPE.KVP_STRUCTURAL_SERVICE_VISIT, + org.smartregister.chw.kvp.util.Constants.EVENT_TYPE.KVP_OTHER_SERVICE_VISIT}; + List visits = getVisits(memberID, eventTypes); + final List all_visits = new ArrayList<>(visits); + + for (Visit visit : visits) { + List child_visits = VisitUtils.getChildVisits(visit.getVisitId()); + all_visits.addAll(child_visits); + } + appExecutors.mainThread().execute(() -> callBack.onDataFetched(all_visits)); + }; + + appExecutors.diskIO().execute(runnable); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpOtherServiceInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpOtherServiceInteractor.java new file mode 100644 index 000000000..c9d3a9587 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpOtherServiceInteractor.java @@ -0,0 +1,70 @@ +package org.smartregister.chw.hf.interactor; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.actionhelper.kvp.KvpOtherServicesActionHelper; +import org.smartregister.chw.kvp.contract.BaseKvpVisitContract; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.interactor.BaseKvpVisitInteractor; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; +import org.smartregister.chw.kvp.util.Constants; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class KvpOtherServiceInteractor extends BaseKvpVisitInteractor { + + String visitType; + + public KvpOtherServiceInteractor(String visitType) { + this.visitType = visitType; + } + + @Override + protected String getCurrentVisitType() { + if (StringUtils.isNotBlank(visitType)) { + return visitType; + } + return super.getCurrentVisitType(); + } + + @Override + protected void populateActionList(BaseKvpVisitContract.InteractorCallBack callBack) { + final Runnable runnable = () -> { + try { + evaluateOtherServices(details); + } catch (BaseKvpVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + private void evaluateOtherServices(Map> details) throws BaseKvpVisitAction.ValidationException { + + KvpOtherServicesActionHelper actionHelper = new KvpOtherServicesActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_other_services_referrals)) + .withOptional(false) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.KVP_STRUCTURAL_AND_OTHER_SERVICES_FORMS.KVP_OTHER_SERVICES_REFERRALS) + .build(); + + actionList.put(context.getString(R.string.kvp_other_services_referrals), action); + } + + @Override + protected String getEncounterType() { + return Constants.EVENT_TYPE.KVP_OTHER_SERVICE_VISIT; + } + + @Override + protected String getTableName() { + return Constants.TABLES.KVP_FOLLOW_UP; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpStructuralServiceInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpStructuralServiceInteractor.java new file mode 100644 index 000000000..17e4338f2 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/KvpStructuralServiceInteractor.java @@ -0,0 +1,70 @@ +package org.smartregister.chw.hf.interactor; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.actionhelper.kvp.KvpGbvAnalysisActionHelper; +import org.smartregister.chw.kvp.contract.BaseKvpVisitContract; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.interactor.BaseKvpVisitInteractor; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; +import org.smartregister.chw.kvp.util.Constants; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class KvpStructuralServiceInteractor extends BaseKvpVisitInteractor { + + String visitType; + + public KvpStructuralServiceInteractor(String visitType) { + this.visitType = visitType; + } + + @Override + protected String getCurrentVisitType() { + if (StringUtils.isNotBlank(visitType)) { + return visitType; + } + return super.getCurrentVisitType(); + } + + @Override + protected void populateActionList(BaseKvpVisitContract.InteractorCallBack callBack) { + final Runnable runnable = () -> { + try { + evaluateGbvAnalysis(details); + } catch (BaseKvpVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + private void evaluateGbvAnalysis(Map> details) throws BaseKvpVisitAction.ValidationException { + + KvpGbvAnalysisActionHelper actionHelper = new KvpGbvAnalysisActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.kvp_gbv_analysis)) + .withOptional(false) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.KVP_STRUCTURAL_AND_OTHER_SERVICES_FORMS.KVP_GBV_ANALYSIS) + .build(); + + actionList.put(context.getString(R.string.kvp_gbv_analysis), action); + } + + @Override + protected String getEncounterType() { + return Constants.EVENT_TYPE.KVP_STRUCTURAL_SERVICE_VISIT; + } + + @Override + protected String getTableName() { + return Constants.TABLES.KVP_FOLLOW_UP; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDActiveManagementStageActivityInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDActiveManagementStageActivityInteractor.java new file mode 100644 index 000000000..05d2e809d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDActiveManagementStageActivityInteractor.java @@ -0,0 +1,417 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.hf.utils.Constants.Events.LD_ACTIVE_MANAGEMENT_OF_3RD_STAGE_OF_LABOUR; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.LDVisitUtils; +import org.smartregister.chw.ld.LDLibrary; +import org.smartregister.chw.ld.contract.BaseLDVisitContract; +import org.smartregister.chw.ld.dao.LDDao; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.Visit; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.interactor.BaseLDVisitInteractor; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.util.JsonFormUtils; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * Created by Kassim Sheghembe on 2022-05-13 + */ +public class LDActiveManagementStageActivityInteractor extends BaseLDVisitInteractor { + + protected Context context; + final LinkedHashMap actionList = new LinkedHashMap<>(); + private MemberObject memberObject; + Map> details = null; + + @Override + public MemberObject getMemberClient(String memberID) { + + return LDDao.getMember(memberID); + } + + @Override + public void calculateActions(BaseLDVisitContract.View view, MemberObject memberObject, BaseLDVisitContract.InteractorCallBack callBack) { + context = view.getContext(); + this.memberObject = memberObject; + + if (view.getEditMode()) { + Visit lastVisit = LDLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), LD_ACTIVE_MANAGEMENT_OF_3RD_STAGE_OF_LABOUR); + + if (lastVisit != null) { + details = org.smartregister.chw.ld.util.VisitUtils.getVisitGroups(LDLibrary.getInstance().visitDetailsRepository().getVisits(lastVisit.getVisitId())); + } + } + + final Runnable runnable = () -> { + // update the local database incase of manual date adjustment + try { + VisitUtils.processVisits(memberObject.getBaseEntityId()); + } catch (Exception e) { + Timber.e(e); + } + + try { + + evaluateUterotonic(details); + evaluateExpulsionOfPlacenta(details); + evaluateMassageUterusAfterDelivery(details); + evaluateEclampsiaManagement(details); + + } catch (BaseLDVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + + @Override + protected String getEncounterType() { + return LD_ACTIVE_MANAGEMENT_OF_3RD_STAGE_OF_LABOUR; + } + + @Override + protected void processExternalVisits(Visit visit, Map externalVisits, String memberID) throws Exception { + super.processExternalVisits(visit, externalVisits, memberID); + try { + LDVisitUtils.processVisits(memberID); + } catch (Exception e) { + Timber.e(e); + } + } + + private void evaluateUterotonic(Map> details) throws BaseLDVisitAction.ValidationException { + + String title = context.getString(R.string.uterotonic); + UterotonicActionHelper actionHelper = new UterotonicActionHelper(); + BaseLDVisitAction action = getBuilder(title) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withBaseEntityID(memberObject.getBaseEntityId()) + .withFormName(Constants.JsonForm.LDActiveManagement.getLDActiveManagementUteronics()) + .build(); + actionList.put(title, action); + } + + private void evaluateExpulsionOfPlacenta(Map> details) throws BaseLDVisitAction.ValidationException { + + String title = context.getString(R.string.ld_expulsion_of_placenta); + ExpulsionOfPlacentaHelper actionHelper = new ExpulsionOfPlacentaHelper(); + BaseLDVisitAction action = getBuilder(title) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withBaseEntityID(memberObject.getBaseEntityId()) + .withFormName(Constants.JsonForm.LDActiveManagement.getLdActiveManagementExpulsionPlacenta()) + .build(); + + actionList.put(title, action); + + } + + private void evaluateMassageUterusAfterDelivery(Map> details) throws BaseLDVisitAction.ValidationException { + String title = context.getString(R.string.ld_massage_uterus_after_delivery); + + MassageUterusAfterDeliveryActionHelper actionHelper = new MassageUterusAfterDeliveryActionHelper(); + BaseLDVisitAction action = getBuilder(title) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withBaseEntityID(memberObject.getBaseEntityId()) + .withFormName(Constants.JsonForm.LDActiveManagement.getLdActiveManagementMassageUterus()) + .build(); + + actionList.put(title, action); + + } + + private void evaluateEclampsiaManagement(Map> details) throws BaseLDVisitAction.ValidationException { + String title = context.getString(R.string.ld_eclampsia_management); + + EclampsiaManagementActionHelper actionHelper = new EclampsiaManagementActionHelper(); + BaseLDVisitAction action = getBuilder(title) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withBaseEntityID(memberObject.getBaseEntityId()) + .withFormName(Constants.JsonForm.LDActiveManagement.getLdActiveEclampsiaManagement()) + .build(); + + actionList.put(title, action); + + } + + public BaseLDVisitAction.Builder getBuilder(String title) { + return new BaseLDVisitAction.Builder(context, title); + } + + private static class ExpulsionOfPlacentaHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private String placenta_and_membrane_expulsion; + private Context context; + private String estimated_blood_loss; + + @Override + public void onJsonFormLoaded(String jsonString, Context context, Map> details) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + placenta_and_membrane_expulsion = JsonFormUtils.getFieldValue(jsonPayload, "placenta_and_membrane_expulsion"); + estimated_blood_loss = JsonFormUtils.getFieldValue(jsonPayload, "estimated_blood_loss"); + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + return null; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isNotBlank(placenta_and_membrane_expulsion)) { + if (placenta_and_membrane_expulsion.equalsIgnoreCase("complete_placenta")) { + return context.getString(R.string.ld_placent_completely_removed_message); + } else { + return context.getString(R.string.ld_placent_incompletely_removed_message); + } + } + return null; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isNotBlank(placenta_and_membrane_expulsion) && StringUtils.isNotBlank(estimated_blood_loss)) { + return BaseLDVisitAction.Status.COMPLETED; + } else if (StringUtils.isNotBlank(placenta_and_membrane_expulsion) || StringUtils.isNotBlank(estimated_blood_loss)) { + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + } else { + return BaseLDVisitAction.Status.PENDING; + } + } + + @Override + public void onPayloadReceived(BaseLDVisitAction ldVisitAction) { + //Todo: Implement here + } + } + + private static class MassageUterusAfterDeliveryActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private String uterus_massage_after_delivery; + private Context context; + + @Override + public void onJsonFormLoaded(String jsonString, Context context, Map> details) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + uterus_massage_after_delivery = JsonFormUtils.getFieldValue(jsonPayload, "uterus_massage_after_delivery"); + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + return null; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isNotBlank(uterus_massage_after_delivery)) { + if (uterus_massage_after_delivery.equalsIgnoreCase("yes")) { + return (context.getString(R.string.ld_yes_uterus_massage)); + } else if (uterus_massage_after_delivery.equalsIgnoreCase("no")) { + return context.getString(R.string.ld_no_uterus_massage); + } + } + return null; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isNotBlank(uterus_massage_after_delivery)) { + if (uterus_massage_after_delivery.equalsIgnoreCase("yes")) { + return BaseLDVisitAction.Status.COMPLETED; + } else { + return BaseLDVisitAction.Status.PARTIALLY_COMPLETED; + } + } else { + return BaseLDVisitAction.Status.PENDING; + } + } + + @Override + public void onPayloadReceived(BaseLDVisitAction ldVisitAction) { + //Todo: Implement here + } + } + + private static class EclampsiaManagementActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private String has_signs_of_eclampsia; + private String administered_magnesium_sulphate; + private Context context; + + @Override + public void onJsonFormLoaded(String jsonString, Context context, Map> details) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + has_signs_of_eclampsia = JsonFormUtils.getFieldValue(jsonPayload, "has_signs_of_eclampsia"); + administered_magnesium_sulphate = JsonFormUtils.getFieldValue(jsonPayload, "administered_magnesium_sulphate"); + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + return null; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isNotBlank(has_signs_of_eclampsia)) { + if (has_signs_of_eclampsia.equalsIgnoreCase("yes")) { + if (administered_magnesium_sulphate.equalsIgnoreCase("yes")) + return (context.getString(R.string.ld_management_of_eclampsia)); + else + return (context.getString(R.string.ld_management_of_eclampsia_not_done)); + } else { + return context.getString(R.string.ld_client_has_no_signs_of_eclampsia); + } + } + return null; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isNotBlank(has_signs_of_eclampsia)) { + return BaseLDVisitAction.Status.COMPLETED; + } else { + return BaseLDVisitAction.Status.PENDING; + } + } + + @Override + public void onPayloadReceived(BaseLDVisitAction ldVisitAction) { + //Todo: Implement here + } + } + + private static class UterotonicActionHelper implements BaseLDVisitAction.LDVisitActionHelper { + + private String uterotonic; + private Context context; + + @Override + public void onJsonFormLoaded(String jsonString, Context context, Map> details) { + this.context = context; + } + + @Override + public String getPreProcessed() { + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + uterotonic = JsonFormUtils.getFieldValue(jsonPayload, "uterotonic"); + } + + @Override + public BaseLDVisitAction.ScheduleStatus getPreProcessedStatus() { + return null; + } + + @Override + public String getPreProcessedSubTitle() { + return null; + } + + @Override + public String postProcess(String jsonPayload) { + return null; + } + + @Override + public String evaluateSubTitle() { + return null; + } + + @Override + public BaseLDVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isNotBlank(uterotonic)) { + return BaseLDVisitAction.Status.COMPLETED; + } else { + return BaseLDVisitAction.Status.PENDING; + } + } + + @Override + public void onPayloadReceived(BaseLDVisitAction ldVisitAction) { + //Todo: Implement here + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDPartographDetailsInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDPartographDetailsInteractor.java new file mode 100644 index 000000000..fc01cee2f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDPartographDetailsInteractor.java @@ -0,0 +1,61 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.anc.util.VisitUtils.getVisitDetailsOnly; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitGroups; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitsOnly; + +import android.content.Context; + +import org.smartregister.chw.anc.contract.BaseAncMedicalHistoryContract; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.core.CoreBaseAncMedicalHistoryInteractor; +import org.smartregister.chw.hf.utils.Constants; + +import java.util.ArrayList; +import java.util.List; + +public class LDPartographDetailsInteractor extends CoreBaseAncMedicalHistoryInteractor { + public static List getVisits(String memberID, String... eventTypes) { + + List visits = new ArrayList<>(); + if (eventTypes != null && eventTypes.length > 0) { + for (String eventType : eventTypes) { + List visit = getVisitsOnly(memberID, eventType); + visits.addAll(visit); + } + } else { + getVisitsOnly(memberID, Constants.Events.LD_PARTOGRAPHY); + } + + int x = 0; + while (visits.size() > x) { + Visit visit = visits.get(x); + List detailList = getVisitDetailsOnly(visit.getVisitId()); + visits.get(x).setVisitDetails(getVisitGroups(detailList)); + x++; + } + + return visits; + } + + @Override + public void getMemberHistory(final String memberID, final Context context, final BaseAncMedicalHistoryContract.InteractorCallBack callBack) { + final Runnable runnable = () -> { + + String[] eventTypes = new String[2]; + eventTypes[0] = Constants.Events.LD_PARTOGRAPHY; + List visits = getVisits(memberID, eventTypes); + final List all_visits = new ArrayList<>(visits); + + for (Visit visit : visits) { + List child_visits = VisitUtils.getChildVisits(visit.getVisitId()); + all_visits.addAll(child_visits); + } + appExecutors.mainThread().execute(() -> callBack.onDataFetched(all_visits)); + }; + + appExecutors.diskIO().execute(runnable); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDPartographInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDPartographInteractor.java new file mode 100644 index 000000000..3733a06bf --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDPartographInteractor.java @@ -0,0 +1,74 @@ +package org.smartregister.chw.hf.interactor; + +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.chw.ld.contract.BaseLDVisitContract; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.interactor.BaseLDVisitInteractor; +import org.smartregister.chw.ld.model.BaseLDVisitAction; + +import java.util.LinkedHashMap; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author issyzac 5/7/22 + */ +public class LDPartographInteractor extends BaseLDVisitInteractor { + + private Flavor flavor; + + public LDPartographInteractor(String baseEntityId){ + setFlavor(new LDPartographInteractorFlv()); + flavor = new LDPartographInteractorFlv(); + } + + @Override + public void calculateActions(BaseLDVisitContract.View view, MemberObject memberObject, BaseLDVisitContract.InteractorCallBack callBack) { + + try { + VisitUtils.processVisits(); + }catch (Exception e){ + Timber.e(e); + } + + final Runnable runnable = () -> { + final LinkedHashMap actionList = new LinkedHashMap<>(); + try { + for (Map.Entry entry : flavor.calculateActions(view, memberObject, callBack).entrySet()){ + actionList.put(entry.getKey(), entry.getValue()); + } + }catch (BaseLDVisitAction.ValidationException e){ + Timber.e(e); + } + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + appExecutors.diskIO().execute(runnable); + } + + @Override + protected String getEncounterType() { + return Constants.Events.LD_PARTOGRAPHY; + } + + @Override + protected String getTableName() { + return org.smartregister.chw.ld.util.Constants.TABLES.LD_CONFIRMATION; + } + + public void setFlavor(LDPartographInteractor.Flavor flavor) { + this.flavor = flavor; + } + + public interface Flavor { + LinkedHashMap calculateActions(final BaseLDVisitContract.View view, MemberObject memberObject, final BaseLDVisitContract.InteractorCallBack callBack) throws BaseLDVisitAction.ValidationException; + } + + @Override + public MemberObject getMemberClient(String memberID) { + MemberObject memberObject = new MemberObject(); + memberObject.setBaseEntityId(memberID); + return memberObject; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDPartographInteractorFlv.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDPartographInteractorFlv.java new file mode 100644 index 000000000..ade5d692d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDPartographInteractorFlv.java @@ -0,0 +1,153 @@ +package org.smartregister.chw.hf.interactor; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.anc.util.AppExecutors; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.actionhelper.LDPartographFetalWellBeingActionHelper; +import org.smartregister.chw.hf.actionhelper.LDPartographLabourProgressActionHelper; +import org.smartregister.chw.hf.actionhelper.LDPartographMotherWellBeingActionHelper; +import org.smartregister.chw.hf.actionhelper.LDPartographTimeActionHelper; +import org.smartregister.chw.hf.actionhelper.LDPartographTreatmentDuringLabourActionHelper; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.ld.LDLibrary; +import org.smartregister.chw.ld.contract.BaseLDVisitContract; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.Visit; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.chw.ld.util.VisitUtils; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author issyzac 5/7/22 + */ +public class LDPartographInteractorFlv implements LDPartographInteractor.Flavor { + + LinkedHashMap actionList = new LinkedHashMap<>(); + private boolean editMode; + + @Override + public LinkedHashMap calculateActions(BaseLDVisitContract.View view, MemberObject memberObject, BaseLDVisitContract.InteractorCallBack callBack) throws BaseLDVisitAction.ValidationException { + + Context context = view.getContext(); + Map> details = null; + + editMode = view.getEditMode(); + + //get preloaded data + if (editMode) { + Visit lastVisit = LDLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), Constants.Events.LD_PARTOGRAPHY); + if (lastVisit != null) { + details = VisitUtils.getVisitGroups(LDLibrary.getInstance().visitDetailsRepository().getVisits(lastVisit.getVisitId())); + } + } + + evaluatePartographTime(actionList, details, memberObject, context, callBack); + + return actionList; + } + + + private void evaluatePartographTime(LinkedHashMap actionList, + Map> details, + final MemberObject memberObject, + final Context context, BaseLDVisitContract.InteractorCallBack callBack) throws BaseLDVisitAction.ValidationException { + + BaseLDVisitAction partographTime = new BaseLDVisitAction.Builder(context, context.getString(R.string.ld_partograph_time)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.LabourAndDeliveryPartograph.getPartographTimeForm()) + .withHelper(new PartographProcessActionHelper(memberObject, editMode, actionList, context, details, callBack)) + .build(); + + actionList.put(context.getString(R.string.ld_partograph_time), partographTime); + } + + public static class PartographProcessActionHelper extends LDPartographTimeActionHelper { + + private final LinkedHashMap actionList; + private final Context context; + private final Map> details; + private final BaseLDVisitContract.InteractorCallBack callBack; + private final MemberObject memberObject; + + public PartographProcessActionHelper(MemberObject memberObject, boolean editMode, LinkedHashMap actionList, Context context, + Map> details, BaseLDVisitContract.InteractorCallBack callBack) { + super(memberObject, editMode); + this.actionList = actionList; + this.context = context; + this.details = details; + this.callBack = callBack; + this.memberObject = memberObject; + } + + @Override + public String postProcess(String s) { + if (StringUtils.isNotBlank(time) && StringUtils.isNotBlank(date)) { + try { + BaseLDVisitAction fetalWellBeingAction = new BaseLDVisitAction.Builder(context, context.getString(R.string.ld_partograph_fetal_well_being)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.LabourAndDeliveryPartograph.getFetalWellBingForm()) + .withHelper(new LDPartographFetalWellBeingActionHelper(memberObject, memberObject.getBaseEntityId())) + .build(); + + actionList.put(context.getString(R.string.ld_partograph_fetal_well_being), fetalWellBeingAction); + + BaseLDVisitAction motherWellBeingAction = new BaseLDVisitAction.Builder(context, context.getString(R.string.ld_partograph_mother_well_being)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.LabourAndDeliveryPartograph.getMotherWellBeingForm()) + .withHelper(new LDPartographMotherWellBeingActionHelper(memberObject)) + .build(); + + actionList.put(context.getString(R.string.ld_partograph_mother_well_being), motherWellBeingAction); + + BaseLDVisitAction progressOfLaborAction = new BaseLDVisitAction.Builder(context, context.getString(R.string.ld_partograph_labor_progress)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.LabourAndDeliveryPartograph.getProgressOfLabourForm()) + .withHelper(new LDPartographLabourProgressActionHelper(memberObject, date, time)) + .build(); + + actionList.put(context.getString(R.string.ld_partograph_labor_progress), progressOfLaborAction); + + BaseLDVisitAction treatmentDuringLabour = new BaseLDVisitAction.Builder(context, context.getString(R.string.ld_partograph_treatment_during_labor)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.LabourAndDeliveryPartograph.getTreatmentDuringLabourForm()) + .withHelper(new LDPartographTreatmentDuringLabourActionHelper(memberObject)) + .build(); + + actionList.put(context.getString(R.string.ld_partograph_treatment_during_labor), treatmentDuringLabour); + + } catch (Exception e) { + Timber.e(e); + } + } else { + if (actionList.containsKey(context.getString(R.string.ld_partograph_fetal_well_being))) + actionList.remove(context.getString(R.string.ld_partograph_fetal_well_being)); + + if (actionList.containsKey(context.getString(R.string.ld_partograph_mother_well_being))) + actionList.remove(context.getString(R.string.ld_partograph_mother_well_being)); + + if (actionList.containsKey(context.getString(R.string.ld_partograph_labor_progress))) + actionList.remove(context.getString(R.string.ld_partograph_labor_progress)); + + if (actionList.containsKey(context.getString(R.string.ld_partograph_treatment_during_labor))) + actionList.remove(context.getString(R.string.ld_partograph_treatment_during_labor)); + } + //Calling the callback method to preload the actions in the actionns list. + new AppExecutors().mainThread().execute(() -> callBack.preloadActions(actionList)); + return super.postProcess(s); + } + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDPostDeliveryManagementMotherActivityInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDPostDeliveryManagementMotherActivityInteractor.java new file mode 100644 index 000000000..e53e13e71 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDPostDeliveryManagementMotherActivityInteractor.java @@ -0,0 +1,679 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.anc.util.Constants.TABLES.EC_CHILD; +import static org.smartregister.chw.anc.util.DBConstants.KEY.RELATIONAL_ID; +import static org.smartregister.chw.anc.util.JsonFormUtils.updateFormField; +import static org.smartregister.chw.hf.interactor.AncRegisterInteractor.populatePNCForm; +import static org.smartregister.chw.hf.utils.Constants.Events.HEI_REGISTRATION; +import static org.smartregister.chw.hf.utils.Constants.Events.LD_POST_DELIVERY_MOTHER_MANAGEMENT; +import static org.smartregister.chw.hf.utils.Constants.Events.PNC_NO_MOTHER_REGISTRATION; +import static org.smartregister.chw.hf.utils.Constants.HIV_STATUS.POSITIVE; +import static org.smartregister.chw.hf.utils.Constants.HeiHIVTestAtAge.AT_BIRTH; +import static org.smartregister.chw.hf.utils.Constants.TableName.HEI; +import static org.smartregister.chw.hf.utils.Constants.TableName.HEI_FOLLOWUP; +import static org.smartregister.chw.hf.utils.Constants.TableName.NO_MOTHER_PNC; +import static org.smartregister.chw.hf.utils.JsonFormUtils.ENCOUNTER_TYPE; +import static org.smartregister.chw.hf.utils.LDVisitUtils.isDeceased; +import static org.smartregister.util.JsonFormUtils.FIELDS; +import static org.smartregister.util.JsonFormUtils.KEY; +import static org.smartregister.util.JsonFormUtils.VALUE; + +import android.content.ContentValues; +import android.content.Context; +import android.util.Pair; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Triple; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.AllConstants; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.util.AppExecutors; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.core.dao.ChwNotificationDao; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.actionhelper.MaternalComplicationLabourActionHelper; +import org.smartregister.chw.hf.actionhelper.PostDeliveryFamilyPlanningActionHelper; +import org.smartregister.chw.hf.actionhelper.PostDeliveryObservationActionHelper; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.LDVisitUtils; +import org.smartregister.chw.ld.LDLibrary; +import org.smartregister.chw.ld.contract.BaseLDVisitContract; +import org.smartregister.chw.ld.dao.LDDao; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.Visit; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.interactor.BaseLDVisitInteractor; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.chw.referral.util.JsonFormConstants; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.commonregistry.AllCommonsRepository; +import org.smartregister.domain.Client; +import org.smartregister.domain.db.EventClient; +import org.smartregister.family.FamilyLibrary; +import org.smartregister.family.util.DBConstants; +import org.smartregister.family.util.Utils; +import org.smartregister.immunization.ImmunizationLibrary; +import org.smartregister.repository.AllSharedPreferences; +import org.smartregister.repository.BaseRepository; +import org.smartregister.sync.ClientProcessorForJava; +import org.smartregister.sync.helper.ECSyncHelper; +import org.smartregister.util.FormUtils; +import org.smartregister.util.JsonFormUtils; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * Created by Kassim Sheghembe on 2022-05-16 + */ +public class LDPostDeliveryManagementMotherActivityInteractor extends BaseLDVisitInteractor { + + private static MemberObject memberObject; + private static boolean isEdit = false; + final LinkedHashMap actionList = new LinkedHashMap<>(); + protected Context context; + Map> details = null; + + public static JSONObject populateHeiFollowupForm(JSONObject form, JSONArray fields, String familyBaseEntityId) { + try { + if (form != null) { + form.put(RELATIONAL_ID, familyBaseEntityId); + + JSONObject stepOne = form.getJSONObject(org.smartregister.chw.anc.util.JsonFormUtils.STEP1); + JSONArray jsonArray = stepOne.getJSONArray(FIELDS); + + if (getRiskStatus(fields).equalsIgnoreCase("high")) { + updateFormField(jsonArray, "test_at_age", AT_BIRTH); + updateFormField(jsonArray, "actual_age", "0d"); + updateFormField(jsonArray, "type_of_hiv_test", "DNA PCR"); + } + + JSONObject jsonObject; + for (int i = 0; i < jsonArray.length(); i++) { + jsonObject = jsonArray.getJSONObject(i); + String value = getObValue(fields, jsonObject.optString(KEY)); + if (value != null) { + jsonObject.put(VALUE, value); + } + } + + return form; + } + } catch (Exception e) { + Timber.e(e); + } + + return null; + } + + private static String getRiskStatus(JSONArray obs) throws JSONException { + int size = obs.length(); + for (int i = 0; i < size; i++) { + JSONObject checkObj = obs.getJSONObject(i); + if (checkObj.getString("fieldCode").equalsIgnoreCase("risk_category")) { + JSONArray values = checkObj.getJSONArray("values"); + if (values != null) { + return values.getString(0); + } + } + } + return null; + } + + private static String getObValue(JSONArray obs, String key) throws JSONException { + String valueString = null; + if (obs.length() > 0) { + for (int i = 0; i < obs.length(); i++) { + JSONObject jsonObject = obs.getJSONObject(i); + if (jsonObject.getString("fieldCode").equalsIgnoreCase(key)) { + JSONArray values = jsonObject.getJSONArray("values"); + if (values != null) { + valueString = values.getString(0); + } + } + } + } + return valueString; + } + + public static String ordinal(int i) { + String[] suffixes = new String[]{"th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th"}; + switch (i % 100) { + case 11: + case 12: + case 13: + return i + "th"; + default: + return i + suffixes[i % 10]; + + } + } + + @Override + public MemberObject getMemberClient(String memberID) { + + return LDDao.getMember(memberID); + } + + @Override + public void calculateActions(BaseLDVisitContract.View view, MemberObject memberObject, BaseLDVisitContract.InteractorCallBack callBack) { + context = view.getContext(); + LDPostDeliveryManagementMotherActivityInteractor.memberObject = memberObject; + + if (view.getEditMode()) { + isEdit = view.getEditMode(); + Visit lastVisit = LDLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), LD_POST_DELIVERY_MOTHER_MANAGEMENT); + + if (lastVisit != null) { + details = org.smartregister.chw.ld.util.VisitUtils.getVisitGroups(LDLibrary.getInstance().visitDetailsRepository().getVisits(lastVisit.getVisitId())); + } + } + + final Runnable runnable = () -> { + // update the local database incase of manual date adjustment + try { + VisitUtils.processVisits(memberObject.getBaseEntityId()); + } catch (Exception e) { + Timber.e(e); + } + + try { + + evaluateMotherStatus(callBack); + evaluatePostDeliveryObservation(); + evaluateMaternalComplicationLabour(); + evaluateFamilyPlanning(); + + } catch (BaseLDVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + private void evaluateMotherStatus(BaseLDVisitContract.InteractorCallBack callBack) throws BaseLDVisitAction.ValidationException { + + String title = context.getString(R.string.ld_mother_status_action_title); + MotherStatusActionHelper actionHelper = new MotherStatusActionHelper(context, memberObject.getBaseEntityId(), actionList, callBack, isEdit); + BaseLDVisitAction action = getBuilder(title) + .withOptional(false) + .withHelper(actionHelper) + .withDetails(details) + .withBaseEntityID(memberObject.getBaseEntityId()) + .withFormName(Constants.JsonForm.LDPostDeliveryMotherManagement.getLdPostDeliveryManagementMotherStatus()) + .build(); + + actionList.put(title, action); + } + + private void evaluatePostDeliveryObservation() throws BaseLDVisitAction.ValidationException { + if (details != null && details.containsKey("status") && details.get("status").get(0).getDetails().equalsIgnoreCase("died")) { + return; + } + String title = context.getString(R.string.ld_post_delivery_observation_action_title); + PostDeliveryObservationActionHelper actionHelper = new PostDeliveryObservationActionHelper(); + BaseLDVisitAction action = getBuilder(title) + .withOptional(false) + .withHelper(actionHelper) + .withDetails(details) + .withBaseEntityID(memberObject.getBaseEntityId()) + .withFormName(Constants.JsonForm.LDPostDeliveryMotherManagement.getLdPostDeliveryMotherObservation()) + .build(); + + actionList.put(title, action); + } + + private void evaluateMaternalComplicationLabour() throws BaseLDVisitAction.ValidationException { + + String title = context.getString(R.string.ld_maternal_complication_action_title); + MaternalComplicationLabourActionHelper actionHelper = new MaternalComplicationLabourActionHelper(); + BaseLDVisitAction action = getBuilder(title) + .withOptional(false) + .withHelper(actionHelper) + .withDetails(details) + .withBaseEntityID(memberObject.getBaseEntityId()) + .withFormName(Constants.JsonForm.LDPostDeliveryMotherManagement.getLdPostDeliveryMaternalComplications()) + .build(); + + actionList.put(title, action); + } + + private void evaluateFamilyPlanning() throws BaseLDVisitAction.ValidationException { + if (details != null && details.containsKey("status") && details.get("status").get(0).getDetails().equalsIgnoreCase("died")) { + return; + } + String title = context.getString(R.string.ld_post_delivery_family_planning); + + PostDeliveryFamilyPlanningActionHelper actionHelper = new PostDeliveryFamilyPlanningActionHelper(); + + BaseLDVisitAction action = getBuilder(title) + .withOptional(false) + .withHelper(actionHelper) + .withDetails(details) + .withBaseEntityID(memberObject.getBaseEntityId()) + .withFormName(Constants.JsonForm.LDPostDeliveryMotherManagement.getLdPostDeliveryFamilyPlanning()) + .build(); + + actionList.put(title, action); + } + + private BaseLDVisitAction.Builder getBuilder(String title) { + return new BaseLDVisitAction.Builder(context, title); + } + + @Override + protected String getEncounterType() { + return LD_POST_DELIVERY_MOTHER_MANAGEMENT; + } + + @Override + protected void processExternalVisits(Visit visit, Map externalVisits, String memberID) throws Exception { + //super.processExternalVisits(visit, externalVisits, memberID); + if (visit != null && !externalVisits.isEmpty()) { + for (Map.Entry entry : externalVisits.entrySet()) { + Map subEvent = new HashMap<>(); + subEvent.put(entry.getKey(), entry.getValue()); + + String subMemberID = entry.getValue().getBaseEntityID(); + if (StringUtils.isBlank(subMemberID)) + subMemberID = memberID; + + submitVisit(false, subMemberID, subEvent, visit.getVisitType()); + } + } + try { + + boolean visitCompleted = true; + for (Map.Entry entry : actionList.entrySet()) { + String actionStatus = entry.getValue().getActionStatus().toString(); + if (actionStatus.equalsIgnoreCase("PARTIALLY_COMPLETED")) { + visitCompleted = false; + + } + } + + if (visitCompleted) { + + AllSharedPreferences allSharedPreferences = ImmunizationLibrary.getInstance().context().allSharedPreferences(); + + JSONObject visitJson = new JSONObject(visit.getJson()); + JSONArray obs = visitJson.getJSONArray("obs"); + String deliveryDate = getDeliveryDateString(obs); + + String completionStatus = getObValue(obs, "newborn_stage_four_module_status"); + + JSONObject removeFamilyMemberForm; + if (isDeceased(obs)) { + removeFamilyMemberForm = getFormAsJson( + CoreConstants.JSON_FORM.getFamilyDetailsRemoveMember(), memberID, getLocationID() + ); + if (removeFamilyMemberForm != null) { + JSONObject stepOne = removeFamilyMemberForm.getJSONObject(org.smartregister.chw.anc.util.JsonFormUtils.STEP1); + JSONArray jsonArray = stepOne.getJSONArray(FIELDS); + + org.smartregister.chw.anc.util.JsonFormUtils.updateFormField(jsonArray, "remove_reason", "Death"); + + // Need to get the date of delivery from the mother status format dd-MM-YYYY + org.smartregister.chw.anc.util.JsonFormUtils.updateFormField(jsonArray, "date_died", deliveryDate); + org.smartregister.chw.anc.util.JsonFormUtils.updateFormField(jsonArray, "age_at_death", memberObject.getAge()); + + removeUser(null, removeFamilyMemberForm, getProviderID()); + } + } + if ((StringUtils.isNotBlank(completionStatus) && completionStatus.equalsIgnoreCase("Fully Completed"))) { + saveChild(memberID, memberObject.getBaseEntityId(), LDDao.getHivStatus(memberObject.getBaseEntityId()), getRiskStatus(obs), allSharedPreferences, memberObject.getFamilyBaseEntityId(), getDeliveryDateString(obs), obs); + } + + LDVisitUtils.processVisits(memberObject.getBaseEntityId(), false); + } + } catch (Exception e) { + Timber.e(e); + } + + } + + private void saveChild(String childBaseEntityId, String motherBaseId, String motherHivStatus, String childRiskCategory, AllSharedPreferences + allSharedPreferences, String familyBaseEntityId, String dob, JSONArray obs) { + String uniqueChildID = AncLibrary.getInstance().getUniqueIdRepository().getNextUniqueId().getOpenmrsId(); + + if (StringUtils.isNotBlank(uniqueChildID)) { + try { + String lastName = memberObject.getLastName(); + JSONObject pncForm = getFormAsJson( + Constants.JsonForm.getLdChildRegistration(), + childBaseEntityId, + getLocationID() + ); + pncForm = populatePNCForm(pncForm, obs, familyBaseEntityId, motherBaseId, childRiskCategory, uniqueChildID, dob, lastName); + pncForm = populateChildRegistrationForm(pncForm, obs, motherBaseId, familyBaseEntityId); + processChild(pncForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS), allSharedPreferences, childBaseEntityId, familyBaseEntityId, motherBaseId, uniqueChildID, lastName, dob); + saveChildRegistration(pncForm.toString(), EC_CHILD, motherBaseId); + String motherStatus = LDVisitUtils.getFieldValue(obs, "mother_status"); + + if (motherStatus != null && motherStatus.equals("died")) { + pncForm.put(ENCOUNTER_TYPE, PNC_NO_MOTHER_REGISTRATION); + saveChildRegistration(pncForm.toString(), NO_MOTHER_PNC, motherBaseId); + } + + if (motherHivStatus.equals(POSITIVE)) { + pncForm.put(ENCOUNTER_TYPE, HEI_REGISTRATION); + saveChildRegistration(pncForm.toString(), HEI, motherBaseId); + + JSONObject heiFollowupForm = getFormAsJson( + Constants.JsonForm.getLdHeiFirstVisit(), + childBaseEntityId, + getLocationID() + ); + + heiFollowupForm = populateHeiFollowupForm(heiFollowupForm, obs, familyBaseEntityId); + saveChildRegistration(heiFollowupForm.toString(), HEI_FOLLOWUP, motherBaseId); + + + } + + } catch (Exception e) { + e.printStackTrace(); + } + + try { + JSONObject removeChildForm; + if (!isChildAlive(obs)) { + removeChildForm = getFormAsJson( + Constants.JsonForm.getMarkChildAsDeceased(), childBaseEntityId, getLocationID() + ); + + if (removeChildForm != null) { + JSONObject stepOne = removeChildForm.getJSONObject(org.smartregister.chw.anc.util.JsonFormUtils.STEP1); + JSONArray jsonArray = stepOne.getJSONArray(FIELDS); + + + // Need to get the date of delivery from the mother status format dd-MM-YYYY + updateFormField(jsonArray, "dob", dob); + updateFormField(jsonArray, "date_died", dob); + updateFormField(jsonArray, "age_at_death", "0d"); + + removeUser(null, removeChildForm, getProviderID()); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + private JSONObject populateChildRegistrationForm(JSONObject form, JSONArray obs, String motherId, String familyId) { + try { + form.put(DBConstants.KEY.RELATIONAL_ID, familyId); + form.put("mother_entity_id", motherId); + JSONObject stepOne = form.getJSONObject(JsonFormUtils.STEP1); + JSONArray fields = stepOne.getJSONArray(FIELDS); + + String babyFirstName = context.getString(R.string.ld_baby_of_text) + " " + memberObject.getFirstName(); + String dob = getDeliveryDateString(obs); + String gender = getChildGender(obs); + + org.smartregister.chw.anc.util.JsonFormUtils.updateFormField(fields, "mother_entity_id", motherId); + org.smartregister.chw.anc.util.JsonFormUtils.updateFormField(fields, "first_name", babyFirstName); + org.smartregister.chw.anc.util.JsonFormUtils.updateFormField(fields, "last_name", memberObject.getLastName()); + org.smartregister.chw.anc.util.JsonFormUtils.updateFormField(fields, "middle_name", memberObject.getMiddleName()); + org.smartregister.chw.anc.util.JsonFormUtils.updateFormField(fields, "dob", dob); + org.smartregister.chw.anc.util.JsonFormUtils.updateFormField(fields, "gender", gender); + org.smartregister.chw.anc.util.JsonFormUtils.updateFormField(fields, "surname", memberObject.getLastName()); + + return form; + } catch (Exception e) { + Timber.e(e); + } + + return null; + } + + private void processChild(JSONArray fields, AllSharedPreferences allSharedPreferences, String entityId, String familyBaseEntityId, String motherBaseId, String uniqueChildID, String lastName, String dob) { + + try { + org.smartregister.clientandeventmodel.Client pncChild = JsonFormUtils.createBaseClient(fields, org.smartregister.chw.anc.util.JsonFormUtils.formTag(allSharedPreferences), entityId); + Map identifiers = new HashMap<>(); + identifiers.put(org.smartregister.chw.anc.util.Constants.JSON_FORM_EXTRA.OPENSPR_ID, uniqueChildID.replace("-", "")); + SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); + Date date = formatter.parse(dob); + pncChild.setLastName(lastName); + pncChild.setBirthdate(date); + pncChild.setIdentifiers(identifiers); + pncChild.addRelationship(org.smartregister.chw.anc.util.Constants.RELATIONSHIP.FAMILY, familyBaseEntityId); + pncChild.addRelationship(org.smartregister.chw.anc.util.Constants.RELATIONSHIP.MOTHER, motherBaseId); + + JSONObject eventJson = new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(pncChild)); + AncLibrary.getInstance().getUniqueIdRepository().close(pncChild.getIdentifier(org.smartregister.chw.anc.util.Constants.JSON_FORM_EXTRA.OPENSPR_ID)); + + NCUtils.getSyncHelper().addClient(pncChild.getBaseEntityId(), eventJson); + + } catch (Exception e) { + Timber.e(e); + } + + } + + private void saveChildRegistration(final String jsonString, String table, String motherBaseId) throws Exception { + AllSharedPreferences allSharedPreferences = AncLibrary.getInstance().context().allSharedPreferences(); + Event baseEvent = org.smartregister.chw.anc.util.JsonFormUtils.processJsonForm(allSharedPreferences, jsonString, table); + org.smartregister.chw.anc.util.JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + String syncLocationId = ChwNotificationDao.getSyncLocationId(motherBaseId); + if (syncLocationId != null) { + // Allows setting the ID for sync purposes + baseEvent.setLocationId(syncLocationId); + } + + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(baseEvent))); + } + + private String removeUser(String familyID, JSONObject closeFormJsonString, String providerId) throws Exception { + String res = null; + Triple, String, List> triple = CoreJsonFormUtils.processRemoveMemberEvent(familyID, Utils.getAllSharedPreferences(), closeFormJsonString, providerId); + if (triple != null && triple.getLeft() != null) { + processEvents(triple.getRight()); + + if (triple.getLeft().second.equalsIgnoreCase(CoreConstants.EventType.REMOVE_CHILD)) { + updateRepo(triple, Utils.metadata().familyMemberRegister.tableName); + updateRepo(triple, CoreConstants.TABLE_NAME.CHILD); + } else if (triple.getLeft().second.equalsIgnoreCase(CoreConstants.EventType.REMOVE_FAMILY)) { + updateRepo(triple, Utils.metadata().familyRegister.tableName); + } else { + updateRepo(triple, Utils.metadata().familyMemberRegister.tableName); + } + res = triple.getLeft().second; + } + + long lastSyncTimeStamp = getAllSharedPreferences().fetchLastUpdatedAtDate(0); + Date lastSyncDate = new Date(lastSyncTimeStamp); + getClientProcessorForJava().processClient(getSyncHelper().getEvents(lastSyncDate, BaseRepository.TYPE_Unprocessed)); + getAllSharedPreferences().saveLastUpdatedAtDate(lastSyncDate.getTime()); + return res; + } + + private void processEvents(List events) throws Exception { + ECSyncHelper syncHelper = HealthFacilityApplication.getInstance().getEcSyncHelper(); + List clients = new ArrayList<>(); + for (Event e : events) { + JSONObject json = new JSONObject(CoreJsonFormUtils.gson.toJson(e)); + syncHelper.addEvent(e.getBaseEntityId(), json); + + org.smartregister.domain.Event event = CoreJsonFormUtils.gson.fromJson(json.toString(), org.smartregister.domain.Event.class); + clients.add(new EventClient(event, new Client(e.getBaseEntityId()))); + } + getClientProcessorForJava().processClient(clients); + } + + public ClientProcessorForJava getClientProcessorForJava() { + return FamilyLibrary.getInstance().getClientProcessorForJava(); + } + + public ECSyncHelper getSyncHelper() { + return FamilyLibrary.getInstance().getEcSyncHelper(); + } + + public AllSharedPreferences getAllSharedPreferences() { + return Utils.context().allSharedPreferences(); + } + + private void updateRepo(Triple, String, List> triple, String tableName) { + AllCommonsRepository commonsRepository = HealthFacilityApplication.getInstance().getAllCommonsRepository(tableName); + + Date date_removed = new Date(); + Date dod = null; + if (triple.getLeft() != null && triple.getLeft().first != null) { + dod = triple.getLeft().first; + } + + if (commonsRepository != null && dod == null) { + ContentValues values = new ContentValues(); + values.put(DBConstants.KEY.DATE_REMOVED, getDBFormatedDate(date_removed)); + commonsRepository.update(tableName, values, triple.getMiddle()); + commonsRepository.updateSearch(triple.getMiddle()); + commonsRepository.close(triple.getMiddle()); + } + + // enter the date of death + if (dod != null && commonsRepository != null) { + ContentValues values = new ContentValues(); + values.put(DBConstants.KEY.DOD, getDBFormatedDate(dod)); + commonsRepository.update(tableName, values, triple.getMiddle()); + commonsRepository.updateSearch(triple.getMiddle()); + } + } + + private String getDBFormatedDate(Date date) { + return new SimpleDateFormat("yyyy-MM-dd").format(date); + } + + public static JSONObject getFormAsJson(String formName, String entityId, String currentLocationId) throws Exception { + JSONObject jsonObject = getJsonForm(formName); + org.smartregister.chw.anc.util.JsonFormUtils.getRegistrationForm(jsonObject, entityId, currentLocationId); + + return jsonObject; + } + + public static JSONObject getJsonForm(String formName) throws Exception { + return FormUtils.getInstance(HealthFacilityApplication.getInstance().getApplicationContext().getApplicationContext()).getFormJson(formName); + } + + protected String getLocationID() { + return org.smartregister.Context.getInstance().allSharedPreferences().getPreference(AllConstants.CURRENT_LOCATION_ID); + } + + protected String getProviderID() { + return org.smartregister.Context.getInstance().allSharedPreferences().fetchRegisteredANM(); + } + + private String getDeliveryDateString(JSONArray obs) throws JSONException { + String deliveryDateString = null; + if (obs.length() > 0) { + for (int i = 0; i < obs.length(); i++) { + JSONObject jsonObject = obs.getJSONObject(i); + if (jsonObject.getString("fieldCode").equalsIgnoreCase("delivery_date")) { + JSONArray values = jsonObject.getJSONArray("values"); + if (values != null) { + deliveryDateString = values.getString(0); + } + } + } + } + return deliveryDateString; + } + + private boolean isChildAlive(JSONArray obs) throws JSONException { + int size = obs.length(); + for (int i = 0; i < size; i++) { + JSONObject checkObj = obs.getJSONObject(i); + if (checkObj.getString("fieldCode").equalsIgnoreCase("newborn_status")) { + JSONArray values = checkObj.getJSONArray("values"); + if (values != null) { + return values.get(0).equals("alive"); + } + } + } + return false; + } + + private String getChildGender(JSONArray obs) throws JSONException { + String gender = null; + if (obs.length() > 0) { + + for (int i = 0; i < obs.length(); i++) { + + JSONObject jsonObject = obs.getJSONObject(i); + + if (jsonObject.getString("fieldCode").equalsIgnoreCase("sex")) { + JSONArray values = jsonObject.getJSONArray("values"); + if (values != null) { + if (!values.getString(0).equalsIgnoreCase("null")) { + gender = values.getString(0); + } else { + gender = jsonObject.getJSONArray("humanReadableValues").getString(0); + } + } + } + + } + + } + + return gender; + } + + private class MotherStatusActionHelper extends org.smartregister.chw.hf.actionhelper.MotherStatusActionHelper { + private final BaseLDVisitContract.InteractorCallBack callBack; + + public MotherStatusActionHelper(Context context, String baseEntityId, LinkedHashMap actionList, BaseLDVisitContract.InteractorCallBack callBack, boolean isEdit) { + super(context, baseEntityId, actionList, callBack, isEdit); + this.callBack = callBack; + } + + @Override + public String postProcess(String jsonPayload) { + if (StringUtils.isNotBlank(status) && !status.equalsIgnoreCase("alive")) { + actionList.remove(context.getString(R.string.ld_post_delivery_family_planning)); + actionList.remove(context.getString(R.string.ld_post_delivery_observation_action_title)); + } else { + if (!actionList.containsKey(context.getString(R.string.ld_post_delivery_observation_action_title))) { + try { + evaluatePostDeliveryObservation(); + } catch (BaseLDVisitAction.ValidationException e) { + e.printStackTrace(); + } + } + if (!actionList.containsKey(context.getString(R.string.ld_post_delivery_family_planning))) { + try { + evaluateFamilyPlanning(); + } catch (BaseLDVisitAction.ValidationException e) { + e.printStackTrace(); + } + } + } + new AppExecutors().mainThread().execute(() -> callBack.preloadActions(actionList)); + return super.postProcess(jsonPayload); + } + } + + protected String getParentVisitEventID(Visit visit, String parentEventType) { + if (visit.getVisitType().contains("Newborn")) + return visitRepository().getParentVisitEventID(memberObject.getBaseEntityId(), parentEventType, visit.getDate()); + else + return super.getParentVisitEventID(visit, parentEventType); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDProfileInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDProfileInteractor.java new file mode 100644 index 000000000..1152b68a2 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDProfileInteractor.java @@ -0,0 +1,20 @@ +package org.smartregister.chw.hf.interactor; + +import org.smartregister.chw.core.application.CoreChwApplication; +import org.smartregister.chw.core.repository.ChwTaskRepository; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.contract.HfLDProfileContract; +import org.smartregister.chw.ld.interactor.BaseLDProfileInteractor; +import org.smartregister.domain.Task; +import org.smartregister.repository.TaskRepository; + +import java.util.Set; + +public class LDProfileInteractor extends BaseLDProfileInteractor implements HfLDProfileContract.Interactor { + @Override + public void getClientTasks(String planId, String baseEntityId, HfLDProfileContract.InteractorCallBack callback) { + TaskRepository taskRepository = CoreChwApplication.getInstance().getTaskRepository(); + Set taskList = ((ChwTaskRepository) taskRepository).getReferralTasksForClientByStatus(planId, baseEntityId, CoreConstants.BUSINESS_STATUS.REFERRED); + callback.setClientTasks(taskList); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDRegistrationDetailsInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDRegistrationDetailsInteractor.java new file mode 100644 index 000000000..56479a569 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDRegistrationDetailsInteractor.java @@ -0,0 +1,61 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.anc.util.VisitUtils.getVisitDetailsOnly; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitGroups; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitsOnly; + +import android.content.Context; + +import org.smartregister.chw.anc.contract.BaseAncMedicalHistoryContract; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.core.CoreBaseAncMedicalHistoryInteractor; +import org.smartregister.chw.hf.utils.Constants; + +import java.util.ArrayList; +import java.util.List; + +public class LDRegistrationDetailsInteractor extends CoreBaseAncMedicalHistoryInteractor { + public static List getVisits(String memberID, String... eventTypes) { + + List visits = new ArrayList<>(); + if (eventTypes != null && eventTypes.length > 0) { + for (String eventType : eventTypes) { + List visit = getVisitsOnly(memberID, eventType); + visits.addAll(visit); + } + } else { + getVisitsOnly(memberID, Constants.Events.LD_REGISTRATION); + } + + int x = 0; + while (visits.size() > x) { + Visit visit = visits.get(x); + List detailList = getVisitDetailsOnly(visit.getVisitId()); + visits.get(x).setVisitDetails(getVisitGroups(detailList)); + x++; + } + + return visits; + } + + @Override + public void getMemberHistory(final String memberID, final Context context, final BaseAncMedicalHistoryContract.InteractorCallBack callBack) { + final Runnable runnable = () -> { + + String[] eventTypes = new String[2]; + eventTypes[0] = Constants.Events.LD_REGISTRATION; + List visits = getVisits(memberID, eventTypes); + final List all_visits = new ArrayList<>(visits); + + for (Visit visit : visits) { + List child_visits = VisitUtils.getChildVisits(visit.getVisitId()); + all_visits.addAll(child_visits); + } + appExecutors.mainThread().execute(() -> callBack.onDataFetched(all_visits)); + }; + + appExecutors.diskIO().execute(runnable); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDRegistrationInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDRegistrationInteractor.java new file mode 100644 index 000000000..f308f6244 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDRegistrationInteractor.java @@ -0,0 +1,113 @@ +package org.smartregister.chw.hf.interactor; + +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.chw.ld.LDLibrary; +import org.smartregister.chw.ld.contract.BaseLDVisitContract; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.Visit; +import org.smartregister.chw.ld.interactor.BaseLDVisitInteractor; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.chw.ld.util.JsonFormUtils; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author ilakozejumanne@gmail.com + * 06/05/2022 + */ +public class LDRegistrationInteractor extends BaseLDVisitInteractor { + private Flavor flavor; + private String encounterType = Constants.Events.LD_REGISTRATION; + public LDRegistrationInteractor(String baseEntityId) { + setFlavor(new LDRegistrationInteractorFlv(baseEntityId)); + flavor = new LDRegistrationInteractorFlv(baseEntityId); + } + + public void setFalseLabourEncounterType() { + encounterType = "False Labour Report"; + } + + @Override + protected String getEncounterType() { + return encounterType; + } + + @Override + protected String getTableName() { + return org.smartregister.chw.ld.util.Constants.TABLES.LD_CONFIRMATION; + } + + @Override + public void calculateActions(BaseLDVisitContract.View view, MemberObject memberObject, BaseLDVisitContract.InteractorCallBack callBack) { + // update the local database incase of manual date adjustment + try { + VisitUtils.processVisits(); + } catch (Exception e) { + Timber.e(e); + } + + final Runnable runnable = () -> { + final LinkedHashMap actionList = new LinkedHashMap<>(); + + try { + + for (Map.Entry entry : flavor.calculateActions(view, memberObject, callBack).entrySet()) { + actionList.put(entry.getKey(), entry.getValue()); + } + } catch (BaseLDVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + public void setFlavor(LDRegistrationInteractor.Flavor flavor) { + this.flavor = flavor; + } + + public interface Flavor { + LinkedHashMap calculateActions(final BaseLDVisitContract.View view, MemberObject memberObject, final BaseLDVisitContract.InteractorCallBack callBack) throws BaseLDVisitAction.ValidationException; + } + + @Override + public MemberObject getMemberClient(String memberID) { + MemberObject memberObject = new MemberObject(); + memberObject.setBaseEntityId(memberID); + return memberObject; + } + + @Override + protected void processExternalVisits(Visit visit, Map externalVisits, String memberID) throws Exception { + super.processExternalVisits(visit, externalVisits, memberID); + + List visits = new ArrayList<>(1); + visits.add(visit); + org.smartregister.chw.ld.util.VisitUtils.processVisits(visits, LDLibrary.getInstance().visitRepository(), LDLibrary.getInstance().visitDetailsRepository()); + } + + @Override + public void submitVisit(boolean editMode, String memberID, Map map, BaseLDVisitContract.InteractorCallBack callBack) { + if (map != null) { + BaseLDVisitAction labourConfirmationAction = map.get("True Labour Confirmation"); + if (labourConfirmationAction != null) { + boolean isTrueLabour = Boolean.parseBoolean( + JsonFormUtils.getFieldValue(labourConfirmationAction.getJsonPayload(), + "labour_confirmation")); + + if (!isTrueLabour) { + setFalseLabourEncounterType(); + } + } + } + super.submitVisit(editMode, memberID, map, callBack); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDRegistrationInteractorFlv.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDRegistrationInteractorFlv.java new file mode 100644 index 000000000..b8060dbf2 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDRegistrationInteractorFlv.java @@ -0,0 +1,410 @@ +package org.smartregister.chw.hf.interactor; + +import static com.vijay.jsonwizard.widgets.TimePickerFactory.KEY.KEY; +import static com.vijay.jsonwizard.widgets.TimePickerFactory.KEY.VALUE; +import static org.smartregister.chw.hf.interactor.AncFirstFacilityVisitInteractorFlv.initializeHealthFacilitiesList; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.dao.AncDao; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.actionhelper.LDRegistrationAdmissionAction; +import org.smartregister.chw.hf.actionhelper.LDRegistrationAncClinicFindingsAction; +import org.smartregister.chw.hf.actionhelper.LDRegistrationCurrentLabourAction; +import org.smartregister.chw.hf.actionhelper.LDRegistrationObstetricHistoryAction; +import org.smartregister.chw.hf.actionhelper.LDRegistrationPastObstetricHistoryAction; +import org.smartregister.chw.hf.actionhelper.LDRegistrationTriageAction; +import org.smartregister.chw.hf.actionhelper.LDRegistrationTrueLabourConfirmationAction; +import org.smartregister.chw.hf.dao.HfAncDao; +import org.smartregister.chw.hf.dao.HfPmtctDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.ld.LDLibrary; +import org.smartregister.chw.ld.contract.BaseLDVisitContract; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.Visit; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.chw.ld.util.AppExecutors; +import org.smartregister.chw.ld.util.JsonFormUtils; +import org.smartregister.chw.ld.util.VisitUtils; +import org.smartregister.chw.referral.util.JsonFormConstants; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +/** + * @author ilakozejumanne@gmail.com + * 06/05/2022 + */ +public class LDRegistrationInteractorFlv implements LDRegistrationInteractor.Flavor { + static JSONObject obstetricForm = null; + static JSONObject ancClinicForm = null; + static JSONObject ancTriageForm = null; + LinkedHashMap actionList = new LinkedHashMap<>(); + private static JSONObject admissionInformationForm; + + public LDRegistrationInteractorFlv(String baseEntityId) { + } + + private void populateObstetricForm(JSONArray fields, org.smartregister.chw.anc.domain.MemberObject memberObject) throws JSONException { + JSONObject gravida = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "gravida"); + JSONObject childrenAlive = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "children_alive"); + JSONObject parity = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "para"); + JSONObject lastMenstrualPeriod = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "last_menstrual_period"); + JSONObject pastMedicalSurgicalHistory = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "past_medical_surgical_history"); + JSONObject otherPastMedicalSurgicalHistory = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "other_past_medical_surgical_history"); + + gravida.put(org.smartregister.family.util.JsonFormUtils.VALUE, memberObject.getGravida()); + parity.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getParity(memberObject.getBaseEntityId())); + childrenAlive.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getNumberOfSurvivingChildren(memberObject.getBaseEntityId())); + lastMenstrualPeriod.put(org.smartregister.family.util.JsonFormUtils.VALUE, memberObject.getLastMenstrualPeriod()); + JSONArray historyValues; + + String pastMedicalAndSurgicalHistory = HfAncDao.getMedicalAndSurgicalHistory(memberObject.getBaseEntityId()); + if (pastMedicalAndSurgicalHistory.startsWith("[")) { + try { + historyValues = new JSONArray(pastMedicalAndSurgicalHistory); + for (int i = 0; i < historyValues.length(); i++) { + String value = historyValues.getString(i); + setCheckBoxValues(pastMedicalSurgicalHistory.getJSONArray("options"), value); + } + } catch (Exception e) { + Timber.e(e); + } + } else { + setCheckBoxValues(pastMedicalSurgicalHistory.getJSONArray("options"), pastMedicalAndSurgicalHistory); + } + String otherPastMedicalAndSurgicalHistory = HfAncDao.getOtherMedicalAndSurgicalHistory(memberObject.getBaseEntityId()); + otherPastMedicalSurgicalHistory.put(org.smartregister.family.util.JsonFormUtils.VALUE, otherPastMedicalAndSurgicalHistory); + } + + private void setCheckBoxValues(JSONArray options, String value) { + for (int j = 0; j < options.length(); j++) { + JSONObject option = null; + try { + option = options.getJSONObject(j); + if (option.getString(KEY).equals(value)) { + option.put(VALUE, true); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + } + + private void populateAncFindingsForm(JSONArray fields, org.smartregister.chw.anc.domain.MemberObject memberObject) throws JSONException { + JSONObject numberOfVisits = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "number_of_visits"); + JSONObject iptDoses = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "ipt_doses"); + JSONObject malaria = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "malaria"); + JSONObject TTDoses = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "tt_doses"); + JSONObject LLINUsed = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "llin_used"); + JSONObject hbTestConducted = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "hb_test"); + JSONObject lastMeasuredHB = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "hb_level"); + JSONObject lastMeasuredHBDate = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "hb_test_date"); + JSONObject syphilis = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "syphilis"); + JSONObject managementProvidedForSyphilis = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "management_provided_for_syphilis"); + JSONObject bloodGroup = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "blood_group"); + JSONObject rhFactor = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "rh_factor"); + JSONObject pmtct = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "anc_hiv_status"); + JSONObject pmtctTestDate = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "pmtct_test_date"); + JSONObject artPrescription = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "art_prescription"); + JSONObject managementProvidedForPmtct = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "management_provided_for_pmtct"); + + numberOfVisits.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getVisitNumber(memberObject.getBaseEntityId())); + iptDoses.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getIptDoses(memberObject.getBaseEntityId())); + malaria.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getMalariaTestResults(memberObject.getBaseEntityId())); + TTDoses.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getTTDoses(memberObject.getBaseEntityId())); + LLINUsed.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.isLLINProvided(memberObject.getBaseEntityId()) ? "Yes" : "No"); + + String lastMeasuredHb = HfAncDao.getLastMeasuredHB(memberObject.getBaseEntityId()); + hbTestConducted.put(org.smartregister.family.util.JsonFormUtils.VALUE, lastMeasuredHb.equals("") ? "no" : "yes"); + if (!lastMeasuredHB.equals("")) { + lastMeasuredHB.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getLastMeasuredHB(memberObject.getBaseEntityId())); + lastMeasuredHBDate.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getLastMeasuredHBDate(memberObject.getBaseEntityId())); + } + syphilis.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getSyphilisTestResult(memberObject.getBaseEntityId())); + managementProvidedForSyphilis.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getSyphilisTreatment(memberObject.getBaseEntityId()) ? "yes" : "no"); + + bloodGroup.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getBloodGroup(memberObject.getBaseEntityId())); + rhFactor.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getRhFactor(memberObject.getBaseEntityId())); + if (HfAncDao.isClientKnownOnArt(memberObject.getBaseEntityId())) { + pmtct.put(org.smartregister.family.util.JsonFormUtils.VALUE, "known_on_art_before_this_pregnancy"); + } else if (HfAncDao.getHivStatus(memberObject.getBaseEntityId()) != null && !HfAncDao.getHivStatus(memberObject.getBaseEntityId()).equalsIgnoreCase("null")) { + pmtct.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getHivStatus(memberObject.getBaseEntityId()).equalsIgnoreCase("positive") ? "positive" : "negative"); + } + pmtctTestDate.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfAncDao.getHivTestDate(memberObject.getBaseEntityId())); + artPrescription.put(org.smartregister.family.util.JsonFormUtils.VALUE, (HfPmtctDao.isPrescribedArtRegimes(memberObject.getBaseEntityId()) || HfAncDao.isClientKnownOnArt(memberObject.getBaseEntityId())) ? "yes" : "no"); + managementProvidedForPmtct.put(org.smartregister.family.util.JsonFormUtils.VALUE, HfPmtctDao.isRegisteredForPmtct(memberObject.getBaseEntityId()) ? "yes" : "no"); + } + + + private void populateTriageForm(JSONArray fields, org.smartregister.chw.anc.domain.MemberObject memberObject) throws JSONException { + JSONObject heightJsonObject = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "height"); + String height = HfAncDao.getClientHeight(memberObject.getBaseEntityId()); + if (!height.equalsIgnoreCase("null")) + heightJsonObject.put(org.smartregister.family.util.JsonFormUtils.VALUE, height); + } + + @Override + public LinkedHashMap calculateActions(BaseLDVisitContract.View view, MemberObject memberObject, BaseLDVisitContract.InteractorCallBack callBack) throws BaseLDVisitAction.ValidationException { + + Context context = view.getContext(); + + obstetricForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryObstetricHistory()); + ancClinicForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryAncClinicFindings()); + ancTriageForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryRegistrationTriage()); + admissionInformationForm = initializeHealthFacilitiesList(FormUtils.getFormUtils().getFormJson(Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryAdmissionInformation())); + + + Map> details = null; + // get the preloaded data + if (view.getEditMode()) { + Visit lastVisit = LDLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), Constants.Events.LD_REGISTRATION); + if (lastVisit != null) { + details = VisitUtils.getVisitGroups(LDLibrary.getInstance().visitDetailsRepository().getVisits(lastVisit.getVisitId())); + + if (!details.isEmpty()) { + JsonFormUtils.populateForm(obstetricForm, details); + JsonFormUtils.populateForm(ancClinicForm, details); + JsonFormUtils.populateForm(ancTriageForm, details); + JsonFormUtils.populateForm(admissionInformationForm, details); + } + } + } else { + // get the preloaded data + if (AncDao.isANCMember(memberObject.getBaseEntityId())) { + if (obstetricForm != null) { + try { + JSONArray fields = obstetricForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + populateObstetricForm(fields, AncDao.getMember(memberObject.getBaseEntityId())); + } catch (JSONException e) { + e.printStackTrace(); + } + } + if (ancClinicForm != null) { + try { + JSONArray fields = ancClinicForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + populateAncFindingsForm(fields, AncDao.getMember(memberObject.getBaseEntityId())); + } catch (JSONException e) { + e.printStackTrace(); + } + } + if (ancTriageForm != null) { + try { + JSONArray fields = ancTriageForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + populateTriageForm(fields, AncDao.getMember(memberObject.getBaseEntityId())); + } catch (JSONException e) { + e.printStackTrace(); + } + } + } + } + + evaluateLDRegistration(actionList, details, memberObject, context, callBack); + + return actionList; + } + + private void evaluateLDRegistration(LinkedHashMap actionList, + Map> details, + final MemberObject memberObject, + final Context context, + BaseLDVisitContract.InteractorCallBack callBack + ) throws BaseLDVisitAction.ValidationException { + BaseLDVisitAction ldRegistrationTriage = new BaseLDVisitAction.Builder(context, context.getString(R.string.ld_registration_triage_title)) + .withOptional(false) + .withDetails(details) + .withJsonPayload(ancTriageForm.toString()) + .withFormName(Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryRegistrationTriage()) + .withHelper(new LDRegistrationTriageAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.ld_registration_triage_title), ldRegistrationTriage); + + BaseLDVisitAction ldRegistrationTrueLabourConfirmation = new BaseLDVisitAction.Builder(context, context.getString(R.string.ld_registration_true_labour_title)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryRegistrationTrueLabourConfirmation()) + .withHelper(new TrueLabourConfirmationAction(memberObject, actionList, details, callBack, context)) + .build(); + actionList.put(context.getString(R.string.ld_registration_true_labour_title), ldRegistrationTrueLabourConfirmation); + + + } + + private static class TrueLabourConfirmationAction extends LDRegistrationTrueLabourConfirmationAction { + private final LinkedHashMap actionList; + private final Context context; + private final Map> details; + private final BaseLDVisitContract.InteractorCallBack callBack; + + public TrueLabourConfirmationAction(MemberObject memberObject, LinkedHashMap actionList, Map> details, BaseLDVisitContract.InteractorCallBack callBack, Context context) { + super(memberObject); + this.actionList = actionList; + this.context = context; + this.details = details; + this.callBack = callBack; + } + + @Override + public String postProcess(String s) { + if (labourConfirmation.equalsIgnoreCase("true")) { + //Adding the next actions when true labour confirmation is completed and the client is confirmed with True Labour. + try { + BaseLDVisitAction ldRegistrationAdmissionInformation = new BaseLDVisitAction.Builder(context, context.getString(R.string.ld_registration_admission_information_title)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryAdmissionInformation()) + .withJsonPayload(admissionInformationForm.toString()) + .withHelper(new RegistrationAdmissionAction(memberObject, actionList, context)) + .build(); + + actionList.put(context.getString(R.string.ld_registration_admission_information_title), ldRegistrationAdmissionInformation); + ldRegistrationAdmissionInformation.evaluateStatus(); + } catch (Exception e) { + Timber.e(e); + } + + try { + BaseLDVisitAction ldRegistrationObstetricHistory = new BaseLDVisitAction.Builder(context, context.getString(R.string.ld_registration_obstetric_history_title)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryObstetricHistory()) + .withJsonPayload(obstetricForm.toString()) + .withHelper(new ObstetricHistoryAction(memberObject, actionList, details, callBack, context)) + .build(); + + actionList.put(context.getString(R.string.ld_registration_obstetric_history_title), ldRegistrationObstetricHistory); + } catch (Exception e) { + Timber.e(e); + } + + try { + BaseLDVisitAction ldRegistrationAncClinicFindings = new BaseLDVisitAction.Builder(context, context.getString(R.string.ld_registration_anc_clinic_findings_title)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryAncClinicFindings()) + .withJsonPayload(ancClinicForm.toString()) + .withHelper(new LDRegistrationAncClinicFindingsAction(memberObject)) + .build(); + + actionList.put(context.getString(R.string.ld_registration_anc_clinic_findings_title), ldRegistrationAncClinicFindings); + } catch (Exception e) { + Timber.e(e); + } + + try { + BaseLDVisitAction ldRegistrationCurrentLabour = new BaseLDVisitAction.Builder(context, context.getString(R.string.ld_registration_current_labour_title)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryCurrentLabour()) + .withHelper(new LDRegistrationCurrentLabourAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.ld_registration_current_labour_title), ldRegistrationCurrentLabour); + } catch (BaseLDVisitAction.ValidationException e) { + Timber.e(e); + } + + + } else { + //Removing the next actions the client is confirmed with False Labour. + if (actionList.containsKey(context.getString(R.string.ld_registration_admission_information_title))) { + actionList.remove(context.getString(R.string.ld_registration_admission_information_title)); + } + + if (actionList.containsKey(context.getString(R.string.ld_registration_obstetric_history_title))) { + actionList.remove(context.getString(R.string.ld_registration_obstetric_history_title)); + } + + if (actionList.containsKey(context.getString(R.string.ld_registration_anc_clinic_findings_title))) { + actionList.remove(context.getString(R.string.ld_registration_anc_clinic_findings_title)); + } + + if (actionList.containsKey(context.getString(R.string.ld_registration_current_labour_title))) { + actionList.remove(context.getString(R.string.ld_registration_current_labour_title)); + } + + } + + //Calling the callback method to preload the actions in the actionns list. + new AppExecutors().mainThread().execute(() -> callBack.preloadActions(actionList)); + return super.postProcess(s); + } + } + + private static class ObstetricHistoryAction extends LDRegistrationObstetricHistoryAction { + private final LinkedHashMap actionList; + private final Context context; + private final Map> details; + private final BaseLDVisitContract.InteractorCallBack callBack; + + public ObstetricHistoryAction(MemberObject memberObject, LinkedHashMap actionList, Map> details, BaseLDVisitContract.InteractorCallBack callBack, Context context) { + super(memberObject); + this.actionList = actionList; + this.details = details; + this.callBack = callBack; + this.context = context; + } + + @Override + public String postProcess(String s) { + if (!StringUtils.isBlank(para) && Integer.parseInt(para) > 0) { + //Adding the actions for capturing previous para obstetric history when para is greater than 0 . + try { + BaseLDVisitAction labourAndDeliveryPastObstetricHistory = new BaseLDVisitAction.Builder(context, context.getString(R.string.ld_registration_past_obstetric_history_title)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryPastObstetricHistory()) + .withHelper(new LDRegistrationPastObstetricHistoryAction(memberObject, Integer.parseInt(para))) + .build(); + + actionList.put(context.getString(R.string.ld_registration_past_obstetric_history_title), labourAndDeliveryPastObstetricHistory); + } catch (Exception e) { + Timber.e(e); + } + } else if (actionList.containsKey(context.getString(R.string.ld_registration_past_obstetric_history_title))) { + actionList.remove(context.getString(R.string.ld_registration_past_obstetric_history_title)); + } + + + //Calling the callback method to preload the actions in the actionns list. + new AppExecutors().mainThread().execute(() -> callBack.preloadActions(actionList)); + + return super.postProcess(s); + } + } + + private static class RegistrationAdmissionAction extends LDRegistrationAdmissionAction { + private final LinkedHashMap actionList; + private Context context; + + public RegistrationAdmissionAction(MemberObject memberObject, LinkedHashMap actionList, Context context) { + super(memberObject); + this.actionList = actionList; + this.context = context; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + super.onPayloadReceived(jsonPayload); + String reasonForAdmission = null; + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + reasonForAdmission = CoreJsonFormUtils.getValue(jsonObject, "reasons_for_admission"); + } catch (Exception e) { + Timber.e(e); + } + BaseLDVisitAction ldRegistrationCurrentLabour = actionList.get(context.getString(R.string.ld_registration_current_labour_title)); + ((LDRegistrationCurrentLabourAction) ldRegistrationCurrentLabour.getLDVisitActionHelper()).setReasonsForAdmission(reasonForAdmission); + } + } +} + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDSummaryDetailsInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDSummaryDetailsInteractor.java new file mode 100644 index 000000000..99b5aa40e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDSummaryDetailsInteractor.java @@ -0,0 +1,63 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.anc.util.VisitUtils.getVisitDetailsOnly; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitGroups; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitsOnly; + +import android.content.Context; + +import org.smartregister.chw.anc.contract.BaseAncMedicalHistoryContract; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.core.CoreBaseAncMedicalHistoryInteractor; +import org.smartregister.chw.hf.utils.Constants; + +import java.util.ArrayList; +import java.util.List; + +public class LDSummaryDetailsInteractor extends CoreBaseAncMedicalHistoryInteractor { + public static List getVisits(String memberID, String... eventTypes) { + + List visits = new ArrayList<>(); + if (eventTypes != null && eventTypes.length > 0) { + for (String eventType : eventTypes) { + List visit = getVisitsOnly(memberID, eventType); + visits.addAll(visit); + } + } else { + getVisitsOnly(memberID, Constants.Events.LD_GENERAL_EXAMINATION); + } + + int x = 0; + while (visits.size() > x) { + Visit visit = visits.get(x); + List detailList = getVisitDetailsOnly(visit.getVisitId()); + visits.get(x).setVisitDetails(getVisitGroups(detailList)); + x++; + } + + return visits; + } + + @Override + public void getMemberHistory(final String memberID, final Context context, final BaseAncMedicalHistoryContract.InteractorCallBack callBack) { + final Runnable runnable = () -> { + + String[] eventTypes = new String[3]; + eventTypes[0] = Constants.Events.LD_GENERAL_EXAMINATION; + eventTypes[1] = Constants.Events.LD_ACTIVE_MANAGEMENT_OF_3RD_STAGE_OF_LABOUR; + eventTypes[2] = Constants.Events.LD_POST_DELIVERY_MOTHER_MANAGEMENT; + List visits = getVisits(memberID, eventTypes); + final List all_visits = new ArrayList<>(visits); + + for (Visit visit : visits) { + List child_visits = VisitUtils.getChildVisits(visit.getVisitId()); + all_visits.addAll(child_visits); + } + appExecutors.mainThread().execute(() -> callBack.onDataFetched(all_visits)); + }; + + appExecutors.diskIO().execute(runnable); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDVisitInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDVisitInteractor.java new file mode 100644 index 000000000..ec80b2544 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LDVisitInteractor.java @@ -0,0 +1,307 @@ +package org.smartregister.chw.hf.interactor; + +import android.content.Context; + +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.actionhelper.LDBloodGroupTestActionHelper; +import org.smartregister.chw.hf.actionhelper.LDGeneralExaminationActionHelper; +import org.smartregister.chw.hf.actionhelper.LDHBTestActionHelper; +import org.smartregister.chw.hf.actionhelper.LDHIVTestActionHelper; +import org.smartregister.chw.hf.actionhelper.LDMalariaTestActionHelper; +import org.smartregister.chw.hf.actionhelper.LDSyphilisTestActionHelper; +import org.smartregister.chw.hf.actionhelper.LDVaginalExaminationActionHelper; +import org.smartregister.chw.hf.dao.LDDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.LDVisitUtils; +import org.smartregister.chw.ld.LDLibrary; +import org.smartregister.chw.ld.contract.BaseLDVisitContract; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.domain.Visit; +import org.smartregister.chw.ld.domain.VisitDetail; +import org.smartregister.chw.ld.interactor.BaseLDVisitInteractor; +import org.smartregister.chw.ld.model.BaseLDVisitAction; +import org.smartregister.clientandeventmodel.Event; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.TimeUnit; + +import timber.log.Timber; + +/** + * Created by Kassim Sheghembe on 2022-05-06 + */ +public class LDVisitInteractor extends BaseLDVisitInteractor { + protected Context context; + final LinkedHashMap actionList = new LinkedHashMap<>(); + Map> details = null; + private MemberObject memberObject; + + @Override + public void calculateActions(BaseLDVisitContract.View view, MemberObject memberObject, BaseLDVisitContract.InteractorCallBack callBack) { + + context = view.getContext(); + this.memberObject = memberObject; + + if (view.getEditMode()) { + Visit lastVisit = LDLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), org.smartregister.chw.ld.util.Constants.EVENT_TYPE.LD_GENERAL_EXAMINATION); + + if (lastVisit != null) { + details = org.smartregister.chw.ld.util.VisitUtils.getVisitGroups(LDLibrary.getInstance().visitDetailsRepository().getVisits(lastVisit.getVisitId())); + } + } + + final Runnable runnable = () -> { + // update the local database incase of manual date adjustment + try { + VisitUtils.processVisits(memberObject.getBaseEntityId()); + } catch (Exception e) { + Timber.e(e); + } + + try { + + evaluateGenExamination(details); + evaluateVaginalExamination(details); + + if (LDDao.getHivStatus(memberObject.getBaseEntityId()) == null || + (!Objects.equals(LDDao.getHivStatus(memberObject.getBaseEntityId()), Constants.HIV_STATUS.POSITIVE) && testDateIsThreeMonthsAgo(memberObject.getBaseEntityId()))) { + evaluateHIVStatus(details); + } + if (LDDao.getBloodGroup(memberObject.getBaseEntityId()) == null || + (Objects.equals(LDDao.getBloodGroup(memberObject.getBaseEntityId()), "test_not_conducted"))) { + evaluateBloodGroupTest(details); + } + + if (hbTestMoreThanTwoWeeksAgo(memberObject.getBaseEntityId())) { + evaluateHBTest(details); + } + + if (!syphilisTestConductedDuringRegistration(memberObject.getBaseEntityId())) + evaluateSyphilisTest(details); + + if (!malariaTestConductedDuringRegistration(memberObject.getBaseEntityId())) + evaluateMalariatest(details); + + } catch (BaseLDVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + public static boolean malariaTestConductedDuringRegistration(String baseEntityId) { + if (LDDao.getMalariaTest(baseEntityId) != null) { + String malariaTest = LDDao.getMalariaTest(baseEntityId); + return !malariaTest.equalsIgnoreCase(Constants.FormConstants.ClinicFindings.Malaria.MALARIA_TEST_NOT_DONE); + } + return false; + } + + public static boolean syphilisTestConductedDuringRegistration(String baseEntityId) { + if (LDDao.getSyphilisTest(baseEntityId) != null) { + String syphilisTest = LDDao.getSyphilisTest(baseEntityId); + return !syphilisTest.equalsIgnoreCase(Constants.FormConstants.ClinicFindings.Syphilis.SYPHILIS_TEST_NOT_DONE); + } + return false; + } + + public static boolean hbTestMoreThanTwoWeeksAgo(String baseEntityId) { + if (LDDao.getHbTestDate(baseEntityId) != null) { + try { + DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy"); + String hbTestDate = LDDao.getHbTestDate(baseEntityId); + Date testDate = dateFormat.parse(hbTestDate); + if (testDate != null) { + Date twoWeeksAgo = new Date(System.currentTimeMillis() - (1000 * 60 * 60 * 24 * 14)); + if (testDate.before(twoWeeksAgo)) { + return true; + } else { + return false; + } + } + return true; + } catch (Exception e) { + Timber.e(e); + } + } + return true; + } + + public static boolean testDateIsThreeMonthsAgo(String baseEntityId) { + if (LDDao.getPmtctTestDate(baseEntityId) != null) { + try { + DateFormat completeDateFormat = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + String pmtctTestDate = LDDao.getPmtctTestDate(baseEntityId); + Date testDate = completeDateFormat.parse(pmtctTestDate); + if (testDate != null) { + Date threeMonthsAgo = new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(90)); + if (testDate.before(threeMonthsAgo)) { + return true; + } else { + return false; + } + } + return true; + + } catch (Exception e) { + Timber.e(e); + } + } + return true; + } + + private void evaluateMalariatest(Map> details) throws BaseLDVisitAction.ValidationException { + + String title = context.getString(R.string.lb_visit_malaria_test_status_action_title); + + LDMalariaTestActionHelper actionHelper = new LDMalariaTestActionHelper(context); + BaseLDVisitAction action = getBuilder(title) + .withOptional(true) + .withHelper(actionHelper) + .withDetails(details) + .withFormName(Constants.JsonForm.LDVisit.getLdMalariaTestForm()) + .build(); + + actionList.put(title, action); + } + + private void evaluateSyphilisTest(Map> details) throws BaseLDVisitAction.ValidationException { + + String title = context.getString(R.string.lb_visit_syphilis_test_status_action_title); + + LDSyphilisTestActionHelper actionHelper = new LDSyphilisTestActionHelper(context); + BaseLDVisitAction action = getBuilder(title) + .withOptional(true) + .withHelper(actionHelper) + .withDetails(details) + .withFormName(Constants.JsonForm.LDVisit.getSyphilisTestForm()) + .build(); + + actionList.put(title, action); + } + + private void evaluateHIVStatus(Map> details) throws BaseLDVisitAction.ValidationException { + + String title = context.getString(R.string.lb_visit_hiv_test_status_action_title); + + LDHIVTestActionHelper actionHelper = new LDHIVTestActionHelper(context); + BaseLDVisitAction action = getBuilder(title) + .withOptional(true) + .withHelper(actionHelper) + .withDetails(details) + .withFormName(Constants.JsonForm.LDVisit.getLdHivTest()) + .build(); + + actionList.put(title, action); + } + + private void evaluateBloodGroupTest(Map> details) throws BaseLDVisitAction.ValidationException { + + String title = context.getString(R.string.lb_visit_blood_group_test_action_title); + + LDBloodGroupTestActionHelper actionHelper = new LDBloodGroupTestActionHelper(context); + BaseLDVisitAction action = getBuilder(title) + .withOptional(true) + .withHelper(actionHelper) + .withDetails(details) + .withFormName(Constants.JsonForm.LDVisit.getLdBloodGroupTest()) + .build(); + + actionList.put(title, action); + } + + private void evaluateHBTest(Map> details) throws BaseLDVisitAction.ValidationException { + + String title = context.getString(R.string.lb_visit_hb_test_action_title); + + LDHBTestActionHelper actionHelper = new LDHBTestActionHelper(context); + BaseLDVisitAction action = getBuilder(title) + .withOptional(true) + .withHelper(actionHelper) + .withDetails(details) + .withFormName(Constants.JsonForm.LDVisit.getLdHBTestForm()) + .build(); + + actionList.put(title, action); + + } + + private void evaluateVaginalExamination(Map> details) throws BaseLDVisitAction.ValidationException { + LDVaginalExaminationActionHelper actionHelper = new LDVaginalExaminationActionHelper(context, memberObject.getBaseEntityId()); + BaseLDVisitAction action = getBuilder(context.getString(R.string.lb_visit_vaginal_assessment)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.JsonForm.LDVisit.getLdVaginalExamination()) + .build(); + + actionList.put(context.getString(R.string.lb_visit_vaginal_assessment), action); + + } + + private void evaluateGenExamination(Map> details) throws BaseLDVisitAction.ValidationException { + + LDGeneralExaminationActionHelper actionHelper = new LDGeneralExaminationActionHelper(context, memberObject); + BaseLDVisitAction action = getBuilder(context.getString(R.string.lb_visit_general_examination)) + .withOptional(false) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.JsonForm.LDVisit.getLdGeneralExamination()) + .build(); + + actionList.put(context.getString(R.string.lb_visit_general_examination), action); + } + + @Override + public MemberObject getMemberClient(String memberID) { + + return LDDao.getMember(memberID); + } + + public BaseLDVisitAction.Builder getBuilder(String title) { + return new BaseLDVisitAction.Builder(context, title); + } + + @Override + protected String getEncounterType() { + return org.smartregister.chw.ld.util.Constants.EVENT_TYPE.LD_GENERAL_EXAMINATION; + } + + @Override + protected String getTableName() { + return org.smartregister.chw.ld.util.Constants.TABLES.EC_LD_GENERAL_EXAMINATION; + } + + @Override + protected void processExternalVisits(Visit visit, Map externalVisits, String memberID) throws Exception { + super.processExternalVisits(visit, externalVisits, memberID); + + /*List visits = new ArrayList<>(1); + visits.add(visit); + org.smartregister.chw.ld.util.VisitUtils.processVisits(visits, LDLibrary.getInstance().visitRepository(), LDLibrary.getInstance().visitDetailsRepository());*/ + try { + + LDVisitUtils.processVisits(memberID); + } catch (Exception e) { + Timber.e(e); + } + + } + + @Override + protected void prepareEvent(Event baseEvent) { + super.prepareEvent(baseEvent); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LoginInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LoginInteractor.java index 92522e06c..e3e9d1dc3 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LoginInteractor.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/LoginInteractor.java @@ -1,14 +1,21 @@ package org.smartregister.chw.hf.interactor; +import org.smartregister.CoreLibrary; +import org.smartregister.P2POptions; +import org.smartregister.chw.core.job.ChwIndicatorGeneratingJob; import org.smartregister.chw.core.job.CoreBasePncCloseJob; import org.smartregister.chw.core.job.HomeVisitServiceJob; import org.smartregister.chw.core.job.StockUsageReportJob; import org.smartregister.chw.core.job.VaccineRecurringServiceJob; import org.smartregister.chw.hf.BuildConfig; +import org.smartregister.chw.hf.job.PncCloseDateServiceJob; +import org.smartregister.chw.hf.job.ProcessVisitsServiceJob; import org.smartregister.immunization.job.VaccineServiceJob; import org.smartregister.job.ImageUploadServiceJob; +import org.smartregister.job.P2pServiceJob; import org.smartregister.job.PlanIntentServiceJob; import org.smartregister.job.PullUniqueIdsServiceJob; +import org.smartregister.job.SyncLocationsByLevelAndTagsServiceJob; import org.smartregister.job.SyncLocationsByTeamIdsJob; import org.smartregister.job.SyncServiceJob; import org.smartregister.job.SyncTaskServiceJob; @@ -33,6 +40,13 @@ protected void scheduleJobsPeriodically() { PullUniqueIdsServiceJob.scheduleJob(PullUniqueIdsServiceJob.TAG, TimeUnit.MINUTES.toMinutes( BuildConfig.PULL_UNIQUE_IDS_MINUTES), getFlexValue(BuildConfig.PULL_UNIQUE_IDS_MINUTES)); + P2POptions p2POptions = CoreLibrary.getInstance().getP2POptions(); + if (p2POptions != null && p2POptions.isEnableP2PLibrary()) { + // Finish processing any unprocessed sync records here + P2pServiceJob.scheduleJob(ProcessVisitsServiceJob.TAG, TimeUnit.MINUTES.toMinutes( + BuildConfig.DATA_SYNC_DURATION_MINUTES), getFlexValue(BuildConfig.DATA_SYNC_DURATION_MINUTES)); + } + VaccineRecurringServiceJob.scheduleJob(VaccineRecurringServiceJob.TAG, TimeUnit.MINUTES.toMinutes( BuildConfig.VACCINE_SYNC_PROCESSING_MINUTES), getFlexValue(BuildConfig.VACCINE_SYNC_PROCESSING_MINUTES)); @@ -42,10 +56,15 @@ protected void scheduleJobsPeriodically() { SyncTaskServiceJob.scheduleJob(SyncTaskServiceJob.TAG, TimeUnit.MINUTES.toMinutes( BuildConfig.DATA_SYNC_DURATION_MINUTES), getFlexValue(BuildConfig.DATA_SYNC_DURATION_MINUTES)); - StockUsageReportJob.scheduleJob(StockUsageReportJob.TAG, TimeUnit.MINUTES.toMinutes( + StockUsageReportJob.scheduleJob(StockUsageReportJob.TAG, TimeUnit.MINUTES.toMinutes( BuildConfig.STOCK_USAGE_REPORT_MINUTES), getFlexValue(BuildConfig.STOCK_USAGE_REPORT_MINUTES)); + ChwIndicatorGeneratingJob.scheduleJob(ChwIndicatorGeneratingJob.TAG, TimeUnit.MINUTES.toMinutes(BuildConfig.REPORT_INDICATOR_GENERATION_MINUTES), getFlexValue(BuildConfig.REPORT_INDICATOR_GENERATION_MINUTES)); + ProcessVisitsServiceJob.scheduleJob(ProcessVisitsServiceJob.TAG, TimeUnit.MINUTES.toMinutes( + BuildConfig.DATA_SYNC_DURATION_MINUTES), getFlexValue(BuildConfig.DATA_SYNC_DURATION_MINUTES)); + PncCloseDateServiceJob.scheduleJob(PncCloseDateServiceJob.TAG, TimeUnit.MINUTES.toMinutes( + BuildConfig.STOCK_USAGE_REPORT_MINUTES), getFlexValue(BuildConfig.STOCK_USAGE_REPORT_MINUTES)); } @Override @@ -60,5 +79,14 @@ protected void scheduleJobsImmediately() { VaccineRecurringServiceJob.scheduleJobImmediately(VaccineRecurringServiceJob.TAG); StockUsageReportJob.scheduleJobImmediately(StockUsageReportJob.TAG); SyncLocationsByTeamIdsJob.scheduleJobImmediately(SyncLocationsByTeamIdsJob.TAG); + SyncLocationsByLevelAndTagsServiceJob.scheduleJobImmediately(SyncLocationsByLevelAndTagsServiceJob.TAG); + ChwIndicatorGeneratingJob.scheduleJobImmediately(ChwIndicatorGeneratingJob.TAG); + ProcessVisitsServiceJob.scheduleJobImmediately(ProcessVisitsServiceJob.TAG); + PncCloseDateServiceJob.scheduleJobImmediately(PncCloseDateServiceJob.TAG); + P2POptions p2POptions = CoreLibrary.getInstance().getP2POptions(); + if (p2POptions != null && p2POptions.isEnableP2PLibrary()) { + // Finish processing any unprocessed sync records here + P2pServiceJob.scheduleJobImmediately(P2pServiceJob.TAG); + } } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PmtctFollowupVisitInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PmtctFollowupVisitInteractor.java new file mode 100644 index 000000000..4f36f99d7 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PmtctFollowupVisitInteractor.java @@ -0,0 +1,61 @@ +package org.smartregister.chw.hf.interactor; + +import org.smartregister.chw.core.interactor.CorePmtctHomeVisitInteractor; +import org.smartregister.chw.hf.utils.PmtctVisitUtils; +import org.smartregister.chw.pmtct.contract.BasePmtctHomeVisitContract; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; +import org.smartregister.chw.pmtct.util.Constants; + +import java.util.LinkedHashMap; +import java.util.Map; + +import timber.log.Timber; + +public class PmtctFollowupVisitInteractor extends CorePmtctHomeVisitInteractor { + private final Flavor flavor; + + public PmtctFollowupVisitInteractor() { + flavor = new PmtctFollowupVisitInteractorFlv(); + setFlavor(new PmtctFollowupVisitInteractorFlv()); + } + + + @Override + protected String getEncounterType() { + return Constants.EVENT_TYPE.PMTCT_FOLLOWUP; + } + + @Override + protected String getTableName() { + return Constants.TABLES.PMTCT_FOLLOW_UP; + } + + @Override + public void calculateActions(BasePmtctHomeVisitContract.View view, org.smartregister.chw.pmtct.domain.MemberObject memberObject, BasePmtctHomeVisitContract.InteractorCallBack callBack) { + //super.calculateActions(view, memberObject, callBack); + try { + PmtctVisitUtils.processVisits(); + } catch (Exception e) { + Timber.e(e); + } + + final Runnable runnable = () -> { + final LinkedHashMap actionList = new LinkedHashMap<>(); + + try { + + for (Map.Entry entry : flavor.calculateActions(view, memberObject, callBack).entrySet()) { + actionList.put(entry.getKey(), entry.getValue()); + } + } catch (BasePmtctHomeVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PmtctFollowupVisitInteractorFlv.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PmtctFollowupVisitInteractorFlv.java new file mode 100644 index 000000000..7634a10bb --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PmtctFollowupVisitInteractorFlv.java @@ -0,0 +1,436 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.util.JsonFormUtils.FIELDS; +import static org.smartregister.util.JsonFormUtils.STEP1; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.actionhelper.PmtctArvLineAction; +import org.smartregister.chw.hf.actionhelper.PmtctBaselineInvestigationAction; +import org.smartregister.chw.hf.actionhelper.PmtctCd4SampleCollection; +import org.smartregister.chw.hf.actionhelper.PmtctCounsellingAction; +import org.smartregister.chw.hf.actionhelper.PmtctDiseaseStagingAction; +import org.smartregister.chw.hf.actionhelper.PmtctNextFollowupVisitAction; +import org.smartregister.chw.hf.actionhelper.PmtctTbScreeningAction; +import org.smartregister.chw.hf.actionhelper.PmtctVisitAction; +import org.smartregister.chw.hf.dao.HfPmtctDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.PmtctLibrary; +import org.smartregister.chw.pmtct.contract.BasePmtctHomeVisitContract; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.Visit; +import org.smartregister.chw.pmtct.domain.VisitDetail; +import org.smartregister.chw.pmtct.model.BasePmtctHomeVisitAction; +import org.smartregister.chw.pmtct.util.AppExecutors; +import org.smartregister.chw.pmtct.util.JsonFormUtils; +import org.smartregister.chw.pmtct.util.VisitUtils; +import org.smartregister.chw.referral.util.JsonFormConstants; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PmtctFollowupVisitInteractorFlv implements PmtctFollowupVisitInteractor.Flavor { + + LinkedHashMap actionList = new LinkedHashMap<>(); + + private static String getFollowupStatusString(String followup_status, Context context) { + switch (followup_status) { + case "continuing_with_services": + return context.getString(R.string.continuing_with_services); + case "transfer_out": + return context.getString(R.string.transfer_out); + case "lost_to_followup": + return context.getString(R.string.lost_to_followup); + default: + return ""; + } + } + + @Override + public LinkedHashMap calculateActions(BasePmtctHomeVisitContract.View view, MemberObject memberObject, BasePmtctHomeVisitContract.InteractorCallBack callBack) throws BasePmtctHomeVisitAction.ValidationException { + + Context context = view.getContext(); + + Map> details = null; + // get the preloaded data + if (view.getEditMode()) { + Visit lastVisit = PmtctLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), org.smartregister.chw.pmtct.util.Constants.EVENT_TYPE.PMTCT_FOLLOWUP); + if (lastVisit != null) { + details = VisitUtils.getVisitGroups(PmtctLibrary.getInstance().visitDetailsRepository().getVisits(lastVisit.getVisitId())); + } + } + evaluatePmtctActions(view, details, callBack, memberObject, context); + + return actionList; + } + + + private void evaluatePmtctActions(BasePmtctHomeVisitContract.View view, Map> details, BasePmtctHomeVisitContract.InteractorCallBack callBack, MemberObject memberObject, Context context) + throws BasePmtctHomeVisitAction.ValidationException { + + if (!HfPmtctDao.isNewClient(memberObject.getBaseEntityId())) { + JSONObject followupStatusForm = null; + try { + followupStatusForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getPmtctFollowupStatus()); + JSONArray fields = followupStatusForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + + //update visit number + JSONObject visitNumber = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "visit_number"); + visitNumber.put(JsonFormUtils.VALUE, HfPmtctDao.getVisitNumber(memberObject.getBaseEntityId())); + + } catch (Exception e) { + Timber.e(e); + } + + BasePmtctHomeVisitAction FollowupStatus = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.pmtct_followup_status_title)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.getPmtctFollowupStatus()) + .withJsonPayload(followupStatusForm.toString()) + .withHelper(new PmtctFollowupStatusAction(view, memberObject, callBack, details)) + .build(); + + actionList.put(context.getString(R.string.pmtct_followup_status_title), FollowupStatus); + } else { + addActions(details, memberObject, context); + } + } + + private void addActions(Map> details, MemberObject memberObject, Context context) { + JSONObject counsellingForm = null; + try { + counsellingForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getPmtctCounselling()); + + //loads details to the form + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(counsellingForm, details); + } + BasePmtctHomeVisitAction Counselling = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.pmtct_counselling_title)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getPmtctCounselling()) + .withJsonPayload(counsellingForm.toString()) + .withHelper(new PmtctCounsellingAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.pmtct_counselling_title), Counselling); + + } catch (Exception e) { + e.printStackTrace(); + } + + JSONObject baselineInvestigationForm = null; + try { + baselineInvestigationForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getPmtctBaselineInvestigation()); + JSONObject global = baselineInvestigationForm.getJSONObject("global"); + + global.put("isLiverFunctionTestConducted", HfPmtctDao.isLiverFunctionTestConducted(memberObject.getBaseEntityId())); + global.put("isLiverFunctionTestResultsFilled", HfPmtctDao.isLiverFunctionTestResultsFilled(memberObject.getBaseEntityId())); + global.put("isRenalFunctionTestConducted", HfPmtctDao.isRenalFunctionTestConducted(memberObject.getBaseEntityId())); + global.put("isRenalFunctionTestResultsFilled", HfPmtctDao.isRenalFunctionTestResultsFilled(memberObject.getBaseEntityId())); + //loads details to the form + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(baselineInvestigationForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + + JSONObject tbScreeningForm = null; + try { + tbScreeningForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getPmtctTbScreening()); + JSONObject global = tbScreeningForm.getJSONObject("global"); + + String hasTheClientEverBeenProvidedWithTpTBefore = HfPmtctDao.hasTheClientBeenProvidedWithTpt(memberObject.getBaseEntityId()); + + global.put("is_provided_with_tpt_before", (hasTheClientEverBeenProvidedWithTpTBefore != null && !hasTheClientEverBeenProvidedWithTpTBefore.equals("no")) || HfPmtctDao.hasTheClientBeenProvidedWithTptInPreviousSessions(memberObject.getBaseEntityId())); + global.put("has_the_client_completed_tpt", (hasTheClientEverBeenProvidedWithTpTBefore != null && hasTheClientEverBeenProvidedWithTpTBefore.equals("yes")) || HfPmtctDao.hasTheClientCompletedTpt(memberObject.getBaseEntityId())); + + JSONArray fields = tbScreeningForm.getJSONObject(STEP1).getJSONArray(FIELDS); + JSONObject hasBeenProvidedWithTptBefore = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "has_been_provided_with_tpt_before"); + if (HfPmtctDao.hasTheClientBeenProvidedWithTptInPreviousSessions(memberObject.getBaseEntityId())) { + hasBeenProvidedWithTptBefore.remove("relevance"); + hasBeenProvidedWithTptBefore.put("value", "partial_complete"); + hasBeenProvidedWithTptBefore.put("type", "hidden"); + } + + //loads details to the form + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(tbScreeningForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + + JSONObject nextVisitForm = null; + try { + nextVisitForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getNextFacilityVisitForm()); + + //Using this form to store client followup status for new clients + //Followup status action wont be shown instead the status will be saved here + if (HfPmtctDao.isNewClient(memberObject.getBaseEntityId())) { + JSONArray fields = nextVisitForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + JSONObject followupStatus = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "followup_status"); + followupStatus.put(JsonFormUtils.VALUE, "new_client"); + } + + //loads details to the form + if (details != null && !details.isEmpty()) { + JsonFormUtils.populateForm(nextVisitForm, details); + } + } catch (Exception e) { + Timber.e(e); + } + + BasePmtctHomeVisitAction BaselineInvestigation = null; + try { + BaselineInvestigation = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.pmtct_baseline_investigation_title)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getPmtctBaselineInvestigation()) + .withJsonPayload(baselineInvestigationForm.toString()) + .withHelper(new PmtctBaselineInvestigationAction(memberObject)) + .build(); + } catch (BasePmtctHomeVisitAction.ValidationException e) { + e.printStackTrace(); + } + + if (HfPmtctDao.isEligibleForBaselineInvestigation(memberObject.getBaseEntityId()) || HfPmtctDao.isEligibleForBaselineInvestigationOnFollowupVisit(memberObject.getBaseEntityId())) + actionList.put(context.getString(R.string.pmtct_baseline_investigation_title), BaselineInvestigation); + + BasePmtctHomeVisitAction HvlSampleCollection = null; + try { + HvlSampleCollection = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.hvl_sample_collection)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getHvlClinicianDetailsForm()) + .withHelper(new HvlSampleCollectionAction(memberObject)) + .build(); + } catch (BasePmtctHomeVisitAction.ValidationException e) { + e.printStackTrace(); + } + + if (HfPmtctDao.isEligibleForHlvTest(memberObject.getBaseEntityId())) + actionList.put(context.getString(R.string.hvl_sample_collection), HvlSampleCollection); + + BasePmtctHomeVisitAction Cd4SampleCollection = null; + try { + Cd4SampleCollection = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.cd4_sample_collection)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getPmtctCd4SampleCollection()) + .withHelper(new PmtctCd4SampleCollection(memberObject)) + .build(); + } catch (BasePmtctHomeVisitAction.ValidationException e) { + e.printStackTrace(); + } + + if (HfPmtctDao.isEligibleForCD4Retest(memberObject.getBaseEntityId()) || HfPmtctDao.isEligibleForCD4Test(memberObject.getBaseEntityId())) + actionList.put(context.getString(R.string.cd4_sample_collection), Cd4SampleCollection); + + + try { + BasePmtctHomeVisitAction ClinicalDiseaseStaging = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.clinical_staging_of_hiv)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getPmtctClinicalStagingOfDisease()) + .withHelper(new PmtctDiseaseStagingAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.clinical_staging_of_hiv), ClinicalDiseaseStaging); + } catch (BasePmtctHomeVisitAction.ValidationException e) { + e.printStackTrace(); + } + + try { + BasePmtctHomeVisitAction TbScreening = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.tb_screening_title)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getPmtctTbScreening()) + .withJsonPayload(tbScreeningForm.toString()) + .withHelper(new PmtctTbScreeningAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.tb_screening_title), TbScreening); + + } catch (BasePmtctHomeVisitAction.ValidationException e) { + e.printStackTrace(); + } + + try { + BasePmtctHomeVisitAction ArvPrescription = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.arv_prescription_title)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getPmtctArvLine()) + .withHelper(new PmtctArvLineAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.arv_prescription_title), ArvPrescription); + } catch (BasePmtctHomeVisitAction.ValidationException e) { + e.printStackTrace(); + } + + try { + BasePmtctHomeVisitAction NextFollowupVisitDate = new BasePmtctHomeVisitAction.Builder(context, context.getString(R.string.next_visit)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getNextFacilityVisitForm()) + .withJsonPayload(nextVisitForm.toString()) + .withHelper(new PmtctNextFollowupVisitAction()) + .build(); + actionList.put(context.getString(R.string.next_visit), NextFollowupVisitDate); + } catch (BasePmtctHomeVisitAction.ValidationException e) { + Timber.e(e); + } + } + + private static class HvlSampleCollectionAction extends PmtctVisitAction { + protected MemberObject memberObject; + private String jsonPayload; + + private String clinician_name; + private BasePmtctHomeVisitAction.ScheduleStatus scheduleStatus; + private String subTitle; + private Context context; + + public HvlSampleCollectionAction(MemberObject memberObject) { + super(memberObject); + this.memberObject = memberObject; + } + + @Override + public void onJsonFormLoaded(String jsonPayload, Context context, Map> map) { + this.jsonPayload = jsonPayload; + this.context = context; + } + + @Override + public String getPreProcessed() { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + return jsonObject.toString(); + } catch (Exception e) { + Timber.e(e); + } + return null; + } + + @Override + public void onPayloadReceived(String jsonPayload) { + try { + JSONObject jsonObject = new JSONObject(jsonPayload); + clinician_name = CoreJsonFormUtils.getValue(jsonObject, "clinician_name"); + } catch (JSONException e) { + Timber.e(e); + } + } + + @Override + public BasePmtctHomeVisitAction.ScheduleStatus getPreProcessedStatus() { + return scheduleStatus; + } + + @Override + public String getPreProcessedSubTitle() { + return subTitle; + } + + @Override + public String postProcess(String s) { + return null; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(clinician_name)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(context.getString(R.string.hvl_sample_collected)); + + return stringBuilder.toString(); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(clinician_name)) { + return BasePmtctHomeVisitAction.Status.PENDING; + } else { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } + } + + @Override + public void onPayloadReceived(BasePmtctHomeVisitAction basePmtctHomeVisitAction) { + Timber.d("onPayloadReceived"); + } + } + + private class PmtctFollowupStatusAction extends org.smartregister.chw.hf.actionhelper.PmtctFollowupStatusAction { + Map> details; + BasePmtctHomeVisitContract.View view; + MemberObject memberObject; + BasePmtctHomeVisitContract.InteractorCallBack callBack; + + public PmtctFollowupStatusAction(BasePmtctHomeVisitContract.View view, MemberObject memberObject, BasePmtctHomeVisitContract.InteractorCallBack callBack, Map> details) { + super(memberObject); + this.details = details; + this.view = view; + this.memberObject = memberObject; + this.callBack = callBack; + } + + @Override + public String evaluateSubTitle() { + if (StringUtils.isBlank(followup_status)) + return null; + + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(view.getContext().getString(R.string.pmtct_followup_status)); + stringBuilder.append(" "); + stringBuilder.append(getFollowupStatusString(followup_status, view.getContext())); + + return stringBuilder.toString(); + } + + @Override + public BasePmtctHomeVisitAction.Status evaluateStatusOnPayload() { + if (StringUtils.isBlank(followup_status)) + return BasePmtctHomeVisitAction.Status.PENDING; + else if (followup_status.equals("continuing_with_services") || followup_status.equals("new_client")) { + return BasePmtctHomeVisitAction.Status.COMPLETED; + } else { + return BasePmtctHomeVisitAction.Status.PARTIALLY_COMPLETED; + } + } + + @Override + public String postProcess(String s) { + Context context = view.getContext(); + if (followup_status.equals("continuing_with_services") || followup_status.equals("new_client")) { + addActions(details, memberObject, context); + + } else { + actionList.remove(context.getString(R.string.pmtct_counselling_title)); + actionList.remove(context.getString(R.string.pmtct_baseline_investigation_title)); + actionList.remove(context.getString(R.string.hvl_sample_collection)); + actionList.remove(context.getString(R.string.cd4_sample_collection)); + actionList.remove(context.getString(R.string.clinical_staging_of_hiv)); + actionList.remove(context.getString(R.string.tb_screening_title)); + actionList.remove(context.getString(R.string.arv_prescription_title)); + actionList.remove(context.getString(R.string.next_visit)); + } + new AppExecutors().mainThread().execute(() -> callBack.preloadActions(actionList)); + return super.postProcess(s); + } + } + +} + + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PmtctMedicalHistoryInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PmtctMedicalHistoryInteractor.java new file mode 100644 index 000000000..1466269b9 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PmtctMedicalHistoryInteractor.java @@ -0,0 +1,60 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.anc.util.VisitUtils.getVisitDetailsOnly; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitGroups; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitsOnly; + +import android.content.Context; + +import org.smartregister.chw.anc.contract.BaseAncMedicalHistoryContract; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.core.CoreBaseAncMedicalHistoryInteractor; +import org.smartregister.chw.pmtct.util.Constants; + +import java.util.ArrayList; +import java.util.List; + +public class PmtctMedicalHistoryInteractor extends CoreBaseAncMedicalHistoryInteractor { + public static List getVisits(String memberID, String... eventTypes) { + + List visits = new ArrayList<>(); + if (eventTypes != null && eventTypes.length > 0) { + for (String eventType : eventTypes) { + List visit = getVisitsOnly(memberID, eventType); + visits.addAll(visit); + } + } else { + getVisitsOnly(memberID, Constants.EVENT_TYPE.PMTCT_FOLLOWUP); + } + + int x = 0; + while (visits.size() > x) { + Visit visit = visits.get(x); + List detailList = getVisitDetailsOnly(visit.getVisitId()); + visits.get(x).setVisitDetails(getVisitGroups(detailList)); + x++; + } + + return visits; + } + + @Override + public void getMemberHistory(final String memberID, final Context context, final BaseAncMedicalHistoryContract.InteractorCallBack callBack) { + final Runnable runnable = () -> { + + String[] eventTypes = new String[] {Constants.EVENT_TYPE.PMTCT_FOLLOWUP}; + List visits = getVisits(memberID, eventTypes); + final List all_visits = new ArrayList<>(visits); + + for (Visit visit : visits) { + List child_visits = VisitUtils.getChildVisits(visit.getVisitId()); + all_visits.addAll(child_visits); + } + appExecutors.mainThread().execute(() -> callBack.onDataFetched(all_visits)); + }; + + appExecutors.diskIO().execute(runnable); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PmtctProfileInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PmtctProfileInteractor.java new file mode 100644 index 000000000..fd08cea1f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PmtctProfileInteractor.java @@ -0,0 +1,47 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.client.utils.constants.JsonFormConstants.STEP1; +import static org.smartregister.client.utils.constants.JsonFormConstants.VALUE; + +import org.json.JSONObject; +import org.smartregister.chw.anc.util.JsonFormUtils; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.core.interactor.CorePmtctProfileInteractor; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.CoreReferralUtils; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.repository.AllSharedPreferences; + +import timber.log.Timber; + +public class PmtctProfileInteractor extends CorePmtctProfileInteractor { + public void createPmtctCommunityFollowupReferralEvent(AllSharedPreferences allSharedPreferences, String jsonString, String entityID) { + Event baseEvent = JsonFormUtils.processJsonForm(allSharedPreferences, CoreReferralUtils.setEntityId(jsonString, entityID), CoreConstants.TABLE_NAME.PMTCT_COMMUNITY_FOLLOWUP); + JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + + try { + JSONObject reasonsForIssuingCommunityReferral = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), STEP1, "reasons_for_issuing_community_referral"); + JSONObject motherChampionLocation = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), STEP1, "mother_champion_location"); + if (reasonsForIssuingCommunityReferral.getString(VALUE).equals("mother_champion_services")) { + //Updating the event type to Mother Champion Referral + baseEvent.setEventType(Constants.Events.MOTHER_CHAMPION_COMMUNITY_SERVICES_REFERRAL); + } + //update sync location to send the referral to the correct targeted chw, + // this is needed for the case of global search client who have moved or clients that may have moved village + if(motherChampionLocation != null){ + String locationId = CoreJsonFormUtils.getSyncLocationUUIDFromDropdown(motherChampionLocation); + baseEvent.setLocationId(locationId); + } + } catch (Exception e) { + Timber.e(e); + } + + try { + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(JsonFormUtils.gson.toJson(baseEvent))); + } catch (Exception e) { + Timber.e(e); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PncFacilityVisitInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PncFacilityVisitInteractor.java new file mode 100644 index 000000000..dd3da1844 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PncFacilityVisitInteractor.java @@ -0,0 +1,76 @@ +package org.smartregister.chw.hf.interactor; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.anc.contract.BaseAncHomeVisitContract; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.core.dao.PNCDao; +import org.smartregister.chw.core.interactor.CoreAncHomeVisitInteractor; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.PncVisitUtils; + +import java.util.LinkedHashMap; +import java.util.Map; + +import timber.log.Timber; + +public class PncFacilityVisitInteractor extends CoreAncHomeVisitInteractor { + private Flavor flavor; + private String parentVisitID; + + public PncFacilityVisitInteractor() { + setFlavor(new PncFacilityVisitInteractorFlv()); + flavor = new PncFacilityVisitInteractorFlv(); + } + + @Override + protected String getEncounterType() { + return Constants.Events.PNC_VISIT; + } + + @Override + protected String getTableName() { + return Constants.TableName.PNC_FOLLOWUP; + } + + @Override + public void calculateActions(BaseAncHomeVisitContract.View view, MemberObject memberObject, BaseAncHomeVisitContract.InteractorCallBack callBack) { + // update the local database incase of manual date adjustment + try { + PncVisitUtils.processVisits(); + } catch (Exception e) { + Timber.e(e); + } + + final Runnable runnable = () -> { + final LinkedHashMap actionList = new LinkedHashMap<>(); + + try { + + for (Map.Entry entry : flavor.calculateActions(view, memberObject, callBack).entrySet()) { + actionList.put(entry.getKey(), entry.getValue()); + } + } catch (BaseAncHomeVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + @Override + public MemberObject getMemberClient(String memberID) { + return PNCDao.getMember(memberID); + } + + @Override + protected String getParentVisitEventID(Visit visit, String parentEventType) { + if (StringUtils.isBlank(parentEventType)) + parentVisitID = visit.getVisitId(); + + return visit.getVisitId().equalsIgnoreCase(parentVisitID) ? null : parentVisitID; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PncFacilityVisitInteractorFlv.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PncFacilityVisitInteractorFlv.java new file mode 100644 index 000000000..27b9b8b79 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PncFacilityVisitInteractorFlv.java @@ -0,0 +1,228 @@ +package org.smartregister.chw.hf.interactor; + +import android.content.Context; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.contract.BaseAncHomeVisitContract; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.model.BaseAncHomeVisitAction; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.core.model.ChildModel; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.actionhelper.AncNextFollowupVisitAction; +import org.smartregister.chw.hf.actionhelper.PncChildGeneralExamination; +import org.smartregister.chw.hf.actionhelper.PncFamilyPlanningServicesAction; +import org.smartregister.chw.hf.actionhelper.PncHivTestingAction; +import org.smartregister.chw.hf.actionhelper.PncImmunizationAction; +import org.smartregister.chw.hf.actionhelper.PncMotherGeneralExaminationAction; +import org.smartregister.chw.hf.actionhelper.PncNutrionSupplementAction; +import org.smartregister.chw.hf.dao.HfPncDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.HfAncJsonFormUtils; +import org.smartregister.chw.referral.util.JsonFormConstants; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PncFacilityVisitInteractorFlv implements AncFirstFacilityVisitInteractor.Flavor { + LinkedHashMap actionList = new LinkedHashMap<>(); + private List children; + + private static JSONObject setMinChildHeadCircumference(JSONObject form, String baseEntityId, Context context) { + double currentMinHeadCircumference = HfPncDao.getChildMinHeadCircumference(baseEntityId); + try { + JSONArray fields = form.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + //update head_circumference minimum + JSONObject head_circumference = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "head_circumference"); + + if (head_circumference != null) { + JSONObject v_min = head_circumference.getJSONObject("v_min"); + v_min.put("value", currentMinHeadCircumference); + v_min.put("err", context.getString(R.string.head_circumference_min_err, String.valueOf(currentMinHeadCircumference))); + } + } catch (JSONException e) { + Timber.e(e); + } + return form; + } + + @Override + public LinkedHashMap calculateActions(BaseAncHomeVisitContract.View view, MemberObject memberObject, BaseAncHomeVisitContract.InteractorCallBack callBack) throws BaseAncHomeVisitAction.ValidationException { + + Context context = view.getContext(); + Boolean editMode = view.getEditMode(); + Map> details = null; + // get the preloaded data + if (editMode) { + Visit lastVisit = AncLibrary.getInstance().visitRepository().getLatestVisit(memberObject.getBaseEntityId(), Constants.Events.PNC_VISIT); + if (lastVisit != null) { + details = Collections.unmodifiableMap(VisitUtils.getVisitGroups(AncLibrary.getInstance().visitDetailsRepository().getVisits(lastVisit.getVisitId()))); + } + } + this.children = HfPncDao.childrenForPncWoman(memberObject.getBaseEntityId()); + + evaluatePncActions(memberObject, details, context, editMode); + return actionList; + } + + private void evaluatePncActions(MemberObject memberObject, Map> details, Context context, Boolean editMode + ) throws BaseAncHomeVisitAction.ValidationException { + + JSONObject motherGeneralExaminationForm = null; + try { + motherGeneralExaminationForm = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getPncMotherGeneralExamination()); + + JSONArray fields = motherGeneralExaminationForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + //update visit number + JSONObject visitNumber = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "visit_number"); + visitNumber.put(org.smartregister.chw.pmtct.util.JsonFormUtils.VALUE, HfPncDao.getVisitNumber(memberObject.getBaseEntityId())); + + //loads details to the form + if (details != null && !details.isEmpty()) { + HfAncJsonFormUtils.populateForm(motherGeneralExaminationForm, details); + } + } catch (JSONException e) { + Timber.e(e); + } + + BaseAncHomeVisitAction motherGeneralExamination = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.mother_general_examination)) + .withOptional(false) + .withDetails(details) + .withFormName(Constants.JsonForm.getPncMotherGeneralExamination()) + .withJsonPayload(motherGeneralExaminationForm.toString()) + .withHelper(new PncMotherGeneralExaminationAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.mother_general_examination), motherGeneralExamination); + int index = 1; + for (ChildModel child : children) { + JSONObject childGeneralExamForm = setMinChildHeadCircumference(FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getPncChildGeneralExamination()), child.getBaseEntityId(), context); + try { + childGeneralExamForm.getJSONObject("global").put("baseEntityId", child.getBaseEntityId()); + childGeneralExamForm.getJSONObject("global").put("is_eligible_for_bcg", HfPncDao.isChildEligibleForBcg(child.getBaseEntityId())); + childGeneralExamForm.getJSONObject("global").put("is_eligible_for_opv0", HfPncDao.isChildEligibleForOpv0(child.getBaseEntityId())); + childGeneralExamForm.getJSONObject("global").put("is_eligible_for_kangaroo", HfPncDao.isChildEligibleForKangaroo(child.getBaseEntityId(), memberObject.getBaseEntityId())); + } catch (JSONException e) { + Timber.e(e); + } + Map> childDetails = null; + if (editMode) { + Visit lastVisit = AncLibrary.getInstance().visitRepository().getLatestVisit(child.getBaseEntityId(), Constants.Events.PNC_CHILD_FOLLOWUP); + if (lastVisit != null) { + childDetails = VisitUtils.getVisitGroups(AncLibrary.getInstance().visitDetailsRepository().getVisits(lastVisit.getVisitId())); + } + if (childDetails != null && !childDetails.isEmpty()) { + HfAncJsonFormUtils.populateForm(childGeneralExamForm, childDetails); + } + } + if (children.size() == 1) { + String childName = child.getFirstName(); + if (childName.startsWith("Baby of")) { + childName = context.getString(R.string.child_general_examination_for_children_without_names, child.getFirstName()); + } else { + childName = context.getString(R.string.child_general_examination, child.getFirstName()); + } + BaseAncHomeVisitAction childGeneralExamination = new BaseAncHomeVisitAction.Builder(context, childName) + .withOptional(false) + .withDetails(childDetails) + .withBaseEntityID(child.getBaseEntityId()) + .withProcessingMode(BaseAncHomeVisitAction.ProcessingMode.SEPARATE) + .withJsonPayload(childGeneralExamForm.toString()) + .withFormName(Constants.JsonForm.getPncChildGeneralExamination()) + .withHelper(new PncChildGeneralExamination(memberObject)) + .build(); + + actionList.put(childName, childGeneralExamination); + } else { + String childName = child.getFirstName(); + if (childName != null && childName.startsWith("Baby of")) { + childName = context.getString(R.string.children_general_examination_for_children_without_names, child.getFirstName(), index); + } else { + childName = context.getString(R.string.children_general_examination, child.getFirstName(), index); + } + BaseAncHomeVisitAction childGeneralExamination = new BaseAncHomeVisitAction.Builder(context, childName) + .withOptional(false) + .withDetails(childDetails) + .withBaseEntityID(child.getBaseEntityId()) + .withProcessingMode(BaseAncHomeVisitAction.ProcessingMode.SEPARATE) + .withJsonPayload(childGeneralExamForm.toString()) + .withFormName(Constants.JsonForm.getPncChildGeneralExamination()) + .withHelper(new PncChildGeneralExamination(memberObject)) + .build(); + actionList.put(childName, childGeneralExamination); + } + index++; + } + + BaseAncHomeVisitAction familyPlanningServices = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.family_planning_services_title)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getPncFamilyPlanningServices()) + .withHelper(new PncFamilyPlanningServicesAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.family_planning_services_title), familyPlanningServices); + + if (HfPncDao.isMotherEligibleForTetanus(memberObject.getBaseEntityId()) || HfPncDao.isMotherEligibleForHepB(memberObject.getBaseEntityId())) { + JSONObject motherPncImmunization = FormUtils.getFormUtils().getFormJson(Constants.JsonForm.getPncImmunization()); + JSONObject global = null; + try { + global = motherPncImmunization.getJSONObject("global"); + global.put("is_eligible_for_tetanus", HfPncDao.isMotherEligibleForTetanus(memberObject.getBaseEntityId())); + global.put("is_eligible_for_hepatitis_b", HfPncDao.isMotherEligibleForHepB(memberObject.getBaseEntityId())); + } catch (JSONException e) { + e.printStackTrace(); + } + + BaseAncHomeVisitAction immunization = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.immunization_title)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getPncImmunization()) + .withJsonPayload(motherPncImmunization.toString()) + .withHelper(new PncImmunizationAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.immunization_title), immunization); + } + + if (HfPncDao.isMotherEligibleForHivTest(memberObject.getBaseEntityId())) { + BaseAncHomeVisitAction hivTesting = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.pnc_hiv_testing)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getPncHivTestResults()) + .withHelper(new PncHivTestingAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.pnc_hiv_testing), hivTesting); + } + + BaseAncHomeVisitAction nutritionSupplements = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.nutritional_supplements_title)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getPncNutritionalSupplement()) + .withHelper(new PncNutrionSupplementAction(memberObject)) + .build(); + actionList.put(context.getString(R.string.nutritional_supplements_title), nutritionSupplements); + + try { + BaseAncHomeVisitAction nextFollowupVisitDate = new BaseAncHomeVisitAction.Builder(context, context.getString(R.string.next_visit)) + .withOptional(true) + .withDetails(details) + .withFormName(Constants.JsonForm.getNextFacilityVisitForm()) + .withHelper(new AncNextFollowupVisitAction()) + .build(); + actionList.put(context.getString(R.string.next_visit), nextFollowupVisitDate); + } catch (BaseAncHomeVisitAction.ValidationException e) { + Timber.e(e); + } + } + + +} + diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PncMemberProfileInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PncMemberProfileInteractor.java index 577858d13..8179a7ca5 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PncMemberProfileInteractor.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PncMemberProfileInteractor.java @@ -1,15 +1,31 @@ package org.smartregister.chw.hf.interactor; +import static org.smartregister.util.Utils.getName; + +import android.widget.TextView; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.anc.util.DBConstants; import org.smartregister.chw.core.application.CoreChwApplication; import org.smartregister.chw.core.interactor.CorePncMemberProfileInteractor; import org.smartregister.chw.core.repository.ChwTaskRepository; import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.chw.hf.contract.PncMemberProfileContract; +import org.smartregister.chw.hf.repository.HfProfileRepository; +import org.smartregister.chw.pnc.PncLibrary; +import org.smartregister.chw.pnc.util.Constants; +import org.smartregister.chw.pnc.util.PncUtil; +import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.domain.Task; import org.smartregister.repository.TaskRepository; +import java.util.List; import java.util.Set; +import de.hdodenhof.circleimageview.CircleImageView; +import timber.log.Timber; + public class PncMemberProfileInteractor extends CorePncMemberProfileInteractor implements PncMemberProfileContract.Interactor { @@ -18,8 +34,55 @@ public void getReferralTasks(String planId, String baseEntityId, PncMemberProfileContract.InteractorCallback callback) { TaskRepository taskRepository = CoreChwApplication.getInstance().getTaskRepository(); - Set taskList = ((ChwTaskRepository)taskRepository).getReferralTasksForClientByStatus(planId, baseEntityId, CoreConstants.BUSINESS_STATUS.REFERRED); + Set taskList = ((ChwTaskRepository) taskRepository).getReferralTasksForClientByStatus(planId, baseEntityId, CoreConstants.BUSINESS_STATUS.REFERRED); callback.updateReferralTasks(taskList); } + + @Override + public String getPncMotherNameDetails(MemberObject memberObject, TextView textView, CircleImageView imageView) { + List children = new HfProfileRepository().getChildrenLessThan49DaysOld(memberObject.getBaseEntityId()); + String nameDetails = memberObject.getMemberName(); + textView.setText(nameDetails); + textView.setSingleLine(false); + imageView.setImageResource(org.smartregister.chw.opensrp_chw_anc.R.mipmap.ic_member); + for (CommonPersonObjectClient childObject : children) { + try { + char gender = childObject.getColumnmaps().get(Constants.KEY.GENDER).charAt(0); + textView.append(" +\n" + childNameDetails(childObject.getColumnmaps().get(DBConstants.KEY.FIRST_NAME), + childObject.getColumnmaps().get(DBConstants.KEY.MIDDLE_NAME), + childObject.getColumnmaps().get(DBConstants.KEY.LAST_NAME), + String.valueOf(PncUtil.getDaysDifference(childObject.getColumnmaps().get(DBConstants.KEY.DOB))), + gender)); + imageView.setImageResource(org.smartregister.chw.pnc.R.drawable.pnc_less_twenty_nine_days); + if (children.size() == 1) { + imageView.setMaxWidth(10); + imageView.setMaxHeight(10); + imageView.setBorderWidth(14); + if (gender == 'M') { + imageView.setBorderColor(PncLibrary.getInstance().context().getColorResource(org.smartregister.chw.pnc.R.color.light_blue)); + } else { + imageView.setBorderColor(PncLibrary.getInstance().context().getColorResource(org.smartregister.chw.pnc.R.color.light_pink)); + } + } + } catch (NullPointerException npe) { + Timber.e(npe); + } + } + + return nameDetails; + } + + private String childNameDetails(String firstName, String middleName, String surName, String age, char gender) { + String dayCountString = PncLibrary.getInstance().context().getStringResource(org.smartregister.chw.pnc.R.string.pnc_day_count); + String spacer = ", "; + middleName = middleName != null ? middleName : ""; + String name = getName(firstName, middleName); + name = getName(name, surName); + + if (StringUtils.isNotBlank(firstName)) { + return name + spacer + age + dayCountString + spacer + gender; + } + return null; + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PrEPMedicalHistoryInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PrEPMedicalHistoryInteractor.java new file mode 100644 index 000000000..e2c142212 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PrEPMedicalHistoryInteractor.java @@ -0,0 +1,71 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.chw.anc.util.VisitUtils.getVisitDetailsOnly; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitGroups; +import static org.smartregister.chw.anc.util.VisitUtils.getVisitsOnly; + +import android.content.Context; + +import com.google.gson.Gson; + +import org.smartregister.chw.anc.contract.BaseAncMedicalHistoryContract; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.util.VisitUtils; +import org.smartregister.chw.core.CoreBaseAncMedicalHistoryInteractor; +import org.smartregister.chw.hf.domain.SortableVisit; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class PrEPMedicalHistoryInteractor extends CoreBaseAncMedicalHistoryInteractor { + public static List getVisits(String memberID, String... eventTypes) { + + List visits = new ArrayList<>(); + if (eventTypes != null && eventTypes.length > 0) { + for (String eventType : eventTypes) { + List visit = getVisitsOnly(memberID, eventType); + visits.addAll(visit); + } + } + + int x = 0; + while (visits.size() > x) { + Visit visit = visits.get(x); + List detailList = getVisitDetailsOnly(visit.getVisitId()); + visits.get(x).setVisitDetails(getVisitGroups(detailList)); + x++; + } + + List sortableVisits = new ArrayList<>(); + for (Visit visit : visits) { + Gson gson = new Gson(); + SortableVisit sortableVisit = gson.fromJson(gson.toJson(visit), SortableVisit.class); + sortableVisits.add(sortableVisit); + } + + Collections.sort(sortableVisits); + + return sortableVisits; + } + + @Override + public void getMemberHistory(final String memberID, final Context context, final BaseAncMedicalHistoryContract.InteractorCallBack callBack) { + final Runnable runnable = () -> { + + String[] eventTypes = new String[]{ + org.smartregister.chw.kvp.util.Constants.EVENT_TYPE.PrEP_FOLLOWUP_VISIT}; + List visits = getVisits(memberID, eventTypes); + final List all_visits = new ArrayList<>(visits); + + for (Visit visit : visits) { + List child_visits = VisitUtils.getChildVisits(visit.getVisitId()); + all_visits.addAll(child_visits); + } + appExecutors.mainThread().execute(() -> callBack.onDataFetched(all_visits)); + }; + + appExecutors.diskIO().execute(runnable); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PrEPVisitInteractor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PrEPVisitInteractor.java new file mode 100644 index 000000000..47c52f4bc --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/interactor/PrEPVisitInteractor.java @@ -0,0 +1,189 @@ +package org.smartregister.chw.hf.interactor; + +import static org.smartregister.client.utils.constants.JsonFormConstants.FIELDS; +import static org.smartregister.client.utils.constants.JsonFormConstants.STEP1; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONObject; +import org.smartregister.chw.anc.util.AppExecutors; +import org.smartregister.chw.core.utils.FormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.actionhelper.prep.PrEPInitiationActionHelper; +import org.smartregister.chw.hf.actionhelper.prep.PrEPOtherServicesActionHelper; +import org.smartregister.chw.hf.dao.HfKvpDao; +import org.smartregister.chw.kvp.contract.BaseKvpVisitContract; +import org.smartregister.chw.kvp.domain.VisitDetail; +import org.smartregister.chw.kvp.interactor.BaseKvpVisitInteractor; +import org.smartregister.chw.kvp.model.BaseKvpVisitAction; +import org.smartregister.chw.kvp.util.Constants; + +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class PrEPVisitInteractor extends BaseKvpVisitInteractor { + + String visitType; + protected BaseKvpVisitContract.InteractorCallBack callBack; + + public PrEPVisitInteractor(String visitType) { + this.visitType = visitType; + } + + @Override + protected String getCurrentVisitType() { + if (StringUtils.isNotBlank(visitType)) { + return visitType; + } + return super.getCurrentVisitType(); + } + + @Override + protected void populateActionList(BaseKvpVisitContract.InteractorCallBack callBack) { + this.callBack = callBack; + final Runnable runnable = () -> { + try { + evaluateVisitType(details); + + } catch (BaseKvpVisitAction.ValidationException e) { + Timber.e(e); + } + + appExecutors.mainThread().execute(() -> callBack.preloadActions(actionList)); + }; + + appExecutors.diskIO().execute(runnable); + } + + private void evaluateVisitType(Map> details) throws BaseKvpVisitAction.ValidationException { + JSONObject prepVisitType = FormUtils.getFormUtils().getFormJson(Constants.PrEP_FOLLOWUP_FORMS.VISIT_TYPE); + + try { + if (HfKvpDao.hasPrepFollowup(memberObject.getBaseEntityId())) { + JSONArray fields = prepVisitType.getJSONObject(STEP1).getJSONArray(FIELDS); + JSONObject visitType = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "visit_type"); + visitType.getJSONArray("options").remove(2); + visitType.getJSONArray("options").remove(0); + } + } catch (Exception e) { + Timber.e(e); + } + + PrEPVisitTypeActionHelper actionHelper = new PrEPVisitTypeActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.prep_visit_type)) + .withOptional(false) + .withDetails(details) + .withJsonPayload(prepVisitType.toString()) + .withHelper(actionHelper) + .withFormName(Constants.PrEP_FOLLOWUP_FORMS.VISIT_TYPE) + .build(); + + actionList.put(context.getString(R.string.prep_visit_type), action); + } + + private void evaluatePrEPScreening(Map> details) throws BaseKvpVisitAction.ValidationException { + PrEPScreeningActionHelper actionHelper = new PrEPScreeningActionHelper(memberObject.getBaseEntityId()); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.prep_screening)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.PrEP_FOLLOWUP_FORMS.SCREENING) + .build(); + + actionList.put(context.getString(R.string.prep_screening), action); + } + + private void evaluatePrEPInitiation(Map> details) throws BaseKvpVisitAction.ValidationException { + JSONObject prepInitiation = FormUtils.getFormUtils().getFormJson(Constants.PrEP_FOLLOWUP_FORMS.INITIATION); + + try { + if (HfKvpDao.isPrEPInitiated(memberObject.getBaseEntityId())) { + JSONArray fields = prepInitiation.getJSONObject(STEP1).getJSONArray(FIELDS); + JSONObject prepStatus = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "prep_status"); + prepStatus.getJSONArray("options").remove(3); + prepStatus.getJSONArray("options").remove(0); + } + } catch (Exception e) { + Timber.e(e); + } + + PrEPInitiationActionHelper actionHelper = new PrEPInitiationActionHelper(memberObject.getBaseEntityId()); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.prep_initiation)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withJsonPayload(prepInitiation.toString()) + .withFormName(Constants.PrEP_FOLLOWUP_FORMS.INITIATION) + .build(); + + actionList.put(context.getString(R.string.prep_initiation), action); + } + + private void evaluateOtherServices(Map> details) throws BaseKvpVisitAction.ValidationException { + + PrEPOtherServicesActionHelper actionHelper = new PrEPOtherServicesActionHelper(); + BaseKvpVisitAction action = getBuilder(context.getString(R.string.other_services)) + .withOptional(true) + .withDetails(details) + .withHelper(actionHelper) + .withFormName(Constants.PrEP_FOLLOWUP_FORMS.OTHER_SERVICES) + .build(); + + actionList.put(context.getString(R.string.other_services), action); + } + + @Override + protected String getEncounterType() { + return Constants.EVENT_TYPE.PrEP_FOLLOWUP_VISIT; + } + + @Override + protected String getTableName() { + return Constants.TABLES.PrEP_FOLLOWUP; + } + + private class PrEPVisitTypeActionHelper extends org.smartregister.chw.hf.actionhelper.prep.PrEPVisitTypeActionHelper { + @Override + public String postProcess(String s) { + if (StringUtils.isNotBlank(visit_type)) { + try { + evaluatePrEPScreening(details); + } catch (BaseKvpVisitAction.ValidationException e) { + e.printStackTrace(); + } + } else { + actionList.remove(context.getString(R.string.prep_screening)); + actionList.remove(context.getString(R.string.prep_initiation)); + actionList.remove(context.getString(R.string.other_services)); + } + new AppExecutors().mainThread().execute(() -> callBack.preloadActions(actionList)); + return super.postProcess(s); + } + + } + + private class PrEPScreeningActionHelper extends org.smartregister.chw.hf.actionhelper.prep.PrEPScreeningActionHelper { + public PrEPScreeningActionHelper(String baseEntityId) { + super(baseEntityId); + } + + @Override + public String postProcess(String s) { + if (should_initiate.equalsIgnoreCase("yes")) { + try { + evaluatePrEPInitiation(details); + evaluateOtherServices(details); + } catch (BaseKvpVisitAction.ValidationException e) { + e.printStackTrace(); + } + } else { + actionList.remove(context.getString(R.string.prep_initiation)); + actionList.remove(context.getString(R.string.other_services)); + } + new AppExecutors().mainThread().execute(() -> callBack.preloadActions(actionList)); + return super.postProcess(s); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/job/HfJobCreator.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/job/HfJobCreator.java index d4b38824a..caaaeb1ca 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/job/HfJobCreator.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/job/HfJobCreator.java @@ -6,16 +6,18 @@ import com.evernote.android.job.Job; import com.evernote.android.job.JobCreator; +import org.smartregister.chw.core.job.ChwIndicatorGeneratingJob; import org.smartregister.chw.core.job.CloseExpiredReferralsServiceJob; import org.smartregister.chw.core.job.SyncTaskWithClientEventsServiceJob; import org.smartregister.chw.core.job.VaccineRecurringServiceJob; -import org.smartregister.chw.core.sync.intent.SyncClientEventsPerTaskIntentService; +import org.smartregister.chw.hf.sync.intent.HfSyncClientEventsPerTaskIntentService; import org.smartregister.chw.hf.sync.intent.HfSyncTaskIntentService; import org.smartregister.job.ExtendedSyncServiceJob; import org.smartregister.job.ImageUploadServiceJob; import org.smartregister.job.LocationStructureServiceJob; -import org.smartregister.job.PlanIntentServiceJob; +import org.smartregister.job.P2pServiceJob; import org.smartregister.job.PullUniqueIdsServiceJob; +import org.smartregister.job.SyncLocationsByLevelAndTagsServiceJob; import org.smartregister.job.SyncLocationsByTeamIdsJob; import org.smartregister.job.SyncServiceJob; import org.smartregister.job.SyncTaskServiceJob; @@ -52,11 +54,23 @@ public Job create(@NonNull String tag) { /* case PlanIntentServiceJob.TAG: return new PlanIntentServiceJob();*/ case SyncTaskWithClientEventsServiceJob.TAG: - return new SyncTaskWithClientEventsServiceJob(SyncClientEventsPerTaskIntentService.class); + return new SyncTaskWithClientEventsServiceJob(HfSyncClientEventsPerTaskIntentService.class); case CloseExpiredReferralsServiceJob.TAG: return new CloseExpiredReferralsServiceJob(); case SyncLocationsByTeamIdsJob.TAG: return new SyncLocationsByTeamIdsJob(); + case SyncLocationsByLevelAndTagsServiceJob.TAG: + return new SyncLocationsByLevelAndTagsServiceJob(); + case ChwIndicatorGeneratingJob.TAG: + return new ChwIndicatorGeneratingJob(); + case MarkPmtctAndHeiLtfServiceJob.TAG: + return new MarkPmtctAndHeiLtfServiceJob(); + case ProcessVisitsServiceJob.TAG: + return new ProcessVisitsServiceJob(); + case PncCloseDateServiceJob.TAG: + return new PncCloseDateServiceJob(); + case P2pServiceJob.TAG: + return new P2pServiceJob(); default: Timber.d("Please create job and specify the right job tag"); return null; diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/job/MarkPmtctAndHeiLtfServiceJob.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/job/MarkPmtctAndHeiLtfServiceJob.java new file mode 100644 index 000000000..dcf30644b --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/job/MarkPmtctAndHeiLtfServiceJob.java @@ -0,0 +1,27 @@ +package org.smartregister.chw.hf.job; + +import android.content.Intent; + +import androidx.annotation.NonNull; + +import org.smartregister.AllConstants; +import org.smartregister.chw.hf.sync.intent.MarkPmtctAndHeiLtfIntentService; +import org.smartregister.job.BaseJob; + +/** + * Created by cozej4 on 2022-03-24. + * + * @author cozej4 https://github.com/cozej4 + */ +public class MarkPmtctAndHeiLtfServiceJob extends BaseJob { + + public static final String TAG = "MarkPmtctAndHeiLtfServiceJob"; + + @NonNull + @Override + protected Result onRunJob(@NonNull Params params) { + Intent intent = new Intent(getApplicationContext(), MarkPmtctAndHeiLtfIntentService.class); + getApplicationContext().startService(intent); + return params != null && params.getExtras().getBoolean(AllConstants.INTENT_KEY.TO_RESCHEDULE, false) ? Result.RESCHEDULE : Result.SUCCESS; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/job/PncCloseDateServiceJob.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/job/PncCloseDateServiceJob.java new file mode 100644 index 000000000..76d401a7b --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/job/PncCloseDateServiceJob.java @@ -0,0 +1,22 @@ +package org.smartregister.chw.hf.job; + +import android.content.Intent; + +import androidx.annotation.NonNull; + +import org.smartregister.AllConstants; +import org.smartregister.chw.hf.sync.intent.PncCloseDateIntentService; +import org.smartregister.job.BaseJob; + +public class PncCloseDateServiceJob extends BaseJob { + + public static final String TAG = "PncCloseDateServiceJob"; + + @NonNull + @Override + protected Result onRunJob(@NonNull Params params) { + Intent intent = new Intent(getApplicationContext(), PncCloseDateIntentService.class); + getApplicationContext().startService(intent); + return params != null && params.getExtras().getBoolean(AllConstants.INTENT_KEY.TO_RESCHEDULE, false) ? Result.RESCHEDULE : Result.SUCCESS; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/job/ProcessVisitsServiceJob.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/job/ProcessVisitsServiceJob.java new file mode 100644 index 000000000..1a691b18e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/job/ProcessVisitsServiceJob.java @@ -0,0 +1,22 @@ +package org.smartregister.chw.hf.job; + +import android.content.Intent; + +import androidx.annotation.NonNull; + +import org.smartregister.AllConstants; +import org.smartregister.chw.hf.sync.intent.ProcessVisitsIntentService; +import org.smartregister.job.BaseJob; + +public class ProcessVisitsServiceJob extends BaseJob { + + public static final String TAG = "ProcessVisitsServiceJob"; + + @NonNull + @Override + protected Result onRunJob(@NonNull Params params) { + Intent intent = new Intent(getApplicationContext(), ProcessVisitsIntentService.class); + getApplicationContext().startService(intent); + return params != null && params.getExtras().getBoolean(AllConstants.INTENT_KEY.TO_RESCHEDULE, false) ? Result.RESCHEDULE : Result.SUCCESS; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/AncBottomNavigationListener.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/AncBottomNavigationListener.java new file mode 100644 index 000000000..91b0a619a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/AncBottomNavigationListener.java @@ -0,0 +1,31 @@ +package org.smartregister.chw.hf.listener; + +import android.app.Activity; +import android.view.MenuItem; + +import androidx.annotation.NonNull; + +import org.smartregister.chw.anc.listener.BaseAncBottomNavigationListener; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.AncRegisterActivity; + +public class AncBottomNavigationListener extends BaseAncBottomNavigationListener { + private final AncRegisterActivity baseRegisterActivity; + + public AncBottomNavigationListener(Activity context) { + super(context); + this.baseRegisterActivity = (AncRegisterActivity) context; + } + + @Override + public boolean onNavigationItemSelected(@NonNull MenuItem item) { + if (item.getItemId() == R.id.action_anc) { + baseRegisterActivity.switchToFragment(0); + return true; + } else if (item.getItemId() == R.id.action_view_pregnancy_confirmation_referrals) { + baseRegisterActivity.switchToFragment(1); + return true; + } else + return super.onNavigationItemSelected(item); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/CdpBottomNavigationListener.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/CdpBottomNavigationListener.java new file mode 100644 index 000000000..a06c905fa --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/CdpBottomNavigationListener.java @@ -0,0 +1,37 @@ +package org.smartregister.chw.hf.listener; + +import android.app.Activity; +import android.view.MenuItem; + +import org.smartregister.chw.cdp.activity.BaseCdpRegisterActivity; +import org.smartregister.chw.cdp.listener.BaseCdpBottomNavigationListener; + +import androidx.annotation.NonNull; + +public class CdpBottomNavigationListener extends BaseCdpBottomNavigationListener { + private final Activity context; + + public CdpBottomNavigationListener(Activity context) { + super(context); + this.context = context; + } + + @Override + public boolean onNavigationItemSelected(@NonNull MenuItem item) { + super.onNavigationItemSelected(item); + + BaseCdpRegisterActivity baseRegisterActivity = (BaseCdpRegisterActivity) context; + int itemId = item.getItemId(); + if (itemId == org.smartregister.cdp.R.id.action_family) { + baseRegisterActivity.switchToBaseFragment(); + } else if (itemId == org.smartregister.cdp.R.id.action_order_receive) { + baseRegisterActivity.switchToFragment(1); + } else if (itemId == org.smartregister.cdp.R.id.action_receive_from_organizations) { + baseRegisterActivity.switchToFragment(2); + } else if (itemId == org.smartregister.cdp.R.id.action_add_outlet) { + baseRegisterActivity.startOutletForm(); + } + + return true; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/CommunityFollowupFeedbackRecyclerClickListener.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/CommunityFollowupFeedbackRecyclerClickListener.java new file mode 100644 index 000000000..fb2939aba --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/CommunityFollowupFeedbackRecyclerClickListener.java @@ -0,0 +1,61 @@ +package org.smartregister.chw.hf.listener; + +import android.app.Activity; +import android.view.View; + +import org.jetbrains.annotations.Contract; +import org.smartregister.chw.hf.activity.CommunityFollowupFeedbackViewActivity; +import org.smartregister.chw.hf.model.ChwFollowupFeedbackDetailsModel; +import org.smartregister.commonregistry.CommonPersonObjectClient; + +/** + * Created by cozej4 on 6/21/20. + * + * @author cozej4 https://github.com/cozej4 + */ + +public class CommunityFollowupFeedbackRecyclerClickListener implements View.OnClickListener { + private ChwFollowupFeedbackDetailsModel followupFeedbackDetailsModel; + private Activity activity; + private String startingActivity; + private CommonPersonObjectClient commonPersonObjectClient; + + @Override + public void onClick(View view) { + CommunityFollowupFeedbackViewActivity.startCommunityFollowupFeedbackViewActivity(getActivity(), getCommonPersonObjectClient(), getFollowupFeedbackDetailsModel(), getStartingActivity()); + } + + public Activity getActivity() { + return activity; + } + + public void setActivity(Activity activity) { + this.activity = activity; + } + + public ChwFollowupFeedbackDetailsModel getFollowupFeedbackDetailsModel() { + return followupFeedbackDetailsModel; + } + + public void setFollowupFeedbackDetailsModel(ChwFollowupFeedbackDetailsModel followupFeedbackDetailsModel) { + this.followupFeedbackDetailsModel = followupFeedbackDetailsModel; + } + + @Contract(pure = true) + private String getStartingActivity() { + return startingActivity; + } + + public void setStartingActivity(String startingActivity) { + this.startingActivity = startingActivity; + } + + @Contract(pure = true) + private CommonPersonObjectClient getCommonPersonObjectClient() { + return commonPersonObjectClient; + } + + public void setCommonPersonObjectClient(CommonPersonObjectClient commonPersonObjectClient) { + this.commonPersonObjectClient = commonPersonObjectClient; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/CommunityIndexFollowupFeedbackRecyclerClickListener.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/CommunityIndexFollowupFeedbackRecyclerClickListener.java new file mode 100644 index 000000000..7be75e893 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/CommunityIndexFollowupFeedbackRecyclerClickListener.java @@ -0,0 +1,55 @@ +package org.smartregister.chw.hf.listener; + +import android.app.Activity; +import android.view.View; + +import org.jetbrains.annotations.Contract; +import org.smartregister.chw.hf.activity.CommunityIndexFollowupFeedbackViewActivity; +import org.smartregister.chw.hf.model.HivIndexFollowupFeedbackDetailsModel; +import org.smartregister.commonregistry.CommonPersonObjectClient; + +public class CommunityIndexFollowupFeedbackRecyclerClickListener implements View.OnClickListener { + private HivIndexFollowupFeedbackDetailsModel followupFeedbackDetailsModel; + private Activity activity; + private String startingActivity; + private CommonPersonObjectClient commonPersonObjectClient; + + @Override + public void onClick(View view) { + CommunityIndexFollowupFeedbackViewActivity.startCommunityIndexFollowupFeedbackViewActivity(getActivity(), getCommonPersonObjectClient(),getStartingActivity(),getFollowupFeedbackDetailsModel()); + } + + public Activity getActivity() { + return activity; + } + + public void setActivity(Activity activity) { + this.activity = activity; + } + + public HivIndexFollowupFeedbackDetailsModel getFollowupFeedbackDetailsModel() { + return followupFeedbackDetailsModel; + } + + public void setFollowupFeedbackDetailsModel(HivIndexFollowupFeedbackDetailsModel followupFeedbackDetailsModel) { + this.followupFeedbackDetailsModel = followupFeedbackDetailsModel; + } + + @Contract(pure = true) + private String getStartingActivity() { + return startingActivity; + } + + public void setStartingActivity(String startingActivity) { + this.startingActivity = startingActivity; + } + + @Contract(pure = true) + private CommonPersonObjectClient getCommonPersonObjectClient() { + return commonPersonObjectClient; + } + + public void setCommonPersonObjectClient(CommonPersonObjectClient commonPersonObjectClient) { + this.commonPersonObjectClient = commonPersonObjectClient; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/KvpServiceActionHandler.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/KvpServiceActionHandler.java new file mode 100644 index 000000000..c1022088f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/listener/KvpServiceActionHandler.java @@ -0,0 +1,37 @@ +package org.smartregister.chw.hf.listener; + +import android.app.Activity; +import android.content.Context; +import android.widget.Toast; + +import org.smartregister.chw.hf.activity.KvpBehavioralServiceActivity; +import org.smartregister.chw.hf.activity.KvpBioMedicalServiceActivity; +import org.smartregister.chw.hf.activity.KvpOtherServiceActivity; +import org.smartregister.chw.hf.activity.KvpStructuralServiceActivity; +import org.smartregister.chw.kvp.domain.ServiceCard; +import org.smartregister.chw.kvp.handlers.BaseServiceActionHandler; +import org.smartregister.chw.kvp.util.Constants; + +public class KvpServiceActionHandler extends BaseServiceActionHandler { + @Override + protected void startVisitActivity(Context context, ServiceCard serviceCard, String baseEntityId) { + boolean isEditMode = isEditMode(serviceCard.getServiceEventName(), baseEntityId); + if (serviceCard.getServiceId().equals(Constants.SERVICES.KVP_BIO_MEDICAL)) { + KvpBioMedicalServiceActivity.startKvpBioMedicalServiceActivity((Activity) context, baseEntityId, isEditMode); + return; + } + else if (serviceCard.getServiceId().equals(Constants.SERVICES.KVP_BEHAVIORAL)) { + KvpBehavioralServiceActivity.startKvpBehavioralServiceActivity((Activity) context, baseEntityId, isEditMode); + return; + } + else if (serviceCard.getServiceId().equals(Constants.SERVICES.KVP_STRUCTURAL)) { + KvpStructuralServiceActivity.startKvpStructuralServiceActivity((Activity) context, baseEntityId, isEditMode); + return; + } + else if (serviceCard.getServiceId().equals(Constants.SERVICES.KVP_OTHERS)) { + KvpOtherServiceActivity.startKvpOtherServiceActivity((Activity) context, baseEntityId, isEditMode); + return; + } + Toast.makeText(context, serviceCard.getServiceName() + "Loading activity... ", Toast.LENGTH_SHORT).show(); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/AdvancedSearchFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/AdvancedSearchFragmentModel.java new file mode 100644 index 000000000..8add85a1b --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/AdvancedSearchFragmentModel.java @@ -0,0 +1,14 @@ +package org.smartregister.chw.hf.model; + +import org.smartregister.configurableviews.model.RegisterConfiguration; +import org.smartregister.family.model.BaseFamilyRegisterFramentModel; +import org.smartregister.family.util.ConfigHelper; +import org.smartregister.family.util.Utils; + +public class AdvancedSearchFragmentModel extends BaseFamilyRegisterFramentModel { + + @Override + public RegisterConfiguration defaultRegisterConfiguration() { + return ConfigHelper.defaultRegisterConfiguration(Utils.context().applicationContext()); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/AncReferralListRegisterRegisterFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/AncReferralListRegisterRegisterFragmentModel.java new file mode 100644 index 000000000..882e8a616 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/AncReferralListRegisterRegisterFragmentModel.java @@ -0,0 +1,56 @@ +package org.smartregister.chw.hf.model; + +import org.smartregister.chw.core.model.CoreAncRegisterFragmentModel; +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class AncReferralListRegisterRegisterFragmentModel extends CoreAncRegisterFragmentModel { + @Override + protected String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(CoreConstants.TABLE_NAME.TASK + ".*"); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.PRIMARY_CAREGIVER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + + return columnList.toArray(new String[columnList.size()]); + } + + + @Override + public String mainSelect(String tableName, String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.TASK + " ON " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID + " = " + CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.FOR + " COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY + " ON " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + queryBuilder.customJoin("LEFT JOIN " + CoreConstants.TABLE_NAME.ANC_MEMBER + " ON " + CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.FOR + " = " + CoreConstants.TABLE_NAME.ANC_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE"); + + return queryBuilder.mainCondition(mainCondition); + } + + @Override + public String countSelect(String tableName, String mainCondition) { + SmartRegisterQueryBuilder countQueryBuilder = new SmartRegisterQueryBuilder(); + countQueryBuilder.selectInitiateMainTableCounts(tableName); + countQueryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.TASK + " ON " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID + " = " + CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.FOR + " COLLATE NOCASE "); + countQueryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY + " ON " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + countQueryBuilder.customJoin("LEFT JOIN " + CoreConstants.TABLE_NAME.ANC_MEMBER + " ON " + CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.FOR + " = " + CoreConstants.TABLE_NAME.ANC_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE"); + String selectQuery = countQueryBuilder.mainCondition(mainCondition); + return selectQuery; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/Cd4ResultsFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/Cd4ResultsFragmentModel.java new file mode 100644 index 000000000..4ed3b611c --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/Cd4ResultsFragmentModel.java @@ -0,0 +1,61 @@ +package org.smartregister.chw.hf.model; + +import static org.smartregister.chw.cdp.util.DBConstants.KEY.FORM_SUBMISSION_ID; + +import androidx.annotation.NonNull; + +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.model.BaseHvlResultsFragmentModel; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class Cd4ResultsFragmentModel extends BaseHvlResultsFragmentModel { + + @NonNull + @Override + public String mainSelect(@NonNull String tableName, @NonNull String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " ON " + tableName + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.ENTITY_ID + "= " + Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + Constants.TABLE_NAME.FAMILY + " ON " + Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " as T1 ON " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.PRIMARY_CAREGIVER + " = T1." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " as T2 ON " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD + " = T2." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_CD4_RESULTS + " ON " + org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_CD4_RESULTS + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.CD4_FOLLOWUP_FORM_SUBMISSION_ID + " = " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + return queryBuilder.mainCondition(mainCondition); + } + + @Override + protected String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + columnList.add(tableName + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.ENTITY_ID + " as " + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(tableName + "." + DBConstants.KEY.BASE_ENTITY_ID + " as " + org.smartregister.chw.pmtct.util.DBConstants.KEY.ENTITY_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.GENDER); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columnList.add("T2." + DBConstants.KEY.PHONE_NUMBER + " AS " + org.smartregister.chw.tb.util.DBConstants.Key.FAMILY_HEAD_PHONE_NUMBER); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add("T1." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.PRIMARY_CAREGIVER); + columnList.add("T2." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.FAMILY_HEAD); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + columnList.add(org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_FOLLOW_UP + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.CD4_SAMPLE_ID); + columnList.add(org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_CD4_RESULTS + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.CD4_RESULT); + columnList.add(org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_FOLLOW_UP + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.CD4_SAMPLE_COLLECTION_DATE); + columnList.add(org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_CD4_RESULTS + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.CD4_RESULT_DATE); + columnList.add(org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_CD4_RESULTS + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.CD4_FOLLOWUP_FORM_SUBMISSION_ID); + columnList.add(org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_CD4_RESULTS + "." + DBConstants.KEY.BASE_ENTITY_ID + " as " + FORM_SUBMISSION_ID); + + return columnList.toArray(new String[columnList.size()]); + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/ChildProfileModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/ChildProfileModel.java deleted file mode 100644 index 5693b9625..000000000 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/ChildProfileModel.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.smartregister.chw.hf.model; - -import org.json.JSONObject; -import org.smartregister.chw.core.model.CoreChildProfileModel; -import org.smartregister.chw.core.utils.CoreJsonFormUtils; -import org.smartregister.dao.LocationsDao; - -import java.util.Collections; - -import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; -import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; -import static org.smartregister.util.JsonFormUtils.STEP1; - -public class ChildProfileModel extends CoreChildProfileModel { - - public ChildProfileModel(String familyName) { - super(familyName); - } - - @Override - public JSONObject getFormAsJson(String formName, String entityId, String currentLocationId, String familyID) throws Exception { - JSONObject form = super.getFormAsJson(formName, entityId, currentLocationId, familyID); - JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(form, STEP1, SYNC_LOCATION_ID); - CoreJsonFormUtils.addLocationsToDropdownField(LocationsDao.getLocationsByTags( - Collections.singleton(SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS)), syncLocationField); - return form; - } -} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/ChildRegisterModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/ChildRegisterModel.java index b0bccde03..74606ea31 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/ChildRegisterModel.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/ChildRegisterModel.java @@ -2,37 +2,16 @@ import android.util.Pair; -import org.json.JSONObject; import org.smartregister.chw.core.model.CoreChildRegisterModel; -import org.smartregister.chw.core.utils.CoreJsonFormUtils; import org.smartregister.chw.hf.utils.JsonFormUtils; import org.smartregister.clientandeventmodel.Client; import org.smartregister.clientandeventmodel.Event; -import org.smartregister.dao.LocationsDao; import org.smartregister.family.util.Utils; -import java.util.Collections; - -import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; -import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; -import static org.smartregister.util.JsonFormUtils.STEP1; - public class ChildRegisterModel extends CoreChildRegisterModel { @Override public Pair processRegistration(String jsonString) { return JsonFormUtils.processChildRegistrationForm(Utils.context().allSharedPreferences(), jsonString); } - - @Override - public JSONObject getFormAsJson(String formName, String entityId, String currentLocationId, String familyID) throws Exception { - JSONObject form = getFormUtils().getFormJson(formName); - if (form == null) { - return null; - } - JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(form, STEP1, SYNC_LOCATION_ID); - CoreJsonFormUtils.addLocationsToDropdownField(LocationsDao.getLocationsByTags( - Collections.singleton(SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS)), syncLocationField); - return JsonFormUtils.getFormAsJson(form, formName, entityId, currentLocationId, familyID); - } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/ChwFollowupFeedbackDetailsModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/ChwFollowupFeedbackDetailsModel.java new file mode 100644 index 000000000..3c50306ca --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/ChwFollowupFeedbackDetailsModel.java @@ -0,0 +1,60 @@ +package org.smartregister.chw.hf.model; + +import java.io.Serializable; + +public class ChwFollowupFeedbackDetailsModel implements Serializable { + private String feedbackType; + private String baseEntityId; + private String feedbackFormSubmissionId; + private String followupFeedback; + private String followupFeedbackDate; + private String chwName; + + public String getBaseEntityId() { + return baseEntityId; + } + + public void setBaseEntityId(String baseEntityId) { + this.baseEntityId = baseEntityId; + } + + public String getFollowupFeedback() { + return followupFeedback; + } + + public void setFollowupFeedback(String followupFeedback) { + this.followupFeedback = followupFeedback; + } + + public String getFollowupFeedbackDate() { + return followupFeedbackDate; + } + + public void setFollowupFeedbackDate(String followupFeedbackDate) { + this.followupFeedbackDate = followupFeedbackDate; + } + + public String getChwName() { + return chwName; + } + + public void setChwName(String chwName) { + this.chwName = chwName; + } + + public String getFeedbackFormSubmissionId() { + return feedbackFormSubmissionId; + } + + public void setFeedbackFormSubmissionId(String feedbackFormSubmissionId) { + this.feedbackFormSubmissionId = feedbackFormSubmissionId; + } + + public String getFeedbackType() { + return feedbackType; + } + + public void setFeedbackType(String feedbackType) { + this.feedbackType = feedbackType; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyDetailsModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyDetailsModel.java index 9636215d3..40798fc77 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyDetailsModel.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyDetailsModel.java @@ -6,6 +6,7 @@ public class FamilyDetailsModel { private String familyHead; private String primaryCareGiver; private String familyName; + private String villageTown; public FamilyDetailsModel(String baseEntityId, String familyHead, String primaryCareGiver, String familyName) { this.baseEntityId = baseEntityId; @@ -38,4 +39,12 @@ public String getFamilyName() { return familyName; } + public String getVillageTown() { + return villageTown; + } + + public void setVillageTown(String villageTown) { + this.villageTown = villageTown; + } + } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyProfileModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyProfileModel.java index 32e235ba0..a6806559f 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyProfileModel.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyProfileModel.java @@ -1,7 +1,12 @@ package org.smartregister.chw.hf.model; +import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; +import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; +import static org.smartregister.util.JsonFormUtils.STEP1; + import org.json.JSONException; import org.json.JSONObject; +import org.smartregister.chw.core.dao.ChwNotificationDao; import org.smartregister.chw.core.utils.CoreJsonFormUtils; import org.smartregister.chw.core.utils.FormUtils; import org.smartregister.dao.LocationsDao; @@ -12,10 +17,6 @@ import timber.log.Timber; -import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; -import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; -import static org.smartregister.util.JsonFormUtils.STEP1; - public class FamilyProfileModel extends BaseFamilyProfileModel { public FamilyProfileModel(String familyName) { @@ -31,8 +32,12 @@ public void updateWra(FamilyEventClient familyEventClient) { public JSONObject getFormAsJson(String formName, String entityId, String currentLocationId) throws Exception { JSONObject form = super.getFormAsJson(formName, entityId, currentLocationId); JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(form, STEP1, SYNC_LOCATION_ID); - CoreJsonFormUtils.addLocationsToDropdownField(LocationsDao.getLocationsByTags( - Collections.singleton(SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS)), syncLocationField); + try { + CoreJsonFormUtils.addLocationsToDropdownField(LocationsDao.getLocationsByTags( + Collections.singleton(SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS)), syncLocationField); + }catch (JSONException e){ + Timber.e(e); + } return form; } @@ -46,14 +51,14 @@ public FamilyEventClient processFamilyRegistrationForm(String jsonString, String @Override public FamilyEventClient processMemberRegistration(String jsonString, String familyBaseEntityId) { FamilyEventClient familyEventClient = super.processMemberRegistration(jsonString, familyBaseEntityId); - setChwLocationId(jsonString, familyEventClient); + setFamilyHeadSyncLocationId(familyBaseEntityId, familyEventClient); return familyEventClient; } @Override public FamilyEventClient processUpdateMemberRegistration(String jsonString, String familyBaseEntityId) { FamilyEventClient familyEventClient = super.processUpdateMemberRegistration(jsonString, familyBaseEntityId); - setChwLocationId(jsonString, familyEventClient); + setFamilyHeadSyncLocationId(familyBaseEntityId, familyEventClient); return familyEventClient; } @@ -66,4 +71,8 @@ private void setChwLocationId(String jsonString, FamilyEventClient familyEventCl Timber.e(e, "Error retrieving Sync location Field"); } } + + private void setFamilyHeadSyncLocationId(String familyBaseEntityId, FamilyEventClient familyEventClient) { + familyEventClient.getEvent().setLocationId(ChwNotificationDao.getFamilyHeadSyncLocationId(familyBaseEntityId)); + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyRegisterModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyRegisterModel.java index 867d0ee85..6a97b4e4c 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyRegisterModel.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyRegisterModel.java @@ -1,5 +1,9 @@ package org.smartregister.chw.hf.model; +import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; +import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; +import static org.smartregister.util.JsonFormUtils.STEP1; + import org.json.JSONException; import org.json.JSONObject; import org.smartregister.chw.core.utils.CoreJsonFormUtils; @@ -12,10 +16,6 @@ import timber.log.Timber; -import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; -import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; -import static org.smartregister.util.JsonFormUtils.STEP1; - public class FamilyRegisterModel extends BaseFamilyRegisterModel { @Override diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyRemoveMemberModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyRemoveMemberModel.java index ad5193174..25045cb51 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyRemoveMemberModel.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FamilyRemoveMemberModel.java @@ -1,6 +1,17 @@ package org.smartregister.chw.hf.model; import org.smartregister.chw.core.model.CoreFamilyRemoveMemberModel; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.family.util.DBConstants; +import org.smartregister.family.util.Utils; + +import java.util.Date; public class FamilyRemoveMemberModel extends CoreFamilyRemoveMemberModel { + @Override + public String getForm(CommonPersonObjectClient client) { + Date dob = Utils.dobStringToDate(Utils.getValue(client.getColumnmaps(), DBConstants.KEY.DOB, false)); + return ((dob != null && getDiffYears(dob, new Date()) >= 5) ? Constants.JSON_FORM.getFamilyDetailsRemoveMember() : Constants.JSON_FORM.getFamilyDetailsRemoveChild()); + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FpRegisterModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FpRegisterModel.java deleted file mode 100644 index 8ed7e495f..000000000 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/FpRegisterModel.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.smartregister.chw.hf.model; - -import org.json.JSONObject; -import org.smartregister.chw.core.utils.CoreJsonFormUtils; -import org.smartregister.chw.fp.model.BaseFpRegisterModel; -import org.smartregister.dao.LocationsDao; - -import java.util.Collections; - -import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; -import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; -import static org.smartregister.util.JsonFormUtils.STEP1; - -public class FpRegisterModel extends BaseFpRegisterModel { - - @Override - public JSONObject getFormAsJson(String formName, String entityId) throws Exception { - JSONObject form = super.getFormAsJson(formName, entityId); - JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(form, STEP1, SYNC_LOCATION_ID); - CoreJsonFormUtils.addLocationsToDropdownField(LocationsDao.getLocationsByTags( - Collections.singleton(SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS)), syncLocationField); - return form; - } -} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HeiHivResultsFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HeiHivResultsFragmentModel.java new file mode 100644 index 000000000..a914409ed --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HeiHivResultsFragmentModel.java @@ -0,0 +1,59 @@ +package org.smartregister.chw.hf.model; + +import androidx.annotation.NonNull; + +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.model.BaseHvlResultsFragmentModel; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class HeiHivResultsFragmentModel extends BaseHvlResultsFragmentModel { + + @NonNull + @Override + public String mainSelect(@NonNull String tableName, @NonNull String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " ON " + tableName + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.ENTITY_ID + "= " + Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + Constants.TABLE_NAME.FAMILY + " ON " + Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " as T1 ON " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.PRIMARY_CAREGIVER + " = T1." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " as T2 ON " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD + " = T2." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Constants.TableName.HEI_HIV_RESULTS + " ON " + Constants.TableName.HEI_HIV_RESULTS + "." + Constants.DBConstants.HEI_FOLLOWUP_FORM_SUBMISSION_ID + " = " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + return queryBuilder.mainCondition(mainCondition); + } + + @Override + protected String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + columnList.add(tableName + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.ENTITY_ID + " as " + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(tableName + "." + DBConstants.KEY.BASE_ENTITY_ID + " as " + org.smartregister.chw.pmtct.util.DBConstants.KEY.ENTITY_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.GENDER); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columnList.add("T2." + DBConstants.KEY.PHONE_NUMBER + " AS " + org.smartregister.chw.tb.util.DBConstants.Key.FAMILY_HEAD_PHONE_NUMBER); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add("T1." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.PRIMARY_CAREGIVER); + columnList.add("T2." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.FAMILY_HEAD); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + columnList.add(Constants.TableName.HEI_FOLLOWUP + "." + Constants.DBConstants.HEI_HIV_SAMPLE_ID); + columnList.add(Constants.TableName.HEI_HIV_RESULTS + "." + Constants.DBConstants.HEI_HIV_TEST_RESULT); + columnList.add(Constants.TableName.HEI_FOLLOWUP + "." + Constants.DBConstants.HEI_HIV_SAMPLE_COLLECTION_DATE); + columnList.add(Constants.TableName.HEI_HIV_RESULTS + "." + Constants.DBConstants.HEI_HIV_RESULT_DATE); + columnList.add(Constants.TableName.HEI_HIV_RESULTS + "." + Constants.DBConstants.HEI_FOLLOWUP_FORM_SUBMISSION_ID); + columnList.add(Constants.TableName.HEI_FOLLOWUP + "." + Constants.DBConstants.HEI_HIV_TYPE_OF_TEST); + + return columnList.toArray(new String[columnList.size()]); + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HeiRegisterFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HeiRegisterFragmentModel.java new file mode 100644 index 000000000..72024f63a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HeiRegisterFragmentModel.java @@ -0,0 +1,53 @@ +package org.smartregister.chw.hf.model; + +import androidx.annotation.NonNull; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.model.BasePmtctRegisterFragmentModel; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class HeiRegisterFragmentModel extends BasePmtctRegisterFragmentModel { + @NonNull + @Override + public String mainSelect(@NonNull String tableName, @NonNull String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " ON " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID + " = " + Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + Constants.TABLE_NAME.FAMILY + " ON " + Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " as T1 ON " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.PRIMARY_CAREGIVER + " = T1." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " as T2 ON " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD + " = T2." + DBConstants.KEY.BASE_ENTITY_ID); + return queryBuilder.mainCondition(mainCondition); + } + + @Override + @NotNull + public String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + + columnList.add(tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOD); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.GENDER); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columnList.add("T2." + DBConstants.KEY.PHONE_NUMBER + " AS " + org.smartregister.chw.tb.util.DBConstants.Key.FAMILY_HEAD_PHONE_NUMBER); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add("T1." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.PRIMARY_CAREGIVER); + columnList.add("T2." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.FAMILY_HEAD); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + + return columnList.toArray(new String[columnList.size()]); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HfAllClientsRegisterModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HfAllClientsRegisterModel.java new file mode 100644 index 000000000..29a5ed44d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HfAllClientsRegisterModel.java @@ -0,0 +1,104 @@ +package org.smartregister.chw.hf.model; + +import static com.vijay.jsonwizard.utils.FormUtils.fields; +import static com.vijay.jsonwizard.utils.FormUtils.getFieldJSONObject; +import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; +import static org.smartregister.chw.hf.utils.JsonFormUtils.METADATA; +import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; +import static org.smartregister.family.util.JsonFormUtils.STEP2; +import static org.smartregister.util.JsonFormUtils.ENCOUNTER_LOCATION; +import static org.smartregister.util.JsonFormUtils.STEP1; + +import android.content.Context; + +import androidx.annotation.Nullable; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.utils.AllClientsUtils; +import org.smartregister.dao.LocationsDao; +import org.smartregister.domain.tag.FormTag; +import org.smartregister.family.util.Constants; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.opd.model.OpdRegisterActivityModel; +import org.smartregister.opd.pojo.OpdEventClient; +import org.smartregister.opd.utils.OpdUtils; + +import java.util.Collections; +import java.util.List; + +import timber.log.Timber; + +public class HfAllClientsRegisterModel extends OpdRegisterActivityModel { + private Context context; + + public HfAllClientsRegisterModel(Context context) { + this.context = context; + } + + + @Nullable + @Override + public JSONObject getFormAsJson(String formName, String entityId, String currentLocationId) { + try { + JSONObject form; + if (context != null) { + form = (new FormUtils()).getFormJsonFromRepositoryOrAssets(context, formName); + } else + form = OpdUtils.getJsonFormToJsonObject(formName); + + if (form == null) { + return null; + } + JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(form, STEP1, SYNC_LOCATION_ID); + CoreJsonFormUtils.addLocationsToDropdownField(LocationsDao.getLocationsByTags( + Collections.singleton(SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS)), syncLocationField); + form.getJSONObject(METADATA).put(ENCOUNTER_LOCATION, currentLocationId); + + String newEntityId = entityId; + if (StringUtils.isNotBlank(entityId)) { + newEntityId = entityId.replace("-", ""); + } + + JSONObject stepOneUniqueId = getFieldJSONObject(fields(form, STEP1), Constants.JSON_FORM_KEY.UNIQUE_ID); + + if (stepOneUniqueId != null) { + stepOneUniqueId.remove(JsonFormUtils.VALUE); + stepOneUniqueId.put(JsonFormUtils.VALUE, newEntityId + "_Family"); + } + + JSONObject stepTwoUniqueId = getFieldJSONObject(fields(form, STEP2), Constants.JSON_FORM_KEY.UNIQUE_ID); + if (stepTwoUniqueId != null) { + stepTwoUniqueId.remove(JsonFormUtils.VALUE); + stepTwoUniqueId.put(JsonFormUtils.VALUE, newEntityId); + } + + JsonFormUtils.addLocHierarchyQuestions(form); + return form; + + } catch (Exception e) { + Timber.e(e, "Error loading All Client registration form"); + } + return null; + } + + @Nullable + @Override + public List processRegistration(String jsonString, FormTag formTag) { + + List opdEventClients = AllClientsUtils.getOpdEventClients(jsonString); + try { + JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), STEP1, SYNC_LOCATION_ID); + for (OpdEventClient opdEventClient : opdEventClients) { + opdEventClient.getEvent().setLocationId(CoreJsonFormUtils.getSyncLocationUUIDFromDropdown(syncLocationField)); + } + } catch (JSONException e) { + Timber.e(e, "Error retrieving Sync location Field"); + } + return opdEventClients; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HfPncRegisterFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HfPncRegisterFragmentModel.java new file mode 100644 index 000000000..37a40f541 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HfPncRegisterFragmentModel.java @@ -0,0 +1,46 @@ +package org.smartregister.chw.hf.model; + +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.core.utils.ChwDBConstants; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class HfPncRegisterFragmentModel extends org.smartregister.chw.core.model.PncRegisterFragmentModel { + @Override + protected String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + + columnList.add(tableName + "." + ChwDBConstants.DELIVERY_DATE); + columnList.add(tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.PRIMARY_CAREGIVER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + + return columnList.toArray(new String[columnList.size()]); + } + + @Override + public String mainSelect(String tableName, String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + " ON " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID + " = " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " AND " + tableName + "." + ChwDBConstants.IS_CLOSED + " IS " + 0 + " AND " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + ChwDBConstants.IS_CLOSED + " IS " + 0 + " AND " + tableName + "." + ChwDBConstants.DELIVERY_DATE + " IS NOT NULL COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY + " ON " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); +// queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.ANC_MEMBER + " ON " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID + " = " + CoreConstants.TABLE_NAME.ANC_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " AND " + tableName + "." + ChwDBConstants.IS_CLOSED + " IS " + 0 + " AND " + tableName + "." + ChwDBConstants.DELIVERY_DATE + " IS NOT NULL COLLATE NOCASE "); + queryBuilder.customJoin("LEFT JOIN (select base_entity_id , max(visit_date) visit_date from visits GROUP by base_entity_id) VISIT_SUMMARY ON VISIT_SUMMARY.base_entity_id = " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + + return queryBuilder.mainCondition(mainCondition); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivFollowupFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivFollowupFragmentModel.java new file mode 100644 index 000000000..05e95614f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivFollowupFragmentModel.java @@ -0,0 +1,62 @@ +package org.smartregister.chw.hf.model; + + +import androidx.annotation.NonNull; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hiv.model.BaseHivRegisterFragmentModel; +import org.smartregister.chw.hiv.util.Constants.Tables; +import org.smartregister.chw.hiv.util.DBConstants.Key; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class HivFollowupFragmentModel extends BaseHivRegisterFragmentModel { + + + @NonNull + @Override + public String mainSelect(@NonNull String tableName, @NonNull String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + " ON " + tableName + "." + Key.ENTITY_ID + " = " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY + " ON " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + " as T1 ON " + CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.PRIMARY_CAREGIVER + " = T1." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + " as T2 ON " + CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD + " = T2." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Tables.HIV_COMMUNITY_FEEDBACK + " as T3 ON " + tableName + "." + Key.ENTITY_ID + " = T3." + Key.ENTITY_ID); + return queryBuilder.mainCondition(mainCondition); + } + + @Override + @NotNull + public String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.GENDER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columnList.add("T2." + DBConstants.KEY.PHONE_NUMBER + " AS " + Key.FAMILY_HEAD_PHONE_NUMBER); + columnList.add("T3." + Key.HIV_COMMUNITY_FOLLOWUP_VISIT_DATE + " AS " + Key.HIV_COMMUNITY_FOLLOWUP_VISIT_DATE); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add("T1." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.PRIMARY_CAREGIVER); + columnList.add("T2." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.FAMILY_HEAD); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + columnList.add(Tables.HIV_COMMUNITY_FOLLOWUP + "." + Key.REASONS_FOR_ISSUING_COMMUNITY_REFERRAL); + columnList.add(Tables.HIV_COMMUNITY_FOLLOWUP + "." + Key.LAST_INTERACTED_WITH); + columnList.add(Tables.HIV_COMMUNITY_FOLLOWUP + "." + Key.HIV_COMMUNITY_REFERRAL_DATE); + columnList.add(Tables.HIV_COMMUNITY_FOLLOWUP + "." + Key.COMMENTS); + return columnList.toArray(new String[columnList.size()]); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivIndexContactsRegisterFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivIndexContactsRegisterFragmentModel.java new file mode 100644 index 000000000..c079aa6d5 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivIndexContactsRegisterFragmentModel.java @@ -0,0 +1,61 @@ +package org.smartregister.chw.hf.model; + + +import androidx.annotation.NonNull; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hiv.model.BaseHivRegisterFragmentModel; +import org.smartregister.chw.hiv.util.Constants.Tables; +import org.smartregister.chw.hiv.util.DBConstants.Key; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class HivIndexContactsRegisterFragmentModel extends BaseHivRegisterFragmentModel { + + @NonNull + @Override + public String mainSelect(@NonNull String tableName, @NonNull String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + " ON " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID + " = " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY + " ON " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN (select base_entity_id , max(visit_date) visit_date from visits GROUP by base_entity_id) VISIT_SUMMARY ON VISIT_SUMMARY.base_entity_id = " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + return queryBuilder.mainCondition(mainCondition); + } + + @Override + @NotNull + public String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + + columnList.add(tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.GENDER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + columnList.add(Tables.HIV_INDEX_HF + "." + Key.HIV_CLIENT_ID); + columnList.add(Tables.HIV_INDEX_HF + "." + Key.HIV_TEST_ELIGIBILITY); + columnList.add(Tables.HIV_INDEX_HF + "." + Key.HAS_STARTED_MEDICATION); + columnList.add(Tables.HIV_INDEX_HF + "." + Key.TEST_RESULTS); + columnList.add(Tables.HIV_INDEX_HF + "." + Key.HOW_TO_NOTIFY_CONTACT_CLIENT); + columnList.add(Tables.HIV_INDEX_HF + "." + Key.HAS_THE_CONTACT_CLIENT_BEEN_TESTED); + columnList.add(Tables.HIV_INDEX_HF + "." + Key.ENROLLED_TO_CLINIC); + columnList.add(Tables.HIV_INDEX_HF + "." + Key.HIV_INDEX_REGISTRATION_DATE); + columnList.add(Tables.HIV_INDEX_HF + "." + Key.IS_CLOSED); + + return columnList.toArray(new String[columnList.size()]); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivIndexFollowupFeedbackDetailsModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivIndexFollowupFeedbackDetailsModel.java new file mode 100644 index 000000000..ceb138b4e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivIndexFollowupFeedbackDetailsModel.java @@ -0,0 +1,60 @@ +package org.smartregister.chw.hf.model; + +import java.io.Serializable; + +public class HivIndexFollowupFeedbackDetailsModel implements Serializable { + private String followedByChw; + private String baseEntityId; + private String feedbackFormSubmissionId; + private String agreedToBeTested; + private String clientFound; + private String testLocation; + + public String getBaseEntityId() { + return baseEntityId; + } + + public void setBaseEntityId(String baseEntityId) { + this.baseEntityId = baseEntityId; + } + + public String getAgreedToBeTested() { + return agreedToBeTested; + } + + public void setAgreedToBeTested(String agreedToBeTested) { + this.agreedToBeTested = agreedToBeTested; + } + + public String getClientFound() { + return clientFound; + } + + public void setClientFound(String clientFound) { + this.clientFound = clientFound; + } + + public String getTestLocation() { + return testLocation; + } + + public void setTestLocation(String testLocation) { + this.testLocation = testLocation; + } + + public String getFeedbackFormSubmissionId() { + return feedbackFormSubmissionId; + } + + public void setFeedbackFormSubmissionId(String feedbackFormSubmissionId) { + this.feedbackFormSubmissionId = feedbackFormSubmissionId; + } + + public String getFollowedByChw() { + return followedByChw; + } + + public void setFollowedByChw(String followedByChw) { + this.followedByChw = followedByChw; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivRegisterFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivRegisterFragmentModel.java new file mode 100644 index 000000000..c553ad9db --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivRegisterFragmentModel.java @@ -0,0 +1,56 @@ +package org.smartregister.chw.hf.model; + + +import androidx.annotation.NonNull; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hiv.model.BaseHivRegisterFragmentModel; +import org.smartregister.chw.hiv.util.Constants.Tables; +import org.smartregister.chw.hiv.util.DBConstants.Key; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class HivRegisterFragmentModel extends BaseHivRegisterFragmentModel { + + @NonNull + @Override + public String mainSelect(@NonNull String tableName, @NonNull String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + " ON " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID + " = " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY + " ON " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN (select base_entity_id , max(visit_date) visit_date from visits GROUP by base_entity_id) VISIT_SUMMARY ON VISIT_SUMMARY.base_entity_id = " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + return queryBuilder.mainCondition(mainCondition); + } + + @Override + @NotNull + public String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + + columnList.add(tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.GENDER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + columnList.add(Tables.HIV + "." + Key.CTC_NUMBER); + columnList.add(Tables.HIV + "." + Key.CBHS_NUMBER); + columnList.add(Tables.HIV + "." + Key.CLIENT_HIV_STATUS_DURING_REGISTRATION); + columnList.add(Tables.HIV + "." + Key.CLIENT_HIV_STATUS_AFTER_TESTING); + + return columnList.toArray(new String[columnList.size()]); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivTbReferralTasksAndFollowupFeedbackModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivTbReferralTasksAndFollowupFeedbackModel.java new file mode 100644 index 000000000..db548a0b9 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HivTbReferralTasksAndFollowupFeedbackModel.java @@ -0,0 +1,33 @@ +package org.smartregister.chw.hf.model; + +import org.smartregister.domain.Task; + +public class HivTbReferralTasksAndFollowupFeedbackModel { + private Task task; + private ChwFollowupFeedbackDetailsModel followupFeedbackDetailsModel; + private String type; + + public Task getTask() { + return task; + } + + public void setTask(Task task) { + this.task = task; + } + + public ChwFollowupFeedbackDetailsModel getFollowupFeedbackDetailsModel() { + return followupFeedbackDetailsModel; + } + + public void setFollowupFeedbackDetailsModel(ChwFollowupFeedbackDetailsModel followupFeedbackDetailsModel) { + this.followupFeedbackDetailsModel = followupFeedbackDetailsModel; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HtsRegisterFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HtsRegisterFragmentModel.java new file mode 100644 index 000000000..a3684f6a5 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HtsRegisterFragmentModel.java @@ -0,0 +1,55 @@ +package org.smartregister.chw.hf.model; + + +import androidx.annotation.NonNull; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hiv.model.BaseHivRegisterFragmentModel; +import org.smartregister.chw.hiv.util.DBConstants.Key; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class HtsRegisterFragmentModel extends BaseHivRegisterFragmentModel { + + @NonNull + @Override + public String mainSelect(@NonNull String tableName, @NonNull String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(CoreConstants.TABLE_NAME.HTS_MEMBERS, mainColumns(CoreConstants.TABLE_NAME.HTS_MEMBERS)); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + " ON " + CoreConstants.TABLE_NAME.HTS_MEMBERS + "." + DBConstants.KEY.BASE_ENTITY_ID + " = " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY + " ON " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN (select base_entity_id , max(visit_date) visit_date from visits GROUP by base_entity_id) VISIT_SUMMARY ON VISIT_SUMMARY.base_entity_id = " + CoreConstants.TABLE_NAME.HTS_MEMBERS + "." + DBConstants.KEY.BASE_ENTITY_ID); + return queryBuilder.mainCondition(mainCondition); + } + + @Override + @NotNull + public String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + + columnList.add(tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.GENDER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + columnList.add(CoreConstants.TABLE_NAME.HTS_MEMBERS + "." + Key.CTC_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.HTS_MEMBERS + "." + Key.CBHS_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.HTS_MEMBERS + "." + Key.CLIENT_HIV_STATUS_DURING_REGISTRATION); + columnList.add(CoreConstants.TABLE_NAME.HTS_MEMBERS + "." + Key.CLIENT_HIV_STATUS_AFTER_TESTING); + + return columnList.toArray(new String[columnList.size()]); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HvlResultsFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HvlResultsFragmentModel.java new file mode 100644 index 000000000..54f720b93 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/HvlResultsFragmentModel.java @@ -0,0 +1,61 @@ +package org.smartregister.chw.hf.model; + +import static org.smartregister.chw.cdp.util.DBConstants.KEY.FORM_SUBMISSION_ID; + +import androidx.annotation.NonNull; + +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.model.BaseHvlResultsFragmentModel; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class HvlResultsFragmentModel extends BaseHvlResultsFragmentModel { + + @NonNull + @Override + public String mainSelect(@NonNull String tableName, @NonNull String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " ON " + tableName + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.ENTITY_ID + "= " + Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + Constants.TABLE_NAME.FAMILY + " ON " + Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " as T1 ON " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.PRIMARY_CAREGIVER + " = T1." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " as T2 ON " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD + " = T2." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_HVL_RESULTS + " ON " + org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_HVL_RESULTS + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.HVL_FOLLOWUP_FORM_SUBMISSION_ID + " = " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + return queryBuilder.mainCondition(mainCondition); + } + + @Override + protected String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + columnList.add(tableName + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.ENTITY_ID + " as " + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(tableName + "." + DBConstants.KEY.BASE_ENTITY_ID + " as " + org.smartregister.chw.pmtct.util.DBConstants.KEY.ENTITY_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.GENDER); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columnList.add("T2." + DBConstants.KEY.PHONE_NUMBER + " AS " + org.smartregister.chw.tb.util.DBConstants.Key.FAMILY_HEAD_PHONE_NUMBER); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add("T1." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.PRIMARY_CAREGIVER); + columnList.add("T2." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.FAMILY_HEAD); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + columnList.add(org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_FOLLOW_UP + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.HVL_SAMPLE_ID); + columnList.add(org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_HVL_RESULTS + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.HVL_RESULT); + columnList.add(org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_FOLLOW_UP + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.HVL_SAMPLE_COLLECTION_DATE); + columnList.add(org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_HVL_RESULTS + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.HVL_RESULT_DATE); + columnList.add(org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_HVL_RESULTS + "." + org.smartregister.chw.pmtct.util.DBConstants.KEY.HVL_FOLLOWUP_FORM_SUBMISSION_ID); + columnList.add(org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_HVL_RESULTS + "." + DBConstants.KEY.BASE_ENTITY_ID + " as " + FORM_SUBMISSION_ID); + + return columnList.toArray(new String[columnList.size()]); + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/IssueReferralActivityModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/IssueReferralActivityModel.java new file mode 100644 index 000000000..316b7c6f5 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/IssueReferralActivityModel.java @@ -0,0 +1,44 @@ +package org.smartregister.chw.hf.model; + +import androidx.annotation.NonNull; + +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.referral.model.BaseIssueReferralModel; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class IssueReferralActivityModel extends BaseIssueReferralModel { + + @NonNull + @Override + public String mainSelect(@NonNull String tableName, @NonNull String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + Constants.TABLE_NAME.FAMILY + " ON " + Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID); + return queryBuilder.mainCondition(mainCondition); + } + + @Override + public String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + + columnList.add(tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.GENDER); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.PRIMARY_CAREGIVER); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + return columnList.toArray(new String[columnList.size()]); + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/IssuedReferralsModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/IssuedReferralsModel.java new file mode 100644 index 000000000..7f637c42c --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/IssuedReferralsModel.java @@ -0,0 +1,65 @@ +package org.smartregister.chw.hf.model; + +import org.smartregister.chw.core.model.BaseReferralModel; +import org.smartregister.chw.core.utils.ChwDBConstants; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class IssuedReferralsModel extends BaseReferralModel { + + @Override + public String mainSelect(String tableName, String entityTable, String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName, entityTable), CoreConstants.DB_CONSTANTS.ID); + queryBuilder.customJoin(String.format("INNER JOIN %s ON %s.%s = %s.%s COLLATE NOCASE", + entityTable, entityTable, DBConstants.KEY.BASE_ENTITY_ID, tableName, CoreConstants.DB_CONSTANTS.FOR)); + queryBuilder.customJoin(String.format("INNER JOIN %s ON %s.%s = %s.%s AND ec_referral.referral_type = 'facility_to_facility_referral' COLLATE NOCASE ", CoreConstants.TABLE_NAME.REFERRAL, + CoreConstants.TABLE_NAME.REFERRAL, DBConstants.KEY.BASE_ENTITY_ID, tableName, ChwDBConstants.TaskTable.REASON_REFERENCE)); + queryBuilder.customJoin("LEFT JOIN ec_family ON ec_family_member.relational_id = ec_family.id COLLATE NOCASE"); + return queryBuilder.mainCondition(mainCondition); + } + + @Override + protected String[] mainColumns(String tableName, String entityTable) { + Set columns = new HashSet<>(Arrays.asList(super.mainColumns(tableName, entityTable))); + addClientDetails(entityTable, columns); + addTaskDetails(columns); + return columns.toArray(new String[]{}); + } + + private void addClientDetails(String table, Set columns) { + columns.add(table + "." + "relational_id as relationalid"); + columns.add(table + "." + DBConstants.KEY.BASE_ENTITY_ID); + columns.add(table + "." + DBConstants.KEY.FIRST_NAME); + columns.add(table + "." + DBConstants.KEY.MIDDLE_NAME); + columns.add(table + "." + DBConstants.KEY.LAST_NAME); + columns.add(table + "." + DBConstants.KEY.DOB); + columns.add(table + "." + DBConstants.KEY.GENDER); + columns.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD); + columns.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columns.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columns.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columns.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columns.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + + } + + private void addTaskDetails(Set columns) { + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.FOCUS); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.OWNER); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.REQUESTER); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.START); + columns.add(CoreConstants.TABLE_NAME.REFERRAL + "." + org.smartregister.chw.referral.util.DBConstants.Key.PROBLEM); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.BUSINESS_STATUS + " AS " + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_STATUS); + columns.add(CoreConstants.TABLE_NAME.REFERRAL + "." + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_HF); + columns.add(CoreConstants.TABLE_NAME.REFERRAL + "." + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_SERVICE); + columns.add(CoreConstants.TABLE_NAME.REFERRAL + "." + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_DATE); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.FOCUS + " AS " + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_TYPE); + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/LDRegisterFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/LDRegisterFragmentModel.java new file mode 100644 index 000000000..4387016dd --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/LDRegisterFragmentModel.java @@ -0,0 +1,47 @@ +package org.smartregister.chw.hf.model; + +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.ld.model.BaseLDRegisterFragmentModel; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class LDRegisterFragmentModel extends BaseLDRegisterFragmentModel { + @Override + public String mainSelect(String tableName, String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " ON " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID + " = " + Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + Constants.TABLE_NAME.FAMILY + " ON " + Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " as T1 ON " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.PRIMARY_CAREGIVER + " = T1." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " as T2 ON " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD + " = T2." + DBConstants.KEY.BASE_ENTITY_ID); + return queryBuilder.mainCondition(mainCondition); + } + + protected String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + + columnList.add(tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOD); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.GENDER); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columnList.add("T2." + DBConstants.KEY.PHONE_NUMBER + " AS " + org.smartregister.chw.tb.util.DBConstants.Key.FAMILY_HEAD_PHONE_NUMBER); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add("T1." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.PRIMARY_CAREGIVER); + columnList.add("T2." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.FAMILY_HEAD); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + + return columnList.toArray(new String[columnList.size()]); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/LTFUModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/LTFUModel.java new file mode 100644 index 000000000..cda9cacab --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/LTFUModel.java @@ -0,0 +1,65 @@ +package org.smartregister.chw.hf.model; + +import org.smartregister.chw.core.model.BaseReferralModel; +import org.smartregister.chw.core.utils.ChwDBConstants; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class LTFUModel extends BaseReferralModel { + + @Override + public String mainSelect(String tableName, String entityTable, String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName, entityTable), CoreConstants.DB_CONSTANTS.ID); + queryBuilder.customJoin(String.format("INNER JOIN %s ON %s.%s = %s.%s AND task.focus = 'LTFU' AND task.business_status <> 'Complete' COLLATE NOCASE", + entityTable, entityTable, DBConstants.KEY.BASE_ENTITY_ID, tableName, CoreConstants.DB_CONSTANTS.FOR)); + queryBuilder.customJoin(String.format("INNER JOIN %s ON %s.%s = %s.%s COLLATE NOCASE ", CoreConstants.TABLE_NAME.REFERRAL, + CoreConstants.TABLE_NAME.REFERRAL, DBConstants.KEY.BASE_ENTITY_ID, tableName, ChwDBConstants.TaskTable.REASON_REFERENCE)); + queryBuilder.customJoin("LEFT JOIN ec_family ON ec_family_member.relational_id = ec_family.id COLLATE NOCASE"); + return queryBuilder.mainCondition(mainCondition); + } + + @Override + protected String[] mainColumns(String tableName, String entityTable) { + Set columns = new HashSet<>(Arrays.asList(super.mainColumns(tableName, entityTable))); + addClientDetails(entityTable, columns); + addTaskDetails(columns); + return columns.toArray(new String[]{}); + } + + private void addClientDetails(String table, Set columns) { + columns.add(table + "." + "relational_id as relationalid"); + columns.add(table + "." + DBConstants.KEY.BASE_ENTITY_ID); + columns.add(table + "." + DBConstants.KEY.FIRST_NAME); + columns.add(table + "." + DBConstants.KEY.MIDDLE_NAME); + columns.add(table + "." + DBConstants.KEY.LAST_NAME); + columns.add(table + "." + DBConstants.KEY.DOB); + columns.add(table + "." + DBConstants.KEY.GENDER); + columns.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD); + columns.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columns.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columns.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columns.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columns.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + + } + + private void addTaskDetails(Set columns) { + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.FOCUS); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.OWNER); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.REQUESTER); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.START); + columns.add(CoreConstants.TABLE_NAME.REFERRAL + "." + org.smartregister.chw.referral.util.DBConstants.Key.PROBLEM); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.BUSINESS_STATUS + " AS " + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_STATUS); + columns.add(CoreConstants.TABLE_NAME.REFERRAL + "." + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_HF); + columns.add(CoreConstants.TABLE_NAME.REFERRAL + "." + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_SERVICE); + columns.add(CoreConstants.TABLE_NAME.REFERRAL + "." + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_DATE); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.FOCUS + " AS " + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_TYPE); + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/LTFUSuccessfulModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/LTFUSuccessfulModel.java new file mode 100644 index 000000000..a174dfe33 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/LTFUSuccessfulModel.java @@ -0,0 +1,65 @@ +package org.smartregister.chw.hf.model; + +import org.smartregister.chw.core.model.BaseReferralModel; +import org.smartregister.chw.core.utils.ChwDBConstants; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +public class LTFUSuccessfulModel extends BaseReferralModel { + + @Override + public String mainSelect(String tableName, String entityTable, String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName, entityTable), CoreConstants.DB_CONSTANTS.ID); + queryBuilder.customJoin(String.format("INNER JOIN %s ON %s.%s = %s.%s AND task.focus = 'LTFU' AND task.business_status = 'Complete' COLLATE NOCASE", + entityTable, entityTable, DBConstants.KEY.BASE_ENTITY_ID, tableName, CoreConstants.DB_CONSTANTS.FOR)); + queryBuilder.customJoin(String.format("INNER JOIN %s ON %s.%s = %s.%s COLLATE NOCASE ", CoreConstants.TABLE_NAME.REFERRAL, + CoreConstants.TABLE_NAME.REFERRAL, DBConstants.KEY.BASE_ENTITY_ID, tableName, ChwDBConstants.TaskTable.REASON_REFERENCE)); + queryBuilder.customJoin("LEFT JOIN ec_family ON ec_family_member.relational_id = ec_family.id COLLATE NOCASE"); + return queryBuilder.mainCondition(mainCondition); + } + + @Override + protected String[] mainColumns(String tableName, String entityTable) { + Set columns = new HashSet<>(Arrays.asList(super.mainColumns(tableName, entityTable))); + addClientDetails(entityTable, columns); + addTaskDetails(columns); + return columns.toArray(new String[]{}); + } + + private void addClientDetails(String table, Set columns) { + columns.add(table + "." + "relational_id as relationalid"); + columns.add(table + "." + DBConstants.KEY.BASE_ENTITY_ID); + columns.add(table + "." + DBConstants.KEY.FIRST_NAME); + columns.add(table + "." + DBConstants.KEY.MIDDLE_NAME); + columns.add(table + "." + DBConstants.KEY.LAST_NAME); + columns.add(table + "." + DBConstants.KEY.DOB); + columns.add(table + "." + DBConstants.KEY.GENDER); + columns.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD); + columns.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columns.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columns.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columns.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columns.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + + } + + private void addTaskDetails(Set columns) { + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.FOCUS); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.OWNER); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.REQUESTER); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.START); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + "description AS " + org.smartregister.chw.referral.util.DBConstants.Key.PROBLEM); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.BUSINESS_STATUS + " AS " + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_STATUS); + columns.add(CoreConstants.TABLE_NAME.REFERRAL + "." + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_HF); + columns.add(CoreConstants.TABLE_NAME.REFERRAL + "." + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_SERVICE); + columns.add(CoreConstants.TABLE_NAME.REFERRAL + "." + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_DATE); + columns.add(CoreConstants.TABLE_NAME.TASK + "." + CoreConstants.DB_CONSTANTS.FOCUS + " AS " + org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_TYPE); + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/NavigationModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/NavigationModel.java index 6116266e9..bab7b9f3f 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/NavigationModel.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/NavigationModel.java @@ -2,9 +2,12 @@ import org.smartregister.chw.core.model.NavigationOption; import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.BuildConfig; +import org.smartregister.chw.hf.HealthFacilityApplication; import org.smartregister.chw.hf.R; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; public class NavigationModel implements org.smartregister.chw.core.model.NavigationModel.Flavor { @@ -13,14 +16,57 @@ public class NavigationModel implements org.smartregister.chw.core.model.Navigat @Override public List getNavigationItems() { if (navigationOptions.size() == 0) { - navigationOptions.add(new NavigationOption(R.mipmap.sidemenu_families, R.mipmap.sidemenu_families_active, R.string.menu_all_clients, CoreConstants.DrawerMenu.ALL_CLIENTS, 0)); - navigationOptions.add(new NavigationOption(R.mipmap.sidemenu_families, R.mipmap.sidemenu_families_active, R.string.menu_all_families, CoreConstants.DrawerMenu.ALL_FAMILIES, 0)); - navigationOptions.add(new NavigationOption(R.mipmap.sidemenu_anc, R.mipmap.sidemenu_anc_active, R.string.menu_anc, CoreConstants.DrawerMenu.ANC, 0)); - navigationOptions.add(new NavigationOption(R.mipmap.sidemenu_pnc, R.mipmap.sidemenu_pnc_active, R.string.menu_pnc, CoreConstants.DrawerMenu.PNC, 0)); - navigationOptions.add(new NavigationOption(R.mipmap.sidemenu_children, R.mipmap.sidemenu_children_active, R.string.menu_child_clients, CoreConstants.DrawerMenu.CHILD_CLIENTS, 0)); - navigationOptions.add(new NavigationOption(R.mipmap.sidemenu_fp, R.mipmap.sidemenu_fp_active, R.string.menu_family_planning, CoreConstants.DrawerMenu.FAMILY_PLANNING, 0)); - navigationOptions.add(new NavigationOption(R.mipmap.sidemenu_malaria, R.mipmap.sidemenu_malaria_active, R.string.menu_malaria, CoreConstants.DrawerMenu.MALARIA, 0)); - navigationOptions.add(new NavigationOption(R.mipmap.sidemenu_referrals, R.mipmap.sidemenu_referrals_active, R.string.menu_referrals, CoreConstants.DrawerMenu.REFERRALS, 0)); + + NavigationOption op1 = new NavigationOption(R.drawable.sidemenu_all_clients, R.drawable.sidemenu_all_clients_active, R.string.menu_all_clients, CoreConstants.DrawerMenu.ALL_CLIENTS, 0); + NavigationOption op2 = new NavigationOption(R.mipmap.sidemenu_families, R.mipmap.sidemenu_families_active, R.string.menu_all_families, CoreConstants.DrawerMenu.ALL_FAMILIES, 0); + NavigationOption op3 = new NavigationOption(R.mipmap.sidemenu_anc, R.mipmap.sidemenu_anc_active, R.string.menu_anc, CoreConstants.DrawerMenu.ANC, 0); + NavigationOption op4 = new NavigationOption(R.mipmap.sidemenu_pnc, R.mipmap.sidemenu_pnc_active, R.string.menu_pnc, CoreConstants.DrawerMenu.PNC, 0); + NavigationOption op5 = new NavigationOption(R.mipmap.sidemenu_children, R.mipmap.sidemenu_children_active, R.string.menu_child_clients, CoreConstants.DrawerMenu.CHILD_CLIENTS, 0); + NavigationOption op6 = new NavigationOption(R.mipmap.sidemenu_fp, R.mipmap.sidemenu_fp_active, R.string.menu_family_planning, CoreConstants.DrawerMenu.FAMILY_PLANNING, 0); + NavigationOption op7 = new NavigationOption(R.mipmap.sidemenu_malaria, R.mipmap.sidemenu_malaria_active, R.string.menu_malaria, CoreConstants.DrawerMenu.MALARIA, 0); + NavigationOption op8 = new NavigationOption(R.mipmap.sidemenu_hiv, R.mipmap.sidemenu_hiv_active, R.string.menu_hiv, CoreConstants.DrawerMenu.HIV_CLIENTS, 0); + NavigationOption op9 = new NavigationOption(R.mipmap.sidemenu_hiv, R.mipmap.sidemenu_hiv_active, R.string.menu_hts, CoreConstants.DrawerMenu.HTS_CLIENTS, 0); + NavigationOption op10 = new NavigationOption(R.mipmap.sidemenu_hiv, R.mipmap.sidemenu_hiv_active, R.string.menu_hiv_index_contacts, CoreConstants.DrawerMenu.HIV_INDEX_CLIENTS_HF, 0); + NavigationOption op11 = new NavigationOption(R.mipmap.sidemenu_tb, R.mipmap.sidemenu_tb_active, R.string.menu_tb, CoreConstants.DrawerMenu.TB_CLIENTS, 0); + NavigationOption op12 = new NavigationOption(R.mipmap.sidemenu_referrals, R.mipmap.sidemenu_referrals_active, R.string.menu_referrals, CoreConstants.DrawerMenu.REFERRALS, 0); + NavigationOption op13 = new NavigationOption(R.drawable.sidemenu_pmtct, R.drawable.sidemenu_pmtct_active, R.string.menu_pmtct, CoreConstants.DrawerMenu.PMTCT, 0); + NavigationOption op14 = new NavigationOption(R.drawable.ic_sidemenu_hei, R.drawable.ic_sidemenu_hei_active, R.string.menu_hei, CoreConstants.DrawerMenu.HEI, 0); + NavigationOption op15 = new NavigationOption(R.drawable.ic_sidemenu_labour_and_delivery, R.drawable.ic_sidemenu_labour_and_delivery_active, R.string.menu_ld, CoreConstants.DrawerMenu.LD, 0); + NavigationOption op16 = new NavigationOption(R.mipmap.sidemenu_referrals, R.mipmap.sidemenu_referrals_active, R.string.menu_ltfu, CoreConstants.DrawerMenu.LTFU, 0); + NavigationOption op17 = new NavigationOption(R.mipmap.sidemenu_hiv, R.mipmap.sidemenu_hiv_active, R.string.menu_hivst, CoreConstants.DrawerMenu.HIV_SELF_TESTING, 0); + NavigationOption op18 = new NavigationOption(R.mipmap.sidemenu_hiv, R.mipmap.sidemenu_hiv_active, R.string.menu_cdp, CoreConstants.DrawerMenu.CDP_HF, 0); + NavigationOption op19 = new NavigationOption(R.mipmap.sidemenu_hiv, R.mipmap.sidemenu_hiv_active, R.string.menu_kvp, CoreConstants.DrawerMenu.KVP, 0); + NavigationOption op20 = new NavigationOption(R.mipmap.sidemenu_hiv, R.mipmap.sidemenu_hiv_active, R.string.menu_prep, CoreConstants.DrawerMenu.PrEP, 0); + + // ANC, PMTCT, LD, PNC, HEI, Child,LTFU, Referrals + if (BuildConfig.BUILD_FOR_BORESHA_AFYA_SOUTH) { + if (BuildConfig.BUILD_FOR_PMTCT_CASE_BASED_MANAGEMENT) { + navigationOptions.addAll(Arrays.asList(op1, op3, op4, op13, op14, op12)); + } else { + navigationOptions.addAll(Arrays.asList(op1, op3, op4, op13, op14, op9, op8, op10, op16, op12)); + } + if (HealthFacilityApplication.getApplicationFlavor().hasLD()) { + navigationOptions.add(2, op15); + } + if (HealthFacilityApplication.getApplicationFlavor().hasChildModule()) { + navigationOptions.add(6, op5); + } + if (HealthFacilityApplication.getApplicationFlavor().hasMalaria()) { + navigationOptions.add(10, op7); + } + if (HealthFacilityApplication.getApplicationFlavor().hasCdp()) { + navigationOptions.add(10, op18); + } + if (HealthFacilityApplication.getApplicationFlavor().hasKvpPrEP()) { + navigationOptions.add(10, op20); + navigationOptions.add(10, op19); + } + if (HealthFacilityApplication.getApplicationFlavor().hasHivst()) { + navigationOptions.add(10, op17); + } + } else { + navigationOptions.addAll(Arrays.asList(op1, op2, op3, op4, op5, op6, op7, op12)); + } } return navigationOptions; diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/PmtctFollowupFeedbackModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/PmtctFollowupFeedbackModel.java new file mode 100644 index 000000000..b23f71fb0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/PmtctFollowupFeedbackModel.java @@ -0,0 +1,22 @@ +package org.smartregister.chw.hf.model; + +public class PmtctFollowupFeedbackModel { + private ChwFollowupFeedbackDetailsModel followupFeedbackDetailsModel; + private String type; + + public ChwFollowupFeedbackDetailsModel getFollowupFeedbackDetailsModel() { + return followupFeedbackDetailsModel; + } + + public void setFollowupFeedbackDetailsModel(ChwFollowupFeedbackDetailsModel followupFeedbackDetailsModel) { + this.followupFeedbackDetailsModel = followupFeedbackDetailsModel; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/PmtctRegisterFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/PmtctRegisterFragmentModel.java new file mode 100644 index 000000000..dfb048772 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/PmtctRegisterFragmentModel.java @@ -0,0 +1,53 @@ +package org.smartregister.chw.hf.model; + +import androidx.annotation.NonNull; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.model.BasePmtctRegisterFragmentModel; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class PmtctRegisterFragmentModel extends BasePmtctRegisterFragmentModel { + @NonNull + @Override + public String mainSelect(@NonNull String tableName, @NonNull String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " ON " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID + " = " + Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + Constants.TABLE_NAME.FAMILY + " ON " + Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " as T1 ON " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.PRIMARY_CAREGIVER + " = T1." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Constants.TABLE_NAME.FAMILY_MEMBER + " as T2 ON " + Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD + " = T2." + DBConstants.KEY.BASE_ENTITY_ID); + return queryBuilder.mainCondition(mainCondition); + } + + @Override + @NotNull + public String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + + columnList.add(tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOD); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.GENDER); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columnList.add(Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columnList.add("T2." + DBConstants.KEY.PHONE_NUMBER + " AS " + org.smartregister.chw.tb.util.DBConstants.Key.FAMILY_HEAD_PHONE_NUMBER); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add("T1." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.PRIMARY_CAREGIVER); + columnList.add("T2." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.FAMILY_HEAD); + columnList.add(Constants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + + return columnList.toArray(new String[columnList.size()]); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/PncNoMotherRegisterFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/PncNoMotherRegisterFragmentModel.java new file mode 100644 index 000000000..0410c6954 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/PncNoMotherRegisterFragmentModel.java @@ -0,0 +1,80 @@ +package org.smartregister.chw.hf.model; + +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.core.utils.ChwDBConstants; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class PncNoMotherRegisterFragmentModel extends org.smartregister.chw.core.model.PncRegisterFragmentModel { + @Override + protected String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + + columnList.add("ec_pnc_child_followup" + "." + DBConstants.KEY.LAST_INTERACTED_WITH + " as lastInteractedWith"); + columnList.add(tableName + "." + ChwDBConstants.DELIVERY_DATE); + columnList.add(tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(tableName + "." + Constants.DBConstants.CAREGIVER_NAME); + columnList.add(tableName + "." + Constants.DBConstants.CAREGIVER_PHONE_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.GENDER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.PRIMARY_CAREGIVER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + + return columnList.toArray(new String[columnList.size()]); + } + + @Override + public String mainSelect(String tableName, String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + " ON " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID + " = " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " AND " + tableName + "." + ChwDBConstants.IS_CLOSED + " IS " + 0 + " AND " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + ChwDBConstants.IS_CLOSED + " IS " + 0 + " AND " + tableName + "." + ChwDBConstants.DELIVERY_DATE + " IS NOT NULL COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY + " ON " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + queryBuilder.customJoin(" LEFT JOIN (SELECT entity_id, max(last_interacted_with) last_interacted_with FROM ec_pnc_child_followup GROUP BY entity_id) ec_pnc_child_followup ON ec_pnc_child_followup.entity_id = ec_family_member.base_entity_id"); + queryBuilder.customJoin("LEFT JOIN (select base_entity_id , max(visit_date) visit_date from visits GROUP by base_entity_id) VISIT_SUMMARY ON VISIT_SUMMARY.base_entity_id = " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + + + //This query is used to obtain a list of children whose mother's died while the children are still in PNC + //This children are moved to No Mother Children Register for continuation of PNC Visits + return queryBuilder.mainCondition(mainCondition) + " UNION Select \n" + + "ec_pregnancy_outcome.id as _id , \n" + + "ec_pregnancy_outcome.delivery_date , \n" + + "childFamilyMember.middle_name , \n" + + "childFamilyMember.first_name , \n" + + "childFamilyMember.gender , \n" + + "ec_family_member.first_name || ' ' ||ec_family_member.middle_name ||' '||ec_family_member.last_name as caregiver_name, \n" + + "ec_family.primary_caregiver , \n" + + "childFamilyMember.last_name , \n" + + "ec_family_member.phone_number , \n" + + "ec_family.village_town , \n" + + "ec_family_member.phone_number as caregiver_phone_number , \n" + + "childFamilyMember.dob , \n" + + "ec_family.family_head , \n" + + "ec_family.first_name as family_name , \n" + + "childFamilyMember.unique_id , \n" + + "childFamilyMember.base_entity_id , \n" + + "ec_family_member.relational_id as relationalid , \n" + + "ec_pnc_child_followup.last_interacted_with as lastInteractedWith , \n" + + "ec_family_member.relational_id \n" + + "FROM ec_pregnancy_outcome \n" + + "INNER JOIN ec_family_member ON ec_pregnancy_outcome.base_entity_id = ec_family_member.base_entity_id AND ec_pregnancy_outcome.is_closed IS 0 AND ec_family_member.is_closed IS 1 AND ec_pregnancy_outcome.delivery_date IS NOT NULL COLLATE NOCASE \n" + + "INNER JOIN ec_family ON ec_family_member.relational_id = ec_family.base_entity_id COLLATE NOCASE \n" + + "INNER JOIN ec_child ON ec_family_member.base_entity_id = ec_child.mother_entity_id COLLATE NOCASE \n" + + "INNER JOIN ec_family_member childFamilyMember ON childFamilyMember.base_entity_id = ec_child.base_entity_id COLLATE NOCASE \n" + + "LEFT JOIN (SELECT entity_id, max(last_interacted_with) last_interacted_with FROM ec_pnc_child_followup GROUP BY entity_id) ec_pnc_child_followup ON ec_pnc_child_followup.entity_id = ec_family_member.base_entity_id \n" + + "LEFT JOIN (select base_entity_id , max(visit_date) visit_date from visits GROUP by base_entity_id) VISIT_SUMMARY ON VISIT_SUMMARY.base_entity_id = ec_pregnancy_outcome.base_entity_id"; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/ReferralModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/ReferralModel.java index 822b2a5b2..8f9590531 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/ReferralModel.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/ReferralModel.java @@ -15,10 +15,9 @@ public class ReferralModel extends BaseReferralModel { public String mainSelect(String tableName, String entityTable, String mainCondition) { SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName, entityTable), CoreConstants.DB_CONSTANTS.ID); - queryBuilder.customJoin(String.format("INNER JOIN %s ON %s.%s = %s.%s AND task.business_status = 'Referred' COLLATE NOCASE ", + queryBuilder.customJoin(String.format("INNER JOIN %s ON %s.%s = %s.%s AND task.focus <> 'LTFU' AND task.business_status = 'Referred' COLLATE NOCASE ", entityTable, entityTable, DBConstants.KEY.BASE_ENTITY_ID, tableName, CoreConstants.DB_CONSTANTS.FOR)); queryBuilder.customJoin("LEFT JOIN ec_family ON ec_family_member.relational_id = ec_family.id COLLATE NOCASE"); - return queryBuilder.mainCondition(mainCondition); } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/TbFollowupFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/TbFollowupFragmentModel.java new file mode 100644 index 000000000..af80f5226 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/TbFollowupFragmentModel.java @@ -0,0 +1,64 @@ +package org.smartregister.chw.hf.model; + + +import androidx.annotation.NonNull; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.tb.model.BaseTbRegisterFragmentModel; +import org.smartregister.chw.tb.util.Constants.Tables; +import org.smartregister.chw.tb.util.DBConstants.Key; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class TbFollowupFragmentModel extends BaseTbRegisterFragmentModel { + + + @NonNull + @Override + public String mainSelect(@NonNull String tableName, @NonNull String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + " ON " + tableName + "." + Key.ENTITY_ID + " = " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY + " ON " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + " as T1 ON " + CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.PRIMARY_CAREGIVER + " = T1." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + " as T2 ON " + CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FAMILY_HEAD + " = T2." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN " + Tables.TB_COMMUNITY_FEEDBACK + " as T3 ON " + tableName + "." + Key.ENTITY_ID + " = T3." + Key.ENTITY_ID); + + return queryBuilder.mainCondition(mainCondition); + } + + @Override + @NotNull + public String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.GENDER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columnList.add("T2." + DBConstants.KEY.PHONE_NUMBER + " AS " + Key.FAMILY_HEAD_PHONE_NUMBER); + columnList.add("T3." + Key.TB_COMMUNITY_FOLLOWUP_VISIT_DATE + " AS " + Key.TB_COMMUNITY_FOLLOWUP_VISIT_DATE); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add("T1." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T1." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.PRIMARY_CAREGIVER); + columnList.add("T2." + DBConstants.KEY.FIRST_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.MIDDLE_NAME + " || " + "' '" + " || " + "T2." + DBConstants.KEY.LAST_NAME + " AS " + DBConstants.KEY.FAMILY_HEAD); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + columnList.add(Tables.TB_COMMUNITY_FOLLOWUP + "." + Key.REASONS_FOR_ISSUING_COMMUNITY_REFERRAL); + columnList.add(Tables.TB_COMMUNITY_FOLLOWUP + "." + Key.LAST_INTERACTED_WITH); + columnList.add(Tables.TB_COMMUNITY_FOLLOWUP + "." + Key.TB_COMMUNITY_REFERRAL_DATE); + columnList.add(Tables.TB_COMMUNITY_FOLLOWUP + "." + Key.COMMENTS); + + return columnList.toArray(new String[columnList.size()]); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/TbRegisterFragmentModel.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/TbRegisterFragmentModel.java new file mode 100644 index 000000000..8392c6a6e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/model/TbRegisterFragmentModel.java @@ -0,0 +1,56 @@ +package org.smartregister.chw.hf.model; + + +import androidx.annotation.NonNull; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.utils.ChildDBConstants; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.tb.model.BaseTbRegisterFragmentModel; +import org.smartregister.chw.tb.util.Constants.Tables; +import org.smartregister.chw.tb.util.DBConstants.Key; +import org.smartregister.cursoradapter.SmartRegisterQueryBuilder; +import org.smartregister.family.util.DBConstants; + +import java.util.HashSet; +import java.util.Set; + +public class TbRegisterFragmentModel extends BaseTbRegisterFragmentModel { + + @NonNull + @Override + public String mainSelect(@NonNull String tableName, @NonNull String mainCondition) { + SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); + queryBuilder.selectInitiateMainTable(tableName, mainColumns(tableName)); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + " ON " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID + " = " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.BASE_ENTITY_ID + " COLLATE NOCASE "); + queryBuilder.customJoin("INNER JOIN " + CoreConstants.TABLE_NAME.FAMILY + " ON " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " = " + CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.BASE_ENTITY_ID); + queryBuilder.customJoin("LEFT JOIN (select base_entity_id , max(visit_date) visit_date from visits GROUP by base_entity_id) VISIT_SUMMARY ON VISIT_SUMMARY.base_entity_id = " + tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + return queryBuilder.mainCondition(mainCondition); + } + + @Override + @NotNull + public String[] mainColumns(String tableName) { + Set columnList = new HashSet<>(); + + columnList.add(tableName + "." + DBConstants.KEY.BASE_ENTITY_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID + " as " + ChildDBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.FIRST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.MIDDLE_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.LAST_NAME); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DOB); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.GENDER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.UNIQUE_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.RELATIONAL_ID); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.PHONE_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.OTHER_PHONE_NUMBER); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.VILLAGE_TOWN); + columnList.add(CoreConstants.TABLE_NAME.FAMILY + "." + DBConstants.KEY.FIRST_NAME + " as " + org.smartregister.chw.anc.util.DBConstants.KEY.FAMILY_NAME); + columnList.add(Tables.TB + "." + Key.PLACE_OF_DOMICILE); + columnList.add(Tables.TB + "." + Key.COMMUNITY_CLIENT_TB_REGISTRATION_NUMBER); + columnList.add(Tables.TB + "." + Key.CLIENT_TB_STATUS_DURING_REGISTRATION); + columnList.add(Tables.TB + "." + Key.CLIENT_TB_STATUS_AFTER_TESTING); + + return columnList.toArray(new String[columnList.size()]); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/AdvancedSearchFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/AdvancedSearchFragmentPresenter.java new file mode 100644 index 000000000..851db9da0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/AdvancedSearchFragmentPresenter.java @@ -0,0 +1,118 @@ +package org.smartregister.chw.hf.presenter; + +import android.util.Log; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.hf.contract.AdvancedSearchContract; +import org.smartregister.chw.hf.domain.Entity; +import org.smartregister.chw.hf.interactor.AdvancedSearchInteractor; +import org.smartregister.configurableviews.model.Field; +import org.smartregister.configurableviews.model.RegisterConfiguration; +import org.smartregister.configurableviews.model.View; +import org.smartregister.configurableviews.model.ViewConfiguration; +import org.smartregister.family.contract.FamilyRegisterFragmentContract; +import org.smartregister.family.contract.FamilyRegisterFragmentContract.Presenter; +import org.smartregister.family.util.DBConstants; +import org.smartregister.family.util.Utils; +import org.smartregister.view.contract.BaseRegisterFragmentContract; + +import java.lang.ref.WeakReference; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +public class AdvancedSearchFragmentPresenter implements Presenter, AdvancedSearchContract.Presenter, AdvancedSearchContract.InteractorCallBack { + + protected WeakReference viewReference; + protected FamilyRegisterFragmentContract.Model model; + protected RegisterConfiguration config; + protected Set visibleColumns = new TreeSet(); + protected String viewConfigurationIdentifier; + protected AdvancedSearchContract.Interactor interactor; + + public AdvancedSearchFragmentPresenter(BaseRegisterFragmentContract.View view, FamilyRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + this.viewReference = new WeakReference(view); + this.model = model; + this.viewConfigurationIdentifier = viewConfigurationIdentifier; + this.config = model.defaultRegisterConfiguration(); + interactor = new AdvancedSearchInteractor(); + } + + public void processViewConfigurations() { + if (!StringUtils.isBlank(this.viewConfigurationIdentifier)) { + ViewConfiguration viewConfiguration = this.model.getViewConfiguration(this.viewConfigurationIdentifier); + if (viewConfiguration != null) { + this.config = (RegisterConfiguration) viewConfiguration.getMetadata(); + this.setVisibleColumns(this.model.getRegisterActiveColumns(this.viewConfigurationIdentifier)); + } + + if (this.config.getSearchBarText() != null && this.getView() != null) { + this.getView().updateSearchBarHint(this.config.getSearchBarText()); + } + + } + } + + public void initializeQueries(String mainCondition) { + String tableName = Utils.metadata().familyRegister.tableName; + String countSelect = this.model.countSelect(tableName, mainCondition); + String mainSelect = this.model.mainSelect(tableName, mainCondition); + this.getView().initializeQueryParams(tableName, countSelect, mainSelect); + //this.getView().initializeAdapter(this.visibleColumns); + //this.getView().countExecute(); + //this.getView().filterandSortInInitializeQueries(); + } + + public void startSync() { + } + + @Override + public void updateSortAndFilter(List filterList, Field sortField) { + String filterText = model.getFilterText(filterList, getView().getString(org.smartregister.R.string.filter)); + String sortText = model.getSortText(sortField); + + getView().updateFilterAndFilterStatus(filterText, sortText); + } + + public void searchGlobally(String uniqueId) { + } + + protected AdvancedSearchContract.View getView() { + return this.viewReference != null ? (AdvancedSearchContract.View) this.viewReference.get() : null; + } + + private void setVisibleColumns(Set visibleColumns) { + this.visibleColumns = visibleColumns; + } + + public void setModel(FamilyRegisterFragmentContract.Model model) { + this.model = model; + } + + public String getMainCondition() { + return String.format(" %s is null ", "date_removed"); + } + + @Override + public String getDefaultSortQuery() { + return DBConstants.KEY.LAST_INTERACTED_WITH + " DESC "; + } + + @Override + public String getQueryTable() { + return null; + } + + public void search(Map searchMap, boolean isLocal) { + Log.d("Search", "searching in presenter: " + searchMap.toString()); + interactor.search(searchMap, isLocal, this); + } + + public void onResultsFound(List members, boolean isLocal) { + System.out.println("Member size: " + members.size()); + + getView().showResults(members, isLocal); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/AncMemberProfilePresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/AncMemberProfilePresenter.java new file mode 100644 index 000000000..ea3a45f26 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/AncMemberProfilePresenter.java @@ -0,0 +1,120 @@ +package org.smartregister.chw.hf.presenter; + +import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; + +import android.content.Context; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.core.contract.AncMemberProfileContract; +import org.smartregister.chw.core.presenter.CoreAncMemberProfilePresenter; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.HfAncDao; +import org.smartregister.chw.hf.interactor.AncMemberProfileInteractor; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.referral.util.JsonFormConstants; +import org.smartregister.dao.LocationsDao; +import org.smartregister.family.util.JsonFormUtils; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.Collections; + +import timber.log.Timber; + +public class AncMemberProfilePresenter extends CoreAncMemberProfilePresenter { + private AncMemberProfileInteractor ancMemberProfileInteractor; + + public AncMemberProfilePresenter(AncMemberProfileContract.View view, AncMemberProfileContract.Interactor interactor, MemberObject memberObject) { + super(view, interactor, memberObject); + ancMemberProfileInteractor = (AncMemberProfileInteractor) interactor; + } + + @Override + public void refreshProfileTopSection(MemberObject memberObject) { + String entityType = memberObject.getBaseEntityId(); + getView().setMemberName(memberObject.getMemberName()); + getView().setMemberGA(String.valueOf(memberObject.getGestationAge())); + getView().setMemberAddress(memberObject.getAddress()); + getView().setMemberChwMemberId(memberObject.getChwMemberId()); + getView().setProfileImage(memberObject.getBaseEntityId(), entityType); + getView().setMemberGravida(memberObject.getGravida()); + if (HfAncDao.isClientClosed(memberObject.getBaseEntityId())) { + getView().setPregnancyRiskLabel(Constants.Visits.TERMINATED); + } else { + getView().setPregnancyRiskLabel(memberObject.getPregnancyRiskLevel()); + } + } + + @Override + public void setPregnancyRiskTransportProfileDetails(MemberObject memberObject) { + String entityType = memberObject.getBaseEntityId(); + getView().setMemberName(memberObject.getMemberName()); + getView().setMemberGA(String.valueOf(memberObject.getGestationAge())); + getView().setMemberAddress(memberObject.getAddress()); + getView().setMemberChwMemberId(memberObject.getChwMemberId()); + getView().setProfileImage(memberObject.getBaseEntityId(), entityType); + getView().setMemberGravida(memberObject.getGravida()); + if (HfAncDao.isClientClosed(memberObject.getBaseEntityId())) { + getView().setPregnancyRiskLabel(Constants.Visits.TERMINATED); + } else { + getView().setPregnancyRiskLabel(memberObject.getPregnancyRiskLevel()); + } + + } + + public void startPartnerFollowupReferralForm(MemberObject memberObject) { + try { + JSONObject formJsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets((Context) getView(), CoreConstants.JSON_FORM.getAncPartnerCommunityFollowupReferral()); + //adds the chw locations under the current facility + JSONObject chwLocations = CoreJsonFormUtils.getJsonField(formJsonObject, org.smartregister.util.JsonFormUtils.STEP1, "chw_location"); + CoreJsonFormUtils.addLocationsToDropdownField(LocationsDao.getLocationsByTags( + Collections.singleton(SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS)), chwLocations); + + getView().startFormActivity(formJsonObject); + } catch (Exception e) { + Timber.e(e); + } + } + + public void startPartnerTestingForm(MemberObject memberObject) { + JSONObject partnerTestingForm; + try { + partnerTestingForm = org.smartregister.chw.core.utils.FormUtils.getFormUtils().getFormJson(CoreConstants.JSON_FORM.PARTNER_TESTING); + partnerTestingForm.getJSONObject("global").put("hiv_testing_done", HfAncDao.isPartnerTestedForHiv(memberObject.getBaseEntityId())); + partnerTestingForm.getJSONObject("global").put("gestational_age", memberObject.getGestationAge()); + partnerTestingForm.getJSONObject("global").put("syphilis_testing_done", HfAncDao.isPartnerTestedForSyphilis(memberObject.getBaseEntityId())); + partnerTestingForm.getJSONObject("global").put("hepatitis_testing_done", HfAncDao.isPartnerTestedForHepatitis(memberObject.getBaseEntityId())); + partnerTestingForm.getJSONObject("global").put("partner_hiv_test_at_32_done", HfAncDao.isPartnerHivTestConductedAtWk32(memberObject.getBaseEntityId())); + partnerTestingForm.getJSONObject("global").put("partner_hiv_status", HfAncDao.getPartnerHivStatus(memberObject.getBaseEntityId())); + partnerTestingForm.getJSONObject("global").put("partner_other_stds", HfAncDao.getPartnerOtherStdsStatus(memberObject.getBaseEntityId())); + + JSONArray fields = partnerTestingForm.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + JSONObject renamePartnerSecondHivAt32 = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "partner_hiv"); + JSONObject partnerHivTestNumberField = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "partner_hiv_test_number"); + JSONObject gest_ageField = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "gest_age"); + partnerHivTestNumberField.put(JsonFormUtils.VALUE, HfAncDao.getNextPartnerHivTestNumber(memberObject.getBaseEntityId())); + gest_ageField.put(JsonFormUtils.VALUE, memberObject.getGestationAge()); + if (HfAncDao.getNextPartnerHivTestNumber(memberObject.getBaseEntityId()) == 2) { + renamePartnerSecondHivAt32.put("label", getView().getContext().getString(R.string.second_hiv_test_results_partner)); + } + + getView().startFormActivity(partnerTestingForm); + } catch (JSONException e) { + Timber.e(e); + } + } + + public void createPartnerFollowupReferralEvent(AllSharedPreferences allSharedPreferences, String jsonString, String entityID) throws Exception { + ancMemberProfileInteractor.createPartnerFollowupReferralEvent(allSharedPreferences, jsonString, entityID); + } + + public void savePartnerTestingEvent(AllSharedPreferences allSharedPreferences, String jsonString, String entityID) throws Exception { + ancMemberProfileInteractor.createTestingEvent(allSharedPreferences, jsonString, entityID); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/Cd4ResultsFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/Cd4ResultsFragmentPresenter.java new file mode 100644 index 000000000..2f33fb116 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/Cd4ResultsFragmentPresenter.java @@ -0,0 +1,20 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.pmtct.contract.HvlResultsFragmentContract; +import org.smartregister.chw.pmtct.presenter.BaseHvlResultsFragmentPresenter; +import org.smartregister.chw.pmtct.util.Constants; +import org.smartregister.chw.pmtct.util.DBConstants; + +public class Cd4ResultsFragmentPresenter extends BaseHvlResultsFragmentPresenter { + private String baseEntityId; + public Cd4ResultsFragmentPresenter(String baseEntityId, HvlResultsFragmentContract.View view, HvlResultsFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + this.baseEntityId = baseEntityId; + } + + @Override + public String getMainCondition() { + return " " + Constants.TABLES.PMTCT_FOLLOW_UP + "." + DBConstants.KEY.CD4_SAMPLE_ID + " IS NOT NULL " + + " AND " + Constants.TABLES.PMTCT_FOLLOW_UP + "." + DBConstants.KEY.ENTITY_ID + " = '"+ baseEntityId+ "'" ; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/FamilyProfilePresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/FamilyProfilePresenter.java index b1077017b..29aa63fe0 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/FamilyProfilePresenter.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/FamilyProfilePresenter.java @@ -1,19 +1,27 @@ package org.smartregister.chw.hf.presenter; +import static org.smartregister.chw.hf.utils.JsonFormUtils.getAutoPopulatedJsonEditFormString; + +import org.json.JSONObject; import org.smartregister.chw.core.contract.FamilyProfileExtendedContract; +import org.smartregister.chw.core.model.CoreChildProfileModel; import org.smartregister.chw.core.model.CoreChildRegisterModel; import org.smartregister.chw.core.presenter.CoreFamilyProfilePresenter; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.Utils; import org.smartregister.chw.hf.interactor.HfFamilyProfileInteractor; -import org.smartregister.chw.hf.model.ChildProfileModel; import org.smartregister.chw.hf.model.ChildRegisterModel; +import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.family.contract.FamilyProfileContract; +import timber.log.Timber; + public class FamilyProfilePresenter extends CoreFamilyProfilePresenter { public FamilyProfilePresenter(FamilyProfileExtendedContract.View loginView, FamilyProfileContract.Model model, String familyBaseEntityId, String familyHead, String primaryCaregiver, String familyName) { super(loginView, model, familyBaseEntityId, familyHead, primaryCaregiver, familyName); interactor = new HfFamilyProfileInteractor(); - childProfileModel = new ChildProfileModel(familyName); + childProfileModel = new CoreChildProfileModel(familyName); verifyHasPhone(); } @@ -21,4 +29,14 @@ public FamilyProfilePresenter(FamilyProfileExtendedContract.View loginView, Fami protected CoreChildRegisterModel getChildRegisterModel() { return new ChildRegisterModel(); } + + @Override + public void startFormForEdit(CommonPersonObjectClient client) { + JSONObject form = getAutoPopulatedJsonEditFormString(CoreConstants.JSON_FORM.getFamilyDetailsRegister(), getView().getApplicationContext(), client, Utils.metadata().familyRegister.updateEventType); + try { + getView().startFormActivity(form); + } catch (Exception e) { + Timber.e(e); + } + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HeiHivResultsFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HeiHivResultsFragmentPresenter.java new file mode 100644 index 000000000..f7cedaa77 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HeiHivResultsFragmentPresenter.java @@ -0,0 +1,25 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.contract.HvlResultsFragmentContract; +import org.smartregister.chw.pmtct.presenter.BaseHvlResultsFragmentPresenter; + +public class HeiHivResultsFragmentPresenter extends BaseHvlResultsFragmentPresenter { + private String baseEntityId; + + public HeiHivResultsFragmentPresenter(String baseEntityId, HvlResultsFragmentContract.View view, HvlResultsFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + this.baseEntityId = baseEntityId; + } + + @Override + public String getMainCondition() { + return " " + Constants.TableName.HEI_FOLLOWUP + "." + Constants.DBConstants.HEI_HIV_SAMPLE_ID + " IS NOT NULL " + + " AND " + Constants.TableName.HEI_FOLLOWUP +".entity_id = '" + baseEntityId + "'"; + } + + @Override + public String getMainTable() { + return Constants.TableName.HEI_FOLLOWUP; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HeiProfilePresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HeiProfilePresenter.java new file mode 100644 index 000000000..8eefeb2e3 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HeiProfilePresenter.java @@ -0,0 +1,53 @@ +package org.smartregister.chw.hf.presenter; + +import org.apache.commons.lang3.tuple.Triple; +import org.smartregister.chw.hf.interactor.HeiProfileInteractor; +import org.smartregister.chw.pmtct.contract.PmtctProfileContract; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.presenter.BasePmtctProfilePresenter; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.family.contract.FamilyProfileContract; +import org.smartregister.family.domain.FamilyEventClient; +import org.smartregister.repository.AllSharedPreferences; + +public class HeiProfilePresenter extends BasePmtctProfilePresenter implements FamilyProfileContract.InteractorCallBack { + private HeiProfileInteractor heiProfileInteractor; + + public HeiProfilePresenter(PmtctProfileContract.View view, PmtctProfileContract.Interactor interactor, MemberObject memberObject) { + super(view, interactor, memberObject); + this.heiProfileInteractor = (HeiProfileInteractor) interactor; + } + + public void createHeiCommunityFollowupReferralEvent(AllSharedPreferences allSharedPreferences, String jsonString, String entityID) throws Exception { + heiProfileInteractor.createHeiCommunityFollowupReferralEvent(allSharedPreferences, jsonString, entityID); + } + + public void createHeiNumberRegistrationEvent(AllSharedPreferences allSharedPreferences, String jsonString, String entityID) throws Exception { + heiProfileInteractor.createHeiNumberRegistrationEvent(allSharedPreferences, jsonString, entityID); + } + + @Override + public void startFormForEdit(CommonPersonObjectClient commonPersonObjectClient) { + //override + } + + @Override + public void refreshProfileTopSection(CommonPersonObjectClient commonPersonObjectClient) { + //override + } + + @Override + public void onUniqueIdFetched(Triple triple, String s) { + //override + } + + @Override + public void onNoUniqueId() { + //override + } + + @Override + public void onRegistrationSaved(boolean b, boolean b1, FamilyEventClient familyEventClient) { + //override + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HeiRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HeiRegisterFragmentPresenter.java new file mode 100644 index 000000000..39369c55f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HeiRegisterFragmentPresenter.java @@ -0,0 +1,22 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.pmtct.contract.PmtctRegisterFragmentContract; +import org.smartregister.chw.pmtct.presenter.BasePmtctRegisterFragmentPresenter; + +public class HeiRegisterFragmentPresenter extends BasePmtctRegisterFragmentPresenter { + public HeiRegisterFragmentPresenter(PmtctRegisterFragmentContract.View view, PmtctRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + + @Override + public String getMainTable() { + return CoreConstants.TABLE_NAME.HEI; + } + + @Override + public String getMainCondition() { + return CoreConstants.TABLE_NAME.HEI + "." + "is_closed is 0"; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HeiRegisterPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HeiRegisterPresenter.java new file mode 100644 index 000000000..28c2432d0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HeiRegisterPresenter.java @@ -0,0 +1,10 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.pmtct.contract.PmtctRegisterContract; +import org.smartregister.chw.pmtct.presenter.BasePmtctRegisterPresenter; + +public class HeiRegisterPresenter extends BasePmtctRegisterPresenter { + public HeiRegisterPresenter(PmtctRegisterContract.View view, PmtctRegisterContract.Model model, PmtctRegisterContract.Interactor interactor) { + super(view, model, interactor); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfAllClientRegisterPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfAllClientRegisterPresenter.java new file mode 100644 index 000000000..b11a6c92a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfAllClientRegisterPresenter.java @@ -0,0 +1,94 @@ +package org.smartregister.chw.hf.presenter; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Triple; +import org.json.JSONObject; +import org.smartregister.chw.core.presenter.CoreAllClientsRegisterPresenter; +import org.smartregister.chw.hf.interactor.HfAllClientsRegisterInteractor; +import org.smartregister.domain.FetchStatus; +import org.smartregister.opd.contract.OpdRegisterActivityContract; +import org.smartregister.opd.pojo.OpdEventClient; +import org.smartregister.opd.pojo.RegisterParams; + +import java.util.List; + +import timber.log.Timber; + +public class HfAllClientRegisterPresenter extends CoreAllClientsRegisterPresenter { + + public HfAllClientRegisterPresenter(OpdRegisterActivityContract.View view, OpdRegisterActivityContract.Model model) { + super(view, model); + } + + @Override + public void saveForm(String jsonString, @NonNull RegisterParams registerParams) { + try { + List opdEventClientList = model.processRegistration(jsonString, registerParams.getFormTag()); + if (opdEventClientList == null || opdEventClientList.isEmpty()) { + return; + } + interactor.saveRegistration(opdEventClientList, jsonString, registerParams, this); + } catch (Exception e) { + Timber.e(e); + } + } + + @NonNull + @Override + public OpdRegisterActivityContract.Interactor createInteractor() { + return new HfAllClientsRegisterInteractor(); + } + + @Override + public void onRegistrationSaved(boolean inEditMode) { + if (getView() != null) { + getView().refreshList(FetchStatus.fetched); + getView().hideProgressDialog(); + } + } + + @Nullable + private OpdRegisterActivityContract.View getView() { + if (viewReference != null) { + return viewReference.get(); + } else { + return null; + } + } + + @Override + public void onNoUniqueId() { + if (getView() != null) + getView().displayShortToast(org.smartregister.family.R.string.no_unique_id); + } + + @Override + public void onUniqueIdFetched(Triple triple, String entityId) { + if (getView() != null) { + try { + startForm(triple.getLeft(), entityId, triple.getMiddle(), triple.getRight()); + } catch (Exception e) { + Timber.e(e); + getView().displayToast(org.smartregister.family.R.string.error_unable_to_start_form); + } + } + } + + + public void startForm(String formName, String entityId, String metadata, String currentLocationId) throws Exception { + + if (StringUtils.isBlank(entityId)) { + Triple triple = Triple.of(formName, metadata, currentLocationId); + interactor.getNextUniqueId(triple, this); + return; + } + + JSONObject form = model.getFormAsJson(formName, entityId, currentLocationId); + if (getView() != null) + getView().startFormActivity(form); + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfAllClientsMemberPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfAllClientsMemberPresenter.java new file mode 100644 index 000000000..c42655b09 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfAllClientsMemberPresenter.java @@ -0,0 +1,61 @@ +package org.smartregister.chw.hf.presenter; + +import static org.smartregister.util.Utils.getName; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Triple; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.core.activity.CoreAllClientsMemberProfileActivity; +import org.smartregister.chw.core.application.CoreChwApplication; +import org.smartregister.chw.core.presenter.CoreAllClientsMemberPresenter; +import org.smartregister.chw.hf.activity.AllClientsMemberProfileActivity; +import org.smartregister.chw.hf.dao.FamilyDao; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.family.util.DBConstants; +import org.smartregister.family.util.Utils; + +import java.text.MessageFormat; + +public class HfAllClientsMemberPresenter extends CoreAllClientsMemberPresenter { + public HfAllClientsMemberPresenter(CoreAllClientsMemberProfileActivity allClientsMemberProfileActivity, String baseEntityId) { + super(allClientsMemberProfileActivity, baseEntityId); + } + + @Override + public void refreshProfileTopSection(CommonPersonObjectClient client) { + if (client != null && client.getColumnmaps() != null) { + String firstName = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.FIRST_NAME, true); + String middleName = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.MIDDLE_NAME, true); + String lastName = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.LAST_NAME, true); + + String dob = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.DOB, true); + int age = StringUtils.isNotBlank(dob) ? Utils.getAgeFromDate(dob) : 0; + + AllClientsMemberProfileActivity currentView = (AllClientsMemberProfileActivity) getView(); + currentView.setProfileName(MessageFormat.format("{0}, {1}", getName(getName(firstName, middleName), lastName), age)); + currentView.setFamilyName(lastName); + String gestationAge = CoreChwApplication.ancRegisterRepository().getGaIfAncWoman(client.getCaseId()); + if (gestationAge != null) { + currentView.setProfileDetailOne(NCUtils.gestationAgeString(gestationAge, currentView.getContext(), true)); + } + String gender = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.GENDER, true); + currentView.setProfileDetailOne(gender); + String villageTown = FamilyDao.getFamilyDetail(client.getCaseId()).getVillageTown(); + currentView.setProfileDetailTwo(villageTown); + String uniqueId = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.UNIQUE_ID, false); + currentView.setProfileDetailThree(String.format(currentView.getString(org.smartregister.chw.core.R.string.id_with_value), uniqueId)); + String entityType = Utils.getValue(client.getColumnmaps(), DBConstants.KEY.ENTITY_TYPE, false); + currentView.setProfileImage(client.getCaseId(), entityType); + } + } + + @Override + public void onUniqueIdFetched(Triple triple, String entityId) { + //Overridden: Not Needed + } + + @Override + public void onNoUniqueId() { + //Overridden: Not Needed + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfAncReferralListRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfAncReferralListRegisterFragmentPresenter.java new file mode 100644 index 000000000..a014f914e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfAncReferralListRegisterFragmentPresenter.java @@ -0,0 +1,47 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.anc.contract.BaseAncRegisterFragmentContract; +import org.smartregister.chw.core.presenter.AncRegisterFragmentPresenter; + +public class HfAncReferralListRegisterFragmentPresenter extends AncRegisterFragmentPresenter { + public HfAncReferralListRegisterFragmentPresenter(BaseAncRegisterFragmentContract.View view, BaseAncRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + + @Override + public String getDefaultSortQuery() { + return " task.last_modified DESC "; + } + + @Override + public void initializeQueries(String mainCondition) { + String tableName = getMainTable(); + + String countSelect = model.countSelect(tableName, getMainCondition()); + String mainSelect = model.mainSelect(tableName, getMainCondition()); + + getView().initializeQueryParams(tableName, countSelect, mainSelect); + getView().initializeAdapter(visibleColumns); + + getView().countExecute(); + getView().filterandSortInInitializeQueries(); + } + + @Override + public String getMainTable() { + return "ec_family_member"; + } + + @Override + public String getMainCondition() { + return " (" + + " ec_anc_register.task_id IS NOT NULL AND "+ + " ec_anc_register.task_id NOT LIKE '%' || task._id || '%' " + + " AND ec_anc_register.confirmation_status <> 'Confirmed' " + + " AND focus='Pregnancy Confirmation' " + + ") " + + " OR (focus='Pregnancy Confirmation' AND ec_anc_register.base_entity_id IS NULL) "; + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfAncRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfAncRegisterFragmentPresenter.java new file mode 100644 index 000000000..ee419faf0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfAncRegisterFragmentPresenter.java @@ -0,0 +1,39 @@ +package org.smartregister.chw.hf.presenter; + +import android.content.Context; + +import org.smartregister.chw.anc.contract.BaseAncRegisterFragmentContract; +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.chw.core.presenter.AncRegisterFragmentPresenter; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; + +import java.text.MessageFormat; + +public class HfAncRegisterFragmentPresenter extends AncRegisterFragmentPresenter { + public HfAncRegisterFragmentPresenter(BaseAncRegisterFragmentContract.View view, BaseAncRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + + @Override + public String getMainCondition() { + return " " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DATE_REMOVED + " is null " + + "AND " + CoreConstants.TABLE_NAME.ANC_MEMBER + "." + DBConstants.KEY.IS_CLOSED + " is 0 AND confirmation_status = 'Confirmed' "; + } + + public String getDueFilterCondition(String hivStatus, String appointmentDate, boolean isReferred, Context context) { + StringBuilder customFilter = new StringBuilder(); + if (hivStatus != null && !hivStatus.equalsIgnoreCase("all")) { + customFilter.append(MessageFormat.format(" and {0} like ''%{1}%'' ", "hiv", hivStatus)); + } + if (appointmentDate != null && !appointmentDate.equalsIgnoreCase(context.getString(R.string.none))) { + customFilter.append(MessageFormat.format(" and {0} like ''%{1}%'' ", "next_facility_visit_date", appointmentDate)); + } + + if (isReferred) { + customFilter.append(MessageFormat.format(" and {0}.{1} IN (SELECT for FROM task WHERE business_status = ''Referred'') ", getMainTable(), "base_entity_id")); + } + return customFilter.toString(); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfNavigationPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfNavigationPresenter.java new file mode 100644 index 000000000..da29c9546 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HfNavigationPresenter.java @@ -0,0 +1,24 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.core.contract.CoreApplication; +import org.smartregister.chw.core.contract.NavigationContract; +import org.smartregister.chw.core.model.NavigationModel; +import org.smartregister.chw.core.presenter.NavigationPresenter; +import org.smartregister.chw.hf.interactor.HfNavigationInteractor; + +import java.lang.ref.WeakReference; + +public class HfNavigationPresenter extends NavigationPresenter { + public HfNavigationPresenter(CoreApplication application, NavigationContract.View view, NavigationModel.Flavor modelFlavor) { + super(application, view, modelFlavor); + mView = new WeakReference<>(view); + + mInteractor = HfNavigationInteractor.getInstance(); + mInteractor.setApplication(application); + + mModel = NavigationModel.getInstance(); + mModel.setNavigationFlavor(modelFlavor); + + initialize(); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivFollowupFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivFollowupFragmentPresenter.java new file mode 100644 index 000000000..0744e2af1 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivFollowupFragmentPresenter.java @@ -0,0 +1,47 @@ +package org.smartregister.chw.hf.presenter; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hiv.contract.BaseHivRegisterFragmentContract; +import org.smartregister.chw.hiv.presenter.BaseHivCommunityFollowupPresenter; +import org.smartregister.chw.hiv.util.Constants.Tables; +import org.smartregister.chw.hiv.util.DBConstants; + +public class HivFollowupFragmentPresenter extends BaseHivCommunityFollowupPresenter { + + public HivFollowupFragmentPresenter(BaseHivRegisterFragmentContract.View view, BaseHivRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + + @Override + @NotNull + public String getMainCondition() { + return " " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.Key.DATE_REMOVED + " is null " + + "AND " + Tables.HIV_COMMUNITY_FOLLOWUP + "." + DBConstants.Key.IS_CLOSED + " = '0' " + + "AND " + Tables.HIV_COMMUNITY_FOLLOWUP + "." + DBConstants.Key.BASE_ENTITY_ID + " NOT IN (SELECT " + DBConstants.Key.COMMUNITY_REFERRAL_FORM_ID + " FROM " + Tables.HIV_COMMUNITY_FEEDBACK + " WHERE mark_as_done = '1' ) "; + + } + + @Override + @NotNull + public String getDueFilterCondition() { + return " " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.Key.DATE_REMOVED + " is null " + + "AND " + Tables.HIV_COMMUNITY_FOLLOWUP + "." + DBConstants.Key.IS_CLOSED + " = '0' " + + "AND " + Tables.HIV_COMMUNITY_FOLLOWUP + "." + DBConstants.Key.BASE_ENTITY_ID + " IN (SELECT " + DBConstants.Key.COMMUNITY_REFERRAL_FORM_ID + " FROM " + Tables.HIV_COMMUNITY_FEEDBACK + " ) "; + + } + + @Override + public void processViewConfigurations() { + super.processViewConfigurations(); + if (getConfig().getSearchBarText() != null && getView() != null) { + getView().updateSearchBarHint(getView().getContext().getString(R.string.search_name_or_id)); + } + } + + @Override + public String getMainTable() { + return Tables.HIV_COMMUNITY_FOLLOWUP; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivFormActivityActivityPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivFormActivityActivityPresenter.java new file mode 100644 index 000000000..26ad3783c --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivFormActivityActivityPresenter.java @@ -0,0 +1,77 @@ +package org.smartregister.chw.hf.presenter; + +import static org.smartregister.chw.hf.utils.Constants.JsonForm.HIV_REGISTRATION; + +import com.nerdstone.neatformcore.domain.model.NFormViewData; +import com.vijay.jsonwizard.utils.FormUtils; + +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.core.utils.CoreChildUtils; +import org.smartregister.chw.hf.activity.HivFormsActivity; +import org.smartregister.chw.hiv.contract.BaseHivFormsContract; +import org.smartregister.chw.hiv.presenter.BaseHivFormsActivityPresenter; +import org.smartregister.chw.hiv.util.Constants; +import org.smartregister.chw.hiv.util.DBConstants; +import org.smartregister.chw.hiv.util.JsonFormConstants; + +import java.util.Calendar; +import java.util.HashMap; + +public class HivFormActivityActivityPresenter extends BaseHivFormsActivityPresenter { + + public HivFormActivityActivityPresenter(@NotNull String baseEntityID, @NotNull BaseHivFormsContract.View view, @NotNull BaseHivFormsContract.Interactor interactor) { + super(baseEntityID, view, interactor); + } + + @Override + public void saveForm(@NotNull HashMap valuesHashMap, @NotNull JSONObject jsonObject) { + super.saveForm(valuesHashMap, jsonObject); + try { + if (jsonObject.getString(JsonFormConstants.ENCOUNTER_TYPE).equals(Constants.EventType.HIV_INDEX_CONTACT_TESTING_FOLLOWUP)) { + boolean is_to_be_registered_to_hiv_registry = valuesHashMap.containsKey(DBConstants.Key.TEST_RESULTS) + && StringUtils.containsIgnoreCase(String.valueOf(valuesHashMap.get(DBConstants.Key.TEST_RESULTS).getValue()), "positive") + && StringUtils.containsIgnoreCase(String.valueOf(valuesHashMap.get(DBConstants.Key.ENROLLED_TO_CLINIC).getValue()), "yes"); + + if (is_to_be_registered_to_hiv_registry) { + //The following implementation is used to generate an HIV Registration event since Index Clients who have tested positive and registered for ctc + // need to be added to the HIV Register so that they can also elicit their contacts for Index testing + generateAndSaveAnHivRegistrationEvent(valuesHashMap); + } + } + if(jsonObject.getString(JsonFormConstants.ENCOUNTER_TYPE).equals(org.smartregister.chw.hf.utils.Constants.Events.UPDATE_HIV_INDEX_TESTING_FOLLOWUP)){ + generateAndSaveAnHivRegistrationEvent(valuesHashMap); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + + private void generateAndSaveAnHivRegistrationEvent(@NotNull HashMap valuesHashMap) { + HashMap hivRegistrationValuesHashMap = new HashMap<>(); + hivRegistrationValuesHashMap.put(DBConstants.Key.CTC_NUMBER, valuesHashMap.get(DBConstants.Key.CTC_NUMBER)); + hivRegistrationValuesHashMap.put(DBConstants.Key.PLACE_WHERE_TEST_WAS_CONDUCTED, valuesHashMap.get(DBConstants.Key.PLACE_WHERE_TEST_WAS_CONDUCTED)); + hivRegistrationValuesHashMap.put(DBConstants.Key.TEST_RESULTS, valuesHashMap.get(DBConstants.Key.TEST_RESULTS)); + hivRegistrationValuesHashMap.put(DBConstants.Key.CLIENT_HIV_STATUS_DURING_REGISTRATION, new NFormViewData("Calculation", "Positive", null, true)); + hivRegistrationValuesHashMap.put(DBConstants.Key.HIV_REGISTRATION_DATE, new NFormViewData("Calculation", Calendar.getInstance().getTimeInMillis(), null, true)); + + try { + JSONObject hivRegistrationFormJsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets(((HivFormsActivity) getView()), HIV_REGISTRATION); + if (hivRegistrationFormJsonObject != null) { + super.saveForm(hivRegistrationValuesHashMap, hivRegistrationFormJsonObject); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public void onRegistrationSaved(boolean saveSuccessful, @NotNull String encounterType) { + super.onRegistrationSaved(saveSuccessful, encounterType); + + //Calling client processor to start processing events in the background + CoreChildUtils.processClientProcessInBackground(); + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivIndexContactProfilePresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivIndexContactProfilePresenter.java new file mode 100644 index 000000000..7c6f224ee --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivIndexContactProfilePresenter.java @@ -0,0 +1,121 @@ +package org.smartregister.chw.hf.presenter; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Triple; +import org.json.JSONObject; +import org.smartregister.chw.core.presenter.CoreHivIndexContactProfilePresenter; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.HivProfileActivity; +import org.smartregister.chw.hf.contract.HivIndexContactProfileContract; +import org.smartregister.chw.hf.custom_view.HivFloatingMenu; +import org.smartregister.chw.hf.model.HfAllClientsRegisterModel; +import org.smartregister.chw.hf.model.HivIndexFollowupFeedbackDetailsModel; +import org.smartregister.chw.hiv.domain.HivIndexContactObject; +import org.smartregister.opd.contract.OpdRegisterActivityContract; +import org.smartregister.opd.pojo.OpdDiagnosisAndTreatmentForm; +import org.smartregister.opd.pojo.OpdEventClient; +import org.smartregister.opd.pojo.RegisterParams; + +import java.util.List; +import java.util.Objects; + +import timber.log.Timber; + +public class HivIndexContactProfilePresenter extends CoreHivIndexContactProfilePresenter + implements HivIndexContactProfileContract.Presenter, HivIndexContactProfileContract.InteractorCallback, OpdRegisterActivityContract.InteractorCallBack { + + private HivIndexContactObject hivIndexContactObject; + private HivIndexContactProfileContract.Interactor interactor; + private HfAllClientsRegisterModel model; + + public HivIndexContactProfilePresenter(HivIndexContactProfileContract.View view, HivIndexContactProfileContract.Interactor interactor, + HivIndexContactObject hivIndexContactObject) { + super(view, interactor, hivIndexContactObject); + this.hivIndexContactObject = hivIndexContactObject; + this.interactor = (HivIndexContactProfileContract.Interactor) interactor; + this.model = new HfAllClientsRegisterModel(view.getContext()); + } + + @Override + public void fetchReferralTasks() { + interactor.getReferralTasks(CoreConstants.REFERRAL_PLAN_ID, hivIndexContactObject.getBaseEntityId(), this); + } + + + @Override + public void getReferralAndFollowupFeedback(List followupFeedbackDetailsModel) { + ((HivIndexContactProfileContract.View) getView()).setReferralAndFollowupFeedback(followupFeedbackDetailsModel); + + } + + public void saveForm(String jsonString, @NonNull RegisterParams registerParams) { + try { + List opdEventClientList = model.processRegistration(jsonString, registerParams.getFormTag()); + if (opdEventClientList == null || opdEventClientList.isEmpty()) { + return; + } + interactor.saveRegistration(opdEventClientList, jsonString, registerParams, hivIndexContactObject, this); + } catch (Exception e) { + Timber.e(e); + } + } + + public void startForm(String formName, String entityId, String metadata, String currentLocationId) throws Exception { + + if (StringUtils.isBlank(entityId)) { + Triple triple = Triple.of(formName, metadata, currentLocationId); + interactor.getNextUniqueId(triple, this); + return; + } + + JSONObject form = model.getFormAsJson(formName, entityId, currentLocationId); + if (getView() != null) + getView().startFormActivity(form, hivIndexContactObject, ((HivProfileActivity) getView()).getString(R.string.register_hiv_index_clients_contacts)); + + } + + @Override + public void onRegistrationSaved(boolean editMode) { + HivProfileActivity view = (HivProfileActivity) getView(); + + if (view != null) { + view.hideProgressDialog(); + ((HivFloatingMenu) Objects.requireNonNull(view.getHivFloatingMenu())).animateFAB(); + } + + view.showToast(view.getString(R.string.successful_index_contact_registration_toast)); + + } + + @Override + public void onEventSaved() { + + } + + @Override + public void onFetchedSavedDiagnosisAndTreatmentForm(@Nullable OpdDiagnosisAndTreatmentForm opdDiagnosisAndTreatmentForm, @NonNull String s, @Nullable String s1) { + + } + + @Override + public void onNoUniqueId() { + if (getView() != null) + getView().displayToast(org.smartregister.family.R.string.no_unique_id); + } + + @Override + public void onUniqueIdFetched(Triple triple, String entityId) { + if (getView() != null) { + try { + startForm(triple.getLeft(), entityId, triple.getMiddle(), triple.getRight()); + } catch (Exception e) { + Timber.e(e); + getView().displayToast(org.smartregister.family.R.string.error_unable_to_start_form); + } + } + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivIndexContactsContactsRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivIndexContactsContactsRegisterFragmentPresenter.java new file mode 100644 index 000000000..e5d0ec6df --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivIndexContactsContactsRegisterFragmentPresenter.java @@ -0,0 +1,50 @@ +package org.smartregister.chw.hf.presenter; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hiv.contract.BaseHivRegisterFragmentContract; +import org.smartregister.chw.hiv.presenter.BaseHivIndexContactsRegisterFragmentPresenter; +import org.smartregister.chw.hiv.util.Constants.Tables; +import org.smartregister.chw.hiv.util.DBConstants; + +public class HivIndexContactsContactsRegisterFragmentPresenter extends BaseHivIndexContactsRegisterFragmentPresenter { + + public HivIndexContactsContactsRegisterFragmentPresenter(BaseHivRegisterFragmentContract.View view, BaseHivRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + + @Override + @NotNull + public String getMainCondition() { + return " " + + Tables.HIV_INDEX_HF + "." + DBConstants.Key.CTC_NUMBER + " IS NULL AND (" + + Tables.HIV_INDEX_HF + "." + DBConstants.Key.TEST_RESULTS + " IS NULL OR " + + Tables.HIV_INDEX_HF + "." + DBConstants.Key.TEST_RESULTS + " <> 'Negative' COLLATE NOCASE) AND " + + Tables.HIV_INDEX_HF + "." + DBConstants.Key.HOW_TO_NOTIFY_CONTACT_CLIENT + " <> 'na' COLLATE NOCASE"; + + } + + @Override + @NotNull + public String getDueFilterCondition() { + return " " + Tables.HIV_INDEX_HF + ".base_entity_id IN (SELECT base_entity_id FROM ec_hiv_index_chw_followup WHERE followed_by_chw = 'true' )" ; + } + + @Override + public void processViewConfigurations() { + super.processViewConfigurations(); + if (getConfig().getSearchBarText() != null && getView() != null) { + getView().updateSearchBarHint(getView().getContext().getString(R.string.search_name_or_id)); + } + + + if (getConfig().getFilterFields() != null && getView() != null) { + getView().updateSearchBarHint(getView().getContext().getString(R.string.search_name_or_id)); + } + } + + @Override + public String getMainTable() { + return Tables.HIV_INDEX_HF; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivProfilePresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivProfilePresenter.java new file mode 100644 index 000000000..74ac8ab18 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivProfilePresenter.java @@ -0,0 +1,154 @@ +package org.smartregister.chw.hf.presenter; + +import android.os.AsyncTask; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.Triple; +import org.json.JSONObject; +import org.smartregister.chw.core.contract.CoreHivProfileContract; +import org.smartregister.chw.core.presenter.CoreHivProfilePresenter; +import org.smartregister.chw.core.utils.CoreChildUtils; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.activity.HivProfileActivity; +import org.smartregister.chw.hf.contract.HivProfileContract; +import org.smartregister.chw.hf.model.HfAllClientsRegisterModel; +import org.smartregister.chw.hf.model.HivTbReferralTasksAndFollowupFeedbackModel; +import org.smartregister.chw.hiv.dao.HivIndexDao; +import org.smartregister.chw.hiv.domain.HivIndexContactObject; +import org.smartregister.chw.hiv.domain.HivMemberObject; +import org.smartregister.family.util.Utils; +import org.smartregister.opd.contract.OpdRegisterActivityContract; +import org.smartregister.opd.pojo.OpdDiagnosisAndTreatmentForm; +import org.smartregister.opd.pojo.OpdEventClient; +import org.smartregister.opd.pojo.RegisterParams; + +import java.util.List; + +import timber.log.Timber; + +public class HivProfilePresenter extends CoreHivProfilePresenter + implements HivProfileContract.Presenter, HivProfileContract.InteractorCallback, OpdRegisterActivityContract.InteractorCallBack { + private HivMemberObject hivMemberObject; + private HivProfileContract.Interactor interactor; + private HfAllClientsRegisterModel model; + + public HivProfilePresenter(CoreHivProfileContract.View view, CoreHivProfileContract.Interactor interactor, + HivMemberObject hivMemberObject) { + super(view, interactor, hivMemberObject); + this.hivMemberObject = hivMemberObject; + this.interactor = (HivProfileContract.Interactor) interactor; + this.model = new HfAllClientsRegisterModel(view.getContext()); + } + + @Override + public void fetchReferralTasks() { + interactor.getReferralTasks(CoreConstants.REFERRAL_PLAN_ID, hivMemberObject.getBaseEntityId(), this); + } + + @Override + public void updateReferralTasksAndFollowupFeedback(List tasksAndFollowupFeedbackModels) { + ((HivProfileContract.View) getView()).setReferralTasksAndFollowupFeedback(tasksAndFollowupFeedbackModels); + } + + public void saveForm(String jsonString, @NonNull RegisterParams registerParams) { + try { + List opdEventClientList = model.processRegistration(jsonString, registerParams.getFormTag()); + if (opdEventClientList == null || opdEventClientList.isEmpty()) { + return; + } + interactor.saveRegistration(opdEventClientList, jsonString, registerParams, hivMemberObject, this); + } catch (Exception e) { + Timber.e(e); + } + } + + public void startForm(String formName, String entityId, String metadata, String currentLocationId) throws Exception { + + if (StringUtils.isBlank(entityId)) { + Triple triple = Triple.of(formName, metadata, currentLocationId); + interactor.getNextUniqueId(triple, this); + return; + } + + JSONObject form = model.getFormAsJson(formName, entityId, currentLocationId); + + if (formName.equalsIgnoreCase(CoreConstants.JSON_FORM.getHivIndexClientsContactsRegistrationForm())) { + JSONObject global = form.getJSONObject("global"); + global.put("index_client_age", Utils.getAgeFromDate(hivMemberObject.getAge())); + } + + if (getView() != null) + getView().startFormActivity(form, hivMemberObject, ((HivProfileActivity) getView()).getString(R.string.register_hiv_index_clients_contacts)); + + } + + @Override + public void onRegistrationSaved(boolean editMode) { + //Calling client processor to start processing events in the background + CoreChildUtils.processClientProcessInBackground(); + + HivProfileActivity view = (HivProfileActivity) getView(); + + if (view != null) { + view.hideProgressDialog(); + } + + view.showToast(view.getString(R.string.successful_index_contact_registration_toast)); + new SetIndexClientsTask(getHivMemberObject()).execute(); + + } + + @Override + public void onEventSaved() { + + } + + @Override + public void onFetchedSavedDiagnosisAndTreatmentForm(@Nullable OpdDiagnosisAndTreatmentForm opdDiagnosisAndTreatmentForm, @NonNull String s, @Nullable String s1) { + + } + + @Override + public void onNoUniqueId() { + if (getView() != null) + getView().displayToast(org.smartregister.family.R.string.no_unique_id); + } + + @Override + public void onUniqueIdFetched(Triple triple, String entityId) { + if (getView() != null) { + try { + startForm(triple.getLeft(), entityId, triple.getMiddle(), triple.getRight()); + } catch (Exception e) { + Timber.e(e); + getView().displayToast(org.smartregister.family.R.string.error_unable_to_start_form); + } + } + } + + private class SetIndexClientsTask extends AsyncTask { + private HivMemberObject hivMemberObject; + + public SetIndexClientsTask(HivMemberObject hivMemberObject) { + this.hivMemberObject = hivMemberObject; + } + + @Override + protected Integer doInBackground(Void... voids) { + List indexContactObjectList = HivIndexDao.getIndexContacts(hivMemberObject.getBaseEntityId()); + if (indexContactObjectList != null) + return indexContactObjectList.size(); + else + return 0; + } + + @Override + protected void onPostExecute(Integer param) { + getView().setIndexClientsStatus(param > 0); + } + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivRegisterFragmentPresenter.java new file mode 100644 index 000000000..d7ede434b --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HivRegisterFragmentPresenter.java @@ -0,0 +1,44 @@ +package org.smartregister.chw.hf.presenter; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hiv.contract.BaseHivRegisterFragmentContract; +import org.smartregister.chw.hiv.presenter.BaseHivRegisterFragmentPresenter; +import org.smartregister.chw.hiv.util.Constants.Tables; +import org.smartregister.chw.hiv.util.DBConstants; + +public class HivRegisterFragmentPresenter extends BaseHivRegisterFragmentPresenter { + + public HivRegisterFragmentPresenter(BaseHivRegisterFragmentContract.View view, BaseHivRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + + @Override + @NotNull + public String getMainCondition() { + return " " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.Key.DATE_REMOVED + " is null " + + "AND UPPER (" + DBConstants.Key.CLIENT_HIV_STATUS_AFTER_TESTING + ") LIKE UPPER('Positive') " + + "AND " + Tables.HIV + "." + DBConstants.Key.IS_CLOSED + " = '0' "; + + } + + @Override + @NotNull + public String getDueFilterCondition() { + return CoreConstants.TABLE_NAME.HIV_MEMBER + ".base_entity_id IN (SELECT for FROM task WHERE business_status = 'Referred')"; + } + + @Override + public void processViewConfigurations() { + super.processViewConfigurations(); + if (getConfig().getSearchBarText() != null && getView() != null) { + getView().updateSearchBarHint(getView().getContext().getString(R.string.search_name_or_id)); + } + } + + @Override + public String getMainTable() { + return Tables.HIV; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HtsRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HtsRegisterFragmentPresenter.java new file mode 100644 index 000000000..0a131a2da --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HtsRegisterFragmentPresenter.java @@ -0,0 +1,55 @@ +package org.smartregister.chw.hf.presenter; + +import androidx.annotation.NonNull; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hiv.contract.BaseHivRegisterFragmentContract; +import org.smartregister.chw.hiv.presenter.BaseHivRegisterFragmentPresenter; +import org.smartregister.chw.hiv.util.DBConstants; + +public class HtsRegisterFragmentPresenter extends BaseHivRegisterFragmentPresenter { + + public HtsRegisterFragmentPresenter(BaseHivRegisterFragmentContract.View view, BaseHivRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + + @Override + @NotNull + public String getMainCondition() { + return " " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.Key.DATE_REMOVED + " is null " + + "AND " + CoreConstants.TABLE_NAME.HTS_MEMBERS + "." + DBConstants.Key.CTC_NUMBER + " IS NULL " + + "AND " + CoreConstants.TABLE_NAME.HTS_MEMBERS + "." + Constants.DBConstants.CHW_REFERRAL_SERVICE + " = 'Conventional HIV Test' " + + "AND " + CoreConstants.TABLE_NAME.HTS_MEMBERS + "." + DBConstants.Key.CLIENT_HIV_STATUS_AFTER_TESTING + " is NULL " + + "AND " + CoreConstants.TABLE_NAME.HTS_MEMBERS + "." + DBConstants.Key.IS_CLOSED + " = '0' " + + "AND " + CoreConstants.TABLE_NAME.HTS_MEMBERS + "." + DBConstants.Key.BASE_ENTITY_ID + + " NOT IN (SELECT base_entity_id FROM " + org.smartregister.chw.hiv.util.Constants.Tables.HIV_INDEX_HF + ")"; + } + + @Override + @NotNull + public String getDueFilterCondition() { + return CoreConstants.TABLE_NAME.HTS_MEMBERS + ".base_entity_id IN (SELECT for FROM task WHERE business_status = 'Referred')"; + } + + @NonNull + @Override + public String getDefaultSortQuery() { + return CoreConstants.TABLE_NAME.HTS_MEMBERS + "." + org.smartregister.chw.hiv.util.DBConstants.Key.HIV_REGISTRATION_DATE + " DESC "; + } + + @Override + public void processViewConfigurations() { + super.processViewConfigurations(); + if (getConfig().getSearchBarText() != null && getView() != null) { + getView().updateSearchBarHint(getView().getContext().getString(R.string.search_name_or_id)); + } + } + + @Override + public String getMainTable() { + return CoreConstants.TABLE_NAME.HTS_MEMBERS; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HvlResultsFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HvlResultsFragmentPresenter.java new file mode 100644 index 000000000..d2d8a4587 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/HvlResultsFragmentPresenter.java @@ -0,0 +1,21 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.pmtct.contract.HvlResultsFragmentContract; +import org.smartregister.chw.pmtct.presenter.BaseHvlResultsFragmentPresenter; +import org.smartregister.chw.pmtct.util.Constants; +import org.smartregister.chw.pmtct.util.DBConstants; + +public class HvlResultsFragmentPresenter extends BaseHvlResultsFragmentPresenter { + private String baseEntityId; + + public HvlResultsFragmentPresenter(String baseEntityId, HvlResultsFragmentContract.View view, HvlResultsFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + this.baseEntityId = baseEntityId; + } + + @Override + public String getMainCondition() { + return " " + Constants.TABLES.PMTCT_FOLLOW_UP + "." + DBConstants.KEY.HVL_SAMPLE_ID + " IS NOT NULL " + + " AND " + Constants.TABLES.PMTCT_FOLLOW_UP + "." + DBConstants.KEY.ENTITY_ID + " = '" + baseEntityId + "'"; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/IndexContactsListActivityPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/IndexContactsListActivityPresenter.java new file mode 100644 index 000000000..adfe38c2c --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/IndexContactsListActivityPresenter.java @@ -0,0 +1,30 @@ +package org.smartregister.chw.hf.presenter; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.smartregister.chw.hf.activity.HivIndexContactProfileActivity; +import org.smartregister.chw.hf.activity.HivProfileActivity; +import org.smartregister.chw.hf.activity.IndexContactsListActivity; +import org.smartregister.chw.hiv.contract.BaseIndexClientsContactListContract; +import org.smartregister.chw.hiv.dao.HivDao; +import org.smartregister.chw.hiv.domain.HivIndexContactObject; +import org.smartregister.chw.hiv.presenter.BaseHivIndexContactsListPresenter; + +import java.util.Objects; + +public class IndexContactsListActivityPresenter extends BaseHivIndexContactsListPresenter { + public IndexContactsListActivityPresenter(@NotNull String hivClientBaseEntityId, @NotNull BaseIndexClientsContactListContract.Interactor interactor, @NotNull BaseIndexClientsContactListContract.View view) { + super(hivClientBaseEntityId, interactor, view); + } + + @Override + public void openIndexContactProfile(@Nullable HivIndexContactObject hivIndexContactObject) { + if (hivIndexContactObject != null) { + if (HivDao.isRegisteredForHiv(hivIndexContactObject.getBaseEntityId())) + HivProfileActivity.startHivProfileActivity(((IndexContactsListActivity) getView()), HivDao.getMember(Objects.requireNonNull(hivIndexContactObject.getBaseEntityId()))); + else + HivIndexContactProfileActivity.startHivIndexContactProfileActivity(((IndexContactsListActivity) getView()), hivIndexContactObject); + } + + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/IssueReferralActivityPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/IssueReferralActivityPresenter.java new file mode 100644 index 000000000..ca78ffe09 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/IssueReferralActivityPresenter.java @@ -0,0 +1,46 @@ +package org.smartregister.chw.hf.presenter; + +import android.app.Activity; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.custom_views.NavigationMenu; +import org.smartregister.chw.hf.model.IssueReferralActivityModel; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.referral.contract.BaseIssueReferralContract; +import org.smartregister.chw.referral.model.AbstractIssueReferralModel; +import org.smartregister.chw.referral.presenter.BaseIssueReferralPresenter; +import org.smartregister.chw.referral.util.DBConstants; + +public class IssueReferralActivityPresenter extends BaseIssueReferralPresenter { + + public IssueReferralActivityPresenter(String baseEntityId, BaseIssueReferralContract.View view, Class viewModelClass, BaseIssueReferralContract.Interactor interactor) { + super(baseEntityId, view, viewModelClass, interactor); + } + + @Override + public Class getViewModel() { + return IssueReferralActivityModel.class; + } + + @NotNull + @Override + public String getMainCondition() { + return " " + Constants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.Key.BASE_ENTITY_ID + " = '" + getBaseEntityID() + "'"; + } + + @NotNull + @Override + public String getMainTable() { + return Constants.TABLE_NAME.FAMILY_MEMBER; + } + + @Override + public void onRegistrationSaved(boolean saveSuccessful) { + super.onRegistrationSaved(saveSuccessful); + NavigationMenu navigationMenu = NavigationMenu.getInstance((Activity) getView(), + null, null); + if (navigationMenu != null) { + navigationMenu.refreshCount(); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/KvpRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/KvpRegisterFragmentPresenter.java new file mode 100644 index 000000000..694aad282 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/KvpRegisterFragmentPresenter.java @@ -0,0 +1,16 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.kvp.contract.KvpRegisterFragmentContract; +import org.smartregister.chw.kvp.presenter.BaseKvpRegisterFragmentPresenter; +import org.smartregister.chw.kvp.util.Constants; + +public class KvpRegisterFragmentPresenter extends BaseKvpRegisterFragmentPresenter { + public KvpRegisterFragmentPresenter(KvpRegisterFragmentContract.View view, KvpRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + + @Override + public String getMainTable() { + return Constants.TABLES.KVP_REGISTER; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LDDischargedRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LDDischargedRegisterFragmentPresenter.java new file mode 100644 index 000000000..38bf764c9 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LDDischargedRegisterFragmentPresenter.java @@ -0,0 +1,17 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.ld.contract.LDRegisterFragmentContract; +import org.smartregister.chw.ld.presenter.BaseLDRegisterFragmentPresenter; +import org.smartregister.chw.ld.util.Constants; + +public class LDDischargedRegisterFragmentPresenter extends BaseLDRegisterFragmentPresenter { + public LDDischargedRegisterFragmentPresenter(LDRegisterFragmentContract.View view, LDRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + + @Override + public String getMainCondition() { + return "" + Constants.TABLES.LD_CONFIRMATION + "." + "labour_confirmation = 'true' AND " + + Constants.TABLES.LD_CONFIRMATION + "." + "is_closed is 1"; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LDProfilePresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LDProfilePresenter.java new file mode 100644 index 000000000..1ae709e2c --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LDProfilePresenter.java @@ -0,0 +1,32 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.contract.HfLDProfileContract; +import org.smartregister.chw.ld.domain.MemberObject; +import org.smartregister.chw.ld.presenter.BaseLDProfilePresenter; +import org.smartregister.domain.Task; + +import java.util.Set; + +public class LDProfilePresenter extends BaseLDProfilePresenter implements HfLDProfileContract.Presenter, HfLDProfileContract.InteractorCallBack { + public LDProfilePresenter(HfLDProfileContract.View view, HfLDProfileContract.Interactor interactor, MemberObject memberObject) { + super(view, interactor, memberObject); + } + + @Override + public void setClientTasks(Set taskList) { + if (getView() != null) { + ((HfLDProfileContract.View) getView()).setClientTasks(taskList); + } + } + + @Override + public void fetchTasks() { + ((HfLDProfileContract.Interactor) interactor).getClientTasks(CoreConstants.REFERRAL_PLAN_ID, memberObject.getBaseEntityId(), this); + } + + @Override + public void setEntityId(String entityId) { + memberObject.getBaseEntityId(); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LDRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LDRegisterFragmentPresenter.java new file mode 100644 index 000000000..e1899e817 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LDRegisterFragmentPresenter.java @@ -0,0 +1,17 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.ld.contract.LDRegisterFragmentContract; +import org.smartregister.chw.ld.presenter.BaseLDRegisterFragmentPresenter; +import org.smartregister.chw.ld.util.Constants; + +public class LDRegisterFragmentPresenter extends BaseLDRegisterFragmentPresenter { + public LDRegisterFragmentPresenter(LDRegisterFragmentContract.View view, LDRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + + @Override + public String getMainCondition() { + return "" + Constants.TABLES.LD_CONFIRMATION + "." + "labour_confirmation = 'true' AND " + + Constants.TABLES.LD_CONFIRMATION + "." + "is_closed is 0"; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LDRegisterPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LDRegisterPresenter.java new file mode 100644 index 000000000..176647ccf --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LDRegisterPresenter.java @@ -0,0 +1,81 @@ +package org.smartregister.chw.hf.presenter; + +import static org.smartregister.chw.hf.utils.Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryCervixDilationMonitoring; +import static org.smartregister.chw.hf.utils.Constants.JsonForm.LabourAndDeliveryRegistration.getLabourAndDeliveryModeOfDelivery; +import static org.smartregister.family.util.Constants.JSON_FORM_KEY.OPTIONS; + +import android.os.Build; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.dao.LDDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.ld.contract.LDRegisterContract; +import org.smartregister.chw.ld.presenter.BaseLDRegisterPresenter; +import org.smartregister.chw.referral.util.JsonFormConstants; +import org.smartregister.util.JsonFormUtils; + +public class LDRegisterPresenter extends BaseLDRegisterPresenter { + public LDRegisterPresenter(LDRegisterContract.View view, LDRegisterContract.Model model, LDRegisterContract.Interactor interactor) { + super(view, model, interactor); + } + + + @Override + public void startForm(String formName, String entityId, String metadata, String currentLocationId) throws Exception { + if (StringUtils.isBlank(entityId)) { + return; + } + JSONObject form = model.getFormAsJson(formName, entityId, currentLocationId); + + + if (form != null && formName.contains(getLabourAndDeliveryCervixDilationMonitoring())) { + try { + JSONArray fields = form.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + populateCervixDilationMonitoringForm(fields, entityId); + + if (LDDao.getVaginalExaminationDate(entityId) != null) { + form.getJSONObject("global").put("last_vaginal_exam_date", LDDao.getVaginalExaminationDate(entityId)); + } + + if (LDDao.getVaginalExaminationTime(entityId) != null) { + form.getJSONObject("global").put("last_vaginal_exam_time", LDDao.getVaginalExaminationTime(entityId)); + } + + } catch (JSONException e) { + e.printStackTrace(); + } + } + + if (form != null && formName.contains(getLabourAndDeliveryModeOfDelivery()) && (org.smartregister.chw.ld.dao.LDDao.getReasonsForAdmission(entityId) != null && org.smartregister.chw.ld.dao.LDDao.getReasonsForAdmission(entityId).equalsIgnoreCase("elective_cesarean_section"))) { + try { + JSONArray fields = form.getJSONObject(Constants.JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + JSONObject modeOfDelivery = JsonFormUtils.getFieldJSONObject(fields, "mode_of_delivery"); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && modeOfDelivery != null) { + modeOfDelivery.getJSONArray(OPTIONS).remove(3); + modeOfDelivery.getJSONArray(OPTIONS).remove(2); + modeOfDelivery.getJSONArray(OPTIONS).remove(0); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + + viewReference.get().startFormActivity(form); + } + + private void populateCervixDilationMonitoringForm(JSONArray fields, String baseEntityId) throws JSONException { + JSONObject vaginalExamDate = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "vaginal_exam_date"); + JSONObject cervixDilation = org.smartregister.util.JsonFormUtils.getFieldJSONObject(fields, "cervix_dilation"); + + if (LDDao.getVaginalExaminationDate(baseEntityId) != null) { + vaginalExamDate.put("min_date", LDDao.getVaginalExaminationDate(baseEntityId)); + } + + if (LDDao.getCervixDilation(baseEntityId) != null) { + cervixDilation.put("start_number", LDDao.getCervixDilation(baseEntityId)); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LoginPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LoginPresenter.java index d3cbe59d4..fb87f143b 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LoginPresenter.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/LoginPresenter.java @@ -21,6 +21,7 @@ import timber.log.Timber; public class LoginPresenter extends BaseLoginPresenter implements BaseLoginContract.Presenter { + public LoginPresenter(BaseLoginContract.View loginView) { mLoginView = new WeakReference<>(loginView); mLoginInteractor = new LoginInteractor(this); @@ -60,7 +61,6 @@ public void processViewCustomizations() { loginLayout.setBackground(gradientDrawable); } - } catch (Exception e) { Timber.e(e); } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/OrdersRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/OrdersRegisterFragmentPresenter.java new file mode 100644 index 000000000..4eccc657d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/OrdersRegisterFragmentPresenter.java @@ -0,0 +1,22 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.cdp.contract.BaseOrdersRegisterFragmentContract; +import org.smartregister.chw.cdp.presenter.BaseOrdersRegisterFragmentPresenter; +import org.smartregister.chw.cdp.util.Constants; +import org.smartregister.chw.cdp.util.DBConstants; + +public class OrdersRegisterFragmentPresenter extends BaseOrdersRegisterFragmentPresenter { + public OrdersRegisterFragmentPresenter(BaseOrdersRegisterFragmentContract.View view, BaseOrdersRegisterFragmentContract.Model model) { + super(view, model); + } + + @Override + public String getMainCondition() { + String providerId = org.smartregister.Context.getInstance().allSharedPreferences().fetchRegisteredANM(); + String userLocationId = org.smartregister.Context.getInstance().allSharedPreferences().fetchUserLocalityId(providerId); + + return super.getMainCondition() + " AND " + getMainTable() + "." + DBConstants.KEY.REQUEST_TYPE + " = '" + Constants.ORDER_TYPES.FACILITY_TO_FACILITY_ORDER + "'" + + " AND " + getMainTable() + "." + DBConstants.KEY.LOCATION_ID + " = " + "'" + userLocationId + "'"; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PmtctProfilePresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PmtctProfilePresenter.java new file mode 100644 index 000000000..49cdfb1f9 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PmtctProfilePresenter.java @@ -0,0 +1,71 @@ +package org.smartregister.chw.hf.presenter; + +import org.apache.commons.lang3.tuple.Triple; +import org.smartregister.chw.core.contract.CorePmtctProfileContract; +import org.smartregister.chw.core.presenter.CorePmtctMemberProfilePresenter; +import org.smartregister.chw.hf.activity.PmtctProfileActivity; +import org.smartregister.chw.hf.dao.HfFollowupFeedbackDao; +import org.smartregister.chw.hf.interactor.PmtctProfileInteractor; +import org.smartregister.chw.hf.model.ChwFollowupFeedbackDetailsModel; +import org.smartregister.chw.hf.model.PmtctFollowupFeedbackModel; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.family.contract.FamilyProfileContract; +import org.smartregister.family.domain.FamilyEventClient; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.ArrayList; +import java.util.List; + +public class PmtctProfilePresenter extends CorePmtctMemberProfilePresenter implements FamilyProfileContract.InteractorCallBack { + private PmtctProfileInteractor createPartnerFollowupReferralEvent; + public PmtctProfilePresenter(CorePmtctProfileContract.View view, CorePmtctProfileContract.Interactor interactor, MemberObject memberObject) { + super(view, interactor, memberObject); + this.createPartnerFollowupReferralEvent = (PmtctProfileInteractor) interactor; + } + + public void updateFollowupFeedback(String baseEntityId) { + List followupFeedbackList = HfFollowupFeedbackDao.getPmtctFollowupFeedback(baseEntityId); + + List pmtctFollowupFeedback = new ArrayList<>(); + if (followupFeedbackList != null) { + for (ChwFollowupFeedbackDetailsModel followupFeedbackDetailsModel : followupFeedbackList) { + PmtctFollowupFeedbackModel followupFeedbackModel = new PmtctFollowupFeedbackModel(); + followupFeedbackModel.setFollowupFeedbackDetailsModel(followupFeedbackDetailsModel); + followupFeedbackModel.setType("FOLLOWUP_FEEDBACK"); + pmtctFollowupFeedback.add(followupFeedbackModel); + } + + ((PmtctProfileActivity) getView()).setFollowupFeedback(pmtctFollowupFeedback); + } + } + + @Override + public void startFormForEdit(CommonPersonObjectClient commonPersonObjectClient) { + //implement + } + + @Override + public void refreshProfileTopSection(CommonPersonObjectClient commonPersonObjectClient) { + //implement + } + + @Override + public void onUniqueIdFetched(Triple triple, String s) { + //implement + } + + @Override + public void onNoUniqueId() { + //implement + } + + @Override + public void onRegistrationSaved(boolean b, boolean b1, FamilyEventClient familyEventClient) { + //implement + } + + public void createPmtctCommunityFollowupReferralEvent(AllSharedPreferences allSharedPreferences, String jsonString, String entityID) throws Exception { + createPartnerFollowupReferralEvent.createPmtctCommunityFollowupReferralEvent(allSharedPreferences, jsonString, entityID); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PmtctRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PmtctRegisterFragmentPresenter.java new file mode 100644 index 000000000..878c37a36 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PmtctRegisterFragmentPresenter.java @@ -0,0 +1,16 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.pmtct.contract.PmtctRegisterFragmentContract; +import org.smartregister.chw.pmtct.presenter.BasePmtctRegisterFragmentPresenter; +import org.smartregister.chw.pmtct.util.Constants; + +public class PmtctRegisterFragmentPresenter extends BasePmtctRegisterFragmentPresenter { + public PmtctRegisterFragmentPresenter(PmtctRegisterFragmentContract.View view, PmtctRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + @Override + public String getMainCondition() { + return "" + Constants.TABLES.PMTCT_REGISTRATION + "." + "hiv_status = 'positive' "+ + " AND " + Constants.TABLES.PMTCT_REGISTRATION + "." + "is_closed is 0 AND ec_family_member.is_closed is 0"; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PmtctRegisterPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PmtctRegisterPresenter.java new file mode 100644 index 000000000..641058170 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PmtctRegisterPresenter.java @@ -0,0 +1,37 @@ +package org.smartregister.chw.hf.presenter; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONObject; +import org.smartregister.chw.hf.activity.PmtctRegisterActivity; +import org.smartregister.chw.hf.dao.HfAncDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.contract.PmtctRegisterContract; +import org.smartregister.chw.pmtct.presenter.BasePmtctRegisterPresenter; + +public class PmtctRegisterPresenter extends BasePmtctRegisterPresenter { + public PmtctRegisterPresenter(PmtctRegisterContract.View view, PmtctRegisterContract.Model model, PmtctRegisterContract.Interactor interactor) { + super(view, model, interactor); + } + + @Override + public void startForm(String formName, String entityId, String metadata, String currentLocationId) throws Exception { + if (StringUtils.isBlank(entityId)) { + return; + } + + JSONObject form = model.getFormAsJson(formName, entityId, currentLocationId); + + if (formName.equals(Constants.JsonForm.getPmtctRegistrationForClientsKnownOnArtForm())) { + String ctcNumber = ((PmtctRegisterActivity) getView()).getCtcNumber(); + if (ctcNumber == null) { + ctcNumber = HfAncDao.getClientCtcNumber(entityId); + } + + if (ctcNumber == null) { + return; + } + form.getJSONObject("global").put("ctc_number", ctcNumber); + } + getView().startFormActivity(form); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PncMemberProfilePresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PncMemberProfilePresenter.java index 546d3a2de..907349c64 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PncMemberProfilePresenter.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PncMemberProfilePresenter.java @@ -1,17 +1,21 @@ package org.smartregister.chw.hf.presenter; +import org.apache.commons.lang3.tuple.Triple; import org.smartregister.chw.anc.domain.MemberObject; import org.smartregister.chw.core.contract.CorePncMemberProfileContract; import org.smartregister.chw.core.presenter.CorePncMemberProfilePresenter; import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.chw.hf.contract.PncMemberProfileContract; +import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.domain.Task; +import org.smartregister.family.contract.FamilyProfileContract; +import org.smartregister.family.domain.FamilyEventClient; import java.util.Set; public class PncMemberProfilePresenter extends CorePncMemberProfilePresenter implements - PncMemberProfileContract.Presenter, PncMemberProfileContract.InteractorCallback { + PncMemberProfileContract.Presenter, PncMemberProfileContract.InteractorCallback, FamilyProfileContract.InteractorCallBack { private PncMemberProfileContract.Interactor interactor; private String entityId; @@ -40,6 +44,31 @@ public String getEntityId() { private void setEntityId(String entityId) { this.entityId = entityId; } + + @Override + public void startFormForEdit(CommonPersonObjectClient commonPersonObjectClient) { + //override + } + + @Override + public void refreshProfileTopSection(CommonPersonObjectClient commonPersonObjectClient) { + //override + } + + @Override + public void onUniqueIdFetched(Triple triple, String s) { + //override + } + + @Override + public void onNoUniqueId() { + //override + } + + @Override + public void onRegistrationSaved(boolean b, boolean b1, FamilyEventClient familyEventClient) { + //override + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PncNoMotherRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PncNoMotherRegisterFragmentPresenter.java new file mode 100644 index 000000000..3644b7915 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PncNoMotherRegisterFragmentPresenter.java @@ -0,0 +1,36 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.anc.contract.BaseAncRegisterFragmentContract; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pnc.presenter.BasePncRegisterFragmentPresenter; + +public class PncNoMotherRegisterFragmentPresenter extends BasePncRegisterFragmentPresenter { + public PncNoMotherRegisterFragmentPresenter(BaseAncRegisterFragmentContract.View view, BaseAncRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + + @Override + public void processViewConfigurations() { + super.processViewConfigurations(); + if (config.getSearchBarText() != null && getView() != null) { + getView().updateSearchBarHint(getView().getContext().getString(R.string.search_name_or_id)); + } + } + + @Override + public String getMainTable() { + return Constants.TableName.NO_MOTHER_PNC; + } + + @Override + public String getMainCondition() { + return ""; + } + + @Override + public String getDefaultSortQuery() { + return "lastInteractedWith DESC"; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PncRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PncRegisterFragmentPresenter.java index 6e09cd04b..07a127367 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PncRegisterFragmentPresenter.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PncRegisterFragmentPresenter.java @@ -1,9 +1,15 @@ package org.smartregister.chw.hf.presenter; +import android.content.Context; + import org.smartregister.chw.anc.contract.BaseAncRegisterFragmentContract; +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.chw.hf.R; import org.smartregister.chw.pnc.presenter.BasePncRegisterFragmentPresenter; +import java.text.MessageFormat; + public class PncRegisterFragmentPresenter extends BasePncRegisterFragmentPresenter { public PncRegisterFragmentPresenter(BaseAncRegisterFragmentContract.View view, BaseAncRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { super(view, model, viewConfigurationIdentifier); @@ -16,4 +22,25 @@ public void processViewConfigurations() { getView().updateSearchBarHint(getView().getContext().getString(R.string.search_name_or_id)); } } + + @Override + public String getMainCondition() { + return " " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.KEY.DATE_REMOVED + " is null " + + "AND " + CoreConstants.TABLE_NAME.PNC_MEMBER + "." + DBConstants.KEY.IS_CLOSED + " is 0 "; + } + + public String getDueFilterCondition(String hivStatus, String appointmentDate, boolean isReferred, Context context) { + StringBuilder customFilter = new StringBuilder(); + if (hivStatus != null && !hivStatus.equalsIgnoreCase("all")) { + customFilter.append(MessageFormat.format(" and {0} like ''%{1}%'' ", "hiv", hivStatus)); + } + if (appointmentDate != null && !appointmentDate.equalsIgnoreCase(context.getString(R.string.none))) { + customFilter.append(MessageFormat.format(" and {0} like ''%{1}%'' ", "next_facility_visit_date", appointmentDate)); + } + + if (isReferred) { + customFilter.append(MessageFormat.format(" and {0}.{1} IN (SELECT for FROM task WHERE business_status = ''Referred'') ", getMainTable(), "base_entity_id")); + } + return customFilter.toString(); + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PrEPRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PrEPRegisterFragmentPresenter.java new file mode 100644 index 000000000..58e32b6b6 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/PrEPRegisterFragmentPresenter.java @@ -0,0 +1,16 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.kvp.contract.KvpRegisterFragmentContract; +import org.smartregister.chw.kvp.presenter.BaseKvpRegisterFragmentPresenter; +import org.smartregister.chw.kvp.util.Constants; + +public class PrEPRegisterFragmentPresenter extends BaseKvpRegisterFragmentPresenter { + public PrEPRegisterFragmentPresenter(KvpRegisterFragmentContract.View view, KvpRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + + @Override + public String getMainTable() { + return Constants.TABLES.PrEP_REGISTER; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/ReferralFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/ReferralFragmentPresenter.java index c47938860..d3cac48c7 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/ReferralFragmentPresenter.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/ReferralFragmentPresenter.java @@ -3,7 +3,6 @@ import org.smartregister.chw.core.contract.BaseReferralRegisterFragmentContract; import org.smartregister.chw.core.presenter.BaseReferralFragmentPresenter; import org.smartregister.chw.core.utils.CoreConstants; -import org.smartregister.chw.hf.model.ReferralModel; import org.smartregister.commonregistry.CommonPersonObjectClient; import java.util.HashSet; @@ -11,9 +10,9 @@ public class ReferralFragmentPresenter extends BaseReferralFragmentPresenter { protected BaseReferralRegisterFragmentContract.View view; - public ReferralFragmentPresenter(BaseReferralRegisterFragmentContract.View view) { + public ReferralFragmentPresenter(BaseReferralRegisterFragmentContract.View view, BaseReferralRegisterFragmentContract.Model model) { super(view); - this.model = new ReferralModel(); + this.model = model; this.view = view; } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/RequestOrdersRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/RequestOrdersRegisterFragmentPresenter.java new file mode 100644 index 000000000..36dfe4796 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/RequestOrdersRegisterFragmentPresenter.java @@ -0,0 +1,26 @@ +package org.smartregister.chw.hf.presenter; + +import static org.smartregister.util.Utils.getAllSharedPreferences; + +import org.smartregister.chw.cdp.contract.BaseOrdersRegisterFragmentContract; +import org.smartregister.chw.cdp.presenter.BaseOrdersRegisterFragmentPresenter; +import org.smartregister.chw.cdp.util.Constants; +import org.smartregister.chw.cdp.util.DBConstants; + +public class RequestOrdersRegisterFragmentPresenter extends BaseOrdersRegisterFragmentPresenter { + private final String userLocationTag = getAllSharedPreferences().fetchUserLocationTag(); + + public RequestOrdersRegisterFragmentPresenter(BaseOrdersRegisterFragmentContract.View view, BaseOrdersRegisterFragmentContract.Model model) { + super(view, model); + } + + @Override + public String getMainCondition() { + String providerId = org.smartregister.Context.getInstance().allSharedPreferences().fetchRegisteredANM(); + String userLocationId = org.smartregister.Context.getInstance().allSharedPreferences().fetchUserLocalityId(providerId); + + return super.getMainCondition() + " AND (" + getMainTable() + "." + DBConstants.KEY.REQUEST_TYPE + " = '" + Constants.ORDER_TYPES.FACILITY_TO_FACILITY_ORDER + "'" + + " OR " + getMainTable() + "." + DBConstants.KEY.REQUEST_TYPE + " = '" + Constants.ORDER_TYPES.COMMUNITY_TO_FACILITY_ORDER + "') AND " + getMainTable() + "." + DBConstants.KEY.LOCATION_ID + " <> " + "'" + userLocationId + "'"; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/TbFollowupFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/TbFollowupFragmentPresenter.java new file mode 100644 index 000000000..f7c64781a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/TbFollowupFragmentPresenter.java @@ -0,0 +1,47 @@ +package org.smartregister.chw.hf.presenter; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.tb.contract.BaseTbRegisterFragmentContract; +import org.smartregister.chw.tb.presenter.BaseTbCommunityFollowupPresenter; +import org.smartregister.chw.tb.util.Constants.Tables; +import org.smartregister.chw.tb.util.DBConstants; + +public class TbFollowupFragmentPresenter extends BaseTbCommunityFollowupPresenter { + + public TbFollowupFragmentPresenter(BaseTbRegisterFragmentContract.View view, BaseTbRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + + @Override + @NotNull + public String getMainCondition() { + return " " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.Key.DATE_REMOVED + " is null " + + "AND " + Tables.TB_COMMUNITY_FOLLOWUP + "." + DBConstants.Key.IS_CLOSED + " = '0' " + + "AND " + Tables.TB_COMMUNITY_FOLLOWUP + "." + DBConstants.Key.BASE_ENTITY_ID + " NOT IN (SELECT " + DBConstants.Key.COMMUNITY_REFERRAL_FORM_ID + " FROM " + Tables.TB_COMMUNITY_FEEDBACK + " WHERE mark_as_done = '1' ) "; + + } + + @Override + @NotNull + public String getDueFilterCondition() { + return " " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.Key.DATE_REMOVED + " is null " + + "AND " + Tables.TB_COMMUNITY_FOLLOWUP + "." + DBConstants.Key.IS_CLOSED + " = '0' " + + "AND " + Tables.TB_COMMUNITY_FOLLOWUP + "." + DBConstants.Key.BASE_ENTITY_ID + " IN (SELECT " + DBConstants.Key.COMMUNITY_REFERRAL_FORM_ID + " FROM " + Tables.TB_COMMUNITY_FEEDBACK + " ) "; + + } + + @Override + public void processViewConfigurations() { + super.processViewConfigurations(); + if (getConfig().getSearchBarText() != null && getView() != null) { + getView().updateSearchBarHint(getView().getContext().getString(R.string.search_name_or_id)); + } + } + + @Override + public String getMainTable() { + return Tables.TB_COMMUNITY_FOLLOWUP; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/TbProfilePresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/TbProfilePresenter.java new file mode 100644 index 000000000..79781bd1e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/TbProfilePresenter.java @@ -0,0 +1,34 @@ +package org.smartregister.chw.hf.presenter; + +import org.smartregister.chw.core.contract.CoreTbProfileContract; +import org.smartregister.chw.core.presenter.CoreTbProfilePresenter; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.contract.TbProfileContract; +import org.smartregister.chw.hf.model.HivTbReferralTasksAndFollowupFeedbackModel; +import org.smartregister.chw.tb.domain.TbMemberObject; + +import java.util.List; + +public class TbProfilePresenter extends CoreTbProfilePresenter + implements TbProfileContract.Presenter, TbProfileContract.InteractorCallback { + + private TbMemberObject tbMemberObject; + private TbProfileContract.Interactor interactor; + + public TbProfilePresenter(CoreTbProfileContract.View view, CoreTbProfileContract.Interactor interactor, + TbMemberObject tbMemberObject) { + super(view, interactor, tbMemberObject); + this.tbMemberObject = tbMemberObject; + this.interactor = (TbProfileContract.Interactor) interactor; + } + + @Override + public void fetchReferralTasks() { + interactor.getReferralTasks(CoreConstants.REFERRAL_PLAN_ID, tbMemberObject.getBaseEntityId(), this); + } + + @Override + public void updateReferralTasksAndFollowupFeedback(List tasksAndFollowupFeedbackModels) { + ((TbProfileContract.View) getView()).setReferralTasksAndFollowupFeedback(tasksAndFollowupFeedbackModels); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/TbRegisterFragmentPresenter.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/TbRegisterFragmentPresenter.java new file mode 100644 index 000000000..b15eb2525 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/presenter/TbRegisterFragmentPresenter.java @@ -0,0 +1,45 @@ +package org.smartregister.chw.hf.presenter; + +import org.jetbrains.annotations.NotNull; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.tb.contract.BaseTbRegisterFragmentContract; +import org.smartregister.chw.tb.presenter.BaseTbRegisterFragmentPresenter; +import org.smartregister.chw.tb.util.Constants.Tables; +import org.smartregister.chw.tb.util.DBConstants; + +public class TbRegisterFragmentPresenter extends BaseTbRegisterFragmentPresenter { + + public TbRegisterFragmentPresenter(BaseTbRegisterFragmentContract.View view, BaseTbRegisterFragmentContract.Model model, String viewConfigurationIdentifier) { + super(view, model, viewConfigurationIdentifier); + } + + @Override + @NotNull + public String getMainCondition() { + return " " + CoreConstants.TABLE_NAME.FAMILY_MEMBER + "." + DBConstants.Key.DATE_REMOVED + " is null " + + "AND " + Tables.TB + "." + DBConstants.Key.TB_CASE_CLOSURE_DATE + " is null " + + "AND (" + Tables.TB + "." + DBConstants.Key.CLIENT_TB_STATUS_AFTER_TESTING + " = 'Positive' OR " + Tables.TB + "." + DBConstants.Key.CLIENT_TB_STATUS_AFTER_TESTING + " IS NULL ) "+ + "AND " + Tables.TB + "." + DBConstants.Key.IS_CLOSED + " = '0' "; + + } + + @Override + @NotNull + public String getDueFilterCondition() { + return CoreConstants.TABLE_NAME.TB_MEMBER + ".base_entity_id IN (SELECT for FROM task WHERE business_status = 'Referred')"; + } + + @Override + public void processViewConfigurations() { + super.processViewConfigurations(); + if (getConfig().getSearchBarText() != null && getView() != null) { + getView().updateSearchBarHint(getView().getContext().getString(R.string.search_name_or_id)); + } + } + + @Override + public String getMainTable() { + return Tables.TB; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/Cd4ResultsViewProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/Cd4ResultsViewProvider.java new file mode 100644 index 000000000..bf696d6da --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/Cd4ResultsViewProvider.java @@ -0,0 +1,77 @@ +package org.smartregister.chw.hf.provider; + +import android.content.Context; +import android.database.Cursor; +import android.view.View; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.pmtct.fragment.BaseHvlResultsFragment; +import org.smartregister.chw.pmtct.util.DBConstants; +import org.smartregister.chw.pmtct.util.NCUtils; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.provider.HvlResultsViewProvider; +import org.smartregister.util.Utils; +import org.smartregister.view.contract.SmartRegisterClient; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; +import java.util.Set; + +import timber.log.Timber; + +public class Cd4ResultsViewProvider extends HvlResultsViewProvider { + private Set visibleColumns; + + public Cd4ResultsViewProvider(Context context, View.OnClickListener paginationClickListener, View.OnClickListener onClickListener, Set visibleColumns) { + super(context, paginationClickListener, onClickListener, visibleColumns); + this.visibleColumns = visibleColumns; + } + + public void getView(Cursor cursor, SmartRegisterClient smartRegisterClient, RegisterViewHolder registerViewHolder) { + CommonPersonObjectClient pc = (CommonPersonObjectClient) smartRegisterClient; + if (visibleColumns.isEmpty()) { + populatePatientColumn(pc, registerViewHolder); + } + } + + private void populatePatientColumn(CommonPersonObjectClient pc, final RegisterViewHolder viewHolder) { + try { + + String sampleId = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.CD4_SAMPLE_ID, false); + String collectionDate = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.CD4_SAMPLE_COLLECTION_DATE, false); + String cd4Result = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.CD4_RESULT, false); + String cd4ResultsDateString = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.CD4_RESULT_DATE, false); + Date cd4ResultDate = null; + if (StringUtils.isNotBlank(cd4ResultsDateString)) { + cd4ResultDate = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()).parse(cd4ResultsDateString); + } + + viewHolder.sampleId.setText(sampleId); + viewHolder.collectionDate.setText(collectionDate); + viewHolder.recordHvl.setTag(pc); + viewHolder.recordHvl.setTag(org.smartregister.pmtct.R.id.VIEW_ID, BaseHvlResultsFragment.CLICK_VIEW_NORMAL); + viewHolder.recordHvl.setText(R.string.record_cd4); + viewHolder.resultTitle.setText(R.string.cd4_count); + viewHolder.recordHvl.setOnClickListener(onClickListener); + + if (StringUtils.isBlank(cd4Result)) { + viewHolder.hvlWrapper.setVisibility(View.GONE); + viewHolder.dueWrapper.setVisibility(View.VISIBLE); + } else { + viewHolder.hvlResult.setText(cd4Result); + viewHolder.hvlWrapper.setVisibility(View.VISIBLE); + viewHolder.dueWrapper.setVisibility(View.GONE); + + if (cd4ResultDate != null && NCUtils.getElapsedDays(cd4ResultDate) < 30) { + viewHolder.dueWrapper.setVisibility(View.VISIBLE); + viewHolder.recordHvl.setText(org.smartregister.pmtct.R.string.edit); + } + } + + } catch (Exception e) { + Timber.e(e); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HeiHivResultsViewProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HeiHivResultsViewProvider.java new file mode 100644 index 000000000..f2f55593a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HeiHivResultsViewProvider.java @@ -0,0 +1,92 @@ +package org.smartregister.chw.hf.provider; + +import android.content.Context; +import android.database.Cursor; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.HeiDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.fragment.BaseHvlResultsFragment; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.provider.HvlResultsViewProvider; +import org.smartregister.util.Utils; +import org.smartregister.view.contract.SmartRegisterClient; + +import java.util.Set; + +import timber.log.Timber; + +public class HeiHivResultsViewProvider extends HvlResultsViewProvider { + private Set visibleColumns; + private Context context; + + public HeiHivResultsViewProvider(Context context, View.OnClickListener paginationClickListener, View.OnClickListener onClickListener, Set visibleColumns) { + super(context, paginationClickListener, onClickListener, visibleColumns); + this.visibleColumns = visibleColumns; + this.context = context; + } + + public void getView(Cursor cursor, SmartRegisterClient smartRegisterClient, RegisterViewHolder registerViewHolder) { + CommonPersonObjectClient pc = (CommonPersonObjectClient) smartRegisterClient; + if (visibleColumns.isEmpty()) { + populatePatientColumn(pc, registerViewHolder); + } + } + + private void populatePatientColumn(CommonPersonObjectClient pc, final RegisterViewHolder viewHolder) { + try { + + String sampleId = Utils.getValue(pc.getColumnmaps(), Constants.DBConstants.HEI_HIV_SAMPLE_ID, false); + String collectionDate = Utils.getValue(pc.getColumnmaps(), Constants.DBConstants.HEI_HIV_SAMPLE_COLLECTION_DATE, false); + String hvlResult = Utils.getValue(pc.getColumnmaps(), Constants.DBConstants.HEI_HIV_TEST_RESULT, false); + String typeOfTest = Utils.getValue(pc.getColumnmaps(), Constants.DBConstants.HEI_HIV_TYPE_OF_TEST, false); + String testAtAge = HeiDao.getTestAtAgeForFollowupVisit(pc.getCaseId()); + + if (StringUtils.isBlank(hvlResult)) { + viewHolder.hvlWrapper.setVisibility(View.GONE); + viewHolder.dueWrapper.setVisibility(View.VISIBLE); + } else { + + if (hvlResult.equalsIgnoreCase("positive")) { + viewHolder.hvlResult.setText(context.getString(R.string.hvl_result_positive)); + } else if (hvlResult.equalsIgnoreCase("negative")) { + viewHolder.hvlResult.setText(context.getString(R.string.hvl_result_negative)); + } else { + viewHolder.hvlResult.setText(hvlResult); + } + + viewHolder.hvlWrapper.setVisibility(View.VISIBLE); + viewHolder.dueWrapper.setVisibility(View.GONE); + } + + + TextView tvTestAtAge = viewHolder.itemView.findViewById(R.id.testAtAge); + if (testAtAge != null && testAtAge.equalsIgnoreCase(Constants.HeiHIVTestAtAge.AT_18_MONTHS)) { + tvTestAtAge.setText(testAtAge); + tvTestAtAge.setVisibility(View.VISIBLE); + } + + viewHolder.sampleId.setText(sampleId); + viewHolder.collectionDate.setText(collectionDate); + viewHolder.recordHvl.setTag(pc); + viewHolder.recordHvl.setTag(org.smartregister.pmtct.R.id.VIEW_ID, BaseHvlResultsFragment.CLICK_VIEW_NORMAL); + viewHolder.recordHvl.setOnClickListener(onClickListener); + + TextView tvTypeOfTest = viewHolder.itemView.findViewById(R.id.type_of_test); + tvTypeOfTest.setText(typeOfTest); + + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + public RegisterViewHolder createViewHolder(ViewGroup parent) { + View view = inflater().inflate(R.layout.hei_hiv_results_list_row, parent, false); + return new RegisterViewHolder(view); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HeiRegisterProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HeiRegisterProvider.java new file mode 100644 index 000000000..7fb11b2cd --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HeiRegisterProvider.java @@ -0,0 +1,214 @@ +package org.smartregister.chw.hf.provider; + +import static org.smartregister.util.Utils.getName; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.database.Cursor; +import android.graphics.Color; +import android.graphics.Typeface; +import android.os.AsyncTask; +import android.view.View; +import android.widget.Button; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.Days; +import org.smartregister.chw.core.rule.HeiFollowupRule; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.FpUtil; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.HeiDao; +import org.smartregister.chw.hf.rule.HfHeiFollowupRule; +import org.smartregister.chw.hf.utils.HfHomeVisitUtil; +import org.smartregister.chw.pmtct.fragment.BasePmtctRegisterFragment; +import org.smartregister.chw.pmtct.util.DBConstants; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.provider.PmtctRegisterProvider; +import org.smartregister.util.Utils; +import org.smartregister.view.contract.SmartRegisterClient; + +import java.text.MessageFormat; +import java.util.Date; +import java.util.Set; + +import timber.log.Timber; + +public class HeiRegisterProvider extends PmtctRegisterProvider { + + private Context context; + private Set visibleColumns; + + public HeiRegisterProvider(Context context, View.OnClickListener paginationClickListener, View.OnClickListener onClickListener, Set visibleColumns) { + super(context, paginationClickListener, onClickListener, visibleColumns); + this.onClickListener = onClickListener; + this.visibleColumns = visibleColumns; + this.context = context; + } + + @Override + public void getView(Cursor cursor, SmartRegisterClient smartRegisterClient, RegisterViewHolder registerViewHolder) { + CommonPersonObjectClient pc = (CommonPersonObjectClient) smartRegisterClient; + if (visibleColumns.isEmpty()) { + populatePatientColumn(pc, registerViewHolder); + registerViewHolder.dueButton.setVisibility(View.GONE); + registerViewHolder.dueButton.setOnClickListener(null); + String baseEntityId = smartRegisterClient.entityId(); + Utils.startAsyncTask(new UpdateHeiDueButtonStatusTask(registerViewHolder, baseEntityId), null); + } + } + + @SuppressLint("SetTextI18n") + @Override + protected void populatePatientColumn(CommonPersonObjectClient pc, final RegisterViewHolder viewHolder) { + try { + + String firstName = getName( + Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.FIRST_NAME, true), + Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.MIDDLE_NAME, true)); + + + String dob = org.smartregister.family.util.Utils.getValue(pc.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.DOB, false); + String dobString = org.smartregister.family.util.Utils.getDuration(dob); + + String dod = org.smartregister.family.util.Utils.getValue(pc.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.DOD, false); + String patientName = getName(firstName, Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.LAST_NAME, true)); + + + if (StringUtils.isNotBlank(dod)) { + dobString = org.smartregister.family.util.Utils.getDuration(dod, dob); + dobString = dobString.contains("y") ? dobString.substring(0, dobString.indexOf("y")) : dobString; + + patientName = patientName + ", " + org.smartregister.family.util.Utils.getTranslatedDate(dobString, context) + " " + context.getString(R.string.deceased_brackets); + viewHolder.patientName.setText(patientName); + viewHolder.patientName.setTextColor(Color.GRAY); + viewHolder.patientName.setTypeface(viewHolder.patientName.getTypeface(), Typeface.ITALIC); + viewHolder.dueWrapper.setVisibility(View.GONE); + } else { + patientName = patientName + ", " + org.smartregister.family.util.Utils.getTranslatedDate(dobString, context); + viewHolder.patientName.setText(patientName); + viewHolder.patientName.setTextColor(Color.BLACK); + viewHolder.patientName.setTypeface(viewHolder.patientName.getTypeface(), Typeface.NORMAL); + viewHolder.patientColumn.setOnClickListener(onClickListener); + viewHolder.dueButton.setOnClickListener(onClickListener); + viewHolder.registerColumns.setOnClickListener(v -> viewHolder.patientColumn.performClick()); + viewHolder.registerColumns.setOnClickListener(v -> viewHolder.dueButton.performClick()); + } + + + viewHolder.textViewGender.setText(updateMemberGender(pc)); + viewHolder.textViewVillage.setText(Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.VILLAGE_TOWN, true)); + + viewHolder.patientColumn.setTag(pc); + viewHolder.patientColumn.setTag(org.smartregister.pmtct.R.id.VIEW_ID, BasePmtctRegisterFragment.CLICK_VIEW_NORMAL); + + viewHolder.dueButton.setTag(pc); + viewHolder.dueButton.setTag(org.smartregister.pmtct.R.id.VIEW_ID, BasePmtctRegisterFragment.FOLLOW_UP_VISIT); + viewHolder.registerColumns.setOnClickListener(onClickListener); + + + } catch (Exception e) { + Timber.e(e); + } + } + + private class UpdateHeiDueButtonStatusTask extends AsyncTask { + private final RegisterViewHolder viewHolder; + private final String baseEntityId; + private HfHeiFollowupRule heiFollowUpRule; + + + private UpdateHeiDueButtonStatusTask(RegisterViewHolder viewHolder, String baseEntityId) { + this.viewHolder = viewHolder; + this.baseEntityId = baseEntityId; + } + + @Override + protected Void doInBackground(Void... voids) { + Date startRegisterDate = HeiDao.getHeiRegisterDate(baseEntityId); + Date followUpDate = HeiDao.getHeiFollowUpVisitDate(baseEntityId); + heiFollowUpRule = HfHomeVisitUtil.getHeiVisitStatus(startRegisterDate, followUpDate, baseEntityId); + return null; + } + + @Override + protected void onPostExecute(Void param) { + if (heiFollowUpRule != null && StringUtils.isNotBlank(heiFollowUpRule.getButtonStatus()) && !CoreConstants.VISIT_STATE.EXPIRED.equalsIgnoreCase(heiFollowUpRule.getButtonStatus())) { + updateDueColumn(context, viewHolder, heiFollowUpRule); + } + } + + private void updateDueColumn(Context context, RegisterViewHolder viewHolder, HeiFollowupRule heiFollowupRule) { + if (!HeiDao.hasTheChildTransferedOut(heiFollowupRule.getBaseEntityId()) && !HeiDao.isTheChildLostToFollowup(heiFollowupRule.getBaseEntityId())) { + if (heiFollowupRule.getDueDate() != null) { + viewHolder.dueButton.setVisibility(View.VISIBLE); + if (heiFollowupRule.getButtonStatus().equalsIgnoreCase(CoreConstants.VISIT_STATE.NOT_DUE_YET)) { + setVisitButtonNextDueStatus(context, FpUtil.sdf.format(heiFollowupRule.getDueDate()), viewHolder.dueButton); + } + if (heiFollowupRule.getButtonStatus().equalsIgnoreCase(CoreConstants.VISIT_STATE.DUE)) { + setVisitButtonDueStatus(context, String.valueOf(Days.daysBetween(new DateTime(heiFollowupRule.getDueDate()), new DateTime()).getDays()), viewHolder.dueButton); + } else if (heiFollowupRule.getButtonStatus().equalsIgnoreCase(CoreConstants.VISIT_STATE.OVERDUE)) { + setVisitButtonOverdueStatus(context, String.valueOf(Days.daysBetween(new DateTime(heiFollowupRule.getOverDueDate()), new DateTime()).getDays()), viewHolder.dueButton); + } else if (heiFollowupRule.getButtonStatus().equalsIgnoreCase(CoreConstants.VISIT_STATE.VISIT_DONE)) { + setVisitDone(context, viewHolder.dueButton); + } + } + } else { + int followupStatus; + int followupStatusColor; + if (HeiDao.hasTheChildTransferedOut(heiFollowupRule.getBaseEntityId())) { + followupStatus = R.string.transfer_out; + followupStatusColor = context.getResources().getColor(org.smartregister.pmtct.R.color.medium_risk_text_orange); + } else { + followupStatus = R.string.lost_to_followup; + followupStatusColor = context.getResources().getColor(org.smartregister.pmtct.R.color.alert_urgent_red); + } + + viewHolder.dueButton.setVisibility(View.VISIBLE); + viewHolder.dueButton.setTextColor(followupStatusColor); + viewHolder.dueButton.setText(followupStatus); + viewHolder.dueButton.setBackgroundResource(org.smartregister.chw.core.R.drawable.colorless_btn_selector); + viewHolder.dueButton.setOnClickListener(null); + } + + } + + private void setVisitButtonNextDueStatus(Context context, String visitDue, Button dueButton) { + dueButton.setTextColor(context.getResources().getColor(org.smartregister.chw.core.R.color.light_grey_text)); + dueButton.setText(MessageFormat.format(context.getString(R.string.next_visit_date), visitDue)); + dueButton.setBackgroundResource(org.smartregister.chw.core.R.drawable.colorless_btn_selector); + dueButton.setOnClickListener(null); + } + + private void setVisitButtonDueStatus(Context context, String visitDue, Button dueButton) { + dueButton.setTextColor(context.getResources().getColor(org.smartregister.chw.core.R.color.alert_in_progress_blue)); + if (visitDue.equalsIgnoreCase("0")) { + dueButton.setText(context.getString(org.smartregister.chw.core.R.string.hiv_visit_day_due_today)); + } else { + dueButton.setText(context.getString(org.smartregister.chw.core.R.string.hiv_visit_day_due, visitDue)); + } + dueButton.setBackgroundResource(org.smartregister.chw.core.R.drawable.blue_btn_selector); + dueButton.setOnClickListener(onClickListener); + } + + + private void setVisitButtonOverdueStatus(Context context, String visitDue, Button dueButton) { + dueButton.setTextColor(context.getResources().getColor(org.smartregister.chw.core.R.color.white)); + if (visitDue.equalsIgnoreCase("0")) { + dueButton.setText(context.getString(org.smartregister.chw.core.R.string.hiv_visit_day_overdue_today)); + + } else { + dueButton.setText(context.getString(org.smartregister.chw.core.R.string.hiv_visit_day_overdue, visitDue)); + } + dueButton.setBackgroundResource(org.smartregister.chw.core.R.drawable.overdue_red_btn_selector); + dueButton.setOnClickListener(onClickListener); + } + + private void setVisitDone(Context context, Button dueButton) { + dueButton.setTextColor(context.getResources().getColor(org.smartregister.chw.core.R.color.alert_complete_green)); + dueButton.setText(context.getString(org.smartregister.chw.core.R.string.visit_done)); + dueButton.setBackgroundColor(context.getResources().getColor(org.smartregister.chw.core.R.color.transparent)); + dueButton.setOnClickListener(null); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfAllClientsRegisterQueryProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfAllClientsRegisterQueryProvider.java new file mode 100644 index 000000000..07f79decf --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfAllClientsRegisterQueryProvider.java @@ -0,0 +1,14 @@ +package org.smartregister.chw.hf.provider; + +import androidx.annotation.NonNull; + +import org.smartregister.chw.core.provider.CoreAllClientsRegisterQueryProvider; +import org.smartregister.chw.hf.utils.HfQueryConstant; + +public class HfAllClientsRegisterQueryProvider extends CoreAllClientsRegisterQueryProvider { + @NonNull + @Override + public String mainSelectWhereIDsIn() { + return HfQueryConstant.ALL_CLIENTS_SELECT_QUERY; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfAllMaleClientsQueryProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfAllMaleClientsQueryProvider.java new file mode 100644 index 000000000..32ba2c387 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfAllMaleClientsQueryProvider.java @@ -0,0 +1,14 @@ +package org.smartregister.chw.hf.provider; + +import androidx.annotation.NonNull; + +import org.smartregister.chw.core.provider.CoreAllClientsRegisterQueryProvider; +import org.smartregister.chw.hf.utils.HfQueryForMaleClients; + +public class HfAllMaleClientsQueryProvider extends CoreAllClientsRegisterQueryProvider { + @NonNull + @Override + public String mainSelectWhereIDsIn() { + return HfQueryForMaleClients.ALL_MALE_CLIENTS_SELECT_QUERY; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfAncReferralListRegisterProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfAncReferralListRegisterProvider.java new file mode 100644 index 000000000..b624fdcd9 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfAncReferralListRegisterProvider.java @@ -0,0 +1,127 @@ +package org.smartregister.chw.hf.provider; + +import android.content.Context; +import android.database.Cursor; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; +import org.joda.time.DateTime; +import org.joda.time.Years; +import org.smartregister.chw.anc.fragment.BaseAncRegisterFragment; +import org.smartregister.chw.anc.provider.AncRegisterProvider; +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.chw.core.provider.ChwAncRegisterProvider; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.HfReferralUtils; +import org.smartregister.commonregistry.CommonPersonObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.commonregistry.CommonRepository; +import org.smartregister.util.Utils; +import org.smartregister.view.contract.SmartRegisterClient; + +import java.text.MessageFormat; +import java.util.Set; + +public class HfAncReferralListRegisterProvider extends ChwAncRegisterProvider { + private final LayoutInflater inflater; + private View.OnClickListener onClickListener; + private Context context; + private Set visibleColumns; + private CommonRepository commonRepository; + + public HfAncReferralListRegisterProvider(Context context, CommonRepository commonRepository, Set visibleColumns, View.OnClickListener onClickListener, View.OnClickListener paginationClickListener) { + super(context, commonRepository, visibleColumns, onClickListener, paginationClickListener); + inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + this.onClickListener = onClickListener; + this.context = context; + this.visibleColumns = visibleColumns; + + this.commonRepository = commonRepository; + } + + @Override + protected void populatePatientColumn(@NotNull CommonPersonObjectClient pc, SmartRegisterClient client, @NotNull final AncRegisterProvider.RegisterViewHolder viewHolder) { + String fname = Utils.getName( + Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.FIRST_NAME, true), + Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.MIDDLE_NAME, true) + ); + + String patientName = Utils.getName(fname, Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.LAST_NAME, true)); + + // calculate LMP + String dobString = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.DOB, false); + if (StringUtils.isNotBlank(dobString)) { + int age = Years.yearsBetween(new DateTime(dobString), new DateTime()).getYears(); + String gaLocation = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.VILLAGE_TOWN, true); + + viewHolder.patientAge.setText(gaLocation); + + String patientNameAge = MessageFormat.format("{0}, {1}", patientName, age); + viewHolder.patientName.setText(patientNameAge); + + } + + // add patient listener + viewHolder.patientColumn.setOnClickListener(onClickListener); + viewHolder.patientColumn.setTag(client); + viewHolder.patientColumn.setTag(R.id.VIEW_ID, BaseAncRegisterFragment.CLICK_VIEW_NORMAL); + + + // add due listener + viewHolder.dueButton.setOnClickListener(onClickListener); + viewHolder.dueButton.setTag(client); + viewHolder.dueButton.setTag(R.id.VIEW_ID, BaseAncRegisterFragment.CLICK_VIEW_DOSAGE_STATUS); + + viewHolder.registerColumns.setOnClickListener(v -> viewHolder.patientColumn.performClick()); + viewHolder.dueWrapper.setOnClickListener(v -> viewHolder.dueButton.performClick()); + } + + @Override + public RegisterViewHolder createViewHolder(ViewGroup parent) { + View view = inflater.inflate(R.layout.anc_register_list_row, parent, false); + return new HfRegisterViewHolder(view); + } + + @Override + public void getView(Cursor cursor, SmartRegisterClient client, RegisterViewHolder viewHolder) { + CommonPersonObjectClient pc = (CommonPersonObjectClient) client; + if (visibleColumns.isEmpty()) { + populatePatientColumn(pc, client, viewHolder); + populateLastColumn(pc, viewHolder); + } + + showLatestAncReferralDay((CommonPersonObjectClient) client, (HfRegisterViewHolder) viewHolder); + } + + private void showLatestAncReferralDay(CommonPersonObjectClient client, HfRegisterViewHolder viewHolder) { + HfReferralUtils.displayReferralDay(client, CoreConstants.TASKS_FOCUS.ANC_DANGER_SIGNS, viewHolder.textViewReferralDay); + } + + public class HfRegisterViewHolder extends RegisterViewHolder { + + public TextView textViewReferralDay; + + public HfRegisterViewHolder(View itemView) { + super(itemView); + textViewReferralDay = itemView.findViewById(R.id.text_view_referral_day); + } + } + + private void populateLastColumn(CommonPersonObjectClient pc, RegisterViewHolder viewHolder) { + if (commonRepository != null) { + CommonPersonObject commonPersonObject = commonRepository.findByBaseEntityId(pc.entityId()); + if (commonPersonObject != null) { + viewHolder.dueButton.setVisibility(View.VISIBLE); + viewHolder.dueButton.setText(context.getString(org.smartregister.chw.opensrp_chw_anc.R.string.anc_home_visit)); + viewHolder.dueButton.setAllCaps(true); + } else { + viewHolder.dueButton.setVisibility(View.GONE); + } + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfAncRegisterProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfAncRegisterProvider.java index be3748779..a51edb230 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfAncRegisterProvider.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfAncRegisterProvider.java @@ -27,6 +27,8 @@ import java.text.MessageFormat; import java.util.Set; +import timber.log.Timber; + public class HfAncRegisterProvider extends ChwAncRegisterProvider { private final LayoutInflater inflater; private View.OnClickListener onClickListener; @@ -51,19 +53,32 @@ protected void populatePatientColumn(@NotNull CommonPersonObjectClient pc, Smart // calculate LMP String dobString = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.DOB, false); String lmpString = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.LAST_MENSTRUAL_PERIOD, false); - if (StringUtils.isNotBlank(dobString) && StringUtils.isNotBlank(lmpString)) { + if (StringUtils.isNotBlank(dobString) ) { int age = Years.yearsBetween(new DateTime(dobString), new DateTime()).getYears(); - - String gaLocation = MessageFormat.format("{0}: {1} {2} {3} {4}", - context.getString(R.string.gestation_age_initial), - NCUtils.gestationAgeString(lmpString, context, false), - context.getString(R.string.abbrv_weeks), - context.getString(R.string.interpunct), - Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.VILLAGE_TOWN, true)); + String gaLocation; + if(StringUtils.isNotBlank(lmpString)){ + String gestationString = ""; + try { + gestationString = NCUtils.gestationAgeString(lmpString, context, false); + }catch (Exception e){ + Timber.e(e); + } + gaLocation = MessageFormat.format("{0}: {1} {2} {3} {4}", + context.getString(R.string.gestation_age_initial), + gestationString, + context.getString(R.string.abbrv_weeks), + context.getString(R.string.interpunct), + Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.VILLAGE_TOWN, true)); + }else{ + gaLocation = MessageFormat.format("{0}{1}", + context.getString(R.string.interpunct), + Utils.getValue(pc.getColumnmaps(),DBConstants.KEY.VILLAGE_TOWN, true)); + } + viewHolder.patientAge.setText(gaLocation); String patientNameAge = MessageFormat.format("{0}, {1}", patientName, age); viewHolder.patientName.setText(patientNameAge); - viewHolder.patientAge.setText(gaLocation); + } // add patient listener diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfHivFollowupProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfHivFollowupProvider.java new file mode 100644 index 000000000..cdde1b6d5 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfHivFollowupProvider.java @@ -0,0 +1,31 @@ +package org.smartregister.chw.hf.provider; + +import android.content.Context; +import android.database.Cursor; +import android.view.View; + +import org.smartregister.chw.hf.utils.HfHivTbFeedbackUtils; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.view.contract.SmartRegisterClient; + +import java.util.Set; + +public class HfHivFollowupProvider extends HfHivRegisterProvider { + + public HfHivFollowupProvider(Context context, Set visibleColumns, View.OnClickListener onClickListener, View.OnClickListener paginationClickListener) { + super(context, visibleColumns, onClickListener, paginationClickListener); + } + + @Override + public void getView(Cursor cursor, SmartRegisterClient smartRegisterClient, RegisterViewHolder registerViewHolder) { + super.getView(cursor, smartRegisterClient, registerViewHolder); + registerViewHolder.getDueWrapper().setVisibility(View.GONE); + + showLatestHivReferralDay((CommonPersonObjectClient) smartRegisterClient, (HfRegisterViewHolder) registerViewHolder); + } + + private void showLatestHivReferralDay(CommonPersonObjectClient client, HfHivFollowupProvider.HfRegisterViewHolder viewHolder) { + HfHivTbFeedbackUtils.displayReferralDay(client, viewHolder.textViewReferralDay); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfHivIndexContactsRegisterProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfHivIndexContactsRegisterProvider.java new file mode 100644 index 000000000..81cff247e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfHivIndexContactsRegisterProvider.java @@ -0,0 +1,101 @@ +package org.smartregister.chw.hf.provider; + +import android.content.Context; +import android.database.Cursor; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import org.smartregister.chw.core.provider.CoreHivIndexContactsProvider; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.HivIndexFollowupFeedbackDao; +import org.smartregister.chw.hf.model.HivIndexFollowupFeedbackDetailsModel; +import org.smartregister.chw.hf.utils.HfReferralUtils; +import org.smartregister.chw.hiv.dao.HivIndexDao; +import org.smartregister.chw.hiv.domain.HivIndexContactObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.view.contract.SmartRegisterClient; + +import java.util.List; +import java.util.Set; + + +public class HfHivIndexContactsRegisterProvider extends CoreHivIndexContactsProvider { + + private final LayoutInflater inflater; + private Context context; + + public HfHivIndexContactsRegisterProvider(Context context, Set visibleColumns, View.OnClickListener onClickListener, View.OnClickListener paginationClickListener) { + super(context, visibleColumns, onClickListener, paginationClickListener); + inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + this.context = context; + } + + @Override + public void getView(Cursor cursor, SmartRegisterClient smartRegisterClient, RegisterViewHolder registerViewHolder) { + super.getView(cursor, smartRegisterClient, registerViewHolder); + registerViewHolder.getDueWrapper().setVisibility(View.GONE); + ((HfRegisterViewHolder) registerViewHolder).goToProfileWrapper.setVisibility(View.VISIBLE); + + showLatestHivReferralDay((CommonPersonObjectClient) smartRegisterClient, (HfRegisterViewHolder) registerViewHolder); + } + + @Override + public RegisterViewHolder createViewHolder(ViewGroup parent) { + View view = inflater.inflate(R.layout.hf_hiv_register_list_row_item, parent, false); + return new HfRegisterViewHolder(view); + } + + private void showLatestHivReferralDay(CommonPersonObjectClient client, HfHivIndexContactsRegisterProvider.HfRegisterViewHolder viewHolder) { + HfReferralUtils.displayReferralDay(client, CoreConstants.TASKS_FOCUS.CONVENTIONAL_HIV_TEST, viewHolder.textViewReferralDay); + displayReferralSent(client, viewHolder); + } + + private void displayReferralSent(CommonPersonObjectClient client, HfHivIndexContactsRegisterProvider.HfRegisterViewHolder viewHolder) { + String baseEntityId = client.entityId(); + HivIndexContactObject hivIndexContactObject = HivIndexDao.getMember(baseEntityId); + + List hivIndexFollowupFeedbackDetailsModels = HivIndexFollowupFeedbackDao.getHivIndexFollowupFeedback(baseEntityId); + + if (hivIndexFollowupFeedbackDetailsModels.size() > 0) { + viewHolder.textViewReferralDay.setVisibility(View.VISIBLE); + String referralDay = viewHolder.itemView.getContext().getString(R.string.index_contact_has_feedback_from_community); + viewHolder.textViewReferralDay.setText(referralDay); + viewHolder.textViewReferralDay.setTextColor(context.getResources().getColor(R.color.primary)); + viewHolder.textViewReferralDay.setBackgroundColor(context.getResources().getColor(R.color.green_overlay)); + } else if (HivIndexDao.isReferralSent(baseEntityId)) { + viewHolder.textViewReferralDay.setVisibility(View.VISIBLE); + String referralDay = viewHolder.itemView.getContext().getString(R.string.referral_sent); + viewHolder.textViewReferralDay.setText(referralDay); + viewHolder.textViewReferralDay.setTextColor(context.getResources().getColor(R.color.due_vaccine_red)); + viewHolder.textViewReferralDay.setBackgroundColor(context.getResources().getColor(R.color.referral_text_background)); + } else if (!hivIndexContactObject.getHasTheContactClientBeenTested().equals("") && !hivIndexContactObject.getHasTheContactClientBeenTested().equals("no") && hivIndexContactObject.getCtcNumber().equals("")) { + viewHolder.textViewReferralDay.setVisibility(View.VISIBLE); + String pendingCtcRegistration = viewHolder.itemView.getContext().getString(R.string.pending_ctc_registration); + viewHolder.textViewReferralDay.setText(pendingCtcRegistration); + viewHolder.textViewReferralDay.setTextColor(context.getResources().getColor(R.color.due_vaccine_red)); + viewHolder.textViewReferralDay.setBackgroundColor(context.getResources().getColor(R.color.referral_text_background)); + }else if (!hivIndexContactObject.getHasTheContactClientBeenTested().equals("") && hivIndexContactObject.getHasTheContactClientBeenTested().equals("no")) { + viewHolder.textViewReferralDay.setVisibility(View.VISIBLE); + String pendingCtcRegistration = viewHolder.itemView.getContext().getString(R.string.client_was_not_tested); + viewHolder.textViewReferralDay.setText(pendingCtcRegistration); + viewHolder.textViewReferralDay.setTextColor(context.getResources().getColor(R.color.due_vaccine_red)); + viewHolder.textViewReferralDay.setBackgroundColor(context.getResources().getColor(R.color.referral_text_background)); + } else { + viewHolder.textViewReferralDay.setVisibility(View.GONE); + } + } + + public class HfRegisterViewHolder extends RegisterViewHolder { + public TextView textViewReferralDay; + public View goToProfileWrapper; + + public HfRegisterViewHolder(View itemView) { + super(itemView); + textViewReferralDay = itemView.findViewById(R.id.text_view_referral_day); + goToProfileWrapper = itemView.findViewById(R.id.go_to_profile_wrapper); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfHivRegisterProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfHivRegisterProvider.java new file mode 100644 index 000000000..30494294d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfHivRegisterProvider.java @@ -0,0 +1,88 @@ +package org.smartregister.chw.hf.provider; + +import android.content.Context; +import android.database.Cursor; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import org.smartregister.chw.core.provider.CoreHivProvider; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.HfReferralUtils; +import org.smartregister.chw.hiv.dao.HivDao; +import org.smartregister.chw.hiv.dao.HivIndexDao; +import org.smartregister.chw.hiv.domain.HivIndexContactObject; +import org.smartregister.chw.hiv.domain.HivMemberObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.view.contract.SmartRegisterClient; + +import java.util.List; +import java.util.Set; + +public class HfHivRegisterProvider extends CoreHivProvider { + + private final LayoutInflater inflater; + private Context context; + + public HfHivRegisterProvider(Context context, Set visibleColumns, View.OnClickListener onClickListener, View.OnClickListener paginationClickListener) { + super(context, visibleColumns, onClickListener, paginationClickListener); + this.context = context; + inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + } + + @Override + public void getView(Cursor cursor, SmartRegisterClient smartRegisterClient, RegisterViewHolder registerViewHolder) { + super.getView(cursor, smartRegisterClient, registerViewHolder); + registerViewHolder.getDueWrapper().setVisibility(View.GONE); + ((HfRegisterViewHolder) registerViewHolder).goToProfileWrapper.setVisibility(View.VISIBLE); + + CommonPersonObjectClient commonPersonObjectClient = ((CommonPersonObjectClient) smartRegisterClient); + List hivIndexContactObjects = HivIndexDao.getIndexContacts(commonPersonObjectClient.entityId()); + if (hivIndexContactObjects != null && hivIndexContactObjects.size() > 0) { + boolean hasPositiveContacts = false; + for (HivIndexContactObject hivIndexContactObject : hivIndexContactObjects) { + if (!hasPositiveContacts && !hivIndexContactObject.getTestResults().toLowerCase().equals("negative")) + hasPositiveContacts = true; + } + + if (!hasPositiveContacts) + ((HfRegisterViewHolder) registerViewHolder).textViewReElicit.setVisibility(View.VISIBLE); + else + ((HfRegisterViewHolder) registerViewHolder).textViewReElicit.setVisibility(View.GONE); + + } + showLatestHivReferralDay((CommonPersonObjectClient) smartRegisterClient, (HfRegisterViewHolder) registerViewHolder); + } + + @Override + public RegisterViewHolder createViewHolder(ViewGroup parent) { + View view = inflater.inflate(R.layout.hf_hiv_register_list_row_item, parent, false); + return new HfRegisterViewHolder(view); + } + + private void showLatestHivReferralDay(CommonPersonObjectClient client, HfHivRegisterProvider.HfRegisterViewHolder viewHolder) { + HivMemberObject hivMemberObject = HivDao.getMember(client.entityId()); + if (hivMemberObject != null && (hivMemberObject.getCtcNumber() == null || hivMemberObject.getCtcNumber().equals("")) && hivMemberObject.getClientHivStatusAfterTesting().equalsIgnoreCase("positive")) { + viewHolder.textViewReferralDay.setVisibility(View.VISIBLE); + String pendingCtcRegistration = context.getString(R.string.pending_ctc_registration); + viewHolder.textViewReferralDay.setText(pendingCtcRegistration); + } else { + HfReferralUtils.displayReferralDay(client, CoreConstants.TASKS_FOCUS.CONVENTIONAL_HIV_TEST, viewHolder.textViewReferralDay); + } + } + + public class HfRegisterViewHolder extends RegisterViewHolder { + public TextView textViewReferralDay; + public TextView textViewReElicit; + public View goToProfileWrapper; + + public HfRegisterViewHolder(View itemView) { + super(itemView); + textViewReferralDay = itemView.findViewById(R.id.text_view_referral_day); + textViewReElicit = itemView.findViewById(R.id.text_view_re_elicit); + goToProfileWrapper = itemView.findViewById(R.id.go_to_profile_wrapper); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfLDRegisterProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfLDRegisterProvider.java new file mode 100644 index 000000000..a7099b564 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfLDRegisterProvider.java @@ -0,0 +1,50 @@ +package org.smartregister.chw.hf.provider; + +import android.content.Context; +import android.database.Cursor; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.HfReferralUtils; +import org.smartregister.chw.ld.provider.LDRegisterProvider; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.view.contract.SmartRegisterClient; + +import java.util.Set; + +public class HfLDRegisterProvider extends LDRegisterProvider { + public HfLDRegisterProvider(Context context, View.OnClickListener paginationClickListener, View.OnClickListener onClickListener, Set visibleColumns) { + super(context, paginationClickListener, onClickListener, visibleColumns); + } + + @Override + public void getView(Cursor cursor, SmartRegisterClient smartRegisterClient, RegisterViewHolder registerViewHolder) { + super.getView(cursor, smartRegisterClient, registerViewHolder); + showLatestAncReferralDay((CommonPersonObjectClient) smartRegisterClient, (HfRegisterViewHolder) registerViewHolder); + } + + private void showLatestAncReferralDay(CommonPersonObjectClient client, HfRegisterViewHolder viewHolder) { + HfReferralUtils.displayReferralDay(client, Constants.FOCUS.LD_EMERGENCY, viewHolder.textViewReferralDay); + } + + + + @Override + public RegisterViewHolder createViewHolder(ViewGroup parent) { + View view = inflater().inflate(org.smartregister.ld.R.layout.ld_register_list_row, parent, false); + return new HfRegisterViewHolder(view); + } + + public class HfRegisterViewHolder extends HfLDRegisterProvider.RegisterViewHolder { + + public TextView textViewReferralDay; + + public HfRegisterViewHolder(View itemView) { + super(itemView); + textViewReferralDay = itemView.findViewById(R.id.text_view_referral_day); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfMaleClientRegisterProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfMaleClientRegisterProvider.java new file mode 100644 index 000000000..2c08956fe --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfMaleClientRegisterProvider.java @@ -0,0 +1,91 @@ +package org.smartregister.chw.hf.provider; + +import static org.smartregister.chw.hf.utils.Constants.PartnerRegistrationConstants.INTENT_BASE_ENTITY_ID; + +import android.app.Activity; +import android.app.AlertDialog; +import android.content.Context; +import android.content.Intent; +import android.view.View; + +import androidx.annotation.NonNull; + +import org.apache.commons.text.WordUtils; +import org.joda.time.DateTime; +import org.joda.time.Period; +import org.smartregister.chw.hf.R; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.family.util.DBConstants; +import org.smartregister.family.util.Utils; +import org.smartregister.opd.OpdLibrary; +import org.smartregister.opd.configuration.OpdRegisterProviderMetadata; +import org.smartregister.opd.holders.OpdRegisterViewHolder; +import org.smartregister.opd.provider.OpdRegisterProvider; +import org.smartregister.opd.utils.ConfigurationInstancesHelper; + +import java.util.Map; + +public class HfMaleClientRegisterProvider extends OpdRegisterProvider { + private final Context context; + + private OpdRegisterProviderMetadata opdRegisterProviderMetadata; + + public HfMaleClientRegisterProvider(@NonNull Context context, @NonNull View.OnClickListener onClickListener, @NonNull View.OnClickListener paginationClickListener) { + super(context, onClickListener, paginationClickListener); + this.context = context; + this.opdRegisterProviderMetadata = ConfigurationInstancesHelper + .newInstance(OpdLibrary.getInstance() + .getOpdConfiguration() + .getOpdRegisterProviderMetadata()); + } + + @Override + public void populatePatientColumn(CommonPersonObjectClient commonPersonObjectClient, OpdRegisterViewHolder viewHolder) { + int age_val = new Period(new DateTime(opdRegisterProviderMetadata.getDob(commonPersonObjectClient.getColumnmaps())), new DateTime()).getYears(); + + Map patientColumnMaps = commonPersonObjectClient.getColumnmaps(); + + viewHolder.hideRegisterType(); + viewHolder.removeCareGiverName(); + String firstName = opdRegisterProviderMetadata.getClientFirstName(patientColumnMaps); + String middleName = opdRegisterProviderMetadata.getClientMiddleName(patientColumnMaps); + String lastName = opdRegisterProviderMetadata.getClientLastName(patientColumnMaps); + String fullName = org.smartregister.util.Utils.getName(firstName, middleName + " " + lastName); + String baseEntityId = commonPersonObjectClient.entityId(); + String age = String.valueOf(age_val); + + fillValue(viewHolder.textViewChildName, WordUtils.capitalize(fullName) + ", " + + WordUtils.capitalize(age)); + setAddressAndGender(commonPersonObjectClient, viewHolder); + viewHolder.itemView.findViewById(R.id.go_to_profile_image_view).setVisibility(View.GONE); + viewHolder.itemView.setOnClickListener(v -> { + AlertDialog.Builder builder = new AlertDialog.Builder(v.getContext()); + builder.setTitle(R.string.register_partner_dialog_title); + builder.setMessage(WordUtils.capitalize(fullName) + ", " + WordUtils.capitalize(age)); + builder.setCancelable(true); + builder.setPositiveButton(v.getContext().getString(R.string.yes), (dialog, id) -> { + Activity parentActivity = (Activity) context; + Intent intent = new Intent(); + intent.putExtra(INTENT_BASE_ENTITY_ID, baseEntityId); + parentActivity.setResult(Activity.RESULT_OK, intent); + parentActivity.finish(); + }); + builder.setNegativeButton(v.getContext().getString(R.string.cancel), ((dialog, id) -> dialog.cancel())); + + AlertDialog alertDialog = builder.create(); + alertDialog.show(); + }); + } + + + @Override + public void setAddressAndGender(CommonPersonObjectClient pc, OpdRegisterViewHolder viewHolder) { + super.setAddressAndGender(pc, viewHolder); + String gender_key = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.GENDER, true); + String gender = ""; + if (gender_key.equalsIgnoreCase("Male")) { + gender = context.getString(org.smartregister.chw.core.R.string.male); + } + fillValue(viewHolder.textViewGender, gender); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfOpdRegisterProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfOpdRegisterProvider.java index 13f671a46..b13ae6b10 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfOpdRegisterProvider.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfOpdRegisterProvider.java @@ -6,26 +6,41 @@ import androidx.annotation.NonNull; +import org.apache.commons.text.WordUtils; +import org.joda.time.DateTime; +import org.joda.time.Period; import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.chw.hf.R; import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.family.util.DBConstants; import org.smartregister.family.util.Utils; +import org.smartregister.opd.OpdLibrary; +import org.smartregister.opd.configuration.OpdRegisterProviderMetadata; import org.smartregister.opd.holders.OpdRegisterViewHolder; import org.smartregister.opd.provider.OpdRegisterProvider; +import org.smartregister.opd.utils.ConfigurationInstancesHelper; import org.smartregister.opd.utils.OpdDbConstants; +import java.util.Map; + public class HfOpdRegisterProvider extends OpdRegisterProvider { private final Context context; + private OpdRegisterProviderMetadata opdRegisterProviderMetadata; + public HfOpdRegisterProvider(@NonNull Context context, @NonNull View.OnClickListener onClickListener, @NonNull View.OnClickListener paginationClickListener) { super(context, onClickListener, paginationClickListener); this.context = context; + this.opdRegisterProviderMetadata = ConfigurationInstancesHelper + .newInstance(OpdLibrary.getInstance() + .getOpdConfiguration() + .getOpdRegisterProviderMetadata()); } @Override public void populatePatientColumn(CommonPersonObjectClient commonPersonObjectClient, OpdRegisterViewHolder viewHolder) { super.populatePatientColumn(commonPersonObjectClient, viewHolder); + Map patientColumnMaps = commonPersonObjectClient.getColumnmaps(); String registerType = org.smartregister.util.Utils.getValue(commonPersonObjectClient.getColumnmaps(), OpdDbConstants.KEY.REGISTER_TYPE, true); @@ -36,6 +51,15 @@ public void populatePatientColumn(CommonPersonObjectClient commonPersonObjectCli } else { viewHolder.hideRegisterType(); } + String firstName = opdRegisterProviderMetadata.getClientFirstName(patientColumnMaps); + String middleName = opdRegisterProviderMetadata.getClientMiddleName(patientColumnMaps); + String lastName = opdRegisterProviderMetadata.getClientLastName(patientColumnMaps); + String fullName = org.smartregister.util.Utils.getName(firstName, middleName + " " + lastName); + + String age = String.valueOf(new Period(new DateTime(opdRegisterProviderMetadata.getDob(patientColumnMaps)), new DateTime()).getYears()); + + fillValue(viewHolder.textViewChildName, WordUtils.capitalize(fullName) + ", " + + WordUtils.capitalize(age)); } private String getTranslatedRegisterType(String registerType) { @@ -49,6 +73,8 @@ private String getTranslatedRegisterType(String registerType) { return context.getString(R.string.menu_family_planning); } else if (registerType.equalsIgnoreCase(CoreConstants.REGISTER_TYPE.MALARIA)) { return context.getString(R.string.menu_malaria); + } else if (registerType.equalsIgnoreCase(CoreConstants.REGISTER_TYPE.INDEPENDENT)) { + return context.getString(R.string.menu_independent); } return registerType; } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfPmtctRegisterProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfPmtctRegisterProvider.java new file mode 100644 index 000000000..050d53f47 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfPmtctRegisterProvider.java @@ -0,0 +1,255 @@ +package org.smartregister.chw.hf.provider; + +import static org.smartregister.util.Utils.getName; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.database.Cursor; +import android.graphics.Color; +import android.graphics.Typeface; +import android.os.AsyncTask; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.TextView; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.Days; +import org.smartregister.chw.core.provider.CorePmtctRegisterProvider; +import org.smartregister.chw.core.rule.PmtctFollowUpRule; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.FpUtil; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.dao.HfPmtctDao; +import org.smartregister.chw.hf.utils.HfHomeVisitUtil; +import org.smartregister.chw.pmtct.fragment.BasePmtctRegisterFragment; +import org.smartregister.chw.pmtct.util.DBConstants; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.provider.PmtctRegisterProvider; +import org.smartregister.util.Utils; +import org.smartregister.view.contract.SmartRegisterClient; + +import java.text.MessageFormat; +import java.util.Date; +import java.util.Set; + +import timber.log.Timber; + +public class HfPmtctRegisterProvider extends CorePmtctRegisterProvider { + + private Context context; + private Set visibleColumns; + + public HfPmtctRegisterProvider(Context context, View.OnClickListener paginationClickListener, View.OnClickListener onClickListener, Set visibleColumns) { + super(context, paginationClickListener, onClickListener, visibleColumns); + this.onClickListener = onClickListener; + this.visibleColumns = visibleColumns; + this.context = context; + } + + @Override + public PmtctRegisterProvider.RegisterViewHolder createViewHolder(ViewGroup parent) { + LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + View view = inflater.inflate(R.layout.hf_hiv_register_list_row_item, parent, false); + return new HfRegisterViewHolder(view); + } + + @SuppressLint("SetTextI18n") + @Override + protected void populatePatientColumn(CommonPersonObjectClient pc, final RegisterViewHolder viewHolder) { + try { + + String firstName = getName( + Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.FIRST_NAME, true), + Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.MIDDLE_NAME, true)); + + + String dob = org.smartregister.family.util.Utils.getValue(pc.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.DOB, false); + String dobString = org.smartregister.family.util.Utils.getDuration(dob); + + String dod = org.smartregister.family.util.Utils.getValue(pc.getColumnmaps(), org.smartregister.family.util.DBConstants.KEY.DOD, false); + String patientName = getName(firstName, Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.LAST_NAME, true)); + + + if (StringUtils.isNotBlank(dod)) { + dobString = org.smartregister.family.util.Utils.getDuration(dod, dob); + dobString = dobString.contains("y") ? dobString.substring(0, dobString.indexOf("y")) : dobString; + + patientName = patientName + ", " + org.smartregister.family.util.Utils.getTranslatedDate(dobString, context) + " " + context.getString(R.string.deceased_brackets); + viewHolder.patientName.setText(patientName); + viewHolder.patientName.setTextColor(Color.GRAY); + viewHolder.patientName.setTypeface(viewHolder.patientName.getTypeface(), Typeface.ITALIC); + viewHolder.dueWrapper.setVisibility(View.GONE); + } else { + patientName = patientName + ", " + org.smartregister.family.util.Utils.getTranslatedDate(dobString, context); + viewHolder.patientName.setText(patientName); + viewHolder.patientName.setTextColor(Color.BLACK); + viewHolder.patientName.setTypeface(viewHolder.patientName.getTypeface(), Typeface.NORMAL); + viewHolder.patientColumn.setOnClickListener(onClickListener); + viewHolder.dueButton.setOnClickListener(onClickListener); + viewHolder.registerColumns.setOnClickListener(v -> viewHolder.patientColumn.performClick()); + viewHolder.registerColumns.setOnClickListener(v -> viewHolder.dueButton.performClick()); + viewHolder.dueWrapper.setVisibility(View.VISIBLE); + } + + + viewHolder.textViewGender.setText(updateMemberGender(pc)); + viewHolder.textViewVillage.setText(Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.VILLAGE_TOWN, true)); + + viewHolder.patientColumn.setTag(pc); + viewHolder.patientColumn.setTag(org.smartregister.pmtct.R.id.VIEW_ID, BasePmtctRegisterFragment.CLICK_VIEW_NORMAL); + + viewHolder.dueButton.setTag(pc); + viewHolder.dueButton.setTag(org.smartregister.pmtct.R.id.VIEW_ID, BasePmtctRegisterFragment.FOLLOW_UP_VISIT); + viewHolder.registerColumns.setOnClickListener(onClickListener); + + + } catch (Exception e) { + Timber.e(e); + } + } + + @Override + public void getView(Cursor cursor, SmartRegisterClient smartRegisterClient, RegisterViewHolder registerViewHolder) { + CommonPersonObjectClient pc = (CommonPersonObjectClient) smartRegisterClient; + if (visibleColumns.isEmpty()) { + populatePatientColumn(pc, registerViewHolder); + registerViewHolder.dueButton.setVisibility(View.GONE); + registerViewHolder.dueButton.setOnClickListener(null); + String baseEntityId = smartRegisterClient.entityId(); + Utils.startAsyncTask(new UpdatePmtctDueButtonStatusTask(registerViewHolder, baseEntityId), null); + displayReferralSent(pc, (HfRegisterViewHolder) registerViewHolder); + } + } + + private void displayReferralSent(CommonPersonObjectClient client, HfRegisterViewHolder viewHolder) { + String baseEntityId = client.entityId(); + + if (HfPmtctDao.hasBeenReferredForMotherChampionServices(baseEntityId)) { + viewHolder.textViewReferralDay.setVisibility(View.VISIBLE); + String referralDay = viewHolder.itemView.getContext().getString(R.string.referral_for_mother_champion_services_sent); + viewHolder.textViewReferralDay.setText(referralDay); + } else { + viewHolder.textViewReferralDay.setVisibility(View.GONE); + } + } + + @Override + protected void updateDueColumn(Context context, RegisterViewHolder viewHolder, PmtctFollowUpRule pmtctFollowUpRule) { + //override due column + } + + private class UpdatePmtctDueButtonStatusTask extends AsyncTask { + private final RegisterViewHolder viewHolder; + private final String baseEntityId; + private PmtctFollowUpRule pmtctFollowUpRule; + + + private UpdatePmtctDueButtonStatusTask(RegisterViewHolder viewHolder, String baseEntityId) { + this.viewHolder = viewHolder; + this.baseEntityId = baseEntityId; + } + + @Override + protected Void doInBackground(Void... voids) { + Date startRegisterDate = HfPmtctDao.getPmtctRegisterDate(baseEntityId); + Date followUpDate = HfPmtctDao.getNextFacilityVisitDate(baseEntityId); + pmtctFollowUpRule = HfHomeVisitUtil.getPmtctVisitStatus(startRegisterDate, followUpDate, baseEntityId); + return null; + } + + @Override + protected void onPostExecute(Void param) { + if (pmtctFollowUpRule != null && StringUtils.isNotBlank(pmtctFollowUpRule.getButtonStatus()) && !CoreConstants.VISIT_STATE.EXPIRED.equalsIgnoreCase(pmtctFollowUpRule.getButtonStatus())) { + updateDueColumn(context, viewHolder, pmtctFollowUpRule); + } + } + + private void updateDueColumn(Context context, RegisterViewHolder viewHolder, PmtctFollowUpRule pmtctFollowupRule) { + if (!HfPmtctDao.hasTheClientTransferedOut(pmtctFollowupRule.getBaseEntityId()) && !HfPmtctDao.isTheClientLostToFollowup(pmtctFollowupRule.getBaseEntityId())) { + if (pmtctFollowupRule.getDueDate() != null) { + viewHolder.dueButton.setVisibility(View.VISIBLE); + if (pmtctFollowupRule.getButtonStatus().equalsIgnoreCase(CoreConstants.VISIT_STATE.NOT_DUE_YET)) { + setVisitButtonNextDueStatus(context, FpUtil.sdf.format(pmtctFollowupRule.getDueDate()), viewHolder.dueButton); + } + if (pmtctFollowupRule.getButtonStatus().equalsIgnoreCase(CoreConstants.VISIT_STATE.DUE)) { + setVisitButtonDueStatus(context, String.valueOf(Days.daysBetween(new DateTime(pmtctFollowupRule.getDueDate()), new DateTime()).getDays()), viewHolder.dueButton); + } else if (pmtctFollowupRule.getButtonStatus().equalsIgnoreCase(CoreConstants.VISIT_STATE.OVERDUE)) { + setVisitButtonOverdueStatus(context, String.valueOf(Days.daysBetween(new DateTime(pmtctFollowupRule.getOverDueDate()), new DateTime()).getDays()), viewHolder.dueButton); + } else if (pmtctFollowupRule.getButtonStatus().equalsIgnoreCase(CoreConstants.VISIT_STATE.VISIT_DONE)) { + setVisitDone(context, viewHolder.dueButton); + } + } + } else { + int followupStatus; + int followupStatusColor; + if (HfPmtctDao.hasTheClientTransferedOut(pmtctFollowupRule.getBaseEntityId())) { + followupStatus = R.string.transfer_out; + followupStatusColor = context.getResources().getColor(org.smartregister.pmtct.R.color.medium_risk_text_orange); + } else { + followupStatus = R.string.lost_to_followup; + followupStatusColor = context.getResources().getColor(org.smartregister.pmtct.R.color.alert_urgent_red); + } + + viewHolder.dueButton.setVisibility(View.VISIBLE); + viewHolder.dueButton.setTextColor(followupStatusColor); + viewHolder.dueButton.setText(followupStatus); + viewHolder.dueButton.setBackgroundResource(org.smartregister.chw.core.R.drawable.colorless_btn_selector); + viewHolder.dueButton.setOnClickListener(null); + } + + } + + private void setVisitButtonNextDueStatus(Context context, String visitDue, Button dueButton) { + dueButton.setTextColor(context.getResources().getColor(org.smartregister.chw.core.R.color.light_grey_text)); + dueButton.setText(MessageFormat.format(context.getString(R.string.next_visit_date), visitDue)); + dueButton.setBackgroundResource(org.smartregister.chw.core.R.drawable.colorless_btn_selector); + dueButton.setOnClickListener(null); + } + + private void setVisitButtonDueStatus(Context context, String visitDue, Button dueButton) { + dueButton.setTextColor(context.getResources().getColor(org.smartregister.chw.core.R.color.alert_in_progress_blue)); + if (visitDue.equalsIgnoreCase("0")) { + dueButton.setText(context.getString(org.smartregister.chw.core.R.string.hiv_visit_day_due_today)); + } else { + dueButton.setText(context.getString(org.smartregister.chw.core.R.string.hiv_visit_day_due, visitDue)); + } + dueButton.setBackgroundResource(org.smartregister.chw.core.R.drawable.blue_btn_selector); + dueButton.setOnClickListener(onClickListener); + } + + + private void setVisitButtonOverdueStatus(Context context, String visitDue, Button dueButton) { + dueButton.setTextColor(context.getResources().getColor(org.smartregister.chw.core.R.color.white)); + if (visitDue.equalsIgnoreCase("0")) { + dueButton.setText(context.getString(org.smartregister.chw.core.R.string.hiv_visit_day_overdue_today)); + + } else { + dueButton.setText(context.getString(org.smartregister.chw.core.R.string.hiv_visit_day_overdue, visitDue)); + } + dueButton.setBackgroundResource(org.smartregister.chw.core.R.drawable.overdue_red_btn_selector); + dueButton.setOnClickListener(onClickListener); + } + + private void setVisitDone(Context context, Button dueButton) { + dueButton.setTextColor(context.getResources().getColor(org.smartregister.chw.core.R.color.alert_complete_green)); + dueButton.setText(context.getString(org.smartregister.chw.core.R.string.visit_done)); + dueButton.setBackgroundColor(context.getResources().getColor(org.smartregister.chw.core.R.color.transparent)); + dueButton.setOnClickListener(null); + } + } + + + public class HfRegisterViewHolder extends PmtctRegisterProvider.RegisterViewHolder { + public TextView textViewReferralDay; + public View goToProfileWrapper; + + public HfRegisterViewHolder(View itemView) { + super(itemView); + textViewReferralDay = itemView.findViewById(R.id.text_view_referral_day); + goToProfileWrapper = itemView.findViewById(R.id.go_to_profile_wrapper); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfPncNoMotherRegisterProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfPncNoMotherRegisterProvider.java new file mode 100644 index 000000000..a4b6029b1 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfPncNoMotherRegisterProvider.java @@ -0,0 +1,131 @@ +package org.smartregister.chw.hf.provider; + +import static org.smartregister.util.Utils.getName; + +import android.content.Context; +import android.database.Cursor; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.Days; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; +import org.smartregister.chw.anc.fragment.BaseAncRegisterFragment; +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.chw.core.provider.ChwPncRegisterProvider; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.hf.utils.HfReferralUtils; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.commonregistry.CommonRepository; +import org.smartregister.util.Utils; +import org.smartregister.view.contract.SmartRegisterClient; + +import java.text.MessageFormat; +import java.util.Set; + +public class HfPncNoMotherRegisterProvider extends ChwPncRegisterProvider { + private final LayoutInflater inflater; + private final Context context; + private final View.OnClickListener onClickListener; + private final Set visibleColumns; + + public HfPncNoMotherRegisterProvider(Context context, CommonRepository commonRepository, Set visibleColumns, View.OnClickListener onClickListener, View.OnClickListener paginationClickListener) { + super(context, commonRepository, visibleColumns, onClickListener, paginationClickListener); + inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + this.onClickListener = onClickListener; + this.context = context; + this.visibleColumns = visibleColumns; + } + + @Override + public void getView(Cursor cursor, SmartRegisterClient client, RegisterViewHolder viewHolder) { + super.getView(cursor, client, viewHolder); + viewHolder.dueWrapper.setVisibility(View.GONE); + CommonPersonObjectClient pc = (CommonPersonObjectClient) client; + showLatestPncReferralDay((CommonPersonObjectClient) client, (HfPncRegisterViewHolder) viewHolder); + if (visibleColumns.isEmpty()) { + populatePatientColumn(pc, client, viewHolder); + } + } + + + @Override + public RegisterViewHolder createViewHolder(ViewGroup parent) { + View view = inflater.inflate(R.layout.pnc_no_mother_register_list_row, parent, false); + return new HfPncRegisterViewHolder(view); + } + + private void showLatestPncReferralDay(CommonPersonObjectClient client, HfPncNoMotherRegisterProvider.HfPncRegisterViewHolder viewHolder) { + HfReferralUtils.displayReferralDay(client, CoreConstants.TASKS_FOCUS.PNC_DANGER_SIGNS, viewHolder.textViewReferralDay); + } + + private void populatePatientColumn(CommonPersonObjectClient pc, SmartRegisterClient client, final RegisterViewHolder viewHolder) { + + viewHolder.villageTown.setText(Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.VILLAGE_TOWN, true)); + + String fname = getName( + Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.FIRST_NAME, true), + Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.MIDDLE_NAME, true) + ); + + String patientName = getName(fname, Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.LAST_NAME, true)); + + String dob = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.DOB, false); + String dobString = org.smartregister.family.util.Utils.getDuration(dob); + if (StringUtils.isNotBlank(dobString)) { + String patientNameAge = MessageFormat.format("{0}, {1}", + patientName, + dobString + ); + viewHolder.patientNameAndAge.setText(patientNameAge); + } else { + viewHolder.patientNameAndAge.setText(patientName); + } + + DateTimeFormatter formatter = DateTimeFormat.forPattern("dd-MM-yyyy"); + String dayPnc = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.DELIVERY_DATE, true); + if (StringUtils.isNotBlank(dayPnc)) { + int period = Days.daysBetween(new DateTime(formatter.parseDateTime(dayPnc)), new DateTime()).getDays(); + String pncDay = MessageFormat.format("{0} {1}", + context.getString(org.smartregister.chw.pnc.R.string.pnc_day), + period + ); + viewHolder.pncDay.setText(pncDay); + } + + TextView childCaregiverName = viewHolder.itemView.findViewById(R.id.child_caregiver); + childCaregiverName.setText(context.getString(R.string.caregiver_name, Utils.getValue(pc.getColumnmaps(), Constants.DBConstants.CAREGIVER_NAME, false))); + + + // add patient listener + viewHolder.patientColumn.setOnClickListener(onClickListener); + viewHolder.patientColumn.setTag(client); + viewHolder.patientColumn.setTag(org.smartregister.chw.opensrp_chw_anc.R.id.VIEW_ID, BaseAncRegisterFragment.CLICK_VIEW_NORMAL); + + // add due listener + viewHolder.dueButton.setOnClickListener(onClickListener); + viewHolder.dueButton.setTag(client); + viewHolder.dueButton.setTag(org.smartregister.chw.opensrp_chw_anc.R.id.VIEW_ID, BaseAncRegisterFragment.CLICK_VIEW_DOSAGE_STATUS); + + + viewHolder.registerColumns.setOnClickListener(v -> viewHolder.patientColumn.performClick()); + + viewHolder.dueWrapper.setOnClickListener(v -> viewHolder.dueButton.performClick()); + } + + public class HfPncRegisterViewHolder extends RegisterViewHolder { + + public TextView textViewReferralDay; + + public HfPncRegisterViewHolder(View itemView) { + super(itemView); + textViewReferralDay = itemView.findViewById(R.id.text_view_referral_day); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfTbFollowupProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfTbFollowupProvider.java new file mode 100644 index 000000000..dc14c7d5d --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfTbFollowupProvider.java @@ -0,0 +1,31 @@ +package org.smartregister.chw.hf.provider; + +import android.content.Context; +import android.database.Cursor; +import android.view.View; + +import org.smartregister.chw.hf.utils.HfHivTbFeedbackUtils; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.view.contract.SmartRegisterClient; + +import java.util.Set; + +public class HfTbFollowupProvider extends HfTbRegisterProvider { + + public HfTbFollowupProvider(Context context, Set visibleColumns, View.OnClickListener onClickListener, View.OnClickListener paginationClickListener) { + super(context, visibleColumns, onClickListener, paginationClickListener); + } + + @Override + public void getView(Cursor cursor, SmartRegisterClient smartRegisterClient, RegisterViewHolder registerViewHolder) { + super.getView(cursor, smartRegisterClient, registerViewHolder); + registerViewHolder.getDueWrapper().setVisibility(View.GONE); + + showLatestHivReferralDay((CommonPersonObjectClient) smartRegisterClient, (HfRegisterViewHolder) registerViewHolder); + } + + private void showLatestHivReferralDay(CommonPersonObjectClient client, HfRegisterViewHolder viewHolder) { + HfHivTbFeedbackUtils.displayReferralDay(client, viewHolder.textViewReferralDay); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfTbRegisterProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfTbRegisterProvider.java new file mode 100644 index 000000000..e0a726d32 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/HfTbRegisterProvider.java @@ -0,0 +1,54 @@ +package org.smartregister.chw.hf.provider; + +import android.content.Context; +import android.database.Cursor; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import org.smartregister.chw.core.provider.CoreTbProvider; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.utils.HfReferralUtils; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.view.contract.SmartRegisterClient; + +import java.util.Set; + +public class HfTbRegisterProvider extends CoreTbProvider { + + private final LayoutInflater inflater; + + public HfTbRegisterProvider(Context context, Set visibleColumns, View.OnClickListener onClickListener, View.OnClickListener paginationClickListener) { + super(context, visibleColumns, onClickListener, paginationClickListener); + inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + } + + @Override + public void getView(Cursor cursor, SmartRegisterClient smartRegisterClient, RegisterViewHolder registerViewHolder) { + super.getView(cursor, smartRegisterClient, registerViewHolder); + registerViewHolder.getDueWrapper().setVisibility(View.GONE); + + showLatestTbReferralDay((CommonPersonObjectClient) smartRegisterClient, (HfRegisterViewHolder) registerViewHolder); + } + + @Override + public RegisterViewHolder createViewHolder(ViewGroup parent) { + View view = inflater.inflate(R.layout.hf_tb_register_list_row_item, parent, false); + return new HfRegisterViewHolder(view); + } + + private void showLatestTbReferralDay(CommonPersonObjectClient client, HfTbRegisterProvider.HfRegisterViewHolder viewHolder) { + HfReferralUtils.displayReferralDay(client, CoreConstants.TASKS_FOCUS.SUSPECTED_TB, viewHolder.textViewReferralDay); + } + + public class HfRegisterViewHolder extends RegisterViewHolder { + public TextView textViewReferralDay; + + public HfRegisterViewHolder(View itemView) { + super(itemView); + textViewReferralDay = itemView.findViewById(R.id.text_view_referral_day); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/ReferralsRegisterProvider.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/ReferralsRegisterProvider.java new file mode 100644 index 000000000..3a43088a0 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/provider/ReferralsRegisterProvider.java @@ -0,0 +1,124 @@ +package org.smartregister.chw.hf.provider; + +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import androidx.core.content.ContextCompat; + +import org.joda.time.DateTime; +import org.joda.time.Years; +import org.smartregister.chw.core.holders.ReferralViewHolder; +import org.smartregister.chw.core.provider.BaseReferralRegisterProvider; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.hf.holder.IssuedReferralViewHolder; +import org.smartregister.chw.referral.util.Constants; +import org.smartregister.chw.referral.util.ReferralUtil; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.domain.Location; +import org.smartregister.family.util.DBConstants; +import org.smartregister.family.util.Utils; +import org.smartregister.repository.LocationRepository; + +import java.util.Locale; + +public class ReferralsRegisterProvider extends BaseReferralRegisterProvider { + private final Context context; + + public ReferralsRegisterProvider(Context context, View.OnClickListener onClickListener, View.OnClickListener paginationClickListener) { + super(context, onClickListener, paginationClickListener); + this.context = context; + } + + + @Override + public void populatePatientColumn(CommonPersonObjectClient pc, ReferralViewHolder viewHolder) { + String firstName = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.FIRST_NAME, true); + String middleName = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.MIDDLE_NAME, true); + String lastName = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.LAST_NAME, true); + String patientName = org.smartregister.util.Utils.getName(firstName, middleName + " " + lastName); + String dobString = Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.DOB, false); + int age = Years.yearsBetween(new DateTime(dobString), new DateTime()).getYears(); + + + IssuedReferralViewHolder issuedReferralViewHolder = (IssuedReferralViewHolder) viewHolder; + issuedReferralViewHolder.patientName.setText(String.format(Locale.getDefault(), "%s, %d", patientName, age)); + issuedReferralViewHolder.textViewGender.setText(ReferralUtil.getTranslatedGenderString(context, Utils.getValue(pc.getColumnmaps(), DBConstants.KEY.GENDER, false))); + issuedReferralViewHolder.textViewService.setText(Utils.getValue(pc.getColumnmaps(), CoreConstants.DB_CONSTANTS.FOCUS, true)); + issuedReferralViewHolder.textViewReferralClinic.setText(getReferralClinic(Utils.getValue(pc.getColumnmaps(), org.smartregister.chw.referral.util.DBConstants.Key.PROBLEM, false))); + issuedReferralViewHolder.textViewReferralClinic.setVisibility(View.VISIBLE); + setReferralStatusColor(context, issuedReferralViewHolder.textReferralStatus, Utils.getValue(pc.getColumnmaps(), org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_STATUS, true)); + setVillageNameName(pc, issuedReferralViewHolder.textViewVillage); + attachPatientOnclickListener(viewHolder.itemView, pc); + } + + @Override + public ReferralViewHolder createViewHolder(ViewGroup parent) { + View view = inflater().inflate(R.layout.issued_referral_register_list_row, parent, false); + return new IssuedReferralViewHolder(view); + } + + + private String getReferralClinic(String key){ + switch (key.toLowerCase()){ + case "ctc": + return context.getString(R.string.ltfu_clinic_ctc); + case "pwid": + return context.getString(R.string.ltfu_clinic_pwid); + case "prep": + return context.getString(R.string.ltfu_clinic_prep); + case "pmtct": + return context.getString(R.string.ltfu_clinic_pmtct); + case "tb": + return context.getString(R.string.ltfu_clinic_tb); + default: + return removeSquareBrackets(key); + } + } + + private String removeSquareBrackets(String text){ + if(text.startsWith("[") && text.endsWith("]")){ + return text.substring(1, text.length() - 1).toUpperCase(); + } + return text.toUpperCase(); + } + + private void setReferralStatusColor(Context context, TextView textViewStatus, String status) { + switch (status) { + case Constants.BusinessStatus.EXPIRED: + textViewStatus.setTextColor( + ContextCompat.getColor(context, R.color.alert_urgent_red) + ); + textViewStatus.setText(context.getString(R.string.referral_status_failed)); + break; + case Constants.BusinessStatus.COMPLETE: + textViewStatus.setTextColor( + ContextCompat.getColor(context, R.color.alert_complete_green) + ); + textViewStatus.setText(context.getString(R.string.referral_status_successful)); + break; + default: + textViewStatus.setTextColor( + ContextCompat.getColor(context, R.color.alert_in_progress_blue) + ); + textViewStatus.setText(context.getString(R.string.referral_status_pending)); + break; + } + } + + private void setVillageNameName(CommonPersonObjectClient pc, TextView textViewVillage) { + String locationId = Utils.getValue(pc.getColumnmaps(), org.smartregister.chw.referral.util.DBConstants.Key.REFERRAL_HF, false); + LocationRepository locationRepository = new LocationRepository(); + Location location = locationRepository.getLocationById(locationId); + + if (location != null) { + textViewVillage.setText(location.getProperties().getName()); + } else { + textViewVillage.setText(locationId); + } + } + + +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/repository/HfChwRepository.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/repository/HfChwRepository.java index 8e31fbd3b..6a88cb182 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/repository/HfChwRepository.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/repository/HfChwRepository.java @@ -12,6 +12,7 @@ import org.smartregister.chw.core.utils.ChwDBConstants; import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.chw.hf.BuildConfig; +import org.smartregister.chw.hf.HealthFacilityApplication; import org.smartregister.chw.hf.dao.FamilyDao; import org.smartregister.domain.db.Column; import org.smartregister.family.util.DBConstants; @@ -24,6 +25,9 @@ import org.smartregister.util.DatabaseMigrationUtils; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; import java.util.List; import timber.log.Timber; @@ -69,10 +73,17 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { upgradeToVersion9(db); case 10: upgradeToVersion10(db); + upgradeToVersion10ForBaSouth(db); case 11: upgradeToVersion11(db); case 12: upgradeToVersion12(db); + case 13: + upgradeToVersion14(db); + case 14: + upgradeToVersion15(db); + case 16: + upgradeToVersion16(db); default: break; } @@ -165,14 +176,32 @@ private static boolean checkIfAppUpdated() { private static void upgradeToVersion7(SQLiteDatabase db) { try { - String indicatorsConfigFile = "config/indicator-definitions.yml"; - String indicatorDataInitialisedPref = "INDICATOR_DATA_INITIALISED"; ReportingLibrary reportingLibraryInstance = ReportingLibrary.getInstance(); + String indicatorDataInitialisedPref = "INDICATOR_DATA_INITIALISED"; boolean indicatorDataInitialised = Boolean.parseBoolean(reportingLibraryInstance.getContext().allSharedPreferences().getPreference(indicatorDataInitialisedPref)); boolean isUpdated = checkIfAppUpdated(); if (!indicatorDataInitialised || isUpdated) { - reportingLibraryInstance.readConfigFile(indicatorsConfigFile, db); + + String indicatorsConfigFile = "config/indicator-definitions.yml"; + String ancIndicatorConfigFile = "config/anc-reporting-indicator-definitions.yml"; + String pmtctIndicatorConfigFile = "config/pmtct-reporting-indicator-definitions.yml"; + String pncIndicatorConfigFile = "config/pnc-reporting-indicator-definitions.yml"; + String cbhsReportingIndicatorConfigFile = "config/cbhs-reporting-indicator-definitions.yml"; + String ldReportingIndicatorConfigFile = "config/ld-reporting-indicator-definitions.yml"; + String motherChampionReportingIndicatorConfigFile = "config/mother_champion-reporting-indicator-definitions.yml"; + String selfTestingIndicatorConfigFile = "config/self-testing-monthly-report.yml"; + String kvpTestingIndicatorConfigFile = "config/kvp-monthly-report.yml"; + String ltfuIndicatorConfigFile = "config/community-ltfu-summary.yml"; + + for (String configFile : Collections.unmodifiableList( + Arrays.asList(indicatorsConfigFile, ancIndicatorConfigFile, + pmtctIndicatorConfigFile, pncIndicatorConfigFile, + cbhsReportingIndicatorConfigFile, ldReportingIndicatorConfigFile, + motherChampionReportingIndicatorConfigFile,selfTestingIndicatorConfigFile,kvpTestingIndicatorConfigFile,ltfuIndicatorConfigFile))) { + reportingLibraryInstance.readConfigFile(configFile, db); + } + reportingLibraryInstance.initIndicatorData(indicatorsConfigFile, db); // This will persist the data in the DB reportingLibraryInstance.getContext().allSharedPreferences().savePreference(indicatorDataInitialisedPref, "true"); reportingLibraryInstance.getContext().allSharedPreferences().savePreference(appVersionCodePref, String.valueOf(org.smartregister.chw.core.BuildConfig.VERSION_CODE)); @@ -237,8 +266,75 @@ private static void upgradeToVersion11(SQLiteDatabase db) { private static void upgradeToVersion12(SQLiteDatabase db) { try { db.execSQL(VisitRepository.ADD_VISIT_GROUP_COLUMN); - }catch (Exception e) { + } catch (Exception e) { Timber.e(e, "upgradeToVersion12"); } } + + private static void upgradeToVersion14(SQLiteDatabase db) { + try { + // add missing columns + db.execSQL("ALTER TABLE ec_ld_confirmation ADD COLUMN blood_group TEXT NULL;"); + db.execSQL("ALTER TABLE ec_ld_confirmation ADD COLUMN rh_factor TEXT NULL;"); + } catch (Exception e) { + Timber.e(e, "upgradeToVersion14"); + } + } + + private static void upgradeToVersion15(SQLiteDatabase db) { + try { + // add missing columns + db.execSQL("ALTER TABLE ec_anc_register ADD COLUMN next_facility_visit_date TEXT NULL;"); + + db.execSQL("ALTER TABLE ec_pregnancy_outcome ADD COLUMN next_facility_visit_date TEXT NULL;"); + + db.execSQL("ALTER TABLE ec_ld_confirmation ADD COLUMN blood_group TEXT NULL;"); + db.execSQL("ALTER TABLE ec_ld_confirmation ADD COLUMN rh_factor TEXT NULL;"); + + db.execSQL("ALTER TABLE ec_cdp_orders ADD COLUMN receiving_order_facility TEXT NULL;"); + db.execSQL("ALTER TABLE ec_cdp_stock_log ADD COLUMN other_issuing_organization TEXT NULL;"); + db.execSQL("ALTER TABLE ec_cdp_stock_log ADD COLUMN condom_brand TEXT NULL;"); + + db.execSQL("ALTER TABLE ec_kvp_register ADD COLUMN client_group TEXT NULL;"); + db.execSQL("ALTER TABLE ec_kvp_register ADD COLUMN prep_assessment TEXT NULL;"); + + db.execSQL("ALTER TABLE ec_prep_register ADD COLUMN prep_status TEXT NULL;"); + db.execSQL("ALTER TABLE ec_prep_register ADD COLUMN prep_initiation_date TEXT NULL;"); + db.execSQL("ALTER TABLE ec_prep_register ADD COLUMN hbv_test_date TEXT NULL;"); + db.execSQL("ALTER TABLE ec_prep_register ADD COLUMN hcv_test_date TEXT NULL;"); + db.execSQL("ALTER TABLE ec_prep_register ADD COLUMN crcl_test_date TEXT NULL;"); + db.execSQL("ALTER TABLE ec_prep_register ADD COLUMN crcl_results TEXT NULL;"); + + + DatabaseMigrationUtils.createAddedECTables(db, + new HashSet<>(Arrays.asList("ec_cdp_issuing_hf","ec_kvp_bio_medical_services","ec_kvp_behavioral_services","ec_kvp_structural_services","ec_kvp_other_services","ec_prep_followup")), + HealthFacilityApplication.createCommonFtsObject()); + } catch (Exception e) { + Timber.e(e, "upgradeToVersion15"); + } + } + private static void upgradeToVersion16(SQLiteDatabase db) { + try { + // add missing columns + db.execSQL("ALTER TABLE ec_cbhs_register ADD COLUMN provider_id TEXT NULL;"); + db.execSQL("ALTER TABLE ec_cdp_stock_log ADD COLUMN condom_brand TEXT NULL;"); + + } catch (Exception e) { + Timber.e(e, "upgradeToVersion16"); + } + } + + private static void upgradeToVersion10ForBaSouth(SQLiteDatabase db) { + try { + db.execSQL("ALTER TABLE ec_family_member ADD COLUMN reasons_for_registration TEXT NULL;"); + db.execSQL("ALTER TABLE ec_family_member ADD COLUMN has_primary_caregiver VARCHAR;"); + db.execSQL("ALTER TABLE ec_family_member ADD COLUMN primary_caregiver_name VARCHAR;"); + + DatabaseMigrationUtils.createAddedECTables(db, + new HashSet<>(Arrays.asList("ec_hiv_register", "ec_hiv_outcome", "ec_hiv_community_followup", "ec_tb_register", "ec_tb_outcome", "ec_tb_community_followup", "ec_hiv_community_feedback", "ec_tb_community_feedback")), + HealthFacilityApplication.createCommonFtsObject()); + } catch (Exception e) { + Timber.e(e, "upgradeToVersion10"); + } + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/repository/HfLocationRepository.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/repository/HfLocationRepository.java new file mode 100644 index 000000000..aa8850487 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/repository/HfLocationRepository.java @@ -0,0 +1,52 @@ +package org.smartregister.chw.hf.repository; + +import net.sqlcipher.Cursor; + +import org.smartregister.domain.Location; +import org.smartregister.domain.LocationTag; +import org.smartregister.repository.LocationRepository; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import timber.log.Timber; + +public class HfLocationRepository extends LocationRepository { + String LOCATION_TABLE = "location"; + String LOCATION_TAG_TABLE = "location_tag"; + + public List getAllLocationsWithTags() { + List locations = new ArrayList<>(); + Cursor cursor = null; + try { + cursor = getReadableDatabase().rawQuery( + ("SELECT * FROM " + + LOCATION_TABLE + " INNER JOIN " + LOCATION_TAG_TABLE + + " on " + LOCATION_TABLE +"._id = " + LOCATION_TAG_TABLE +".location_id"), + null); + while (cursor.moveToNext()) { + locations.add(readCursor(cursor)); + } + cursor.close(); + } catch (Exception e) { + Timber.e(e); + } + return locations; + } + + @Override + protected Location readCursor(Cursor cursor) { + String geoJson = cursor.getString(cursor.getColumnIndex(GEOJSON)); + Location location = gson.fromJson(geoJson, Location.class); + int locationTagNameIndex = 6; + String tagName = cursor.getString(locationTagNameIndex); + Set locationTagSet = new HashSet<>(); + LocationTag locationTag = new LocationTag(); + locationTag.setName(tagName); + locationTagSet.add(locationTag); + location.setLocationTags(locationTagSet); + return location; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/repository/HfProfileRepository.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/repository/HfProfileRepository.java new file mode 100644 index 000000000..d99437c5a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/repository/HfProfileRepository.java @@ -0,0 +1,70 @@ +package org.smartregister.chw.hf.repository; + +import android.database.Cursor; + +import net.sqlcipher.database.SQLiteDatabase; + +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.chw.pnc.repository.ProfileRepository; +import org.smartregister.chw.pnc.util.Constants; +import org.smartregister.chw.pnc.util.PncUtil; +import org.smartregister.commonregistry.CommonPersonObjectClient; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class HfProfileRepository extends ProfileRepository { + private static final String MOHTER_ENTITY_ID = "mother_entity_id"; + + private CommonPersonObjectClient getChildMember(Cursor cursor) { + String[] columnNames = cursor.getColumnNames(); + Map details = new HashMap<>(); + + for (String columnName : columnNames) { + details.put(columnName, cursor.getString(cursor.getColumnIndex(columnName))); + } + + CommonPersonObjectClient commonPersonObject = new CommonPersonObjectClient("", details, ""); + commonPersonObject.setColumnmaps(details); + commonPersonObject.setCaseId(cursor.getString(cursor.getColumnIndex(DBConstants.KEY.BASE_ENTITY_ID))); + + return commonPersonObject; + + } + + + public List getChildrenLessThan49DaysOld(String motherBaseEntityID) { + List childMemberObjects = new ArrayList<>(); + + SQLiteDatabase database = getReadableDatabase(); + net.sqlcipher.Cursor cursor = null; + try { + if (database == null) { + return null; + } + cursor = database.rawQuery("SELECT * fROM " + Constants.TABLES.EC_CHILD + " WHERE " + MOHTER_ENTITY_ID + "=? AND is_closed = 0 ORDER by first_name ASC", + new String[]{motherBaseEntityID}); + if (cursor != null && cursor.getCount() > 0 && cursor.moveToFirst()) { + while (!cursor.isAfterLast()) { + String dob = cursor.getString(cursor.getColumnIndex(DBConstants.KEY.DOB)); + int childAgeInDays = PncUtil.getDaysDifference(dob); + if (childAgeInDays < 49) { + childMemberObjects.add(getChildMember(cursor)); + } + cursor.moveToNext(); + } + } + } catch (Exception e) { + Timber.e(e); + } finally { + if (cursor != null) { + cursor.close(); + } + } + return childMemberObjects; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/repository/HfTaskRepository.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/repository/HfTaskRepository.java index 15630e5ea..7196088ea 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/repository/HfTaskRepository.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/repository/HfTaskRepository.java @@ -1,13 +1,19 @@ package org.smartregister.chw.hf.repository; +import static org.smartregister.util.Utils.getAllSharedPreferences; + import net.sqlcipher.Cursor; import org.smartregister.chw.core.repository.ChwTaskRepository; import org.smartregister.chw.core.utils.ChwDBConstants; import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.domain.Task; +import org.smartregister.repository.AllSharedPreferences; import org.smartregister.repository.TaskNotesRepository; +import java.util.HashSet; +import java.util.Set; + import timber.log.Timber; public class HfTaskRepository extends ChwTaskRepository { @@ -17,11 +23,14 @@ public HfTaskRepository(TaskNotesRepository taskNotesRepository) { } public Task getLatestTaskByEntityId(String forEntity, String referralType) { + AllSharedPreferences allSharedPreferences = getAllSharedPreferences(); + String anmIdentifier = allSharedPreferences.fetchRegisteredANM(); + Task task = new Task(); - try (Cursor cursor = getReadableDatabase().rawQuery(String.format("SELECT * FROM %s WHERE %s = ? AND %s = ? AND %s = ? AND %s = ? ORDER BY %s DESC LIMIT 1", - TASK_TABLE, ChwDBConstants.TaskTable.BUSINESS_STATUS, ChwDBConstants.TaskTable.STATUS, - TASK_TABLE + "." + ChwDBConstants.TaskTable.FOR, ChwDBConstants.TaskTable.FOCUS, ChwDBConstants.TaskTable.START), - new String[]{CoreConstants.BUSINESS_STATUS.REFERRED, Task.TaskStatus.READY.name(), forEntity, referralType})) { + try (Cursor cursor = getReadableDatabase().rawQuery(String.format("SELECT * FROM %s WHERE %s = ? AND %s = ? AND %s = ? AND %s = ? AND %s <> ? ORDER BY %s DESC LIMIT 1", + TASK_TABLE, ChwDBConstants.TaskTable.BUSINESS_STATUS, ChwDBConstants.TaskTable.STATUS, + TASK_TABLE + "." + ChwDBConstants.TaskTable.FOR, ChwDBConstants.TaskTable.FOCUS, ChwDBConstants.TaskTable.LOCATION, ChwDBConstants.TaskTable.START), + new String[]{CoreConstants.BUSINESS_STATUS.REFERRED, Task.TaskStatus.READY.name(), forEntity, referralType, allSharedPreferences.fetchUserLocalityId(anmIdentifier)})) { if (cursor.moveToFirst()) { task = readCursor(cursor); } @@ -30,4 +39,27 @@ public Task getLatestTaskByEntityId(String forEntity, String referralType) { } return task; } + + @Override + public Set getReferralTasksForClientByStatus(String planId, String forEntity, String businessStatus) { + AllSharedPreferences allSharedPreferences = getAllSharedPreferences(); + String anm = allSharedPreferences.fetchRegisteredANM(); + + Cursor cursor = null; + Set taskSet = new HashSet<>(); + try { + cursor = getReadableDatabase().rawQuery(String.format("SELECT * FROM %s WHERE %s=? COLLATE NOCASE AND %s =? AND %s = ? COLLATE NOCASE AND code = 'Referral' AND %s <> ? ", + TASK_TABLE, CoreConstants.DB_CONSTANTS.PLAN_ID, CoreConstants.DB_CONSTANTS.BUSINESS_STATUS, CoreConstants.DB_CONSTANTS.FOR, CoreConstants.DB_CONSTANTS.OWNER), new String[]{planId, businessStatus, forEntity, anm}); + while (cursor.moveToNext()) { + Task task = readCursor(cursor); + taskSet.add(task); + } + } catch (Exception e) { + Timber.e(e); + } finally { + if (cursor != null) + cursor.close(); + } + return taskSet; + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/rule/AncVisitAlertRule.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/rule/AncVisitAlertRule.java new file mode 100644 index 000000000..5f5056473 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/rule/AncVisitAlertRule.java @@ -0,0 +1,202 @@ +package org.smartregister.chw.hf.rule; + +import android.content.Context; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.Days; +import org.joda.time.LocalDate; +import org.joda.time.Months; +import org.joda.time.format.DateTimeFormat; +import org.joda.time.format.DateTimeFormatter; +import org.smartregister.chw.core.R; +import org.smartregister.chw.core.contract.RegisterAlert; +import org.smartregister.chw.core.interactor.CoreChildProfileInteractor; +import org.smartregister.chw.core.rule.ICommonRule; + +import java.text.SimpleDateFormat; +import java.util.Date; + +public class AncVisitAlertRule implements ICommonRule, RegisterAlert { + + private final int[] monthNames = {R.string.january, R.string.february, R.string.march, R.string.april, R.string.may, R.string.june, R.string.july, R.string.august, R.string.september, R.string.october, R.string.november, R.string.december}; + public String buttonStatus = CoreChildProfileInteractor.VisitType.DUE.name(); + public String noOfMonthDue; + public String noOfDayDue; + public String visitMonthName; + private LocalDate dateCreated; + private LocalDate todayDate; + private LocalDate lastVisitDate; + private LocalDate visitNotDoneDate; + private Context context; + + + public AncVisitAlertRule(Context context, String lmpDate, String visitDate, String visitNotDoneDate, LocalDate dateCreated) { + this.context = context; + + DateTimeFormatter formatter = DateTimeFormat.forPattern("dd-MM-yyyy"); + LocalDate lmpDate1 = formatter.parseDateTime(lmpDate).toLocalDate(); + + this.todayDate = new LocalDate(); + if (StringUtils.isNotBlank(visitDate)) { + this.lastVisitDate = formatter.parseDateTime(visitDate).toLocalDate(); + } + + noOfDayDue = ((lastVisitDate == null) ? dayDifference(lmpDate1, todayDate) : dayDifference(lastVisitDate, todayDate)) + " days"; + + if (StringUtils.isNotBlank(visitNotDoneDate)) { + this.visitNotDoneDate = formatter.parseDateTime(visitNotDoneDate).toLocalDate(); + } + + this.dateCreated = dateCreated; + } + + private int dayDifference(LocalDate date1, LocalDate date2) { + return Days.daysBetween(date1, date2).getDays(); + } + + @Override + public String getNumberOfMonthsDue() { + return noOfMonthDue; + } + + @Override + public String getNumberOfDaysDue() { + return noOfDayDue; + } + + @Override + public String getVisitMonthName() { + return visitMonthName; + } + + public boolean isVisitNotDone() { + return (visitNotDoneDate != null && getMonthsDifference(visitNotDoneDate, todayDate) < 1); + } + + private int getMonthsDifference(LocalDate date1, LocalDate date2) { + return Months.monthsBetween( + date1.withDayOfMonth(1), + date2.withDayOfMonth(1)).getMonths(); + } + + // never expire + public boolean isExpiry() { + //return (lmpDate != null) && Months.monthsBetween(lmpDate, todayDate).getMonths() > 11; + return false; + } + + public boolean isOverdueWithinMonth(Integer value) { + LocalDate overdue = LocalDate.parse(new SimpleDateFormat("yyyy-MM-dd").format(getOverDueDate())); + int diff = getMonthsDifference(overdue, todayDate); + if (diff >= value) { + noOfMonthDue = diff + "M"; + return true; + } + return false; + } + + public boolean isDueWithinMonth() { + if (todayDate.getDayOfMonth() == 1) { + return true; + } + if (lastVisitDate == null) { + return !isVisitThisMonth(dateCreated, todayDate); + } + + return !isVisitThisMonth(lastVisitDate, todayDate); + } + + private Date getFirstDayOfMonth(Date refDate) { + return new DateTime(refDate).withDayOfMonth(1).toDate(); + } + + /** + * visit is due the first day of the month + * + * @return + */ + public Date getDueDate() { + Date lastDueDate = getLastDueDate(); + if (lastDueDate.getTime() < getFirstDayOfMonth(new Date()).getTime()) { + return getFirstDayOfMonth(new Date()); + } else { + return lastDueDate; + } + } + + private Date getLastDueDate() { + if (lastVisitDate != null && getFirstDayOfMonth(lastVisitDate.toDate()).getTime() < dateCreated.toDate().getTime()) { + return getFirstDayOfMonth(lastVisitDate.toDate()); + } else { + return dateCreated.toDate(); + } + } + + public Date getCompletionDate() { + if (lastVisitDate != null && lastVisitDate.toDate().getTime() >= getDueDate().getTime()) { + return lastVisitDate.toDate(); + } + return null; + } + + public Date getExpiryDate() { + return getLastDayOfMonth(new Date()); + } + + public Date getOverDueDate() { + if (lastVisitDate == null) { + return (visitNotDoneDate != null) ? visitNotDoneDate.toDate() : getLastDayOfMonth(dateCreated.toDate()); + } else { + + if (visitNotDoneDate == null || lastVisitDate.isAfter(visitNotDoneDate)) { + int monthsDiff = getMonthsDifference(lastVisitDate, todayDate); + return monthsDiff > 1 ? getLastDayOfMonth(lastVisitDate.toDate()) : getLastDayOfMonth(todayDate.toDate()); + } else if (visitNotDoneDate != null) { + return visitNotDoneDate.toDate(); + } else { + return getLastDayOfMonth(lastVisitDate.toDate()); + } + } + } + + protected Date getLastDayOfMonth(Date refDate) { + DateTime first = new DateTime(refDate).withDayOfMonth(1); + return first.plusMonths(1).minusDays(1).toDate(); + } + + private boolean isVisitThisMonth(LocalDate lastVisit, LocalDate todayDate) { + return getMonthsDifference(lastVisit, todayDate) < 1; + } + + public boolean isVisitWithinTwentyFour() { + visitMonthName = theMonth(todayDate.getMonthOfYear() - 1); + noOfDayDue = context.getString(R.string.less_than_twenty_four); + return (lastVisitDate != null) && !(lastVisitDate.isBefore(todayDate.minusDays(1)) && lastVisitDate.isBefore(todayDate)); + } + + private String theMonth(int month) { + return context.getResources().getString(monthNames[month]); + } + + public boolean isVisitWithinThisMonth() { + return (lastVisitDate != null) && isVisitThisMonth(lastVisitDate, todayDate); + } + + public Date getNotDoneDate() { + if (getCompletionDate() == null && visitNotDoneDate != null) { + return visitNotDoneDate.toDate().getTime() >= getDueDate().getTime() ? visitNotDoneDate.toDate() : null; + } + return null; + } + + @Override + public String getRuleKey() { + return "ancVisitAlertRule"; + } + + @Override + public String getButtonStatus() { + return buttonStatus; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/rule/HfHeiFollowupRule.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/rule/HfHeiFollowupRule.java new file mode 100644 index 000000000..e7849b3e4 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/rule/HfHeiFollowupRule.java @@ -0,0 +1,39 @@ +package org.smartregister.chw.hf.rule; + +import androidx.annotation.Nullable; + +import org.joda.time.DateTime; +import org.joda.time.Days; +import org.smartregister.chw.core.rule.HeiFollowupRule; + +import java.util.Date; + +public class HfHeiFollowupRule extends HeiFollowupRule { + public HfHeiFollowupRule(Date startDate, @Nullable Date latestFollowupDate, String baseEntityId) { + super(startDate, latestFollowupDate, baseEntityId); + } + + @Override + public void updateDueDates() { + + if (isFirstVisit()) { + this.dueDate = startDate.plusDays(0); + this.overDueDate = startDate.plusDays(7); + } else if (latestFollowupDate != null) { + this.dueDate = latestFollowupDate.plusDays(0); + this.overDueDate = latestFollowupDate.plusDays(7); + } else { + this.dueDate = startDate.plusDays(30); + this.overDueDate = startDate.plusDays(37); + } + } + + @Override + public int getDatesDiff() { + + if (isFirstVisit()) { + return Days.daysBetween(new DateTime(startDate), new DateTime()).getDays(); + } else + return Days.daysBetween(new DateTime(this.dueDate), new DateTime()).getDays(); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/rule/HfPmtctFollowupRule.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/rule/HfPmtctFollowupRule.java new file mode 100644 index 000000000..ced3b0f74 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/rule/HfPmtctFollowupRule.java @@ -0,0 +1,84 @@ +package org.smartregister.chw.hf.rule; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.smartregister.chw.core.rule.PmtctFollowUpRule; +import org.smartregister.chw.core.utils.CoreConstants; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; + +public class HfPmtctFollowupRule extends PmtctFollowUpRule { + private final String baseEntityId; + @NonNull + private DateTime pmtctDate; + @Nullable + private DateTime latestFollowUpDate; + private DateTime dueDate; + private DateTime overDueDate; + private DateTime expiryDate; + + public HfPmtctFollowupRule(Date pmtctDate, @Nullable Date latestFollowupDate, String baseEntityId) { + super(pmtctDate, latestFollowupDate, baseEntityId); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()); + this.pmtctDate = new DateTime(sdf.format(pmtctDate)); + this.baseEntityId = baseEntityId; + this.latestFollowUpDate = latestFollowupDate == null ? null : new DateTime(sdf.format(latestFollowupDate)); + updateDueDates(); + } + + @Override + public boolean isValid(int dueDay, int overDueDay, int expiry) { + //using the updateDueDates method to update the dueDate and overDueDate for faster refresh + return false; + } + + public void updateDueDates(){ + if (latestFollowUpDate != null) { + this.dueDate = latestFollowUpDate.plusDays(0); + this.overDueDate = latestFollowUpDate.plusDays(32); + this.expiryDate = latestFollowUpDate.plusDays(356); + } else { + this.dueDate = pmtctDate.plusDays(0); + this.overDueDate = pmtctDate.plusDays(32); + this.expiryDate = pmtctDate.plusDays(356); + } + } + + @Override + public String getBaseEntityId() { + return baseEntityId; + } + + public Date getDueDate() { + return dueDate != null ? dueDate.toDate() : null; + } + + public Date getOverDueDate() { + return overDueDate != null ? overDueDate.toDate() : null; + } + + @Override + public String getButtonStatus() { + DateTime currentDate = new DateTime(new LocalDate().toDate()); + DateTime lastVisit = latestFollowUpDate; + + if (currentDate.isBefore(expiryDate)) { + if ((currentDate.isAfter(overDueDate) || currentDate.isEqual(overDueDate))) + return CoreConstants.VISIT_STATE.OVERDUE; + if ((currentDate.isAfter(dueDate) || currentDate.isEqual(dueDate)) && currentDate.isBefore(overDueDate)) + return CoreConstants.VISIT_STATE.DUE; + if (lastVisit != null && currentDate.isEqual(lastVisit)) + return CoreConstants.VISIT_STATE.VISIT_DONE; + return CoreConstants.VISIT_STATE.NOT_DUE_YET; + + } + return CoreConstants.VISIT_STATE.EXPIRED; + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/schedulers/BaseTaskExecutor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/schedulers/BaseTaskExecutor.java new file mode 100644 index 000000000..3cda5b097 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/schedulers/BaseTaskExecutor.java @@ -0,0 +1,50 @@ +package org.smartregister.chw.hf.schedulers; + +import org.joda.time.LocalDate; +import org.smartregister.chw.core.contract.ScheduleService; +import org.smartregister.chw.core.contract.ScheduleTask; +import org.smartregister.chw.core.domain.BaseScheduleTask; +import org.smartregister.chw.hf.HealthFacilityApplication; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.UUID; + +public abstract class BaseTaskExecutor implements ScheduleService { + + @Override + public void scheduleMaintenance() { + LocalDate localDate = new LocalDate(); + localDate.plusDays(-31); + + HealthFacilityApplication.getInstance().getScheduleRepository().deleteSchedulesByName(getScheduleName(), localDate.toDate()); + } + + @Override + public void resetSchedule(String baseEntityID, String scheduleName) { + // delete from the repo all the old schedules by this name + HealthFacilityApplication.getInstance().getScheduleRepository().deleteScheduleByName(scheduleName, baseEntityID); + } + + protected BaseScheduleTask prepareNewTaskObject(String baseEntityID) { + BaseScheduleTask baseScheduleTask = new BaseScheduleTask(); + baseScheduleTask.setBaseEntityID(baseEntityID); + baseScheduleTask.setCreatedAt(new Date()); + baseScheduleTask.setUpdatedAt(new Date()); + baseScheduleTask.setID(UUID.randomUUID().toString()); + baseScheduleTask.setScheduleName(getScheduleName()); + baseScheduleTask.setScheduleGroupName(getScheduleGroup()); + return baseScheduleTask; + } + + protected List toScheduleList(ScheduleTask task, ScheduleTask... tasks) { + List res = new ArrayList<>(); + res.add(task); + if (tasks != null && tasks.length > 0) + res.addAll(Arrays.asList(tasks)); + + return res; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/schedulers/HfScheduleTaskExecutor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/schedulers/HfScheduleTaskExecutor.java new file mode 100644 index 000000000..cf1a78c8f --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/schedulers/HfScheduleTaskExecutor.java @@ -0,0 +1,66 @@ +package org.smartregister.chw.hf.schedulers; + +import static org.smartregister.chw.hf.utils.Constants.Events.ANC_FACILITY_VISIT_NOT_DONE; +import static org.smartregister.chw.hf.utils.Constants.Events.ANC_FACILITY_VISIT_NOT_DONE_UNDO; +import static org.smartregister.chw.hf.utils.Constants.Events.ANC_FIRST_FACILITY_VISIT; +import static org.smartregister.chw.hf.utils.Constants.Events.ANC_RECURRING_FACILITY_VISIT; + +import org.smartregister.chw.core.contract.ScheduleService; +import org.smartregister.chw.core.schedulers.ScheduleTaskExecutor; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.task.ANCVisitScheduler; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class HfScheduleTaskExecutor extends ScheduleTaskExecutor { + + private static HfScheduleTaskExecutor scheduleTaskExecutor; + + protected HfScheduleTaskExecutor() { + //scheduleServiceMap.put(); + } + + public static HfScheduleTaskExecutor getInstance() { + if (scheduleTaskExecutor == null) { + scheduleTaskExecutor = new HfScheduleTaskExecutor(); + } + return scheduleTaskExecutor; + } + + @Override + protected Map> getClassifier() { + if (scheduleServiceMap == null || scheduleServiceMap.size() == 0) { + scheduleServiceMap = new HashMap<>(); + + initializeANCClassifier(scheduleServiceMap); + + + } + return scheduleServiceMap; + } + + private void addToClassifers(String eventType, Map> classifier, List scheduleServices) { + List services = classifier.get(eventType); + if (services == null) + services = new ArrayList<>(); + + services.addAll(scheduleServices); + classifier.put(eventType, services); + } + + private void initializeANCClassifier(Map> classifier) { + List scheduleServices = new ArrayList<>(); + scheduleServices.add(new ANCVisitScheduler()); + + addToClassifers(CoreConstants.EventType.ANC_REGISTRATION, classifier, scheduleServices); + addToClassifers(ANC_FIRST_FACILITY_VISIT, classifier, scheduleServices); + addToClassifers(ANC_RECURRING_FACILITY_VISIT, classifier, scheduleServices); + addToClassifers(ANC_FACILITY_VISIT_NOT_DONE, classifier, scheduleServices); + addToClassifers(ANC_FACILITY_VISIT_NOT_DONE_UNDO, classifier, scheduleServices); + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/HfClientProcessor.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/HfClientProcessor.java index 10cb2869b..85ddf4214 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/HfClientProcessor.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/HfClientProcessor.java @@ -1,10 +1,48 @@ package org.smartregister.chw.hf.sync; +import static org.smartregister.chw.anc.util.Constants.EVENT_TYPE.DELETE_EVENT; +import static org.smartregister.chw.core.utils.CoreConstants.EventType.ANC_FOLLOWUP_CLIENT_REGISTRATION; +import static org.smartregister.chw.core.utils.CoreConstants.EventType.ANC_PARTNER_TESTING; +import static org.smartregister.chw.core.utils.CoreConstants.EventType.ANC_PREGNANCY_CONFIRMATION; +import static org.smartregister.chw.hf.utils.Constants.Events.ANC_FIRST_FACILITY_VISIT; +import static org.smartregister.chw.hf.utils.Constants.Events.ANC_RECURRING_FACILITY_VISIT; +import static org.smartregister.chw.hf.utils.Constants.Events.HEI_FOLLOWUP; +import static org.smartregister.chw.hf.utils.Constants.Events.HEI_NEGATIVE_INFANT; +import static org.smartregister.chw.hf.utils.Constants.Events.HEI_POSITIVE_INFANT; +import static org.smartregister.chw.hf.utils.Constants.Events.LD_ACTIVE_MANAGEMENT_OF_3RD_STAGE_OF_LABOUR; +import static org.smartregister.chw.hf.utils.Constants.Events.LD_GENERAL_EXAMINATION; +import static org.smartregister.chw.hf.utils.Constants.Events.LD_PARTOGRAPHY; +import static org.smartregister.chw.hf.utils.Constants.Events.LD_POST_DELIVERY_MOTHER_MANAGEMENT; +import static org.smartregister.chw.hf.utils.Constants.Events.LD_REGISTRATION; +import static org.smartregister.chw.hf.utils.Constants.Events.PNC_CHILD_FOLLOWUP; +import static org.smartregister.chw.hf.utils.Constants.Events.PNC_VISIT; +import static org.smartregister.chw.hf.utils.Constants.FormConstants.FormSubmissionFields.CTC_NUMBER; +import static org.smartregister.chw.hf.utils.Constants.FormConstants.FormSubmissionFields.HIV_TEST_RESULT; +import static org.smartregister.chw.hf.utils.Constants.FormConstants.FormSubmissionFields.HIV_TEST_RESULT_DATE; +import static org.smartregister.chw.hf.utils.Constants.FormConstants.FormSubmissionFields.TYPE_OF_HIV_TEST; + import android.content.Context; +import org.apache.commons.lang3.StringUtils; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.core.dao.EventDao; import org.smartregister.chw.core.sync.CoreClientProcessor; +import org.smartregister.chw.hf.dao.HeiDao; +import org.smartregister.chw.hf.dao.HfPmtctDao; +import org.smartregister.chw.pmtct.util.Constants; +import org.smartregister.domain.Event; +import org.smartregister.domain.Obs; +import org.smartregister.domain.db.EventClient; +import org.smartregister.domain.jsonmapping.ClientClassification; +import org.smartregister.domain.jsonmapping.Table; import org.smartregister.sync.ClientProcessorForJava; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import timber.log.Timber; + public class HfClientProcessor extends CoreClientProcessor { private HfClientProcessor(Context context) { @@ -28,4 +66,146 @@ public boolean saveReportDateSent() { return false; } + @Override + protected void processEvents(ClientClassification clientClassification, Table vaccineTable, Table serviceTable, EventClient eventClient, Event event, String eventType) throws Exception { + super.processEvents(clientClassification, vaccineTable, serviceTable, eventClient, event, eventType); + + switch (eventType) { + case ANC_PREGNANCY_CONFIRMATION: + case ANC_FOLLOWUP_CLIENT_REGISTRATION: + case ANC_FIRST_FACILITY_VISIT: + case ANC_RECURRING_FACILITY_VISIT: + case PNC_VISIT: + case PNC_CHILD_FOLLOWUP: + case LD_PARTOGRAPHY: + case LD_REGISTRATION: + case LD_ACTIVE_MANAGEMENT_OF_3RD_STAGE_OF_LABOUR: + case LD_GENERAL_EXAMINATION: + case LD_POST_DELIVERY_MOTHER_MANAGEMENT: + case ANC_PARTNER_TESTING: + case org.smartregister.chw.kvp.util.Constants.EVENT_TYPE.KVP_BEHAVIORAL_SERVICE_VISIT: + case org.smartregister.chw.kvp.util.Constants.EVENT_TYPE.KVP_BIO_MEDICAL_SERVICE_VISIT: + case org.smartregister.chw.kvp.util.Constants.EVENT_TYPE.KVP_STRUCTURAL_SERVICE_VISIT: + case org.smartregister.chw.kvp.util.Constants.EVENT_TYPE.KVP_OTHER_SERVICE_VISIT: + case org.smartregister.chw.kvp.util.Constants.EVENT_TYPE.PrEP_FOLLOWUP_VISIT: + case Constants.EVENT_TYPE.PMTCT_FOLLOWUP: + if (eventClient.getEvent() == null) { + return; + } + processVisitEvent(eventClient); + processEvent(eventClient.getEvent(), eventClient.getClient(), clientClassification); + break; + case HEI_FOLLOWUP: + case HEI_POSITIVE_INFANT: + case HEI_NEGATIVE_INFANT: + processVisitEvent(eventClient); + processEvent(eventClient.getEvent(), eventClient.getClient(), clientClassification); + processHeiFollowupCEvent(eventClient.getEvent()); + break; + + case org.smartregister.chw.ld.util.Constants.EVENT_TYPE.VOID_EVENT: + case DELETE_EVENT: + processDeleteEvent(eventClient.getEvent()); + default: + break; + } + + } + + private void processVisitEvent(EventClient eventClient) { + try { + NCUtils.processHomeVisit(eventClient); // save locally + } catch (Exception e) { + String formID = (eventClient != null && eventClient.getEvent() != null) ? eventClient.getEvent().getFormSubmissionId() : "no form id"; + Timber.e("Form id " + formID + ". " + e.toString()); + } + } + + @Override + protected String getHumanReadableConceptResponse(String value, Object object) { + try { + if (StringUtils.isBlank(value) || (object != null && !(object instanceof Obs))) { + return value; + } + // Skip human readable values and just get values which would aid in translations + final String VALUES = "values"; + List values = new ArrayList(); + + Object valueObject = getValue(object, VALUES); + if (valueObject instanceof List) { + values = (List) valueObject; + } + if (object == null || values.isEmpty()) { + return value; + } + + return values.size() == 1 ? values.get(0).toString() : values.toString(); + + } catch (Exception e) { + Timber.e(e); + } + return value; + } + + private void processHeiFollowupCEvent(Event event) { + List heiFollowupObs = event.getObs(); + String typeOfHivTest = null; + String hivTestResult = null; + String hivTestResultDate = null; + String ctcNumber = null; + if (heiFollowupObs.size() > 0) { + for (Obs obs : heiFollowupObs) { + if (TYPE_OF_HIV_TEST.equals(obs.getFormSubmissionField())) { + typeOfHivTest = (String) obs.getValue(); + } else if (HIV_TEST_RESULT.equals(obs.getFormSubmissionField())) { + hivTestResult = (String) obs.getValue(); + } else if (HIV_TEST_RESULT_DATE.equals(obs.getFormSubmissionField())) { + hivTestResultDate = (String) obs.getValue(); + } else if (CTC_NUMBER.equals(obs.getFormSubmissionField())) { + ctcNumber = (String) obs.getValue(); + } + } + + if (typeOfHivTest != null && typeOfHivTest.equals("Antibody Test")) + HeiDao.saveAntiBodyTestResults(event.getBaseEntityId(), event.getFormSubmissionId(), hivTestResult, hivTestResultDate, ctcNumber); + } + } + + @Override + public void processDeleteEvent(Event event) { + try { + List pmtctFollowupTables = Arrays.asList("ec_ld_partograph", "ec_pmtct_followup", "ec_pmtct_hvl_results", "ec_pmtct_cd4_results", "ec_hei_followup", "ec_hei_hiv_results", "ec_anc_followup", "ec_pnc_followup", "ec_prep_followup"); + if (event.getDetails().containsKey(org.smartregister.chw.anc.util.Constants.JSON_FORM_EXTRA.DELETE_FORM_SUBMISSION_ID)) { + // delete from vaccine table + EventDao.deleteVaccineByFormSubmissionId(event.getDetails().get(org.smartregister.chw.anc.util.Constants.JSON_FORM_EXTRA.DELETE_FORM_SUBMISSION_ID)); + // delete from visit table + EventDao.deleteVisitByFormSubmissionId(event.getDetails().get(org.smartregister.chw.anc.util.Constants.JSON_FORM_EXTRA.DELETE_FORM_SUBMISSION_ID)); + // delete from recurring service table + EventDao.deleteServiceByFormSubmissionId(event.getDetails().get(org.smartregister.chw.anc.util.Constants.JSON_FORM_EXTRA.DELETE_FORM_SUBMISSION_ID)); + + //delete from all PMTCT Case Based Management tables that use formSubmissionIds as primaryKeys + for (String tableName : pmtctFollowupTables) { + try { + HfPmtctDao.deleteEntryFromTableByFormSubmissionId(tableName, event.getDetails().get(org.smartregister.chw.anc.util.Constants.JSON_FORM_EXTRA.DELETE_FORM_SUBMISSION_ID)); + } catch (Exception e) { + Timber.e(e); + } + } + } else { + super.processDeleteEvent(event); + //delete from all PMTCT Case Based Management tables that use formSubmissionIds as primaryKeys + for (String tableName : pmtctFollowupTables) { + try { + HfPmtctDao.deleteEntryFromTableByFormSubmissionId(tableName, event.getFormSubmissionId()); + } catch (Exception e) { + Timber.e(e); + } + } + } + + Timber.d("Ending processDeleteEvent: %s", event.getEventId()); + } catch (Exception e) { + Timber.e(e); + } + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/HfSyncConfiguration.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/HfSyncConfiguration.java index e2674c24d..c06431d25 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/HfSyncConfiguration.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/HfSyncConfiguration.java @@ -5,13 +5,16 @@ import org.smartregister.SyncFilter; import org.smartregister.chw.hf.BuildConfig; -import java.util.Collections; +import java.util.Arrays; import java.util.List; /** * @author Elly Nerdstone */ public class HfSyncConfiguration extends SyncConfiguration { + private int connectTimeout = 900000; + private int readTimeout = 900000; + @Override public int getSyncMaxRetries() { return BuildConfig.MAX_SYNC_RETRIES; @@ -60,11 +63,21 @@ public boolean updateClientDetailsTable() { @Override public List getSynchronizedLocationTags() { - return Collections.emptyList(); + return Arrays.asList("Facility"); } @Override public String getTopAllowedLocationLevel() { - return ""; + return "Country"; + } + + @Override + public int getReadTimeout() { + return connectTimeout; + } + + @Override + public int getConnectTimeout() { + return readTimeout; } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/helper/HfTaskServiceHelper.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/helper/HfTaskServiceHelper.java index 7148056f5..a7b719165 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/helper/HfTaskServiceHelper.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/helper/HfTaskServiceHelper.java @@ -1,14 +1,14 @@ package org.smartregister.chw.hf.sync.helper; +import androidx.annotation.NonNull; + import org.smartregister.CoreLibrary; import org.smartregister.chw.core.utils.CoreConstants; -import org.smartregister.chw.hf.BuildConfig; import org.smartregister.location.helper.LocationHelper; import org.smartregister.repository.TaskRepository; import org.smartregister.sync.helper.TaskServiceHelper; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Set; @@ -31,15 +31,18 @@ public static HfTaskServiceHelper getInstance() { @Override protected List getLocationIds() { LocationHelper locationHelper = LocationHelper.getInstance(); - ArrayList allowedLevels = new ArrayList<>(Arrays.asList(BuildConfig.FACILITY_LEVEL)); - List locations = new ArrayList<>(); + return getLocationsInHierarchy(locationHelper); + } + + @NonNull + private ArrayList getLocationsInHierarchy(LocationHelper locationHelper) { + ArrayList locations = new ArrayList<>(); if (locationHelper != null) { - List locationIds = locationHelper.generateDefaultLocationHierarchy(allowedLevels); - if (locationIds != null) { - for (String locationName : locationIds) { - locations.add(locationHelper.getOpenMrsLocationId(locationName)); - } - } + //This would return the location and its sub-levels based off the allowed locations i.e Council, Ward, Facility, Village + //If a referral exists in any of the location hierarchy as group id it would be synced. + String defaultLocation = locationHelper.getDefaultLocation(); + List locationsFromHierarchy = locationHelper.locationsFromHierarchy(true, defaultLocation); + locations.addAll(locationsFromHierarchy); } return locations; } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/HfSyncClientEventsPerTaskIntentService.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/HfSyncClientEventsPerTaskIntentService.java new file mode 100644 index 000000000..a15a50161 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/HfSyncClientEventsPerTaskIntentService.java @@ -0,0 +1,69 @@ +package org.smartregister.chw.hf.sync.intent; + +import android.content.Intent; + +import com.google.gson.Gson; + +import org.json.JSONArray; +import org.json.JSONObject; +import org.smartregister.chw.core.sync.intent.SyncClientEventsPerTaskIntentService; +import org.smartregister.chw.hf.dao.LDDao; +import org.smartregister.domain.FetchStatus; +import org.smartregister.domain.Response; + +import java.util.List; + +import timber.log.Timber; + +public class HfSyncClientEventsPerTaskIntentService extends SyncClientEventsPerTaskIntentService { + @Override + protected void onHandleIntent(Intent intent) { + super.onHandleIntent(intent); + List motherBaseEntityIds = LDDao.getBaseEntityIdsOfMothersForChildrenWithEmergencyReferrals(); + + if (motherBaseEntityIds != null) { + try { + JSONArray baseEntityIds = new JSONArray(new Gson().toJson(motherBaseEntityIds)); + if (baseEntityIds.length() > 0) + fetchEventsForBaseEntityIds(baseEntityIds); + } catch (Exception e) { + Timber.e(e); + } + } + } + + public synchronized void fetchEventsForBaseEntityIds(JSONArray baseEntityIds) { + Timber.i("Mother's Base Entity ids with missing Events = %s", baseEntityIds.toString()); + + try { + if (getHttpAgent() == null) { + complete(FetchStatus.fetchedFailed); + return; + } + + Response resp = fetchClientEventsByBaseEntityIds(baseEntityIds); + if (resp.isTimeoutError() || resp.isUrlError()) { + FetchStatus.fetchedFailed.setDisplayValue(resp.status().displayValue()); + complete(FetchStatus.fetchedFailed); + return; + } else if (resp.isFailure()) { + fetchEventsForBaseEntityIds(baseEntityIds); + return; + } + + JSONObject jsonObject = new JSONObject((String) resp.payload()); + int eCount = fetchNumberOfEvents(jsonObject); + if (eCount < 0) { + fetchEventsForBaseEntityIds(baseEntityIds); + return; + } else { + processClientEvent(jsonObject); //Process the client and his/her events + } + } catch (Exception e) { + Timber.e(e, "Fetch Retry Exception: %s", e.getMessage()); + fetchEventsForBaseEntityIds(baseEntityIds); + } + complete(FetchStatus.fetched); + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/HfSyncTaskIntentService.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/HfSyncTaskIntentService.java index 36f8ff47b..2fa2afca2 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/HfSyncTaskIntentService.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/HfSyncTaskIntentService.java @@ -10,6 +10,7 @@ public class HfSyncTaskIntentService extends SyncTaskIntentService { @Override protected void onHandleIntent(Intent intent) { + super.onHandleIntent(intent); HfTaskServiceHelper taskServiceHelper = HfTaskServiceHelper.getInstance(); taskServiceHelper.syncTasks(); SyncTaskWithClientEventsServiceJob.scheduleJobImmediately(SyncTaskWithClientEventsServiceJob.TAG); diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/MarkPmtctAndHeiLtfIntentService.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/MarkPmtctAndHeiLtfIntentService.java new file mode 100644 index 000000000..f977d7811 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/MarkPmtctAndHeiLtfIntentService.java @@ -0,0 +1,188 @@ +package org.smartregister.chw.hf.sync.intent; + +import android.app.IntentService; +import android.content.Intent; + +import org.json.JSONObject; +import org.smartregister.chw.core.application.CoreChwApplication; +import org.smartregister.chw.core.dao.ChwNotificationDao; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.Utils; +import org.smartregister.chw.hf.dao.HeiDao; +import org.smartregister.chw.hf.dao.HfPmtctDao; +import org.smartregister.chw.hf.utils.Constants; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.clientandeventmodel.Obs; +import org.smartregister.family.FamilyLibrary; +import org.smartregister.repository.AllSharedPreferences; +import org.smartregister.sync.helper.ECSyncHelper; +import org.smartregister.util.JsonFormUtils; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; + +import timber.log.Timber; + +/** + * Created by cozej4 on 2022-03-24. + * + * @author cozej4 https://github.com/cozej4 + */ +public class MarkPmtctAndHeiLtfIntentService extends IntentService { + + private static final String TAG = MarkPmtctAndHeiLtfIntentService.class.getSimpleName(); + private AllSharedPreferences sharedPreferences; + private ECSyncHelper syncHelper; + private SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + + + public MarkPmtctAndHeiLtfIntentService() { + super(TAG); + sharedPreferences = Utils.getAllSharedPreferences(); + syncHelper = FamilyLibrary.getInstance().getEcSyncHelper(); + } + + @Override + protected void onHandleIntent(Intent intent) { + List pmtctMembers = HfPmtctDao.getMembers(); + if (pmtctMembers != null) { + for (MemberObject pmtctMember : pmtctMembers) { + if (!HfPmtctDao.hasTheClientTransferedOut(pmtctMember.getBaseEntityId()) && !HfPmtctDao.isTheClientLostToFollowup(pmtctMember.getBaseEntityId()) && pmtctMember.getDod() == null) { + Date lastVisitDate = HfPmtctDao.getPmtctFollowUpVisitDate(pmtctMember.getBaseEntityId()); + Calendar ltfCalendar = Calendar.getInstance(); + if (lastVisitDate == null) + lastVisitDate = HfPmtctDao.getPmtctRegisterDate(pmtctMember.getBaseEntityId()); + + if (lastVisitDate != null) { + ltfCalendar.setTimeInMillis(lastVisitDate.getTime()); + ltfCalendar.add(Calendar.DAY_OF_YEAR, 56); + checkIfLtf(ltfCalendar, pmtctMember.getBaseEntityId(), ChwNotificationDao.getSyncLocationId(pmtctMember.getBaseEntityId()), HfPmtctDao.getVisitNumber(pmtctMember.getBaseEntityId()), true); + } + } + } + } + + + List heiMembers = HeiDao.getMember(); + if (heiMembers != null) { + for (MemberObject heiMember : heiMembers) { + if (!HeiDao.hasTheChildTransferedOut(heiMember.getBaseEntityId()) && heiMember.getDod() == null) { + int visitNumber = HeiDao.getVisitNumber(heiMember.getBaseEntityId()); + Date lastVisitDate = HeiDao.getHeiFollowUpVisitDate(heiMember.getBaseEntityId()); + Calendar ltfCalendar = Calendar.getInstance(); + + if (lastVisitDate == null) + lastVisitDate = HeiDao.getHeiRegisterDate(heiMember.getBaseEntityId()); + + if (lastVisitDate != null) { + ltfCalendar.setTimeInMillis(lastVisitDate.getTime()); + + if (visitNumber == 1) + ltfCalendar.add(Calendar.DAY_OF_YEAR, 56); + else + ltfCalendar.add(Calendar.DAY_OF_YEAR, 70); + + checkIfLtf(ltfCalendar, heiMember.getBaseEntityId(), ChwNotificationDao.getSyncLocationId(heiMember.getBaseEntityId()), visitNumber, false); + } + } + } + } + } + + public void checkIfLtf(Calendar ltfCalendar, String baseEntityId, String syncLocationId, int visitNumber, boolean isPmtct) { + if (Calendar.getInstance().getTime().after(ltfCalendar.getTime())) { + saveLtfEvent( + baseEntityId, + syncLocationId, + visitNumber, + isPmtct + ); + } + } + + + private void saveLtfEvent(String baseEntityId, String userLocationId, int visitNumber, boolean isPmtct) { + try { + + Event baseEvent = generateEvent(baseEntityId, userLocationId); + if (isPmtct) { + baseEvent.setEventType(Constants.Events.MARK_PMTCT_CLIENT_AS_LTF); + baseEvent.setEntityType((Constants.TableName.PMTCT_FOLLOWUP)); + } else { + baseEvent.setEventType(Constants.Events.MARK_HEI_CLIENT_AS_LTF); + baseEvent.setEntityType((Constants.TableName.HEI_FOLLOWUP)); + } + + baseEvent.addObs((new Obs()) + .withFormSubmissionField(Constants.FormConstants.FormSubmissionFields.VISIT_NUMBER) + .withValue(visitNumber) + .withFieldCode(Constants.FormConstants.FormSubmissionFields.VISIT_NUMBER) + .withFieldType(CoreConstants.FORMSUBMISSION_FIELD).withFieldDataType(CoreConstants.TEXT).withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + + baseEvent.addObs((new Obs()) + .withFormSubmissionField(Constants.FormConstants.FormSubmissionFields.FOLLOWUP_VISIT_DATE) + .withValue(sdf.format(Calendar.getInstance().getTime())) + .withFieldCode(Constants.FormConstants.FormSubmissionFields.FOLLOWUP_VISIT_DATE) + .withFieldType(CoreConstants.FORMSUBMISSION_FIELD).withFieldDataType(CoreConstants.TEXT).withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + + baseEvent.addObs((new Obs()) + .withFormSubmissionField(Constants.FormConstants.FormSubmissionFields.FOLLOWUP_STATUS) + .withValue(Constants.LOST_TO_FOLLOWUP) + .withFieldCode(Constants.FormConstants.FormSubmissionFields.FOLLOWUP_STATUS) + .withFieldType(CoreConstants.FORMSUBMISSION_FIELD).withFieldDataType(CoreConstants.TEXT).withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + + + CoreJsonFormUtils.tagSyncMetadata(sharedPreferences, baseEvent); + syncEvents(baseEvent, baseEntityId); + } catch (Exception e) { + Timber.e(e, "MarkPmtctAndHeiLtfIntentService --> savePmtctLtfEvent"); + } + } + + private Event generateEvent(String baseEntityId, String userLocationId) { + Event baseEvent = null; + try { + AllSharedPreferences sharedPreferences = org.smartregister.family.util.Utils.getAllSharedPreferences(); + baseEvent = (Event) new Event() + .withBaseEntityId(baseEntityId) + .withEventDate(new Date()) + .withFormSubmissionId(JsonFormUtils.generateRandomUUIDString()) + .withProviderId(sharedPreferences.fetchRegisteredANM()) + .withLocationId(userLocationId) + .withTeamId(sharedPreferences.fetchDefaultTeamId(sharedPreferences.fetchRegisteredANM())) + .withTeam(sharedPreferences.fetchDefaultTeam(sharedPreferences.fetchRegisteredANM())) + .withDateCreated(new Date()); + + CoreJsonFormUtils.tagSyncMetadata(sharedPreferences, baseEvent); + } catch (Exception e) { + Timber.e(e, "MarkPmtctAndHeiLtfIntentService --> generateEvent"); + } + return baseEvent; + } + + private void syncEvents(Event baseEvent, String baseEntityId) { + try { + JSONObject eventJson = new JSONObject(JsonFormUtils.gson.toJson(baseEvent)); + syncHelper.addEvent(baseEntityId, eventJson); + long lastSyncTimeStamp = sharedPreferences.fetchLastUpdatedAtDate(0); + Date lastSyncDate = new Date(lastSyncTimeStamp); + List formSubmissionIds = new ArrayList<>(); + formSubmissionIds.add(baseEvent.getFormSubmissionId()); + CoreChwApplication.getInstance().getClientProcessorForJava().processClient(syncHelper.getEvents(formSubmissionIds)); + sharedPreferences.saveLastUpdatedAtDate(lastSyncDate.getTime()); + } catch (Exception e) { + Timber.e(e, "MarkPmtctAndHeiLtfIntentService --> syncEvents"); + } + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/PncCloseDateIntentService.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/PncCloseDateIntentService.java new file mode 100644 index 000000000..9cb2420df --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/PncCloseDateIntentService.java @@ -0,0 +1,31 @@ +package org.smartregister.chw.hf.sync.intent; + +import android.app.IntentService; +import android.content.Intent; + +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.hf.activity.PncMemberProfileActivity; +import org.smartregister.chw.hf.dao.HfPncDao; + +import java.util.List; + +public class PncCloseDateIntentService extends IntentService { + + private static final String TAG = PncCloseDateIntentService.class.getSimpleName(); + + + public PncCloseDateIntentService() { + super(TAG); + } + + @Override + protected void onHandleIntent(Intent intent) { + List memberObjectList = HfPncDao.getPncMembersWithMoreThan42Days(); + if(memberObjectList != null && memberObjectList.size()> 0){ + for(MemberObject memberObject : memberObjectList){ + PncMemberProfileActivity.closePncMemberVisits(memberObject.getBaseEntityId()); + } + } + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/ProcessVisitsIntentService.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/ProcessVisitsIntentService.java new file mode 100644 index 000000000..1ccc5b86e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/sync/intent/ProcessVisitsIntentService.java @@ -0,0 +1,38 @@ +package org.smartregister.chw.hf.sync.intent; + +import android.app.IntentService; +import android.content.Intent; + +import org.smartregister.chw.hf.utils.HeiVisitUtils; +import org.smartregister.chw.hf.utils.PmtctVisitUtils; +import org.smartregister.chw.hf.utils.PncVisitUtils; +import org.smartregister.chw.hf.utils.VisitUtils; +import org.smartregister.chw.kvp.util.KvpVisitsUtil; +import org.smartregister.chw.kvp.util.PrEPVisitsUtil; + +import timber.log.Timber; + +public class ProcessVisitsIntentService extends IntentService { + + private static final String TAG = ProcessVisitsIntentService.class.getSimpleName(); + + + public ProcessVisitsIntentService() { + super(TAG); + } + + @Override + protected void onHandleIntent(Intent intent) { + try { + PncVisitUtils.processVisits(); + VisitUtils.processVisits(); + HeiVisitUtils.processVisits(); + PmtctVisitUtils.processVisits(); + KvpVisitsUtil.processVisits(); + PrEPVisitsUtil.processVisits(); + } catch (Exception e) { + Timber.e(e); + } + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/task/ANCVisitScheduler.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/task/ANCVisitScheduler.java new file mode 100644 index 000000000..698b24103 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/task/ANCVisitScheduler.java @@ -0,0 +1,88 @@ +package org.smartregister.chw.hf.task; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormat; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.core.contract.ScheduleTask; +import org.smartregister.chw.core.dao.AncDao; +import org.smartregister.chw.core.dao.VisitDao; +import org.smartregister.chw.core.domain.BaseScheduleTask; +import org.smartregister.chw.core.rule.AncVisitAlertRule; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.schedulers.BaseTaskExecutor; +import org.smartregister.chw.hf.utils.Constants; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Locale; + +public class ANCVisitScheduler extends BaseTaskExecutor { + @Override + public void resetSchedule(String baseEntityID, String scheduleName) { + super.resetSchedule(baseEntityID, scheduleName); + HealthFacilityApplication.getInstance().getScheduleRepository().deleteScheduleByGroup(getScheduleGroup(), baseEntityID); + } + + @Override + public List generateTasks(String baseEntityID, String eventName, Date eventDate) { + BaseScheduleTask baseScheduleTask = prepareNewTaskObject(baseEntityID); + + // clean the visit db . delete all do and undo events that happened the same day + List strings = VisitDao.getVisitsToDelete(); + for (String visitID : strings) { + AncLibrary.getInstance().visitRepository().deleteVisit(visitID); + } + + Visit lastNotDoneVisit = AncLibrary.getInstance().visitRepository().getLatestVisit(baseEntityID, Constants.Events.ANC_FACILITY_VISIT_NOT_DONE); + if (lastNotDoneVisit != null) { + Visit lastNotDoneVisitUndo = AncLibrary.getInstance().visitRepository().getLatestVisit(baseEntityID, Constants.Events.ANC_FACILITY_VISIT_NOT_DONE_UNDO); + if (lastNotDoneVisitUndo != null + && lastNotDoneVisitUndo.getDate().after(lastNotDoneVisit.getDate())) { + lastNotDoneVisit = null; + } + } + + SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + Visit lastVisit = AncLibrary.getInstance().visitRepository().getLatestVisit(baseEntityID, Constants.Events.ANC_RECURRING_FACILITY_VISIT); + if (lastVisit == null) + lastVisit = AncLibrary.getInstance().visitRepository().getLatestVisit(baseEntityID, Constants.Events.ANC_FIRST_FACILITY_VISIT); + + String visitDate = lastVisit != null ? sdf.format(lastVisit.getDate()) : null; + String lastVisitNotDone = lastNotDoneVisit != null ? sdf.format(lastNotDoneVisit.getDate()) : null; + + String create_date = AncDao.getAncDateCreated(baseEntityID); + LocalDate dateCreated = StringUtils.isNotBlank(create_date) ? (new DateTime(create_date)).toLocalDate() : new LocalDate(eventDate); + + AncVisitAlertRule alertRule = new AncVisitAlertRule( + HealthFacilityApplication.getInstance().getApplicationContext() + , DateTimeFormat.forPattern("dd-MM-yyyy").print(dateCreated), + visitDate, + lastVisitNotDone, + dateCreated + ); + + + baseScheduleTask.setScheduleDueDate(alertRule.getDueDate()); + baseScheduleTask.setScheduleNotDoneDate(alertRule.getNotDoneDate()); + baseScheduleTask.setScheduleExpiryDate(alertRule.getExpiryDate()); + baseScheduleTask.setScheduleCompletionDate(alertRule.getCompletionDate()); + baseScheduleTask.setScheduleOverDueDate(alertRule.getOverDueDate()); + + return toScheduleList(baseScheduleTask); + } + + @Override + public String getScheduleName() { + return CoreConstants.SCHEDULE_TYPES.ANC_VISIT; + } + + @Override + public String getScheduleGroup() { + return Constants.ScheduleGroups.FACILITY_VISIT; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/AllClientsUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/AllClientsUtils.java index 853ef488e..0837a1bf2 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/AllClientsUtils.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/AllClientsUtils.java @@ -3,10 +3,10 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; - -import androidx.annotation.NonNull; +import android.view.Menu; import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; import org.smartregister.chw.anc.domain.MemberObject; import org.smartregister.chw.core.application.CoreChwApplication; import org.smartregister.chw.core.utils.CoreChildUtils; @@ -14,20 +14,41 @@ import org.smartregister.chw.fp.dao.FpDao; import org.smartregister.chw.hf.R; import org.smartregister.chw.hf.activity.AboveFiveChildProfileActivity; +import org.smartregister.chw.hf.activity.AllClientsMemberProfileActivity; import org.smartregister.chw.hf.activity.AncMemberProfileActivity; import org.smartregister.chw.hf.activity.ChildProfileActivity; import org.smartregister.chw.hf.activity.FamilyOtherMemberProfileActivity; import org.smartregister.chw.hf.activity.FamilyPlanningMemberProfileActivity; +import org.smartregister.chw.hf.activity.HivProfileActivity; +import org.smartregister.chw.hf.activity.KvpProfileActivity; +import org.smartregister.chw.hf.activity.LDProfileActivity; import org.smartregister.chw.hf.activity.MalariaProfileActivity; import org.smartregister.chw.hf.activity.PncMemberProfileActivity; +import org.smartregister.chw.hf.activity.TbProfileActivity; import org.smartregister.chw.hf.dao.FamilyDao; +import org.smartregister.chw.hf.dao.HfHivDao; +import org.smartregister.chw.hf.dao.HfHtsDao; import org.smartregister.chw.hf.model.FamilyDetailsModel; +import org.smartregister.chw.hiv.dao.HivDao; +import org.smartregister.chw.pmtct.dao.PmtctDao; +import org.smartregister.chw.tb.dao.TbDao; +import org.smartregister.clientandeventmodel.Client; +import org.smartregister.commonregistry.CommonPersonObject; import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.commonregistry.CommonRepository; +import org.smartregister.family.domain.FamilyEventClient; import org.smartregister.family.util.Constants; import org.smartregister.family.util.DBConstants; import org.smartregister.family.util.Utils; +import org.smartregister.opd.pojo.OpdEventClient; import org.smartregister.opd.utils.OpdDbConstants; +import java.util.ArrayList; +import java.util.List; + +import androidx.annotation.NonNull; +import androidx.fragment.app.FragmentActivity; + import static org.smartregister.chw.core.utils.CoreConstants.INTENT_KEY.CLIENT; import static org.smartregister.chw.core.utils.Utils.passToolbarTitle; import static org.smartregister.opd.utils.OpdDbConstants.KEY.REGISTER_TYPE; @@ -55,7 +76,7 @@ public static void goToClientProfile(Activity activity, @NonNull CommonPersonObj AllClientsUtils.goToChildProfile(activity, commonPersonObjectClient, bundle); break; case CoreConstants.REGISTER_TYPE.ANC: - AllClientsUtils.goToAncProfile(activity, commonPersonObjectClient, bundle); + AllClientsUtils.goToAncProfile(activity, commonPersonObjectClient); break; case CoreConstants.REGISTER_TYPE.PNC: AllClientsUtils.gotToPncProfile(activity, commonPersonObjectClient, bundle); @@ -66,6 +87,12 @@ public static void goToClientProfile(Activity activity, @NonNull CommonPersonObj case CoreConstants.REGISTER_TYPE.FAMILY_PLANNING: AllClientsUtils.goToFamilyPlanningProfile(activity, commonPersonObjectClient); break; + case CoreConstants.REGISTER_TYPE.LD: + AllClientsUtils.goToLDProfile(activity, commonPersonObjectClient); + break; + case CoreConstants.REGISTER_TYPE.KVP: + AllClientsUtils.goToKVPProfile(activity, commonPersonObjectClient); + break; default: AllClientsUtils.goToOtherMemberProfile(activity, commonPersonObjectClient, bundle, familyDetailsModel.getFamilyHead(), familyDetailsModel.getPrimaryCareGiver()); @@ -79,7 +106,7 @@ public static void goToClientProfile(Activity activity, @NonNull CommonPersonObj } } - private static void goToChildProfile(Activity activity, CommonPersonObjectClient patient, Bundle bundle) { + public static void goToChildProfile(Activity activity, CommonPersonObjectClient patient, Bundle bundle) { String dobString = Utils.getDuration(Utils.getValue(patient.getColumnmaps(), DBConstants.KEY.DOB, false)); Integer yearOfBirth = CoreChildUtils.dobStringToYear(dobString); Intent intent; @@ -97,24 +124,31 @@ private static void goToChildProfile(Activity activity, CommonPersonObjectClient activity.startActivity(intent); } - private static void gotToPncProfile(Activity activity, CommonPersonObjectClient patient, Bundle bundle) { + public static void gotToPncProfile(Activity activity, CommonPersonObjectClient patient, Bundle bundle) { patient.getColumnmaps().putAll(CoreChwApplication.pncRegisterRepository().getPncCommonPersonObject(patient.entityId()).getColumnmaps()); activity.startActivity(initProfileActivityIntent(activity, patient, bundle, PncMemberProfileActivity.class)); } - private static void goToAncProfile(Activity activity, CommonPersonObjectClient patient, Bundle bundle) { - patient.getColumnmaps().putAll(CoreChwApplication.ancRegisterRepository().getAncCommonPersonObject(patient.entityId()).getColumnmaps()); - activity.startActivity(initProfileActivityIntent(activity, patient, bundle, AncMemberProfileActivity.class)); + public static void goToAncProfile(Activity activity, CommonPersonObjectClient patient) { + AncMemberProfileActivity.startMe(activity, patient.getCaseId()); } - private static void gotToMalariaProfile(Activity activity, CommonPersonObjectClient patient) { + public static void gotToMalariaProfile(Activity activity, CommonPersonObjectClient patient) { MalariaProfileActivity.startMalariaActivity(activity, patient.getCaseId()); } - private static void goToFamilyPlanningProfile(Activity activity, CommonPersonObjectClient patient) { + public static void goToFamilyPlanningProfile(Activity activity, CommonPersonObjectClient patient) { FamilyPlanningMemberProfileActivity.startFpMemberProfileActivity(activity, FpDao.getMember(patient.getCaseId())); } + public static void goToLDProfile(Activity activity, CommonPersonObjectClient patient) { + LDProfileActivity.startProfileActivity(activity, patient.getCaseId()); + } + + public static void goToKVPProfile(Activity activity, CommonPersonObjectClient patient) { + KvpProfileActivity.startProfile(activity, patient.getCaseId()); + } + private static Intent initProfileActivityIntent(Activity activity, CommonPersonObjectClient patient, Bundle bundle, Class clazz) { Intent intent = new Intent(activity, clazz); if (bundle != null) { @@ -126,13 +160,19 @@ private static Intent initProfileActivityIntent(Activity activity, CommonPersonO return intent; } - private static void goToOtherMemberProfile(Activity activity, CommonPersonObjectClient patient, - Bundle bundle, String familyHead, String primaryCaregiver) { + public static void goToOtherMemberProfile(Activity activity, CommonPersonObjectClient patient, + Bundle bundle, String familyHead, String primaryCaregiver) { if (StringUtils.isBlank(familyHead) && StringUtils.isBlank(primaryCaregiver)) { showShortToast(activity, activity.getString(R.string.error_opening_profile)); } else { - Intent intent = new Intent(activity, FamilyOtherMemberProfileActivity.class); + String registerType = patient.getDetails().get(REGISTER_TYPE); + Intent intent; + if (CoreConstants.REGISTER_TYPE.INDEPENDENT.equals(registerType)) { + intent = new Intent(activity, AllClientsMemberProfileActivity.class); + } else { + intent = new Intent(activity, FamilyOtherMemberProfileActivity.class); + } intent.putExtras(bundle != null ? bundle : new Bundle()); intent.putExtra(Constants.INTENT_KEY.BASE_ENTITY_ID, patient.getCaseId()); intent.putExtra(CoreConstants.INTENT_KEY.CHILD_COMMON_PERSON, patient); @@ -144,4 +184,83 @@ private static void goToOtherMemberProfile(Activity activity, CommonPersonObject } } + + @NotNull + public static List getOpdEventClients(String jsonString) { + List allClientMemberEvents = new ArrayList<>(); + + FamilyEventClient locationDetailsEvent = JsonFormUtils.processFamilyUpdateForm( + Utils.context().allSharedPreferences(), jsonString); + if (locationDetailsEvent == null) { + return allClientMemberEvents; + } + + FamilyEventClient clientDetailsEvent = JsonFormUtils.processFamilyHeadRegistrationForm( + Utils.context().allSharedPreferences(), jsonString, locationDetailsEvent.getClient().getBaseEntityId()); + if (clientDetailsEvent == null) { + return allClientMemberEvents; + } + + if (clientDetailsEvent.getClient() != null && locationDetailsEvent.getClient() != null) { + String headUniqueId = clientDetailsEvent.getClient().getIdentifier(Utils.metadata().uniqueIdentifierKey); + if (StringUtils.isNotBlank(headUniqueId)) { + String familyUniqueId = headUniqueId + Constants.IDENTIFIER.FAMILY_SUFFIX; + locationDetailsEvent.getClient().addIdentifier(Utils.metadata().uniqueIdentifierKey, familyUniqueId); + } + } + + // Update the family head and primary caregiver + Client familyClient = locationDetailsEvent.getClient(); + familyClient.addRelationship(Utils.metadata().familyRegister.familyHeadRelationKey, clientDetailsEvent.getClient().getBaseEntityId()); + familyClient.addRelationship(Utils.metadata().familyRegister.familyCareGiverRelationKey, clientDetailsEvent.getClient().getBaseEntityId()); + + //Use different entity type for independent members + locationDetailsEvent.getEvent().setEntityType(CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT); + clientDetailsEvent.getEvent().setEntityType(CoreConstants.TABLE_NAME.INDEPENDENT_CLIENT); + + allClientMemberEvents.add(new OpdEventClient(locationDetailsEvent.getClient(), locationDetailsEvent.getEvent())); + allClientMemberEvents.add(new OpdEventClient(clientDetailsEvent.getClient(), clientDetailsEvent.getEvent())); + return allClientMemberEvents; + } + + public static void updateHivMenuItems(String baseEntityId, Menu menu) { + if (HfHivDao.isHivMember(baseEntityId)) { + menu.findItem(R.id.action_hiv_registration).setVisible(false); + } else { + menu.findItem(R.id.action_hiv_registration).setVisible(true); + } + } + + public static void updateTbMenuItems(String baseEntityId, Menu menu) { + if (TbDao.isRegisteredForTb(baseEntityId)) { + menu.findItem(R.id.action_tb_registration).setVisible(false); + } else { + menu.findItem(R.id.action_tb_registration).setVisible(true); + } + } + + public static void goToHivProfile(FragmentActivity activity, CommonPersonObjectClient hivClient) { + HivProfileActivity.startHivProfileActivity(activity, HivDao.getMember(hivClient.getCaseId())); + } + + public static void goToHTsProfile(FragmentActivity activity, CommonPersonObjectClient hivClient) { + HivProfileActivity.startHivProfileActivity(activity, HfHtsDao.getMember(hivClient.getCaseId())); + } + + public static void goToTbProfile(FragmentActivity activity, CommonPersonObjectClient tbClient) { + TbProfileActivity.startTbProfileActivity(activity, TbDao.getMember(tbClient.getCaseId())); + } + + public static void updatePmtctMenuItems(String baseEntityId, Menu menu) { + menu.findItem(R.id.action_pmtct_register).setVisible(!PmtctDao.isRegisteredForPmtct(baseEntityId)); + } + + public static String getClientGender(String baseEntityId) { + CommonRepository commonRepository = Utils.context().commonrepository(Utils.metadata().familyMemberRegister.tableName); + + final CommonPersonObject commonPersonObject = commonRepository.findByBaseEntityId(baseEntityId); + final CommonPersonObjectClient client = new CommonPersonObjectClient(commonPersonObject.getCaseId(), commonPersonObject.getDetails(), ""); + client.setColumnmaps(commonPersonObject.getColumnmaps()); + return Utils.getValue(commonPersonObject.getColumnmaps(), DBConstants.KEY.GENDER, false); + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/Constants.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/Constants.java new file mode 100644 index 000000000..8fa64a8be --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/Constants.java @@ -0,0 +1,736 @@ +package org.smartregister.chw.hf.utils; + +import static org.smartregister.chw.core.utils.CoreConstants.JSON_FORM.assetManager; +import static org.smartregister.chw.core.utils.CoreConstants.JSON_FORM.locale; + +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.Utils; + +public class Constants extends CoreConstants { + public static String DEFAULT_LOCATION_NAME = "default_location_name"; + public static String pregnancyOutcome = "preg_outcome"; + public static String LOST_TO_FOLLOWUP = "lost_to_followup"; + public static String REFERRAL_TASK_FOCUS = "referral_task_focus"; + + public static String FILTER_APPOINTMENT_DATE = "FILTER_APPOINTMENT_DATE"; + public static String FILTER_IS_REFERRED = "FILTER_IS_REFERRED"; + public static String FILTER_HIV_STATUS = "FILTER_HIV_STATUS"; + public static String FILTERS_ENABLED = "FILTERS_ENABLED"; + + public static int REQUEST_FILTERS = 2004; + + public enum FamilyRegisterOptionsUtil {Miscarriage, Other} + + public interface ScheduleGroups { + String FACILITY_VISIT = "FACILITY_VISIT"; + } + + public interface PregnancyConfirmationGroups { + String PREGNANCY_CONFIRMATION = "Pregnancy Confirmation"; + } + + public interface PartnerRegistrationConstants { + int EXISTING_PARTNER_REQUEST_CODE = 12344; + int NEW_PARTNER_REQUEST_CODE = 12345; + String INTENT_BASE_ENTITY_ID = "BASE_ENTITY_ID"; + String PARTNER_BASE_ENTITY_ID = "partner_base_entity_id"; + } + + public static final class FOCUS { + public static final String LOST_TO_FOLLOWUP_FOCUS = "LTFU"; + public static final String LD_EMERGENCY = "Labour And Delivery Emergency"; + public static final String LD_CHILD_EMERGENCY = "Labour And Delivery Child Emergency"; + } + + public static final class Events { + public static final String ANC_FIRST_FACILITY_VISIT = "ANC First Facility Visit"; + public static final String ANC_RECURRING_FACILITY_VISIT = "ANC Recurring Facility Visit"; + public static final String ANC_FACILITY_VISIT_NOT_DONE = "ANC Facility Visit Not Done"; + public static final String ANC_FACILITY_VISIT_NOT_DONE_UNDO = "ANC Facility Visit Not Done Undo"; + public static final String PMTCT_FIRST_EAC_VISIT = "PMTCT EAC First Visit"; + public static final String PMTCT_SECOND_EAC_VISIT = "PMTCT EAC Second Visit"; + public static final String PMTCT_EAC_VISIT = "PMTCT EAC Visit"; + public static final String UPDATE_HIV_INDEX_TESTING_FOLLOWUP = "Update HIV Index Contact Testing Followup"; + public static final String PARTNER_REGISTRATION_EVENT = "Partner Registration"; + public static final String HEI_REGISTRATION = "HEI Registration"; + public static final String HEI_FOLLOWUP = "HEI Followup"; + public static final String HEI_POSITIVE_INFANT = "HEI Positive Infant"; + public static final String HEI_NEGATIVE_INFANT = "HEI Negative Infant"; + public static final String PMTCT_CLOSE_VISITS = "PMTCT Close Visits"; + public static final String PNC_VISIT = "PNC VISIT"; + public static final String PNC_NO_MOTHER_REGISTRATION = "PNC No Mother Registration"; + public static final String CLOSE_PNC_VISITS = "Close PNC Visits"; + public static final String PNC_CHILD_FOLLOWUP = "PNC Child Followup"; + public static final String MOTHER_CHAMPION_COMMUNITY_SERVICES_REFERRAL = "Mother Champion Community Services Referral"; + public static final String MARK_PMTCT_CLIENT_AS_LTF = "Mark PMTCT Client As LTF"; + public static final String MARK_HEI_CLIENT_AS_LTF = "Mark HEI Client As LTF"; + public static final String HEI_COMMUNITY_FOLLOWUP = "HEI Community Followup"; + public static final String HEI_NUMBER_REGISTRATION = "HEI Number Registration"; + public static final String LD_REGISTRATION = "LD Registration"; + public static final String LD_PARTOGRAPHY = "LD Partograph"; + public static final String LD_GENERAL_EXAMINATION = "LD General Examination"; + public static final String LD_ACTIVE_MANAGEMENT_OF_3RD_STAGE_OF_LABOUR = "LD Active Management of 3rd Stage Of Labour"; + public static final String LD_POST_DELIVERY_MOTHER_MANAGEMENT = "Post Delivery Mother Management"; + public static final String CLOSE_LD = "Close LD"; + public static final String PMTCT_POST_PNC_REGISTRATION = "PMTCT Post PNC Registration"; + } + + public static final class TableName { + public static final String ANC_FIRST_FACILITY_VISIT = "ec_anc_first_facility_visit"; + public static final String ANC_RECURRING_FACILITY_VISIT = "ec_anc_recurring_facility_visit"; + public static final String PMTCT_EAC_VISIT = "ec_pmtct_eac_visit"; + public static final String HEI = "ec_hei"; + public static final String HEI_HIV_RESULTS = "ec_hei_hiv_results"; + public static final String HEI_FOLLOWUP = "ec_hei_followup"; + public static final String PNC_FOLLOWUP = "ec_pnc_followup"; + public static final String PMTCT_FOLLOWUP = "ec_pmtct_followup"; + public static final String NO_MOTHER_PNC = "ec_no_mother_pnc"; + } + + public static final class Visits { + public static final String TERMINATED = "Terminated"; + public static final String FIRST_EAC = "First Eac"; + public static final String SECOND_EAC = "Second Eac"; + public static final String PMTCT_VISIT = "Pmtct"; + public static final String HEI_VISIT = "HEI"; + public static final String LD_GENERAL_VISIT = "L&D Examination"; + public static final String LD_PARTOGRAPH_VISIT = "L&D Partograph"; + public static final String LD_MANAGEMENT_OF_3rd_STAGE_OF_LABOUR_VISIT = "L&D Management of 3rd Stage Of Labour"; + public static final String LD_IMMEDIATE_POSTPARTUM_CARE = "L&D Immediate Postpartum Care"; + } + + public static final class ActionList { + public static final String FOLLOWUP = "Followup_action"; + } + + public static final class JsonForm { + public static final String HIV_REGISTRATION = "hiv_registration"; + public static final String HVL_TEST_RESULTS = "pmtct_hvl_test_results"; + public static final String CD4_TEST_RESULTS = "pmtct_cd4_test_results"; + public static final String EAC_VISITS_FORM = "pmtct_eac_visits"; + public static final String HVL_SUPPRESSION_FORM_AFTER_EAC_1 = "pmtct_hvl_suppression_after_eac_1"; + public static final String HVL_SUPPRESSION_FORM_AFTER_EAC_2 = "pmtct_hvl_suppression_after_eac_2"; + public static final String HVL_CLINICIAN_DETAILS_FORM = "pmtct_hvl_sample_collection"; + public static final String MARK_CLIENT_AS_DECEASED = "mark_client_as_deceased"; + public static final String MARK_CHILD_AS_DECEASED = "mark_child_as_deceased"; + public static final String HEI_COMMUNITY_FOLLOWUP_REFERRAL = "hei_community_followup_referral"; + //TODO: cleanup + private static final String NEXT_FACILITY_VISIT_FORM = "next_facility_visit_date_form"; + private static final String PMTCT_REGISTRATION = "pmtct_registration"; + private static final String PMTCT_REGISTRATION_FOR_CLIENTS_KNOWN_ON_ART_FORM = "pmtct_registration_for_clients_known_on_art"; + private static final String COUNSELLING = "anc_counselling"; + private static final String HIV_INDEX_CONTACT_CTC_ENROLLMENT = "hiv_index_contact_ctc_enrollment"; + private static final String PARTNER_REGISTRATION_FORM = "male_partner_registration_form"; + private static final String PMTCT_COUNSELLING = "pmtct_fv_counselling"; + private static final String PMTCT_BASELINE_INVESTIGATION = "pmtct_fv_baseline_investigation"; + private static final String PMTCT_CD4_SAMPLE_COLLECTION = "pmtct_cd4_sample_collection"; + private static final String PMTCT_CLINICAL_STAGING_OF_DISEASE = "pmtct_clinical_staging_of_disease"; + private static final String PMTCT_TB_SCREENING = "pmtct_tb_screening"; + private static final String PMTCT_ARV_LINE = "pmtct_prescription_line_selection"; + private static final String HEI_DNA_PCR_SAMPLE_COLLECTION = "hei_dna_pcr_sample_collection"; + private static final String HEI_ARV_PRESCRIPTION_HIGH_RISK_INFANT = "hei_arv_prescription_high_risk_infant"; + private static final String HEI_ARV_PRESCRIPTION_HIGH_OR_LOW_RISK_INFANT = "hei_arv_prescription_high_or_low_risk_infant"; + private static final String HEI_CTX_PRESCRIPTION = "hei_rv_ctx"; + private static final String HEI_HIV_TEST_RESULTS = "hei_hiv_test_results"; + private static final String HEI_NUMBER_REGISTRATION = "hei_number_registration"; + private static final String HEI_BASLINE_INVESTIGATION = "hei_baseline_investigation"; + private static final String HIV_CLIENT_UPDATE_CTC_NUMBER = "hiv_client_update_ctc_number"; + private static final String PNC_MOTHER_GENERAL_EXAMINATION = "pnc_mother_general_examination"; + private static final String PNC_CHILD_GENERAL_EXAMINATION = "pnc_child_general_examination"; + private static final String PNC_FAMILY_PLANNING_SERVICES = "pnc_family_planning_services"; + private static final String PNC_IMMUNIZATION = "pnc_immunization"; + private static final String PNC_HIV_TEST_RESULTS = "pnc_hiv_test_results"; + private static final String PNC_NUTRITIONAL_SUPPLEMENT = "pnc_nutritional_supplement"; + private static final String PMTCT_FOLLOWUP_STATUS = "pmtct_followup_status"; + private static final String LD_REGISTRATION = "labour_and_delivery_registration"; + private static final String LD_CHILD_REGISTRATION = "ld_child_registration"; + private static final String LD_HEI_FIRST_VISIT = "ld_hei_first_visit"; + private static final String LTFU_REFERRAL_FORM = "referrals/ltfu_referral_form"; + private static final String LD_EMERGENCY_REFERRAL_FORM = "referrals/labour_and_delivery_emergency_referral"; + private static final String LD_CHILD_EMERGENCY_REFERRAL_FORM = "referrals/labour_and_delivery_child_emergency_referral"; + private static final String PMTCT_REGISTRATION_FOR_CLIENTS_POST_PNC = "pmtct_registration_for_clients_post_pnc"; + + public static String getNextFacilityVisitForm() { + return NEXT_FACILITY_VISIT_FORM; + } + + public static String getHeiCommunityFollowupReferral() { + return HEI_COMMUNITY_FOLLOWUP_REFERRAL; + } + + public static String getLtfuReferralForm() { + return LTFU_REFERRAL_FORM; + } + + public static String getLdEmergencyReferralForm() { + return LD_EMERGENCY_REFERRAL_FORM; + } + + public static String getLdChildEmergencyReferralForm() { + return LD_CHILD_EMERGENCY_REFERRAL_FORM; + } + + public static String getHeiNumberRegistration() { + return HEI_NUMBER_REGISTRATION; + } + + public static String getPncChildGeneralExamination() { + return PNC_CHILD_GENERAL_EXAMINATION; + } + + public static String getPncFamilyPlanningServices() { + return PNC_FAMILY_PLANNING_SERVICES; + } + + public static String getPncImmunization() { + return PNC_IMMUNIZATION; + } + + public static String getPncHivTestResults() { + return PNC_HIV_TEST_RESULTS; + } + + public static String getPncNutritionalSupplement() { + return PNC_NUTRITIONAL_SUPPLEMENT; + } + + public static String getPncMotherGeneralExamination() { + return PNC_MOTHER_GENERAL_EXAMINATION; + } + + public static String getHeiCtxPrescription() { + return HEI_CTX_PRESCRIPTION; + } + + public static String getHeiHivTestResults() { + return HEI_HIV_TEST_RESULTS; + } + + public static String getHeiArvPrescriptionHighOrLowRiskInfant() { + return HEI_ARV_PRESCRIPTION_HIGH_OR_LOW_RISK_INFANT; + } + + public static String getHeiDnaPcrSampleCollection() { + return HEI_DNA_PCR_SAMPLE_COLLECTION; + } + + public static String getHeiArvPrescriptionHighRiskInfant() { + return HEI_ARV_PRESCRIPTION_HIGH_RISK_INFANT; + } + + public static String getHeiBaselineInvestigation() { + return HEI_BASLINE_INVESTIGATION; + } + + public static String getPmtctCounselling() { + return PMTCT_COUNSELLING; + } + + public static String getPmtctBaselineInvestigation() { + return PMTCT_BASELINE_INVESTIGATION; + } + + public static String getPmtctCd4SampleCollection() { + return PMTCT_CD4_SAMPLE_COLLECTION; + } + + public static String getPmtctClinicalStagingOfDisease() { + return PMTCT_CLINICAL_STAGING_OF_DISEASE; + } + + public static String getEacVisitsForm() { + return EAC_VISITS_FORM; + } + + public static String getPmtctTbScreening() { + return PMTCT_TB_SCREENING; + } + + public static String getPmtctArvLine() { + return PMTCT_ARV_LINE; + } + + public static String getPartnerRegistrationForm() { + return Utils.getLocalForm(PARTNER_REGISTRATION_FORM, locale, assetManager); + } + + public static String getCounselling() { + return COUNSELLING; + } + + public static String getPmtctRegistration() { + return PMTCT_REGISTRATION; + } + + public static String getPmtctRegistrationForClientsPostPnc() { + return PMTCT_REGISTRATION_FOR_CLIENTS_POST_PNC; + } + + public static String getPmtctRegistrationForClientsKnownOnArtForm() { + return PMTCT_REGISTRATION_FOR_CLIENTS_KNOWN_ON_ART_FORM; + } + + public static String getHvlTestResultsForm() { + return HVL_TEST_RESULTS; + } + + public static String getCd4TestResultsForm() { + return CD4_TEST_RESULTS; + } + + public static String getHvlSuppressionFormAfterEac1() { + return HVL_SUPPRESSION_FORM_AFTER_EAC_1; + } + + public static String getHivIndexContactCtcEnrollment() { + return HIV_INDEX_CONTACT_CTC_ENROLLMENT; + } + + public static String getHvlSuppressionFormAfterEac2() { + return HVL_SUPPRESSION_FORM_AFTER_EAC_2; + } + + public static String getHivRegistration() { + return Utils.getLocalForm(HIV_REGISTRATION, locale, assetManager); + } + + public static String getMarkClientAsDeceased() { + return Utils.getLocalForm(MARK_CLIENT_AS_DECEASED, locale, assetManager); + } + + public static String getMarkChildAsDeceased() { + return Utils.getLocalForm(MARK_CHILD_AS_DECEASED, locale, assetManager); + } + + public static String getPmtctFollowupStatus() { + return PMTCT_FOLLOWUP_STATUS; + } + + public static String getHvlClinicianDetailsForm() { + return HVL_CLINICIAN_DETAILS_FORM; + } + + public static String getHivClientUpdateCtcNumber() { + return HIV_CLIENT_UPDATE_CTC_NUMBER; + } + + public static String getLdRegistration() { + return LD_REGISTRATION; + } + + public static String getLdChildRegistration() { + return LD_CHILD_REGISTRATION; + } + + public static String getLdHeiFirstVisit() { + return LD_HEI_FIRST_VISIT; + } + + public static class EacVisits { + public static final String PMTCT_EAC_VISIT = "pmtct_eac_visits"; + + public static String getPmtctEacVisit() { + return PMTCT_EAC_VISIT; + } + } + + public static class AncFirstVisit { + public static final String OBSTETRIC_EXAMINATION = "anc_fv_obstetric_examination"; + public static final String TT_VACCINATION = "anc_fv_tt_vaccination"; + private static final String MEDICAL_AND_SURGICAL_HISTORY = "anc_fv_medical_and_surgical_history"; + private static final String BASELINE_INVESTIGATION = "anc_fv_baseline_investigation"; + private static final String TB_SCREENING = "anc_fv_tb_screening"; + private static final String MALARIA_INVESTIGATION = "anc_fv_malaria_investigation_form"; + + public static String getMedicalAndSurgicalHistory() { + return Utils.getLocalForm(MEDICAL_AND_SURGICAL_HISTORY, locale, assetManager); + } + + public static String getBaselineInvestigation() { + return Utils.getLocalForm(BASELINE_INVESTIGATION, locale, assetManager); + } + + public static String getObstetricExamination() { + return Utils.getLocalForm(OBSTETRIC_EXAMINATION, locale, assetManager); + } + + + public static String getTtVaccination() { + return Utils.getLocalForm(TT_VACCINATION, locale, assetManager); + } + + public static String getTbScreening() { + return Utils.getLocalForm(TB_SCREENING, locale, assetManager); + } + + public static String getMalariaInvestigation() { + return Utils.getLocalForm(MALARIA_INVESTIGATION, locale, assetManager); + } + + + } + + public static class AncRecurringVisit { + public static final String TRIAGE = "anc_rv_triage"; + public static final String CONSULTATION = "anc_rv_consultation"; + public static final String LAB_TESTS = "anc_rv_lab_test"; + public static final String BIRTH_REVIEW_AND_EMERGENCY_PLAN = "anc_rv_birth_review_and_emergency_plan"; + private static final String PHARMACY = "anc_rv_pharmacy"; + private static final String PREGNANCY_STATUS = "anc_rv_pregnancy_status"; + private static final String MALARIA_INVESTIGATION = "anc_rv_malaria_investigation_form"; + + public static String getTriage() { + return Utils.getLocalForm(TRIAGE, locale, assetManager); + } + + public static String getConsultation() { + return Utils.getLocalForm(CONSULTATION, locale, assetManager); + } + + public static String getLabTests() { + return Utils.getLocalForm(LAB_TESTS, locale, assetManager); + } + + public static String getPharmacy() { + return Utils.getLocalForm(PHARMACY, locale, assetManager); + } + + public static String getPregnancyStatus() { + return Utils.getLocalForm(PREGNANCY_STATUS, locale, assetManager); + } + + public static String getBirthReviewAndEmergencyPlan() { + return Utils.getLocalForm(BIRTH_REVIEW_AND_EMERGENCY_PLAN, locale, assetManager); + } + + public static String getMalariaInvestigation() { + return Utils.getLocalForm(MALARIA_INVESTIGATION, locale, assetManager); + } + } + + public static class LabourAndDeliveryRegistration { + public static final String LABOUR_AND_DELIVERY_REGISTRATION_TRIAGE = "labour_and_delivery_registration_triage"; + public static final String LABOUR_AND_DELIVERY_REGISTRATION_TRUE_LABOUR_CONFIRMATION = "labour_and_delivery_registration_true_labour_confirmation"; + public static final String LABOUR_AND_DELIVERY_ADMISSION_INFORMATION = "labour_and_delivery_registration_admission_information"; + public static final String LABOUR_AND_DELIVERY_OBSTETRIC_HISTORY = "labour_and_delivery_registration_obstetric_history"; + public static final String LABOUR_AND_DELIVERY_ANC_CLINIC_FINDINGS = "labour_and_delivery_registration_anc_clinic_findings"; + public static final String LABOUR_AND_DELIVERY_CURRENT_LABOUR = "labour_and_delivery_registration_current_labour"; + public static final String LABOUR_AND_DELIVERY_LABOUR_STAGE = "labour_and_delivery_labour_stage"; + public static final String LABOUR_AND_DELIVERY_CERVIX_DILATION_MONITORING = "labour_and_delivery_cervix_dilation_monitoring"; + public static final String LABOUR_AND_DELIVERY_MODE_OF_DELIVERY = "labour_and_delivery_mode_of_delivery"; + public static final String LABOUR_AND_DELIVERY_PAST_OBSTETRIC_HISTORY = "labour_and_delivery_past_obstetric_history"; + + public static String getLabourAndDeliveryRegistrationTriage() { + return LABOUR_AND_DELIVERY_REGISTRATION_TRIAGE; + } + + public static String getLabourAndDeliveryRegistrationTrueLabourConfirmation() { + return LABOUR_AND_DELIVERY_REGISTRATION_TRUE_LABOUR_CONFIRMATION; + } + + public static String getLabourAndDeliveryAdmissionInformation() { + return LABOUR_AND_DELIVERY_ADMISSION_INFORMATION; + } + + public static String getLabourAndDeliveryObstetricHistory() { + return LABOUR_AND_DELIVERY_OBSTETRIC_HISTORY; + } + + public static String getLabourAndDeliveryAncClinicFindings() { + return LABOUR_AND_DELIVERY_ANC_CLINIC_FINDINGS; + } + + public static String getLabourAndDeliveryCurrentLabour() { + return LABOUR_AND_DELIVERY_CURRENT_LABOUR; + } + + public static String getLabourAndDeliveryLabourStage() { + return LABOUR_AND_DELIVERY_LABOUR_STAGE; + } + + public static String getLabourAndDeliveryCervixDilationMonitoring() { + return LABOUR_AND_DELIVERY_CERVIX_DILATION_MONITORING; + } + + public static String getLabourAndDeliveryModeOfDelivery() { + return LABOUR_AND_DELIVERY_MODE_OF_DELIVERY; + } + + public static String getLabourAndDeliveryPastObstetricHistory() { + return LABOUR_AND_DELIVERY_PAST_OBSTETRIC_HISTORY; + } + } + + public static class LabourAndDeliveryPartograph { + public static final String PARTOGRAPH_FETAL_WELLBEING = "labour_and_delivery_fetal_well_being"; + public static final String PARTOGRAPH_MOTHER_WELLBEING = "labour_and_delivery_mother_well_being"; + public static final String PARTOGRAPH_PROGRESS_OF_LABOUR = "labour_and_delivery_labour_progress"; + public static final String PARTOGRAPH_TREATMENT_DURING_LABOUR = "labour_and_delivery_treatment_during_labour"; + public static final String PARTOGRAPH_TIME = "labour_and_delivery_partograph_time"; + + public static String getFetalWellBingForm() { + return PARTOGRAPH_FETAL_WELLBEING; + } + + public static String getMotherWellBeingForm() { + return PARTOGRAPH_MOTHER_WELLBEING; + } + + public static String getProgressOfLabourForm() { + return PARTOGRAPH_PROGRESS_OF_LABOUR; + } + + public static String getTreatmentDuringLabourForm() { + return PARTOGRAPH_TREATMENT_DURING_LABOUR; + } + + public static String getPartographTimeForm() { + return PARTOGRAPH_TIME; + } + + } + + public static class LDVisit { + + public static final String LD_GENERAL_EXAMINATION = "labour_and_delivery_general_examination"; + public static final String LD_VAGINAL_EXAMINATION = "labour_and_delivery_vaginal_examination"; + public static final String LD_HIV_TEST = "labour_and_delivery_hiv_test"; + public static final String LD_BLOOD_GROUP_TEST = "labour_and_delivery_blood_group_test"; + public static final String LD_HB_TEST_FORM = "labour_and_delivery_hb_test_form"; + public static final String LD_SYPHILIS_TEST_FORM = "labour_and_delivery_syphilis_test"; + public static final String LD_MALARIA_TEST_FORM = "labour_and_delivery_malaria_test"; + + public static String getLdGeneralExamination() { + return Utils.getLocalForm(LD_GENERAL_EXAMINATION); + } + + public static String getLdVaginalExamination() { + return Utils.getLocalForm(LD_VAGINAL_EXAMINATION); + } + + public static String getLdHivTest() { + return Utils.getLocalForm(LD_HIV_TEST); + } + + public static String getLdBloodGroupTest() { + return Utils.getLocalForm(LD_BLOOD_GROUP_TEST); + } + + public static String getLdHBTestForm() { + return Utils.getLocalForm(LD_HB_TEST_FORM); + } + + public static String getSyphilisTestForm() { + return Utils.getLocalForm(LD_SYPHILIS_TEST_FORM); + } + + public static String getLdMalariaTestForm() { + return Utils.getLocalForm(LD_MALARIA_TEST_FORM); + } + + } + + public static class LDActiveManagement { + public static final String LD_ACTIVE_MANAGEMENT_UTERONICS = "labour_and_delivery_uterotonic"; + public static final String LD_ACTIVE_MANAGEMENT_EXPULSION_PLACENTA = "labour_and_delivery_placenta_and_membrane"; + public static final String LD_ACTIVE_MANAGEMENT_MASSAGE_UTERUS = "labour_and_delivery_uterus"; + public static final String LD_ACTIVE_ECLAMPSIA_MANAGEMENT= "labour_and_delivery_eclampsia_management_form"; + + public static String getLDActiveManagementUteronics() { + return Utils.getLocalForm(LD_ACTIVE_MANAGEMENT_UTERONICS); + } + + public static String getLdActiveManagementExpulsionPlacenta() { + return Utils.getLocalForm(LD_ACTIVE_MANAGEMENT_EXPULSION_PLACENTA); + } + + public static String getLdActiveManagementMassageUterus() { + return Utils.getLocalForm(LD_ACTIVE_MANAGEMENT_MASSAGE_UTERUS); + } + + public static String getLdActiveEclampsiaManagement() { + return Utils.getLocalForm(LD_ACTIVE_ECLAMPSIA_MANAGEMENT); + } + + } + + public static class LDPostDeliveryMotherManagement { + + public static final String LD_POST_DELIVERY_MANAGEMENT_MOTHER_STATUS = "labour_and_delivery_mother_status"; + public static final String LD_POST_DELIVERY_MOTHER_OBSERVATION = "labour_and_delivery_mother_observation"; + public static final String LD_POST_DELIVERY_MATERNAL_COMPLICATIONS = "labour_and_delivery_maternal_complications"; + public static final String LD_NEW_BORN_STATUS = "labour_and_delivery_stage4_newborn"; + public static final String LD_POST_DELIVERY_FAMILY_PLANNING = "labour_and_delivery_stage4_family_planning"; + + public static String getLdPostDeliveryManagementMotherStatus() { + return Utils.getLocalForm(LD_POST_DELIVERY_MANAGEMENT_MOTHER_STATUS); + } + + public static String getLdPostDeliveryMotherObservation() { + return Utils.getLocalForm(LD_POST_DELIVERY_MOTHER_OBSERVATION); + } + + public static String getLdPostDeliveryMaternalComplications() { + return Utils.getLocalForm(LD_POST_DELIVERY_MATERNAL_COMPLICATIONS); + } + + public static String getLdNewBornStatus() { + return Utils.getLocalForm(LD_NEW_BORN_STATUS); + } + + public static String getLdPostDeliveryFamilyPlanning() { + return Utils.getLocalForm(LD_POST_DELIVERY_FAMILY_PLANNING); + } + + } + + } + + public static final class JsonFormConstants { + public static final String NAME_OF_HF = "name_of_hf"; + public static final String STEP1 = "step1"; + } + + public static final class DBConstants { + public static final String CHW_REFERRAL_SERVICE = "chw_referral_service"; + public static final String ANC_MRDT_FOR_MALARIA = "mRDT_for_malaria"; + public static final String ANC_HIV = "hiv"; + public static final String ANC_SYPHILIS = "syphilis"; + public static final String ANC_HEPATITIS = "hepatitis"; + public static final String TASK_ID = "task_id"; + public static final String HEI_FOLLOWUP_FORM_SUBMISSION_ID = "hei_followup_form_submission_id"; + public static final String HEI_HIV_SAMPLE_ID = "sample_id"; + public static final String HEI_HIV_TEST_RESULT = "hiv_test_result"; + public static final String HEI_HIV_SAMPLE_COLLECTION_DATE = "sample_collection_date"; + public static final String HEI_HIV_RESULT_DATE = "hiv_test_result_date"; + public static final String HEI_HIV_TYPE_OF_TEST = "type_of_hiv_test"; + public static final String HIV_REGISTRATION_DATE = "hiv_registration_date"; + public static final String CAREGIVER_NAME = "caregiver_name"; + public static final String CAREGIVER_PHONE_NUMBER = "caregiver_phone_number"; + } + + public static final class EacVisitTypes { + public static final String EAC_FIRST_VISIT = "EAC FIRST VISIT"; + public static final String EAC_SECOND_VISIT = "EAC SECOND VISIT"; + } + + public static final class JSON_FORM_EXTRA { + public static final String RISK_CATEGORY = "risk_category"; + public static final String HIV_STATUS = "hiv"; + } + + public static final class HIV_STATUS { + public static final String POSITIVE = "positive"; + public static final String NEGATIVE = "negative"; + } + + public static final class HeiHIVTestAtAge { + public static final String AT_BIRTH = "At Birth"; + public static final String AT_6_WEEKS = "6 Weeks"; + public static final String AT_9_MONTHS = "9 Months"; + public static final String AT_15_MONTHS = "15 Months"; + public static final String AT_18_MONTHS = "18 Months"; + } + + public static final class FormConstants { + + public interface FormSubmissionFields { + String VISIT_NUMBER = "visit_number"; + String FOLLOWUP_VISIT_DATE = "followup_visit_date"; + String FOLLOWUP_STATUS = "followup_status"; + String TYPE_OF_HIV_TEST = "type_of_hiv_test"; + String HIV_TEST_RESULT = "hiv_test_result"; + String HIV_TEST_RESULT_DATE = "hiv_test_result_date"; + String CTC_NUMBER = "ctc_number"; + } + + public interface ClinicFindings{ + + interface Syphilis { + String SYPHILIS_RESULT_POSITIVE = "positive"; + String SYPHILIS_RESULT_NEGATIVE = "negative"; + String SYPHILIS_TEST_NOT_DONE = "test_not_conducted"; + } + + interface Malaria { + String MALARIA_RESULT_POSITIVE = "positive"; + String MALARIA_RESULT_NEGATIVE = "negative"; + String MALARIA_TEST_NOT_DONE = "test_not_conducted"; + } + } + + } + + public static final class ReportConstants { + public interface PMTCTReportKeys { + String THREE_MONTHS = "three_months"; + String TWELVE_MONTHS = "twelve_months"; + String TWENTY_FOUR_MONTHS = "twenty_four_months"; + String EID_MONTHLY = "eid_monthly"; + } + + public interface CDPReportKeys { + String ISSUING_AT_THE_FACILITY_REPORTS = "issuing_at_the_facility_reports"; + String ISSUING_FROM_THE_FACILITY_REPORTS = "issuing_from_the_facility_reports"; + String RECEIVING_REPORTS = "receiving_reports"; + } + + public interface ReportTypes { + String PMTCT_REPORT = "pmtct_report"; + String ANC_REPORT = "anc_report"; + String PNC_REPORT = "pnc_report"; + String CBHS_REPORT = "cbhs_report"; + String LTFU_SUMMARY = "ltfu_report"; + String LD_REPORT = "ld_report"; + String MOTHER_CHAMPION_REPORT = "mother_champion_report"; + String SELF_TESTING_REPORT = "self_testing_report"; + String CONDOM_DISTRIBUTION_REPORT = "condom_distribution_report"; + String KVP_REPORT = "kvp_report"; + } + + public interface ReportPaths { + String ANC_REPORT_PATH = "anc-taarifa-ya-mwezi"; + String PMTCT_3_MONTHS_REPORT_PATH = "pmtct-reports/taarifa-ya-miezi-3"; + String PMTCT_12_MONTHS_REPORT_PATH = "pmtct-reports/taarifa-ya-miezi-12"; + String PMTCT_24_MONTHS_REPORT_PATH = "pmtct-reports/taarifa-ya-miezi-24"; + String PMTCT_EID_MONTHLY_REPORT_PATH = "pmtct-reports/taarifa-cross-sectional"; + String PNC_REPORT_PATH = "pnc-taarifa-ya-mwezi"; + String CBHS_REPORT_PATH = "cbhs-taarifa-ya-mwezi"; + String LTFU_REPORT_PATH = "ltfu-summary-report"; + String LD_REPORT_PATH = "labour-delivery-taarifa-ya-mwezi"; + String MOTHER_CHAMPION_REPORT_PATH = "mother-champion-report"; + String SELF_TESTING_REPORT_PATH = "self-testing-report"; + String CONDOM_DISTRIBUTION_ISSUING_AT_THE_FACILITY_REPORT_PATH = "condom-distribution-issuing-report-at-the-facility"; + String CONDOM_DISTRIBUTION_ISSUING_FROM_THE_FACILITY_REPORT_PATH = "condom-distribution-issuing-report-from-the-facility"; + String CONDOM_DISTRIBUTION_RECEIVING_REPORT_PATH = "condom-distribution-receiving-report"; + String KVP_REPORT_PATH = "kvp-report"; + } + } + + public static final class DB { + public static final String FIRST_NAME = "firstName"; + public static final String LAST_NAME = "lastName"; + } + + public static final class LDFormFields { + public interface GeneralExamination { + + } + public interface VaginalExamination { + String VAGINAL_EXAMINATION_DATE = "vaginal_exam_date"; + String VAGINAL_EXAMINATION_TIME = "vaginal_exam_time"; + String PRESENTING_PART = "presenting_part"; + String OCCIPUT_POSITION = "occiput_position"; + String MENTO_POSITION = "mento_position"; + String SACRO_POSITION = "sacro_position"; + String DORSO_POSITION = "dorso_position"; + String MOULDING = "moulding"; + } + } + + public interface GENDER { + String MALE = "male"; + String FEMALE = "female"; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/ContactUtil.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/ContactUtil.java new file mode 100644 index 000000000..56a9f0504 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/ContactUtil.java @@ -0,0 +1,91 @@ +package org.smartregister.chw.hf.utils; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.joda.time.Days; +import org.joda.time.LocalDate; +import org.joda.time.format.DateTimeFormat; +import org.smartregister.chw.anc.domain.MemberObject; +import org.smartregister.chw.core.helper.ContactRule; +import org.smartregister.chw.hf.HealthFacilityApplication; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class ContactUtil { + + public static Map getContactSchedule(MemberObject memberObject) { + return getContactSchedule(memberObject, LocalDate.now()); + } + + public static Map getContactSchedule(MemberObject memberObject, LocalDate startDate) { + + LocalDate lastContact = new DateTime(memberObject.getDateCreated()).toLocalDate(); + boolean isFirst = (StringUtils.isBlank(memberObject.getLastContactVisit())); + LocalDate lastMenstrualPeriod = DateTimeFormat.forPattern("dd-MM-yyyy").parseLocalDate(memberObject.getLastMenstrualPeriod()); + + if (StringUtils.isNotBlank(memberObject.getLastContactVisit())) + lastContact = DateTimeFormat.forPattern("dd-MM-yyyy").parseLocalDate(memberObject.getLastContactVisit()); + + Map dateMap = new LinkedHashMap<>(); + + // today is the due date for the very first visit + if (isFirst) { + dateMap.put(0, startDate); + } + + dateMap.putAll(ContactUtil.getContactWeeks(isFirst, lastContact, lastMenstrualPeriod)); + + return dateMap; + } + + /** + * Returns the contact schedule in weeks for the given contact + * + * @param lastContact + * @param lastMenstrualPeriod + * @return + */ + public static Map getContactWeeks(Boolean isFirst, LocalDate lastContact, LocalDate lastMenstrualPeriod) { + + try { + + int gestationAge = Days.daysBetween(lastMenstrualPeriod, lastContact).getDays() / 7; + + Map dateMap = new LinkedHashMap<>(); + ContactRule contactRule = new ContactRule(gestationAge, isFirst); + + LocalDate expectedDeliveryDate = lastMenstrualPeriod.plusDays(280); + + // gets the list of contacts + List weeks = HealthFacilityApplication.getInstance().getRulesEngineHelper() + .getContactVisitSchedule(contactRule, Constants.RULE_FILE.CONTACT_RULES); + + boolean visitAfterEdd = false; + for (Integer i : weeks) { + + LocalDate visitDate = lastMenstrualPeriod.plusWeeks(i).plusDays(1); + if (visitDate.isBefore(expectedDeliveryDate) || visitDate.isEqual(expectedDeliveryDate)) { + dateMap.put(i, visitDate); + } else { + visitAfterEdd = true; + } + } + + // remove a day form the last day + if (visitAfterEdd) { + dateMap.put(weeks.get(dateMap.size()), expectedDeliveryDate); + } + + return dateMap; + } catch (Exception e) { + Timber.e(e); + } + + return new LinkedHashMap<>(); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HFFamilyPlanningUtil.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HFFamilyPlanningUtil.java index 6fe4f0aa5..a9cf3cc4b 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HFFamilyPlanningUtil.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HFFamilyPlanningUtil.java @@ -10,7 +10,6 @@ import org.smartregister.chw.anc.util.NCUtils; import org.smartregister.chw.core.dao.ChwNotificationDao; import org.smartregister.chw.core.utils.CoreConstants; -import org.smartregister.chw.core.utils.CoreJsonFormUtils; import org.smartregister.chw.core.utils.CoreReferralUtils; import org.smartregister.chw.fp.FpLibrary; import org.smartregister.chw.fp.util.FpJsonFormUtils; @@ -21,9 +20,6 @@ import timber.log.Timber; -import static org.smartregister.chw.hf.utils.JsonFormUtils.SYNC_LOCATION_ID; -import static org.smartregister.util.JsonFormUtils.STEP1; - public class HFFamilyPlanningUtil extends FpUtil { public static void saveFormEvent(final String jsonString) throws Exception { @@ -43,12 +39,7 @@ public static void createFamilyPlanningUpdateEvent(String jsonString, String bas AllSharedPreferences allSharedPreferences = Utils.getAllSharedPreferences(); Event baseEvent = org.smartregister.chw.anc.util.JsonFormUtils.processJsonForm(allSharedPreferences, CoreReferralUtils.setEntityId(formObject.toString(), baseEntityId), CoreConstants.TABLE_NAME.FAMILY_PLANNING_UPDATE); org.smartregister.chw.anc.util.JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); - try { - JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), STEP1, SYNC_LOCATION_ID); - baseEvent.setLocationId(CoreJsonFormUtils.getSyncLocationUUIDFromDropdown(syncLocationField)); - } catch (JSONException e) { - Timber.e(e, "Error retrieving Sync location Field"); - } + baseEvent.setLocationId(ChwNotificationDao.getSyncLocationId(baseEntityId)); NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(JsonFormUtils.gson.toJson(baseEvent))); } catch (Exception ex) { Timber.e(ex); diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HeiVisitUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HeiVisitUtils.java new file mode 100644 index 000000000..a5975d57c --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HeiVisitUtils.java @@ -0,0 +1,225 @@ +package org.smartregister.chw.hf.utils; + +import com.google.gson.Gson; + +import org.json.JSONArray; +import org.json.JSONObject; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.hf.dao.HeiDao; +import org.smartregister.chw.hiv.util.DBConstants; +import org.smartregister.chw.pmtct.PmtctLibrary; +import org.smartregister.chw.pmtct.domain.MemberObject; +import org.smartregister.chw.pmtct.domain.Visit; +import org.smartregister.chw.pmtct.repository.VisitDetailsRepository; +import org.smartregister.chw.pmtct.repository.VisitRepository; +import org.smartregister.chw.pmtct.util.VisitUtils; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.clientandeventmodel.Obs; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import timber.log.Timber; + +public class HeiVisitUtils extends VisitUtils { + public static void processVisits() throws Exception { + processVisits(PmtctLibrary.getInstance().visitRepository(), PmtctLibrary.getInstance().visitDetailsRepository()); + } + + public static void processVisits(VisitRepository visitRepository, VisitDetailsRepository visitDetailsRepository) throws Exception { + + List visits = visitRepository.getAllUnSynced(); + List heiFollowupVisits = new ArrayList<>(); + + + for (Visit v : visits) { + Date visitDate = new Date(v.getDate().getTime()); + int daysDiff = TimeUtils.getElapsedDays(visitDate); + if (daysDiff >= 1 && v.getVisitType().equalsIgnoreCase(Constants.Events.HEI_FOLLOWUP)) { + try { + heiFollowupVisits.add(v); + } catch (Exception e) { + Timber.e(e); + } + } + + } + + if (heiFollowupVisits.size() > 0) { + processVisits(heiFollowupVisits, visitRepository, visitDetailsRepository); + for (Visit v : heiFollowupVisits) { + boolean confirmedNegative = isClientConfirmedNegative(v); + boolean confirmedPositive = isClientConfirmedPositive(v); + if (confirmedPositive || confirmedNegative) { + createCancelledEvent(v, confirmedPositive); + } + } + } + } + + public static boolean isClientConfirmedPositive(Visit visit) { + try { + JSONObject jsonObject = new JSONObject(visit.getJson()); + JSONArray obs = jsonObject.getJSONArray("obs"); + int size = obs.length(); + boolean testPositive = false; + boolean confirmed = false; + int breakLoop = 0; + for (int i = 0; i < size; i++) { + JSONObject checkObj = obs.getJSONObject(i); + if (checkObj.getString("fieldCode").equalsIgnoreCase("hiv_status")) { + breakLoop++; + JSONArray values = checkObj.getJSONArray("values"); + if ((values.getString(0).equalsIgnoreCase("positive"))) { + testPositive = true; + } + } + if (checkObj.getString("fieldCode").equalsIgnoreCase("confirmation_hiv_test_result")) { + breakLoop++; + JSONArray values = checkObj.getJSONArray("values"); + if ((values.getString(0).equalsIgnoreCase("yes"))) { + confirmed = true; + } + } + if (breakLoop == 2) { + break; + } + } + if (testPositive && confirmed) { + return true; + } + } catch (Exception e) { + Timber.e(e); + } + return false; + } + + public static boolean isClientConfirmedNegative(Visit visit) { + if (!HeiDao.getNextHivTestAge(visit.getBaseEntityId()).equalsIgnoreCase(Constants.HeiHIVTestAtAge.AT_18_MONTHS)) { + return false; + } + try { + JSONObject jsonObject = new JSONObject(visit.getJson()); + JSONArray obs = jsonObject.getJSONArray("obs"); + int size = obs.length(); + for (int i = 0; i < size; i++) { + JSONObject checkObj = obs.getJSONObject(i); + if (checkObj.getString("fieldCode").equalsIgnoreCase("hiv_status")) { + JSONArray values = checkObj.getJSONArray("values"); + if ((values.getString(0).equalsIgnoreCase("negative"))) { + return true; + } + } + } + } catch (Exception e) { + Timber.e(e); + } + return false; + } + + private static void createCancelledEvent(Visit v, boolean isPositiveConfirmed) throws Exception { + String json = v.getJson(); + String baseEntityId = v.getBaseEntityId(); + AllSharedPreferences allSharedPreferences = AncLibrary.getInstance().context().allSharedPreferences(); + Event closePmtctEvent = getClosePmtctEvent(json, baseEntityId); + + Event closeHEIEvent; + if (isPositiveConfirmed) { + //close if positive HEI + closeHEIEvent = getCloseEventForPositive(json, baseEntityId); + } else { + //close if negative HEI + closeHEIEvent = getCloseEventForNegative(json, baseEntityId); + } + NCUtils.addEvent(allSharedPreferences, closeHEIEvent); + NCUtils.startClientProcessing(); + + //process close PMTCT event regardless of hiv status + NCUtils.addEvent(allSharedPreferences, closePmtctEvent); + NCUtils.startClientProcessing(); + } + + protected static Event getCloseEventForPositive(String jsonString, String baseEntityId) { + Event closeHeiEvent = new Gson().fromJson(jsonString, Event.class); + + closeHeiEvent.setEntityType(Constants.TableName.HEI_HIV_RESULTS); + closeHeiEvent.setEventType(Constants.Events.HEI_POSITIVE_INFANT); + closeHeiEvent.setBaseEntityId(baseEntityId); + closeHeiEvent.addObs( + (new Obs()) + .withFormSubmissionField(Constants.DBConstants.HIV_REGISTRATION_DATE) + .withValue(System.currentTimeMillis()) + .withFieldCode(Constants.DBConstants.HIV_REGISTRATION_DATE) + .withFieldType("formsubmissionField") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + closeHeiEvent.addObs( + (new Obs()) + .withFormSubmissionField(DBConstants.Key.CLIENT_HIV_STATUS_DURING_REGISTRATION) + .withValue("positive") + .withFieldCode(DBConstants.Key.CLIENT_HIV_STATUS_DURING_REGISTRATION) + .withFieldType("formsubmissionField") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + closeHeiEvent.addObs( + (new Obs()) + .withFieldCode(DBConstants.Key.CLIENT_HIV_STATUS_AFTER_TESTING) + .withFormSubmissionField(DBConstants.Key.TEST_RESULTS) + .withValue("positive") + .withFieldType("formsubmissionField") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + + return closeHeiEvent; + } + + protected static Event getCloseEventForNegative(String jsonString, String baseEntityId) { + Event closeHeiEvent = new Gson().fromJson(jsonString, Event.class); + + closeHeiEvent.setEntityType(Constants.TableName.HEI_HIV_RESULTS); + closeHeiEvent.setEventType(Constants.Events.HEI_NEGATIVE_INFANT); + closeHeiEvent.setBaseEntityId(baseEntityId); + + return closeHeiEvent; + } + + protected static Event getClosePmtctEvent(String jsonString, String baseEntityId) { + Event closePmtctEvent = new Gson().fromJson(jsonString, Event.class); + + closePmtctEvent.setEntityType(org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_REGISTRATION); + closePmtctEvent.setEventType(Constants.Events.PMTCT_CLOSE_VISITS); + closePmtctEvent.setBaseEntityId(HeiDao.getMotherBaseEntityId(baseEntityId)); + closePmtctEvent.setFormSubmissionId(JsonFormUtils.generateRandomUUIDString()); + closePmtctEvent.setEventDate(new Date()); + return closePmtctEvent; + } + + + public static void closePmtctForDeceasedHei(String heiBaseEntityId) { + String motherBaseEntityId = HeiDao.getMotherBaseEntityId(heiBaseEntityId); + List heiChildren = HeiDao.getMembersByMotherBaseEntityId(motherBaseEntityId); + boolean hasOtherHeiChildren = false; + for (MemberObject memberObject : heiChildren) { + if (!heiBaseEntityId.equals(memberObject.getBaseEntityId())) { + hasOtherHeiChildren = true; + } + } + if (!hasOtherHeiChildren) { + AllSharedPreferences allSharedPreferences = AncLibrary.getInstance().context().allSharedPreferences(); + Event closePmtctEvent = getClosePmtctEvent(new JSONObject().toString(), heiBaseEntityId); + try { + NCUtils.addEvent(allSharedPreferences, closePmtctEvent); + NCUtils.startClientProcessing(); + } catch (Exception e) { + Timber.e(e); + } + } + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfAncJsonFormUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfAncJsonFormUtils.java new file mode 100644 index 000000000..1e4faa28a --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfAncJsonFormUtils.java @@ -0,0 +1,162 @@ +package org.smartregister.chw.hf.utils; + +import com.vijay.jsonwizard.constants.JsonFormConstants; + +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.Nullable; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.util.JsonFormUtils; +import org.smartregister.chw.anc.util.NCUtils; + +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import timber.log.Timber; + +public class HfAncJsonFormUtils extends JsonFormUtils { + public static void populateForm(@Nullable JSONObject jsonObject, Map> details) { + if (details == null || jsonObject == null) return; + try { + // x steps + String count_str = jsonObject.getString(JsonFormConstants.COUNT); + + int step_count = StringUtils.isNotBlank(count_str) ? Integer.valueOf(count_str) : 1; + while (step_count > 0) { + JSONArray jsonArray = jsonObject.getJSONObject(MessageFormat.format("step{0}", step_count)).getJSONArray(JsonFormConstants.FIELDS); + + int field_count = jsonArray.length() - 1; + while (field_count >= 0) { + + JSONObject jo = jsonArray.getJSONObject(field_count); + String key = jo.getString(JsonFormConstants.KEY); + List detailList = details.get(key); + + if (detailList != null) { + if (jo.getString(JsonFormConstants.TYPE).equalsIgnoreCase(JsonFormConstants.CHECK_BOX)) { + jo.put(JsonFormConstants.VALUE, getValue(jo, detailList)); + } else { + String value = getValue(detailList.get(0)); + if (key.contains("date")) { + value = NCUtils.getFormattedDate(NCUtils.getSaveDateFormat(), NCUtils.getSourceDateFormat(), value); + } + jo.put(JsonFormConstants.VALUE, value); + } + } + + field_count--; + } + + step_count--; + } + + } catch (Exception e) { + Timber.e(e); + } + } + + public static JSONArray getValue(JSONObject jo, List visitDetails) throws JSONException { + JSONArray values = new JSONArray(); + if (jo.getString(JsonFormConstants.TYPE).equalsIgnoreCase(JsonFormConstants.CHECK_BOX)) { + JSONArray options = jo.getJSONArray(JsonFormConstants.OPTIONS_FIELD_NAME); + HashMap valueMap = new HashMap<>(); + + int x = options.length() - 1; + while (x >= 0) { + JSONObject object = options.getJSONObject(x); + valueMap.put(object.getString(JsonFormConstants.KEY), new NameID(object.getString(JsonFormConstants.KEY), x)); + x--; + } + + for (VisitDetail d : visitDetails) { + String val = getValue(d); + List checkedList = new ArrayList<>(Arrays.asList(val.split(", "))); + if (checkedList.size() > 1) { + for (String item : checkedList) { + NameID nid = valueMap.get(item); + if (nid != null) { + values.put(nid.name); + options.getJSONObject(nid.position).put(JsonFormConstants.VALUE, true); + } + } + } else { + NameID nid = valueMap.get(val); + if (nid != null) { + values.put(nid.name); + options.getJSONObject(nid.position).put(JsonFormConstants.VALUE, true); + } + } + } + } else { + for (VisitDetail d : visitDetails) { + String val = getValue(d); + if (StringUtils.isNotBlank(val)) { + values.put(val); + } + } + } + return values; + } + + /** + * Returns a value from a native forms checkbox field and returns an comma separated string + * + * @param jsonObject native forms jsonObject + * @param key field object key + * @return value + */ + public static String getCheckBoxValue(JSONObject jsonObject, String key) { + try { + JSONArray jsonArray = jsonObject.getJSONObject(JsonFormConstants.STEP1).getJSONArray(JsonFormConstants.FIELDS); + + JSONObject jo = null; + int x = 0; + while (jsonArray.length() > x) { + jo = jsonArray.getJSONObject(x); + if (jo.getString(JsonFormConstants.KEY).equalsIgnoreCase(key)) { + break; + } + x++; + } + + StringBuilder resBuilder = new StringBuilder(); + if (jo != null) { + // read all the checkboxes + JSONArray jaOptions = jo.getJSONArray(JsonFormConstants.OPTIONS_FIELD_NAME); + int optionSize = jaOptions.length(); + int y = 0; + while (optionSize > y) { + JSONObject options = jaOptions.getJSONObject(y); + if (options.has(JsonFormConstants.VALUE) && options.getBoolean(JsonFormConstants.VALUE)) { + resBuilder.append(options.getString(JsonFormConstants.TEXT)).append(", "); + } + y++; + } + + String res = resBuilder.toString(); + res = (res.length() >= 2) ? res.substring(0, res.length() - 2) : ""; + return res; + } + + } catch (Exception e) { + Timber.e(e); + } + return ""; + } + + private static class NameID { + private String name; + private int position; + + public NameID(String name, int position) { + this.name = name; + this.position = position; + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfChildUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfChildUtils.java index a7d4e5f52..91236e328 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfChildUtils.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfChildUtils.java @@ -1,18 +1,25 @@ package org.smartregister.chw.hf.utils; +import net.sqlcipher.database.SQLiteDatabase; + import org.json.JSONObject; import org.smartregister.chw.core.utils.CoreChildUtils; import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.chw.core.utils.CoreJsonFormUtils; import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.pnc.PncLibrary; +import org.smartregister.chw.pnc.repository.ProfileRepository; import org.smartregister.clientandeventmodel.Event; import org.smartregister.clientandeventmodel.Obs; +import org.smartregister.commonregistry.CommonPersonObjectClient; import org.smartregister.family.FamilyLibrary; +import org.smartregister.family.util.DBConstants; import org.smartregister.repository.BaseRepository; import org.smartregister.sync.helper.ECSyncHelper; import java.util.ArrayList; import java.util.Date; +import java.util.HashMap; import java.util.Map; import timber.log.Timber; @@ -77,4 +84,35 @@ public static void updateHomeVisitAsEvent(String entityId, String eventType, Str Timber.e(e); } } + + public static CommonPersonObjectClient getChildClientByBaseEntityId(String baseEntityId) { + CommonPersonObjectClient child = null; + ProfileRepository profileRepository = PncLibrary.getInstance().profileRepository(); + SQLiteDatabase database = profileRepository.getReadableDatabase(); + net.sqlcipher.Cursor cursor; + + try { + if (database == null) { + return null; + } + cursor = database.rawQuery("SELECT * FROM " + CoreConstants.TABLE_NAME.CHILD + " WHERE base_entity_id = ? AND is_closed = 0 ", new String[]{baseEntityId}); + if (cursor != null && cursor.getCount() > 0 && cursor.moveToFirst()) { + String[] columnNames = cursor.getColumnNames(); + Map details = new HashMap<>(); + + for (String columnName : columnNames) { + details.put(columnName, cursor.getString(cursor.getColumnIndex(columnName))); + } + + CommonPersonObjectClient commonPersonObject = new CommonPersonObjectClient("", details, ""); + commonPersonObject.setColumnmaps(details); + commonPersonObject.setCaseId(cursor.getString(cursor.getColumnIndex(DBConstants.KEY.BASE_ENTITY_ID))); + child = commonPersonObject; + } + } catch (Exception e) { + Timber.e(e); + } + + return child; + } } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfHivTbFeedbackUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfHivTbFeedbackUtils.java new file mode 100644 index 000000000..b441c2449 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfHivTbFeedbackUtils.java @@ -0,0 +1,45 @@ +package org.smartregister.chw.hf.utils; + +import static org.smartregister.chw.hiv.util.DBConstants.Key.HIV_COMMUNITY_FOLLOWUP_VISIT_DATE; + +import android.view.View; +import android.widget.TextView; + +import org.joda.time.DateTime; +import org.joda.time.Duration; +import org.smartregister.chw.hf.R; +import org.smartregister.chw.tb.util.DBConstants; +import org.smartregister.commonregistry.CommonPersonObjectClient; + +import java.math.BigDecimal; +import java.util.Calendar; + +public class HfHivTbFeedbackUtils { + public static void displayReferralDay(CommonPersonObjectClient client, TextView textViewReferralDay) { + + String followupDate = null; + if (client.getColumnmaps().get(DBConstants.Key.TB_COMMUNITY_FOLLOWUP_VISIT_DATE) != null) { + followupDate = client.getColumnmaps().get(DBConstants.Key.TB_COMMUNITY_FOLLOWUP_VISIT_DATE); + } else if (client.getColumnmaps().get(HIV_COMMUNITY_FOLLOWUP_VISIT_DATE) != null) { + followupDate = client.getColumnmaps().get(HIV_COMMUNITY_FOLLOWUP_VISIT_DATE); + } + + + if (followupDate != null) { + textViewReferralDay.setVisibility(View.VISIBLE); + String referralDay = textViewReferralDay.getContext().getResources().getString( + R.string.feedback_day, getReferralPeriod(new DateTime(new BigDecimal(followupDate).longValue()))); + textViewReferralDay.setText(referralDay); + } else { + textViewReferralDay.setVisibility(View.GONE); + } + } + + private static String getReferralPeriod(DateTime executionStartDate) { + String standardDays = String.valueOf(new Duration(executionStartDate, + new DateTime(Calendar.getInstance().getTime())).abs().toStandardDays()); + + return standardDays.toLowerCase().replace("p", ""); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfHomeVisitUtil.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfHomeVisitUtil.java new file mode 100644 index 000000000..cd1fdb6fa --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfHomeVisitUtil.java @@ -0,0 +1,24 @@ +package org.smartregister.chw.hf.utils; + +import org.smartregister.chw.core.application.CoreChwApplication; +import org.smartregister.chw.core.rule.PmtctFollowUpRule; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.core.utils.HomeVisitUtil; +import org.smartregister.chw.hf.rule.HfHeiFollowupRule; +import org.smartregister.chw.hf.rule.HfPmtctFollowupRule; + +import java.util.Date; + +public class HfHomeVisitUtil extends HomeVisitUtil { + public static HfHeiFollowupRule getHeiVisitStatus(Date heiStartDate, Date followupDate, String baseEntityId) { + HfHeiFollowupRule heiFollowupRule = new HfHeiFollowupRule(heiStartDate, followupDate, baseEntityId); + CoreChwApplication.getInstance().getRulesEngineHelper().getHeiRule(heiFollowupRule, CoreConstants.RULE_FILE.HEI_FOLLOWUP_VISIT); + return heiFollowupRule; + } + + public static PmtctFollowUpRule getPmtctVisitStatus(Date pmtctRegisterDate, Date followUpDate, String baseEntityId) { + PmtctFollowUpRule pmtctFollowUpRule = new HfPmtctFollowupRule(pmtctRegisterDate, followUpDate, baseEntityId); + CoreChwApplication.getInstance().getRulesEngineHelper().getPmtctRule(pmtctFollowUpRule, CoreConstants.RULE_FILE.PMTCT_FOLLOW_UP_VISIT); + return pmtctFollowUpRule; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfQueryConstant.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfQueryConstant.java new file mode 100644 index 000000000..e7958f773 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfQueryConstant.java @@ -0,0 +1,508 @@ +package org.smartregister.chw.hf.utils; + +public interface HfQueryConstant { + String ALL_CLIENTS_SELECT_QUERY = " SELECT * FROM (" + + "/*INDEPENDENT MEMBERS*/\n" + + "SELECT ec_family_member.first_name,\n" + + " ec_family_member.middle_name,\n" + + " ec_family_member.last_name,\n" + + " ec_family_member.gender,\n" + + " ec_family_member.dob,\n" + + " ec_family_member.base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " 'Independent' AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " NULL AS mother_first_name,\n" + + " NULL AS mother_last_name,\n" + + " NULL AS mother_middle_name,\n" + + " ec_family_member.last_interacted_with AS last_interacted_with\n" + + "FROM ec_family_member\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " AND ec_family.entity_type = 'ec_independent_client'\n" + + " AND ec_family_member.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register where ec_anc_register.is_closed is 0 and ec_anc_register.confirmation_status = 'Confirmed'\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome where (ec_pregnancy_outcome.delivery_date is not null AND ec_pregnancy_outcome.is_closed is 0)\n" + + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_kvp_register.base_entity_id AS base_entity_id\n" + + " FROM ec_kvp_register\n" + + " WHERE ec_kvp_register.is_closed is 0 "+ + " UNION ALL\n" + + " SELECT ec_malaria_confirmation.base_entity_id AS base_entity_id\n" + + " FROM ec_malaria_confirmation\n" + + " UNION ALL\n" + + " SELECT ec_family_planning.base_entity_id AS base_entity_id\n" + + " FROM ec_family_planning\n" + + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null\n" + + " UNION ALL\n" + + " SELECT ec_hiv_index_hf.base_entity_id AS base_entity_id\n" + + " FROM ec_hiv_index_hf\n" + + " UNION ALL\n" + + " SELECT ec_hiv_register.base_entity_id AS base_entity_id\n" + + " FROM ec_hiv_register WHERE (UPPER (ec_hiv_register.client_hiv_status_after_testing) LIKE UPPER('Positive')) \n" + + " UNION ALL\n" + + " SELECT ec_hts_register.base_entity_id AS base_entity_id\n" + + " FROM ec_hts_register \n"+ + " WHERE ec_hts_register.is_closed is 0\n" + + " AND ec_hts_register.ctc_number is null \n " + + " AND ec_hts_register.chw_referral_service = 'Conventional HIV Test' \n"+ + " AND (ec_hts_register.client_hiv_status_after_testing IS NULL) \n"+ + " UNION ALL\n" + + " SELECT ec_ld_confirmation.base_entity_id AS base_entity_id\n" + + " FROM ec_ld_confirmation \n" + + " WHERE labour_confirmation = 'true' AND is_closed is 0\n" + + ")" + + "UNION ALL" + + "/* HIV REGISTER */\n" + + "\n" + + "SELECT ec_family_member.first_name AS first_name,\n" + + " ec_family_member.middle_name AS middle_name,\n" + + " ec_family_member.last_name AS last_name,\n" + + " ec_family_member.gender AS gender,\n" + + " ec_family_member.dob AS dob,\n" + + " ec_family_member.base_entity_id AS base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " 'HIV' AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " NULL AS mother_first_name,\n" + + " NULL AS mother_last_name,\n" + + " NULL AS mother_middle_name,\n" + + " ec_hiv_register.last_interacted_with AS last_interacted_with\n" + + "FROM ec_hiv_register\n" + + " inner join ec_family_member on ec_family_member.base_entity_id = ec_hiv_register.base_entity_id\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " and ec_hiv_register.is_closed is 0\n" + + " AND (UPPER (ec_hiv_register.client_hiv_status_after_testing) LIKE UPPER('Positive')) \n"+ + " AND ec_hiv_register.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register where ec_anc_register.is_closed is 0\n" + + " UNION ALL\n" + + " SELECT ec_kvp_register.base_entity_id AS base_entity_id\n" + + " FROM ec_kvp_register\n" + + " WHERE ec_kvp_register.is_closed is 0 "+ + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome where (ec_pregnancy_outcome.delivery_date is not null AND ec_pregnancy_outcome.is_closed is 0)\n" + + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null\n" + + ")\n" + + "\n" + + "UNION ALL" + + "/* HTS REGISTER */\n" + + "\n" + + "SELECT ec_family_member.first_name AS first_name,\n" + + " ec_family_member.middle_name AS middle_name,\n" + + " ec_family_member.last_name AS last_name,\n" + + " ec_family_member.gender AS gender,\n" + + " ec_family_member.dob AS dob,\n" + + " ec_family_member.base_entity_id AS base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " 'HTS' AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " NULL AS mother_first_name,\n" + + " NULL AS mother_last_name,\n" + + " NULL AS mother_middle_name,\n" + + " ec_hts_register.last_interacted_with AS last_interacted_with\n" + + "FROM ec_hts_register\n" + + " inner join ec_family_member on ec_family_member.base_entity_id = ec_hts_register.base_entity_id\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " and ec_hts_register.is_closed is 0\n" + + " AND ec_hts_register.ctc_number is null \n " + + " AND ec_hts_register.chw_referral_service = 'Conventional HIV Test' \n"+ + " AND (ec_hts_register.client_hiv_status_after_testing IS NULL) \n"+ + " AND ec_hts_register.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome\n" + + " UNION ALL\n" + + " SELECT ec_kvp_register.base_entity_id AS base_entity_id\n" + + " FROM ec_kvp_register\n" + + " WHERE ec_kvp_register.is_closed is 0 "+ + " UNION ALL \n" + + " SELECT ec_hiv_index_hf.base_entity_id AS base_entity_id\n" + + " FROM ec_hiv_index_hf\n" + + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null\n" + + ")\n" + + "\n" + + "UNION ALL\n" + + "/*OTHER FAMILY MEMBERS*/\n" + + "SELECT ec_family_member.first_name,\n" + + " ec_family_member.middle_name,\n" + + " ec_family_member.last_name,\n" + + " ec_family_member.gender,\n" + + " ec_family_member.dob,\n" + + " ec_family_member.base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " NULL AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " NULL AS mother_first_name,\n" + + " NULL AS mother_last_name,\n" + + " NULL AS mother_middle_name,\n" + + " ec_family_member.last_interacted_with AS last_interacted_with\n" + + "FROM ec_family_member\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " AND (ec_family.entity_type = 'ec_family' OR ec_family.entity_type is null)\n" + + " AND ec_family_member.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register where ec_anc_register.is_closed is 0\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome where ec_pregnancy_outcome.delivery_date is not null\n" + + " UNION ALL\n" + + " SELECT ec_kvp_register.base_entity_id AS base_entity_id\n" + + " FROM ec_kvp_register\n" + + " WHERE ec_kvp_register.is_closed is 0 "+ + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_malaria_confirmation.base_entity_id AS base_entity_id\n" + + " FROM ec_malaria_confirmation\n" + + " UNION ALL\n" + + " SELECT ec_family_planning.base_entity_id AS base_entity_id\n" + + " FROM ec_family_planning\n" + + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null\n" + + " UNION ALL\n" + + " SELECT ec_hiv_register.base_entity_id AS base_entity_id\n" + + " FROM ec_hiv_register\n" + + ")\n" + + "UNION ALL\n" + + "/* ANC REGISTER */\n" + + "SELECT ec_family_member.first_name AS first_name,\n" + + " ec_family_member.middle_name AS middle_name,\n" + + " ec_family_member.last_name AS last_name,\n" + + " ec_family_member.gender AS gender,\n" + + " ec_family_member.dob AS dob,\n" + + " ec_family_member.base_entity_id AS base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " 'ANC' AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " NULL AS mother_first_name,\n" + + " NULL AS mother_last_name,\n" + + " NULL AS mother_middle_name,\n" + + " ec_anc_register.last_interacted_with AS last_interacted_with\n" + + "FROM ec_anc_register\n" + + " inner join ec_family_member on ec_family_member.base_entity_id = ec_anc_register.base_entity_id\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " and ec_anc_register.is_closed is 0\n" + + " and ec_anc_register.confirmation_status = 'Confirmed'\n" + + " and ec_anc_register.base_entity_id IN (%s)\n" + + "\n" + + "UNION ALL\n" + + "\n" + + "/* PNC REGISTER */\n" + + "\n" + + "SELECT ec_family_member.first_name AS first_name,\n" + + " ec_family_member.middle_name AS middle_name,\n" + + " ec_family_member.last_name AS last_name,\n" + + " ec_family_member.gender AS gender,\n" + + " ec_family_member.dob AS dob,\n" + + " ec_family_member.base_entity_id AS base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " 'PNC' AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " NULL AS mother_first_name,\n" + + " NULL AS mother_last_name,\n" + + " NULL AS mother_middle_name,\n" + + " ec_pregnancy_outcome.last_interacted_with AS last_interacted_with\n" + + "FROM ec_pregnancy_outcome\n" + + " inner join ec_family_member on ec_family_member.base_entity_id = ec_pregnancy_outcome.base_entity_id\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " and ec_pregnancy_outcome.is_closed is 0\n" + + " and ec_pregnancy_outcome.delivery_date is not null\n" + + " AND ec_pregnancy_outcome.base_entity_id NOT IN\n" + + " (SELECT base_entity_id FROM ec_anc_register WHERE ec_anc_register.is_closed IS 0)\n" + + " AND ec_pregnancy_outcome.base_entity_id IN (%s)\n" + + "\n" + + "UNION ALL\n" + + "/* CHILD REGISTER */\n" + + "\n" + + "SELECT ec_family_member.first_name AS first_name,\n" + + " ec_family_member.middle_name AS middle_name,\n" + + " ec_family_member.last_name AS last_name,\n" + + " ec_family_member.gender AS gender,\n" + + " ec_family_member.dob AS dob,\n" + + " ec_family_member.base_entity_id AS base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " 'Child' AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " ec_child.mother_first_name AS mother_first_name,\n" + + " ec_child.mother_middle_name AS mother_middle_name,\n" + + " ec_child.mother_last_name AS mother_last_name,\n" + + " ec_child.last_interacted_with AS last_interacted_with\n" + + "FROM (SELECT ec_child.*,\n" + + " mother.first_name AS mother_first_name,\n" + + " mother.last_name AS mother_last_name,\n" + + " mother.middle_name AS mother_middle_name\n" + + " FROM ec_child\n" + + " inner join ec_family on ec_family.base_entity_id = ec_child.relational_id\n" + + " INNER JOIN ec_family_member AS mother ON ec_family.primary_caregiver = mother.base_entity_id\n" + + " ) ec_child\n" + + " inner join ec_family_member on ec_family_member.base_entity_id = ec_child.base_entity_id\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "WHERE ec_family_member.is_closed = '0'\n" + + " AND ec_family_member.date_removed is null\n" + + " AND cast(strftime('%Y-%m-%d %H:%M:%S', 'now') - strftime('%Y-%m-%d %H:%M:%S', ec_child.dob) as int) > 0\n" + + " AND ec_child.base_entity_id IN (%s)\n" + + "\n" + + "UNION ALL\n" + + "/* TB REGISTER */\n" + + "\n" + + "SELECT ec_family_member.first_name AS first_name,\n" + + " ec_family_member.middle_name AS middle_name,\n" + + " ec_family_member.last_name AS last_name,\n" + + " ec_family_member.gender AS gender,\n" + + " ec_family_member.dob AS dob,\n" + + " ec_family_member.base_entity_id AS base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " 'TB' AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " ec_tb_register.last_interacted_with AS last_interacted_with,\n" + + " NULL AS mother_first_name,\n" + + " NULL AS mother_last_name,\n" + + " NULL AS mother_middle_name\n" + + "FROM ec_tb_register\n" + + " inner join ec_family_member on ec_family_member.base_entity_id = ec_tb_register.base_entity_id\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " and ec_tb_register.is_closed is 0\n" + + " and ec_tb_register.tb_case_closure_date is null\n" + + " AND ec_tb_register.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome\n" + + " UNION ALL\n" + + " SELECT ec_kvp_register.base_entity_id AS base_entity_id\n" + + " FROM ec_kvp_register\n" + + " WHERE ec_kvp_register.is_closed is 0 "+ + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + ")\n" + + "\n" + + "UNION ALL\n" + + "/*ONLY MALARIA PATIENTS*/\n" + + "SELECT ec_family_member.first_name,\n" + + " ec_family_member.middle_name,\n" + + " ec_family_member.last_name,\n" + + " ec_family_member.gender,\n" + + " ec_family_member.dob,\n" + + " ec_family_member.base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " 'Malaria' AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " NULL AS mother_first_name,\n" + + " NULL AS mother_last_name,\n" + + " NULL AS mother_middle_name,\n" + + " ec_malaria_confirmation.last_interacted_with AS last_interacted_with\n" + + "FROM ec_family_member\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + " inner join ec_malaria_confirmation\n" + + " on ec_family_member.base_entity_id = ec_malaria_confirmation.base_entity_id\n" + + "where ec_family_member.date_removed is null\n" + + " AND ec_family_member.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome\n" + + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_family_planning.base_entity_id AS base_entity_id\n" + + " FROM ec_family_planning\n" + + " UNION ALL\n" + + " SELECT ec_kvp_register.base_entity_id AS base_entity_id\n" + + " FROM ec_kvp_register\n" + + " WHERE ec_kvp_register.is_closed is 0 "+ + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null\n" + + " UNION ALL\n" + + " SELECT ec_hiv_register.base_entity_id AS base_entity_id\n" + + " FROM ec_hiv_register\n" + + ")\n" + + "UNION ALL\n" + + "\n" + + "/*ONLY FAMILY PLANNING PATIENTS*/\n" + + "SELECT ec_family_member.first_name,\n" + + " ec_family_member.middle_name,\n" + + " ec_family_member.last_name,\n" + + " ec_family_member.gender,\n" + + " ec_family_member.dob,\n" + + " ec_family_member.base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " 'Family Planning' AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " NULL AS mother_first_name,\n" + + " NULL AS mother_last_name,\n" + + " NULL AS mother_middle_name,\n" + + " ec_family_planning.last_interacted_with AS last_interacted_with\n" + + "FROM ec_family_member\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + " inner join ec_family_planning\n" + + " on ec_family_member.base_entity_id = ec_family_planning.base_entity_id\n" + + "where ec_family_member.date_removed is null\n" + + " AND ec_family_planning.is_closed is 0\n" + + " AND ec_family_member.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome\n" + + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_kvp_register.base_entity_id AS base_entity_id\n" + + " FROM ec_kvp_register\n" + + " WHERE ec_kvp_register.is_closed is 0 "+ + " UNION ALL\n" + + " SELECT ec_malaria_confirmation.base_entity_id AS base_entity_id\n" + + " FROM ec_malaria_confirmation\n" + + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null\n" + + " UNION ALL\n" + + " SELECT ec_hiv_register.base_entity_id AS base_entity_id\n" + + " FROM ec_hiv_register)\n" + + "UNION ALL\n" + + "\n" + + "/*ONLY LABOUR AND DELIVERY PATIENTS*/\n" + + "SELECT ec_family_member.first_name,\n" + + " ec_family_member.middle_name,\n" + + " ec_family_member.last_name,\n" + + " ec_family_member.gender,\n" + + " ec_family_member.dob,\n" + + " ec_family_member.base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " 'Labour & Delivery' AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " NULL AS mother_first_name,\n" + + " NULL AS mother_last_name,\n" + + " NULL AS mother_middle_name,\n" + + " ec_ld_confirmation.last_interacted_with AS last_interacted_with\n" + + "FROM ec_family_member\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + " inner join ec_ld_confirmation\n" + + " on ec_family_member.base_entity_id = ec_ld_confirmation.base_entity_id\n" + + "where ec_family_member.date_removed is null\n" + + " AND ec_ld_confirmation.is_closed is 0\n" + + " AND ec_ld_confirmation.labour_confirmation = 'true'\n" + + " AND ec_family_member.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register where ec_anc_register.is_closed is 0\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome\n" + + " UNION ALL\n" + + " SELECT ec_kvp_register.base_entity_id AS base_entity_id\n" + + " FROM ec_kvp_register\n" + + " WHERE ec_kvp_register.is_closed is 0 "+ + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_malaria_confirmation.base_entity_id AS base_entity_id\n" + + " FROM ec_malaria_confirmation\n" + + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null)\n" + + "UNION ALL\n" + + "\n" + + "/*ONLY KVP CLIENTS */\n" + + "SELECT ec_family_member.first_name,\n" + + " ec_family_member.middle_name,\n" + + " ec_family_member.last_name,\n" + + " ec_family_member.gender,\n" + + " ec_family_member.dob,\n" + + " ec_family_member.base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " 'KVP' AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " NULL AS mother_first_name,\n" + + " NULL AS mother_last_name,\n" + + " NULL AS mother_middle_name,\n" + + " ec_kvp_register.last_interacted_with AS last_interacted_with\n" + + "FROM ec_family_member\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + " inner join ec_kvp_register\n" + + " on ec_family_member.base_entity_id = ec_kvp_register.base_entity_id\n" + + "where ec_family_member.date_removed is null\n" + + " AND ec_kvp_register.is_closed is 0\n" + + " AND ec_family_member.base_entity_id IN (%s)\n" + + " AND ec_family_member.base_entity_id NOT IN (\n" + + " SELECT ec_anc_register.base_entity_id AS base_entity_id\n" + + " FROM ec_anc_register where ec_anc_register.is_closed is 0\n" + + " UNION ALL\n" + + " SELECT ec_pregnancy_outcome.base_entity_id AS base_entity_id\n" + + " FROM ec_pregnancy_outcome\n" + + " UNION ALL\n" + + " SELECT ec_child.base_entity_id AS base_entity_id\n" + + " FROM ec_child\n" + + " UNION ALL\n" + + " SELECT ec_malaria_confirmation.base_entity_id AS base_entity_id\n" + + " FROM ec_malaria_confirmation\n" + + " UNION ALL\n" + + " SELECT ec_tb_register.base_entity_id AS base_entity_id\n" + + " FROM ec_tb_register\n" + + " WHERE ec_tb_register.tb_case_closure_date is null)\n" + + ")\n" + + "ORDER BY last_interacted_with DESC;"; +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfQueryForMaleClients.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfQueryForMaleClients.java new file mode 100644 index 000000000..30c1beda6 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfQueryForMaleClients.java @@ -0,0 +1,28 @@ +package org.smartregister.chw.hf.utils; + +public interface HfQueryForMaleClients { + String ALL_MALE_CLIENTS_SELECT_QUERY = "" + + "/*INDEPENDENT MEMBERS*/\n" + + "SELECT ec_family_member.first_name,\n" + + " ec_family_member.middle_name,\n" + + " ec_family_member.last_name,\n" + + " ec_family_member.gender,\n" + + " ec_family_member.dob,\n" + + " ec_family_member.base_entity_id,\n" + + " ec_family_member.id as _id,\n" + + " 'Independent' AS register_type,\n" + + " ec_family_member.relational_id as relationalid,\n" + + " ec_family.village_town as home_address,\n" + + " NULL AS mother_first_name,\n" + + " NULL AS mother_last_name,\n" + + " NULL AS mother_middle_name,\n" + + " ec_family_member.last_interacted_with AS last_interacted_with\n" + + "FROM ec_family_member\n" + + " inner join ec_family on ec_family.base_entity_id = ec_family_member.relational_id\n" + + "where ec_family_member.date_removed is null\n" + + " AND ec_family.entity_type = 'ec_independent_client'\n" + + " AND ec_family_member.gender = 'Male' " + + " AND (date(ec_family_member.dob, '+15 years') <= date('now')) \n" + + " AND ec_family_member.base_entity_id IN (%s)\n" + + "ORDER BY last_interacted_with DESC;"; +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfReferralUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfReferralUtils.java index 58a2ec02c..bf2ed1b24 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfReferralUtils.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfReferralUtils.java @@ -48,7 +48,7 @@ private static Task getLatestClientReferralTask(String baseEntityId, String refe public static String getReferralDueFilter(String tableName, String taskFocus) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append( - " SELECT distinct (task.for) ") + " SELECT distinct (task.for) ") .append(" FROM task ") .append(" INNER JOIN %t ON %t.base_entity_id = task.for ") .append(" WHERE task.business_status = 'Referred' ") @@ -81,6 +81,9 @@ public static String getTaskFocus(String registerType) { case CoreConstants.REGISTER_TYPE.FAMILY_PLANNING: focus = CoreConstants.TASKS_FOCUS.FP_SIDE_EFFECTS; break; + case CoreConstants.REGISTER_TYPE.LD: + focus = Constants.FOCUS.LD_EMERGENCY; + break; default: focus = CoreConstants.REGISTER_TYPE.OTHER; break; diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfWebAppInterface.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfWebAppInterface.java new file mode 100644 index 000000000..a719d3659 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/HfWebAppInterface.java @@ -0,0 +1,120 @@ +package org.smartregister.chw.hf.utils; + +import static org.smartregister.chw.hf.utils.Constants.ReportConstants.CDPReportKeys.ISSUING_AT_THE_FACILITY_REPORTS; +import static org.smartregister.chw.hf.utils.Constants.ReportConstants.CDPReportKeys.ISSUING_FROM_THE_FACILITY_REPORTS; +import static org.smartregister.chw.hf.utils.Constants.ReportConstants.CDPReportKeys.RECEIVING_REPORTS; +import static org.smartregister.chw.hf.utils.Constants.ReportConstants.PMTCTReportKeys.EID_MONTHLY; +import static org.smartregister.chw.hf.utils.Constants.ReportConstants.PMTCTReportKeys.THREE_MONTHS; +import static org.smartregister.chw.hf.utils.Constants.ReportConstants.PMTCTReportKeys.TWELVE_MONTHS; +import static org.smartregister.chw.hf.utils.Constants.ReportConstants.PMTCTReportKeys.TWENTY_FOUR_MONTHS; +import static org.smartregister.util.Utils.getAllSharedPreferences; + +import android.content.Context; +import android.webkit.JavascriptInterface; + + +public class HfWebAppInterface { + private static final String DEFAULT_LOCALITY_NAME = "dfltLocName"; + Context mContext; + + String reportType; + + + public HfWebAppInterface(Context c, String reportType) { + mContext = c; + this.reportType = reportType; + } + + @JavascriptInterface + public String getData(String key) { + if (reportType.equalsIgnoreCase(Constants.ReportConstants.ReportTypes.PMTCT_REPORT)) { + switch (key) { + case THREE_MONTHS: + ReportUtils.setPrintJobName("report_ya_miezi_mitatu-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.PMTCTReports.computeThreeMonths(ReportUtils.getReportDate()); + case TWELVE_MONTHS: + ReportUtils.setPrintJobName("report_ya_miezi_kumi_na_mbili-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.PMTCTReports.computeTwelveMonths(ReportUtils.getReportDate()); + case TWENTY_FOUR_MONTHS: + ReportUtils.setPrintJobName("report_ya_miaka_miwili-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.PMTCTReports.computeTwentyFourMonths(ReportUtils.getReportDate()); + case EID_MONTHLY: + ReportUtils.setPrintJobName("report_ya_mwezi-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.PMTCTReports.computeEIDMonthly(ReportUtils.getReportDate()); + default: + return ""; + } + } + if (reportType.equalsIgnoreCase(Constants.ReportConstants.ReportTypes.PNC_REPORT)) { + ReportUtils.setPrintJobName("pnc_report_ya_mwezi-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.PNCReports.computePncReport(ReportUtils.getReportDate()); + } + if (reportType.equalsIgnoreCase(Constants.ReportConstants.ReportTypes.ANC_REPORT)) { + ReportUtils.setPrintJobName("anc_report_ya_mwezi-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.ANCReports.computeAncReport(ReportUtils.getReportDate()); + } + if( reportType.equalsIgnoreCase(Constants.ReportConstants.ReportTypes.CBHS_REPORT)){ + ReportUtils.setPrintJobName("cbhs_report_ya_mwezi-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.CBHSReports.computeCbhsReport(ReportUtils.getReportDate()); + } + if(reportType.equalsIgnoreCase(Constants.ReportConstants.ReportTypes.LTFU_SUMMARY)){ + ReportUtils.setPrintJobName("ltfu_summary_ya_mwezi-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.LTFUReports.computeLTFUReport(ReportUtils.getReportDate()); + } + if(reportType.equalsIgnoreCase(Constants.ReportConstants.ReportTypes.LD_REPORT)){ + ReportUtils.setPrintJobName("wodi_ya_wazazi_report_ya_mwezi-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.LDReports.computeLdReport(ReportUtils.getReportDate()); + } + if (reportType.equalsIgnoreCase(Constants.ReportConstants.ReportTypes.MOTHER_CHAMPION_REPORT)){ + ReportUtils.setPrintJobName("mother_champion_report_ya_mwezi-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.MotherChampionReports.computeMotherChampionReport(ReportUtils.getReportDate()); + } + if (reportType.equalsIgnoreCase(Constants.ReportConstants.ReportTypes.SELF_TESTING_REPORT)){ + ReportUtils.setPrintJobName("self_testing_report_ya_mwezi-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.SelfTestingReport.computeSelfTestingReportReport(ReportUtils.getReportDate()); + } + if (reportType.equalsIgnoreCase(Constants.ReportConstants.ReportTypes.KVP_REPORT)){ + ReportUtils.setPrintJobName("kvp_report_ya_mwezi-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.KvpReport.computeReport(ReportUtils.getReportDate()); + } + if (reportType.equalsIgnoreCase(Constants.ReportConstants.ReportTypes.CONDOM_DISTRIBUTION_REPORT)){ + switch (key) { + case ISSUING_AT_THE_FACILITY_REPORTS: + ReportUtils.setPrintJobName("CDP_issuing_at_the_facility_report_ya_mwezi-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.CDPReports.computeIssuingAtFacilityReports(ReportUtils.getReportDate()); + case ISSUING_FROM_THE_FACILITY_REPORTS: + ReportUtils.setPrintJobName("CDP_issuing_from_the_facility_report_ya_mwezi-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.CDPReports.computeIssuingFromFacilityReports(ReportUtils.getReportDate()); + case RECEIVING_REPORTS: + ReportUtils.setPrintJobName("CDP_receiving_report_ya_mwezi-" + ReportUtils.getReportPeriod() + ".pdf"); + return ReportUtils.CBHSReport.computeReport(ReportUtils.getReportDate()); + + default: + return ""; + } + } + return ""; + } + + @JavascriptInterface + public String getDataPeriod() { + return ReportUtils.getReportPeriod(); + } + + @JavascriptInterface + public String getDataPeriod(String reportKey) { + if(reportType.equalsIgnoreCase(Constants.ReportConstants.ReportTypes.PMTCT_REPORT)){ + return ReportUtils.getReportPeriodForCohortReport(reportKey); + } + if(reportType.equalsIgnoreCase(Constants.ReportConstants.ReportTypes.CONDOM_DISTRIBUTION_REPORT)){ + return ReportUtils.getReportPeriodForCohortReport(reportKey); + } + + return ReportUtils.getReportPeriod(); + } + + @JavascriptInterface + public String getReportingFacility() { + return getAllSharedPreferences().getPreference(DEFAULT_LOCALITY_NAME); + } +} \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/JsonFormUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/JsonFormUtils.java index 4ebf0b4c5..73bc71c3f 100644 --- a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/JsonFormUtils.java +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/JsonFormUtils.java @@ -1,5 +1,7 @@ package org.smartregister.chw.hf.utils; +import static org.smartregister.AllConstants.LocationConstants.SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS; + import android.content.Context; import android.util.Pair; @@ -8,19 +10,27 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Triple; import org.json.JSONArray; -import org.json.JSONException; import org.json.JSONObject; +import org.smartregister.chw.core.dao.ChwNotificationDao; import org.smartregister.chw.core.utils.CoreConstants; import org.smartregister.chw.core.utils.CoreJsonFormUtils; +import org.smartregister.chw.core.utils.Utils; import org.smartregister.chw.hf.HealthFacilityApplication; import org.smartregister.chw.hf.repository.HfChwRepository; import org.smartregister.clientandeventmodel.Client; import org.smartregister.clientandeventmodel.Event; import org.smartregister.commonregistry.CommonPersonObject; +import org.smartregister.commonregistry.CommonPersonObjectClient; +import org.smartregister.dao.LocationsDao; import org.smartregister.family.util.Constants; import org.smartregister.family.util.DBConstants; +import org.smartregister.location.helper.LocationHelper; import org.smartregister.repository.AllSharedPreferences; import org.smartregister.repository.EventClientRepository; +import org.smartregister.util.FormUtils; +import org.smartregister.view.LocationPickerView; + +import java.util.Collections; import timber.log.Timber; @@ -74,20 +84,7 @@ public static Pair processChildRegistrationForm(AllSharedPreferen EventClientRepository eventClientRepository = new EventClientRepository(); JSONObject clientjson = eventClientRepository.getClient(db, lookUpBaseEntityId); baseClient.setAddresses(getAddressFromClientJson(clientjson)); - } - - try { - JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), STEP1, SYNC_LOCATION_ID); - baseEvent.setLocationId(CoreJsonFormUtils.getSyncLocationUUIDFromDropdown(syncLocationField)); - } catch (JSONException e) { - Timber.e(e, "Error retrieving Sync location Field"); - } - - try { - JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(new JSONObject(jsonString), STEP1, SYNC_LOCATION_ID); - baseEvent.setLocationId(CoreJsonFormUtils.getSyncLocationUUIDFromDropdown(syncLocationField)); - } catch (JSONException e) { - Timber.e(e, "Error retrieving Sync location Field"); + baseEvent.setLocationId(ChwNotificationDao.getFamilyHeadSyncLocationId(lookUpBaseEntityId)); } return Pair.create(baseClient, baseEvent); @@ -116,4 +113,44 @@ private static void processChildEnrollment(JSONObject jsonForm, JSONArray fields } } + + public static JSONObject getAutoPopulatedJsonEditFormString(String formName, Context context, CommonPersonObjectClient client, String eventType) { + try { + JSONObject form = FormUtils.getInstance(context).getFormJson(formName); + LocationPickerView lpv = new LocationPickerView(context); + lpv.init(); + + Timber.d("Form is %s", form.toString()); + if (form != null) { + form.put(org.smartregister.family.util.JsonFormUtils.ENTITY_ID, client.getCaseId()); + form.put(org.smartregister.family.util.JsonFormUtils.ENCOUNTER_TYPE, eventType); + + JSONObject metadata = form.getJSONObject(org.smartregister.family.util.JsonFormUtils.METADATA); + String lastLocationId = LocationHelper.getInstance().getOpenMrsLocationId(lpv.getSelectedItem()); + + JSONObject syncLocationField = CoreJsonFormUtils.getJsonField(form, STEP1, SYNC_LOCATION_ID); + CoreJsonFormUtils.addLocationsToDropdownField(LocationsDao.getLocationsByTags( + Collections.singleton(SPECIAL_TAG_FOR_OPENMRS_TEAM_MEMBERS)), syncLocationField); + metadata.put(org.smartregister.family.util.JsonFormUtils.ENCOUNTER_LOCATION, lastLocationId); + + form.put(org.smartregister.family.util.JsonFormUtils.CURRENT_OPENSRP_ID, Utils.getValue(client.getColumnmaps(), DBConstants.KEY.UNIQUE_ID, false)); + + //inject opensrp id into the form + JSONObject stepOne = form.getJSONObject(org.smartregister.family.util.JsonFormUtils.STEP1); + JSONArray jsonArray = stepOne.getJSONArray(org.smartregister.family.util.JsonFormUtils.FIELDS); + for (int i = 0; i < jsonArray.length(); i++) { + JSONObject jsonObject = jsonArray.getJSONObject(i); + + processPopulatableFields(client, jsonObject); + + } + return form; + } + } catch (Exception e) { + Timber.e(e); + } + + return null; + } + } diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/LDReferralFormUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/LDReferralFormUtils.java new file mode 100644 index 000000000..3fd3c7fbf --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/LDReferralFormUtils.java @@ -0,0 +1,76 @@ +package org.smartregister.chw.hf.utils; + +import android.app.Activity; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.activity.LdEmergencyReferralRegistrationActivity; + +import timber.log.Timber; + +public class LDReferralFormUtils { + public static void setLFTUClinic(JSONObject form, String key, String text) { + try { + JSONObject option = new JSONObject(); + option.put("name", key); + option.put("text", text); + option.put("meta_data", new JSONObject() + .put("openmrs_entity", "") + .put("openmrs_entity_id", key) + .put("openmrs_entity_parent", "")); + JSONArray steps = form.getJSONArray("steps"); + JSONObject step = steps.getJSONObject(0); + JSONArray fields = step.getJSONArray("fields"); + for (int i = 0; i < fields.length(); i++) { + JSONObject field = fields.getJSONObject(i); + if (field.getString("name").equals("problem")) { + field.getJSONArray("options").put(option); + } + } + } catch (JSONException e) { + Timber.e(e); + } + } + + public static void startLTFUReferral(Activity context, String baseEntityId) { + JSONObject formJsonObject; + try { + formJsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets(context, Constants.JsonForm.getLtfuReferralForm()); + if (formJsonObject != null) { + formJsonObject.put(Constants.REFERRAL_TASK_FOCUS, Constants.FOCUS.LOST_TO_FOLLOWUP_FOCUS); + LdEmergencyReferralRegistrationActivity.startGeneralReferralFormActivityForResults(context, baseEntityId, formJsonObject, false); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + + public static void startLDEmergencyReferral(Activity context, String baseEntityId) { + JSONObject formJsonObject; + try { + formJsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets(context, Constants.JsonForm.getLdEmergencyReferralForm()); + if (formJsonObject != null) { + formJsonObject.put(Constants.REFERRAL_TASK_FOCUS, Constants.FOCUS.LD_EMERGENCY); + LdEmergencyReferralRegistrationActivity.startGeneralReferralFormActivityForResults(context, baseEntityId, formJsonObject, false); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + + public static void startLDChildEmergencyReferral(Activity context, String baseEntityId) { + JSONObject formJsonObject; + try { + formJsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets(context, Constants.JsonForm.getLdChildEmergencyReferralForm()); + if (formJsonObject != null) { + formJsonObject.put(Constants.REFERRAL_TASK_FOCUS, Constants.FOCUS.LD_CHILD_EMERGENCY); + LdEmergencyReferralRegistrationActivity.startGeneralReferralFormActivityForResults(context, baseEntityId, formJsonObject, false); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/LDVisitUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/LDVisitUtils.java new file mode 100644 index 000000000..b7cfd6220 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/LDVisitUtils.java @@ -0,0 +1,333 @@ +package org.smartregister.chw.hf.utils; + +import static org.smartregister.chw.hf.interactor.LDPostDeliveryManagementMotherActivityInteractor.ordinal; +import static org.smartregister.chw.hf.interactor.LDVisitInteractor.hbTestMoreThanTwoWeeksAgo; +import static org.smartregister.chw.hf.interactor.LDVisitInteractor.malariaTestConductedDuringRegistration; +import static org.smartregister.chw.hf.interactor.LDVisitInteractor.syphilisTestConductedDuringRegistration; +import static org.smartregister.chw.hf.utils.Constants.Events.LD_POST_DELIVERY_MOTHER_MANAGEMENT; +import static org.smartregister.chw.hf.utils.Constants.HIV_STATUS.POSITIVE; + +import com.google.gson.Gson; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.util.JsonFormUtils; +import org.smartregister.chw.core.dao.ChwNotificationDao; +import org.smartregister.chw.hf.actionhelper.LDGeneralExaminationActionHelper; +import org.smartregister.chw.hf.interactor.LDVisitInteractor; +import org.smartregister.chw.hf.utils.Constants.Events; +import org.smartregister.chw.ld.LDLibrary; +import org.smartregister.chw.ld.dao.LDDao; +import org.smartregister.chw.ld.domain.Visit; +import org.smartregister.chw.ld.repository.VisitDetailsRepository; +import org.smartregister.chw.ld.repository.VisitRepository; +import org.smartregister.chw.ld.util.Constants; +import org.smartregister.chw.ld.util.NCUtils; +import org.smartregister.chw.ld.util.VisitUtils; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import java.util.Objects; +import java.util.UUID; + +/** + * Created by Kassim Sheghembe on 2022-05-10 + */ +public class LDVisitUtils extends VisitUtils { + + public static void processVisits(String baseEntityId, boolean isPartograph) throws Exception { + processVisits(LDLibrary.getInstance().visitRepository(), LDLibrary.getInstance().visitDetailsRepository(), baseEntityId, isPartograph); + } + + public static void processVisits(VisitRepository visitRepository, VisitDetailsRepository visitDetailsRepository, String baseEntityId, boolean isPartograph) throws Exception { + Calendar calendar = Calendar.getInstance(); + + List visits = StringUtils.isNotBlank(baseEntityId) ? + visitRepository.getAllUnSynced(calendar.getTime().getTime(), baseEntityId) : + visitRepository.getAllUnSynced(calendar.getTime().getTime()); + + List ldVisits = new ArrayList<>(); + + for (Visit visit : visits) { + if (visit.getVisitType().equalsIgnoreCase(Constants.EVENT_TYPE.LD_GENERAL_EXAMINATION)) { + JSONObject visitJson = new JSONObject(visit.getJson()); + JSONArray obs = visitJson.getJSONArray("obs"); + + boolean isGeneralConditionDone = computeCompletionStatus(obs, "general_condition"); + boolean isPulseRateDone = computeCompletionStatus(obs, "pulse_rate"); + boolean isRespiratoryRateDone = computeCompletionStatus(obs, "respiratory_rate"); + boolean isTemperatureDone = computeCompletionStatus(obs, "temperature"); + boolean isSystolicDone = computeCompletionStatus(obs, "systolic"); + boolean isDiastolicDone = computeCompletionStatus(obs, "diastolic"); + boolean isUrineProteinDone = computeCompletionStatus(obs, "urine_protein"); + boolean isUrineAcetoneDone = computeCompletionStatus(obs, "urine_acetone"); + + boolean isFundalHeightDone = true; + if (!LDGeneralExaminationActionHelper.fundalHeightCaptured(baseEntityId)) + isFundalHeightDone = computeCompletionStatus(obs, "fundal_height"); + + boolean isPresentationDone = true; + if (!LDGeneralExaminationActionHelper.featalLieCaptured(baseEntityId)) + isPresentationDone = getFieldValue(obs, "lie").equalsIgnoreCase("transverse") || computeCompletionStatus(obs, "presentation"); + + + boolean isFetalHeartRateDone = computeCompletionStatus(obs, "fetal_heart_rate"); + boolean isVaginalExamDateDone = computeCompletionStatus(obs, "vaginal_exam_date"); + boolean isVaginalExamTimeDone = computeCompletionStatus(obs, "vaginal_exam_time"); + boolean isCervixStateDone = computeCompletionStatus(obs, "cervix_state"); + boolean isCervixDilationDone = computeCompletionStatus(obs, "cervix_dilation"); + boolean isPresentingPartDone = true; + if (LDDao.getPresentingPart(baseEntityId) == null) + isPresentingPartDone = computeCompletionStatus(obs, "presenting_part"); + + boolean isMouldingDone; + String presentingPart = getFieldValue(obs, "presenting_part"); + if (presentingPart != null && !presentingPart.equalsIgnoreCase("breech") && !presentingPart.equalsIgnoreCase("shoulder")) { + isMouldingDone = computeCompletionStatus(obs, "moulding"); + } else { + isMouldingDone = true; + } + boolean isStationDone = computeCompletionStatus(obs, "station"); + boolean isDecisionDone = computeCompletionStatus(obs, "decision"); + + boolean hivActionDone = false; + + if (LDDao.getHivStatus(baseEntityId) == null || (!Objects.equals(LDDao.getHivStatus(baseEntityId), POSITIVE) && LDVisitInteractor.testDateIsThreeMonthsAgo(baseEntityId))) { + String hivStatus = getFieldValue(obs, "hiv"); + String hivTestConducted = getFieldValue(obs, "hiv_test_conducted"); + if (hivTestConducted != null && hivTestConducted.equalsIgnoreCase("no")) { + hivActionDone = true; + } else { + if (StringUtils.isNotBlank(hivStatus) && hivTestConducted.equalsIgnoreCase("yes")) { + hivActionDone = true; + } + } + } else { + hivActionDone = true; + } + + boolean malariaActionDone = true; + if (!malariaTestConductedDuringRegistration(baseEntityId)) { + String malariaTest = getFieldValue(obs, "malaria"); + if (malariaTest == null || malariaTest.isEmpty()) + malariaActionDone = false; + } + + boolean syphilisActionDone = true; + if (!syphilisTestConductedDuringRegistration(baseEntityId)) { + String syphilisTest = getFieldValue(obs, "syphilis"); + if (syphilisTest == null || syphilisTest.isEmpty()) + syphilisActionDone = false; + } + + boolean hbActionDone = true; + if (hbTestMoreThanTwoWeeksAgo(baseEntityId)) { + String hbTest = getFieldValue(obs, "hb_test_conducted"); + if (hbTest == null || hbTest.isEmpty()) + hbActionDone = false; + } + + + if (isGeneralConditionDone && + isPulseRateDone && + isRespiratoryRateDone && + isTemperatureDone && + isSystolicDone && + isDiastolicDone && + isUrineProteinDone && + isUrineAcetoneDone && + isFundalHeightDone && + isPresentationDone && + isFetalHeartRateDone && + isVaginalExamDateDone && + isVaginalExamTimeDone && + isCervixStateDone && + isCervixDilationDone && + isPresentingPartDone && + isMouldingDone && + isStationDone && + isDecisionDone && + syphilisActionDone && + malariaActionDone && + hbActionDone && + hivActionDone) { + ldVisits.add(visit); + } + } else if (visit.getVisitType().equalsIgnoreCase(Events.LD_PARTOGRAPHY)) { + if (isPartograph && shouldProcessPartographVisit(visit)) { + ldVisits.add(visit); + } + } else if (visit.getVisitType().equalsIgnoreCase(Events.LD_ACTIVE_MANAGEMENT_OF_3RD_STAGE_OF_LABOUR)) { + JSONObject visitJson = new JSONObject(visit.getJson()); + JSONArray obs = visitJson.getJSONArray("obs"); + + boolean hasPlacentaAndMembraneExpelled = computeCompletionStatus(obs, "placenta_and_membrane_expulsion"); + boolean isUterotonicDone = computeCompletionStatus(obs, "uterotonic"); + boolean isMassageOfUterusAfterDeliveryDone = computeCompletionStatus(obs, "uterus_massage_after_delivery"); + boolean isEclampsiaManagementDone = computeCompletionStatus(obs, "has_signs_of_eclampsia"); + + if (hasPlacentaAndMembraneExpelled && isUterotonicDone && isMassageOfUterusAfterDeliveryDone && isEclampsiaManagementDone) { + ldVisits.add(visit); + } + } else if (visit.getVisitType().equalsIgnoreCase(LD_POST_DELIVERY_MOTHER_MANAGEMENT)) { + JSONObject visitJson = new JSONObject(visit.getJson()); + JSONArray obs = visitJson.getJSONArray("obs"); + String motherStatusCompletionStatus = getFieldValue(obs, "mother_status_module_status"); + String motherObservationModuleStatus = getFieldValue(obs, "mother_observation_module_status"); + String maternalComplicationsModuleStatus = getFieldValue(obs, "maternal_complications_module_status"); + String familyPlanningModuleStatus = getFieldValue(obs, "family_planning_module_status"); + boolean childVisitsCompletionStatus = true; + + String number_children_string = getFieldValue(obs, "number_of_children_born"); + int numberOfChildrenBorn = 0; + + if (number_children_string != null) { + numberOfChildrenBorn = Integer.parseInt(number_children_string); + } + for (int i = 0; i < numberOfChildrenBorn; i++) { + // Get visit details for each individual child + Visit immediateNewBornCareVisit = LDLibrary.getInstance().visitRepository().getVisitsByParentVisitId(visit.getVisitId(), "LND " + ordinal(i + 1) + " Newborn").get(0); + + if (immediateNewBornCareVisit.getVisitType().contains("LND") && + immediateNewBornCareVisit.getVisitType().contains("Newborn") && + (immediateNewBornCareVisit.getVisitType().contains("1st") || immediateNewBornCareVisit.getVisitType().contains("2nd") || immediateNewBornCareVisit.getVisitType().contains("3rd") || immediateNewBornCareVisit.getVisitType().contains("th"))) { + + JSONObject immediateNewBornCareVisitJson = new JSONObject(immediateNewBornCareVisit.getJson()); + JSONArray immediateNewBornCareObs = immediateNewBornCareVisitJson.getJSONArray("obs"); + String newbornStageFourModuleStatus = getFieldValue(immediateNewBornCareObs, "newborn_stage_four_module_status"); + + if (newbornStageFourModuleStatus != null) { + if (newbornStageFourModuleStatus.equalsIgnoreCase("Fully Completed")) { + ldVisits.add(immediateNewBornCareVisit); + } else { + childVisitsCompletionStatus = false; + } + } + } + + } + + if (isDeceased(obs) && + motherStatusCompletionStatus != null && + maternalComplicationsModuleStatus != null && + motherStatusCompletionStatus.equalsIgnoreCase("Fully Completed") && + maternalComplicationsModuleStatus.equalsIgnoreCase("Fully Completed") && + childVisitsCompletionStatus) { + ldVisits.add(visit); + } else if (motherStatusCompletionStatus != null && + maternalComplicationsModuleStatus != null && + motherObservationModuleStatus != null && + familyPlanningModuleStatus != null && + motherStatusCompletionStatus.equalsIgnoreCase("Fully Completed") && + motherObservationModuleStatus.equalsIgnoreCase("Fully Completed") && + maternalComplicationsModuleStatus.equalsIgnoreCase("Fully Completed") && + familyPlanningModuleStatus.equalsIgnoreCase("Fully Completed") && childVisitsCompletionStatus) { + ldVisits.add(visit); + } + + } else { + ldVisits.add(visit); + } + } + + if (ldVisits.size() > 0) { + processVisits(ldVisits, visitRepository, visitDetailsRepository, baseEntityId); + } + } + + public static void processVisits(List visits, VisitRepository visitRepository, VisitDetailsRepository visitDetailsRepository, String baseEntityId) throws Exception { + String visitGroupId = UUID.randomUUID().toString(); + for (Visit v : visits) { + if (!v.getProcessed()) { + + // persist to db + Event baseEvent = new Gson().fromJson(v.getPreProcessedJson(), Event.class); + if (StringUtils.isBlank(baseEvent.getFormSubmissionId())) + baseEvent.setFormSubmissionId(UUID.randomUUID().toString()); + + baseEvent.addDetails(Constants.LD_VISIT_GROUP, visitGroupId); + + AllSharedPreferences allSharedPreferences = LDLibrary.getInstance().context().allSharedPreferences(); + JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + + String syncLocationId = ChwNotificationDao.getSyncLocationId(baseEvent.getBaseEntityId()); + if (syncLocationId != null) { + // Allows setting the ID for sync purposes + baseEvent.setLocationId(syncLocationId); + } + + org.smartregister.chw.anc.util.NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(JsonFormUtils.gson.toJson(baseEvent))); + visitRepository.completeProcessing(v.getVisitId()); + } + } + // process after all events are saved + NCUtils.startClientProcessing(); + } + + public static boolean computeCompletionStatus(JSONArray obs, String checkString) throws JSONException { + int size = obs.length(); + for (int i = 0; i < size; i++) { + JSONObject jsonObject = obs.getJSONObject(i); + if (jsonObject.getString("fieldCode").equalsIgnoreCase(checkString)) { + return true; + } + } + return false; + } + + public static String getFieldValue(JSONArray obs, String checkString) throws JSONException { + int size = obs.length(); + for (int i = 0; i < size; i++) { + JSONObject jsonObject = obs.getJSONObject(i); + if (jsonObject.getString("fieldCode").equalsIgnoreCase(checkString)) { + JSONArray values = jsonObject.getJSONArray("values"); + return values.getString(0); + } + } + return null; + } + + public static boolean shouldProcessPartographVisit(Visit visit) throws JSONException { + JSONObject visitJson = new JSONObject(visit.getJson()); + JSONArray obs = visitJson.getJSONArray("obs"); + + boolean hasPartographDate = computeCompletionStatus(obs, "partograph_date"); + boolean hasPartographTime = computeCompletionStatus(obs, "partograph_time"); + + boolean hasRespiratoryRate = computeCompletionStatus(obs, "respiratory_rate"); + boolean hasPulseRate = computeCompletionStatus(obs, "pulse_rate"); + boolean hasAmnioticFluid = computeCompletionStatus(obs, "amnioticFluid"); + boolean hasMolding = computeCompletionStatus(obs, "moulding"); + boolean hasFetalHeartRate = computeCompletionStatus(obs, "fetal_heart_rate"); + boolean hasTemperature = computeCompletionStatus(obs, "temperature"); + boolean hasSystolic = computeCompletionStatus(obs, "systolic"); + boolean hasDiastolic = computeCompletionStatus(obs, "diastolic"); + boolean hasUrineProtein = computeCompletionStatus(obs, "urine_protein"); + boolean hasUrineAcetone = computeCompletionStatus(obs, "urine_acetone"); + boolean hasUrineVolume = computeCompletionStatus(obs, "urine_volume"); + boolean hasCervixDilation = computeCompletionStatus(obs, "cervix_dilation"); + boolean hasDescentPresentingPart = computeCompletionStatus(obs, "descent_presenting_part"); + boolean hasContractionEveryHalfHourFrequency = computeCompletionStatus(obs, "contraction_every_half_hour_frequency"); + boolean hasContractionEveryHalfAnHour = computeCompletionStatus(obs, "contraction_every_half_hour_time"); + + return hasPartographDate && hasPartographTime && (hasRespiratoryRate || hasPulseRate || hasAmnioticFluid || hasFetalHeartRate || hasTemperature || hasSystolic || hasDiastolic || hasUrineProtein || hasUrineAcetone || hasUrineVolume || hasCervixDilation || hasDescentPresentingPart || hasContractionEveryHalfHourFrequency || hasContractionEveryHalfAnHour || hasMolding); + } + + public static boolean isDeceased(JSONArray obs) throws JSONException { + int size = obs.length(); + for (int i = 0; i < size; i++) { + JSONObject checkObj = obs.getJSONObject(i); + if (checkObj.getString("fieldCode").equalsIgnoreCase("status")) { + JSONArray values = checkObj.getJSONArray("values"); + return values.get(0).equals("deceased") || values.get(0).equals("died"); + } + } + return false; + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/LFTUFormUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/LFTUFormUtils.java new file mode 100644 index 000000000..9883a4820 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/LFTUFormUtils.java @@ -0,0 +1,97 @@ +package org.smartregister.chw.hf.utils; + +import android.app.Activity; + +import com.vijay.jsonwizard.utils.FormUtils; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.hf.activity.ReferralRegistrationActivity; +import org.smartregister.chw.hf.dao.HfHivDao; +import org.smartregister.chw.hf.dao.HfKvpDao; +import org.smartregister.chw.hf.dao.HfPmtctDao; + +import timber.log.Timber; + +public class LFTUFormUtils { + public static void setLFTUClinic(JSONObject form, String key, String text) { + try { + JSONObject option = new JSONObject(); + option.put("name", key); + option.put("text", text); + option.put("meta_data", new JSONObject() + .put("openmrs_entity", "") + .put("openmrs_entity_id", key) + .put("openmrs_entity_parent", "")); + JSONArray steps = form.getJSONArray("steps"); + JSONObject step = steps.getJSONObject(0); + JSONArray fields = step.getJSONArray("fields"); + for (int i = 0; i < fields.length(); i++) { + JSONObject field = fields.getJSONObject(i); + if (field.getString("name").equals("problem")) { + field.getJSONArray("options").put(option); + } + } + } catch (JSONException e) { + Timber.e(e); + } + } + + public static void startLTFUReferral(Activity context, String baseEntityId, String gender, int age) { + JSONObject formJsonObject; + try { + formJsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets(context, Constants.JsonForm.getLtfuReferralForm()); + if (formJsonObject != null) { + formJsonObject.put(Constants.REFERRAL_TASK_FOCUS, Constants.FOCUS.LOST_TO_FOLLOWUP_FOCUS); + JSONArray steps = formJsonObject.getJSONArray("steps"); + JSONObject step = steps.getJSONObject(0); + JSONArray fields = step.getJSONArray("fields"); + if ((gender.equalsIgnoreCase("Male") && age > 2)) { + removeFieldOption(fields, "problem", "PMTCT"); + } + ReferralRegistrationActivity.startGeneralReferralFormActivityForResults(context, baseEntityId, formJsonObject, false); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + + public static void startLTFUReferral(Activity context, String baseEntityId) { + JSONObject formJsonObject; + try { + formJsonObject = (new FormUtils()).getFormJsonFromRepositoryOrAssets(context, Constants.JsonForm.getLtfuReferralForm()); + if (formJsonObject != null) { + formJsonObject.put(Constants.REFERRAL_TASK_FOCUS, Constants.FOCUS.LOST_TO_FOLLOWUP_FOCUS); + + ReferralRegistrationActivity.startGeneralReferralFormActivityForResults(context, baseEntityId, formJsonObject, false); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + + private static void removeFieldOption(JSONArray fields, String fieldName, String fieldOptionName) throws JSONException { + int position = 0; + boolean found = false; + for (int i = 0; i < fields.length(); i++) { + JSONObject field = fields.getJSONObject(i); + if (field.getString("name").equalsIgnoreCase(fieldName)) { + position = i; + found = true; + break; + } + } + if (found) { + JSONObject fieldObject = (JSONObject) fields.get(position); + JSONArray options = fieldObject.getJSONArray("options"); + for (int i = 0; i < options.length(); i++) { + JSONObject option = options.getJSONObject(i); + if (option.getString("name").equalsIgnoreCase(fieldOptionName)) { + options.remove(i); + break; + } + } + } + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/LocalContentWebViewClient.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/LocalContentWebViewClient.java new file mode 100644 index 000000000..a2ae97bc4 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/LocalContentWebViewClient.java @@ -0,0 +1,40 @@ +package org.smartregister.chw.hf.utils; + +import android.net.Uri; +import android.webkit.WebResourceRequest; +import android.webkit.WebResourceResponse; +import android.webkit.WebView; + +import androidx.annotation.RequiresApi; +import androidx.webkit.WebViewAssetLoader; +import androidx.webkit.WebViewClientCompat; + +import org.smartregister.chw.hf.activity.PmtctReportsViewActivity; + +public class LocalContentWebViewClient extends WebViewClientCompat { + private final WebViewAssetLoader mAssetLoader; + + public LocalContentWebViewClient(WebViewAssetLoader assetLoader) { + mAssetLoader = assetLoader; + } + + @Override + @RequiresApi(21) + public WebResourceResponse shouldInterceptRequest(WebView view, + WebResourceRequest request) { + return mAssetLoader.shouldInterceptRequest(request.getUrl()); + } + + @Override + @SuppressWarnings("deprecation") // to support API < 21 + public WebResourceResponse shouldInterceptRequest(WebView view, + String url) { + return mAssetLoader.shouldInterceptRequest(Uri.parse(url)); + } + + @Override + public void onPageFinished(WebView view, String url) { + super.onPageFinished(view, url); + PmtctReportsViewActivity.printWebView = view; + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/PmtctVisitUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/PmtctVisitUtils.java new file mode 100644 index 000000000..eeb7fdfbe --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/PmtctVisitUtils.java @@ -0,0 +1,379 @@ +package org.smartregister.chw.hf.utils; + +import static org.smartregister.chw.anc.util.Constants.TABLES.EC_CHILD; +import static org.smartregister.util.Utils.getAllSharedPreferences; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.AllConstants; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.dao.HomeVisitDao; +import org.smartregister.chw.anc.model.BaseAncRegisterModel; +import org.smartregister.chw.anc.util.DBConstants; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.core.model.ChildModel; +import org.smartregister.chw.hf.dao.HeiDao; +import org.smartregister.chw.hf.dao.HfPmtctDao; +import org.smartregister.chw.hf.dao.HfPncDao; +import org.smartregister.chw.pmtct.PmtctLibrary; +import org.smartregister.chw.pmtct.domain.Visit; +import org.smartregister.chw.pmtct.repository.VisitDetailsRepository; +import org.smartregister.chw.pmtct.repository.VisitRepository; +import org.smartregister.chw.pmtct.util.VisitUtils; +import org.smartregister.clientandeventmodel.Client; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.clientandeventmodel.Obs; +import org.smartregister.immunization.ImmunizationLibrary; +import org.smartregister.repository.AllSharedPreferences; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.UUID; + +import timber.log.Timber; + +public class PmtctVisitUtils extends VisitUtils { + public static void processVisits() throws Exception { + processVisits(PmtctLibrary.getInstance().visitRepository(), PmtctLibrary.getInstance().visitDetailsRepository()); + } + + public static void processVisits(VisitRepository visitRepository, VisitDetailsRepository visitDetailsRepository) throws Exception { + + List visits = visitRepository.getAllUnSynced(); + List pmtctFollowupVisits = new ArrayList<>(); + + + for (Visit v : visits) { + Date visitDate = new Date(v.getDate().getTime()); + int daysDiff = TimeUtils.getElapsedDays(visitDate); + if (daysDiff >= 1 && v.getVisitType().equalsIgnoreCase(org.smartregister.chw.pmtct.util.Constants.EVENT_TYPE.PMTCT_FOLLOWUP)) { + try { + JSONObject jsonObject = new JSONObject(v.getJson()); + String baseEntityId = jsonObject.getString("baseEntityId"); + JSONArray obs = jsonObject.getJSONArray("obs"); + List checks = new ArrayList(); + + boolean isFollowupStatusDone = computeCompletionStatus(obs, "followup_status"); + + boolean isCounsellingDone = computeCompletionStatus(obs, "is_client_counselled"); + boolean isClinicalStagingDone = computeCompletionStatus(obs, "clinical_staging_disease"); + boolean isTbScreeningDone = computeCompletionStatus(obs, "on_tb_treatment"); + boolean isArvPrescriptionDone = computeCompletionStatus(obs, "prescribed_regimes"); + boolean isNextVisitSet = computeCompletionStatus(obs, "next_facility_visit_date"); + + boolean isBaselineInvestigationComplete = computeCompletionStatus(obs, "liver_function_test_conducted") && computeCompletionStatus(obs, "renal_function_test_conducted"); + + + checks.add(isFollowupStatusDone); + + if (isContinuingWithServices(v)) { + checks.add(isCounsellingDone); + checks.add(isClinicalStagingDone); + checks.add(isTbScreeningDone); + checks.add(isArvPrescriptionDone); + checks.add(isNextVisitSet); + + if (HfPmtctDao.isEligibleForBaselineInvestigation(baseEntityId) || HfPmtctDao.isEligibleForBaselineInvestigationOnFollowupVisit(baseEntityId)) { + checks.add(isBaselineInvestigationComplete); + } + } + + + if (!checks.contains(false)) { + pmtctFollowupVisits.add(v); + } + } catch (Exception e) { + Timber.e(e); + } + + } + } + + if (pmtctFollowupVisits.size() > 0) { + processVisits(pmtctFollowupVisits, visitRepository, visitDetailsRepository); + for (Visit v : pmtctFollowupVisits) { + if (isWomanTransferOut(v)) { + createHeiTransferOutUpdate(v.getJson()); + } + } + } + } + + public static boolean computeCompletionStatus(JSONArray obs, String checkString) throws JSONException { + int size = obs.length(); + for (int i = 0; i < size; i++) { + JSONObject checkObj = obs.getJSONObject(i); + if (checkObj.getString("fieldCode").equalsIgnoreCase(checkString)) { + return true; + } + } + return false; + } + + public static boolean isContinuingWithServices(Visit visit) { + boolean isContinuingWithServices = false; + try { + JSONObject jsonObject = new JSONObject(visit.getJson()); + JSONArray obs = jsonObject.getJSONArray("obs"); + int size = obs.length(); + for (int i = 0; i < size; i++) { + JSONObject checkObj = obs.getJSONObject(i); + if (checkObj.getString("fieldCode").equalsIgnoreCase("followup_status")) { + JSONArray values = checkObj.getJSONArray("values"); + if ((values.getString(0).equalsIgnoreCase("continuing_with_services")) || (values.getString(0).equalsIgnoreCase("new_client"))) { + isContinuingWithServices = true; + break; + } + } + } + } catch (Exception e) { + Timber.e(e); + } + return isContinuingWithServices; + } + + public static boolean isWomanTransferOut(Visit visit) { + boolean isWomanTransferOut = false; + try { + JSONObject jsonObject = new JSONObject(visit.getJson()); + JSONArray obs = jsonObject.getJSONArray("obs"); + int size = obs.length(); + for (int i = 0; i < size; i++) { + JSONObject checkObj = obs.getJSONObject(i); + if (checkObj.getString("fieldCode").equalsIgnoreCase("followup_status")) { + JSONArray values = checkObj.getJSONArray("values"); + if (values.getString(0).equalsIgnoreCase("transfer_out")) { + isWomanTransferOut = true; + break; + } + } + } + } catch (Exception e) { + Timber.e(e); + } + return isWomanTransferOut; + } + + private static void createHeiTransferOutUpdate(String json) throws Exception { + JSONObject jsonObject = new JSONObject(json); + String motherBaseEntityId = jsonObject.getString("baseEntityId"); + List childModels = HfPncDao.childrenForPncWoman(motherBaseEntityId); + SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault()); + //process if the mother has children + if (childModels.size() > 0) { + for (ChildModel childModel : childModels) { + String childBaseEntityId = childModel.getBaseEntityId(); + AllSharedPreferences sharedPreferences = getAllSharedPreferences(); + Event baseEvent = (Event) new Event() + .withBaseEntityId(childBaseEntityId) + .withEventDate(new Date()) + .withEventType(Constants.Events.HEI_FOLLOWUP) + .withEntityType(Constants.TableName.HEI_FOLLOWUP) + .withFormSubmissionId(UUID.randomUUID().toString()) + .withDateCreated(new Date()); + + baseEvent.addObs( + (new Obs()) + .withFormSubmissionField("followup_status") + .withValue("transfer_out") + .withFieldCode("followup_status") + .withFieldType("transfer_out") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + baseEvent.addObs( + (new Obs()) + .withFormSubmissionField("visit_number") + .withFieldCode("visit_number") + .withValue(String.valueOf(HeiDao.getVisitNumber(childBaseEntityId))) + .withFieldType("transfer_out") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + baseEvent.addObs( + (new Obs()) + .withFormSubmissionField("followup_visit_date") + .withFieldCode("followup_visit_date") + .withValue(sdf.format(new Date())) + .withFieldType("followup_visit_date") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + // tag docs + org.smartregister.chw.hf.utils.JsonFormUtils.tagSyncMetadata(sharedPreferences, baseEvent); + NCUtils.processEvent(baseEvent.getBaseEntityId(), new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(baseEvent))); + } + } + + } + + public static void deleteSavedEvent(AllSharedPreferences allSharedPreferences, String baseEntityId, String eventId, String formSubmissionId, String type) { + Event event = (Event) new Event() + .withBaseEntityId(baseEntityId) + .withEventDate(new Date()) + .withEventType(org.smartregister.chw.anc.util.Constants.EVENT_TYPE.DELETE_EVENT) + .withLocationId(org.smartregister.chw.anc.util.JsonFormUtils.locationId(allSharedPreferences)) + .withProviderId(allSharedPreferences.fetchRegisteredANM()) + .withEntityType(type) + .withFormSubmissionId(UUID.randomUUID().toString()) + .withDateCreated(new Date()); + + event.addDetails(org.smartregister.chw.anc.util.Constants.JSON_FORM_EXTRA.DELETE_EVENT_ID, eventId); + event.addDetails(org.smartregister.chw.anc.util.Constants.JSON_FORM_EXTRA.DELETE_FORM_SUBMISSION_ID, formSubmissionId); + + try { + NCUtils.processEvent(event.getBaseEntityId(), new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(event))); + } catch (Exception e) { + Timber.e(e); + } + } + + public static void deleteProcessedVisit(String visitID, String baseEntityId) { + // check if the event + AllSharedPreferences allSharedPreferences = ImmunizationLibrary.getInstance().context().allSharedPreferences(); + org.smartregister.chw.anc.domain.Visit visit = AncLibrary.getInstance().visitRepository().getVisitByVisitId(visitID); + if (visit == null || !visit.getProcessed()) return; + + Event processedEvent = HomeVisitDao.getEventByFormSubmissionId(visit.getFormSubmissionId()); + if (processedEvent == null) return; + + PmtctVisitUtils.deleteSavedEvent(allSharedPreferences, baseEntityId, processedEvent.getEventId(), processedEvent.getFormSubmissionId(), "event"); + AncLibrary.getInstance().visitRepository().deleteVisit(visitID); + } + + + // Implementation used to save children + public static void generateAndSaveFormsForEachChild(Map> jsonObjectMap, String motherBaseId, String familyBaseEntityId, String dob, String familyName) { + + AllSharedPreferences allSharedPreferences = ImmunizationLibrary.getInstance().context().allSharedPreferences(); + + JSONArray childFields; + for (Map.Entry> entry : jsonObjectMap.entrySet()) { + if (entry.getValue().size() > 1) { + childFields = new JSONArray(); + for (JSONObject jsonObject : entry.getValue()) { + try { + String replaceString = jsonObject.getString(org.smartregister.chw.anc.util.JsonFormUtils.KEY); + + JSONObject childField = new JSONObject(jsonObject.toString().replaceAll(replaceString, replaceString.substring(0, replaceString.lastIndexOf("_")))); + + childFields.put(childField); + } catch (JSONException e) { + e.printStackTrace(); + } + } + saveChild(childFields, motherBaseId, allSharedPreferences, familyBaseEntityId, dob, familyName); + } + } + } + + public static Map> getChildFieldMaps(JSONArray fields) { + Map> jsonObjectMap = new HashMap(); + + for (int i = 0; i < fields.length(); i++) { + try { + JSONObject jsonObject = fields.getJSONObject(i); + String key = jsonObject.getString(org.smartregister.chw.anc.util.JsonFormUtils.KEY); + String keySplit = key.substring(key.lastIndexOf("_")); + if (keySplit.matches(".*\\d.*")) { + + String formattedKey = keySplit.replaceAll("[^\\d.]", ""); + if (formattedKey.length() < 10) + continue; + List jsonObjectList = jsonObjectMap.get(formattedKey); + + if (jsonObjectList == null) + jsonObjectList = new ArrayList<>(); + + jsonObjectList.add(jsonObject); + jsonObjectMap.put(formattedKey, jsonObjectList); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + return jsonObjectMap; + } + + private static void saveChild(JSONArray childFields, String motherBaseId, AllSharedPreferences + allSharedPreferences, String familyBaseEntityId, String dob, String familyName) { + String uniqueChildID = AncLibrary.getInstance().getUniqueIdRepository().getNextUniqueId().getOpenmrsId(); + + if (StringUtils.isNotBlank(uniqueChildID)) { + String childBaseEntityId = org.smartregister.chw.anc.util.JsonFormUtils.generateRandomUUIDString(); + try { + + JSONObject surNameObject = org.smartregister.util.JsonFormUtils.getFieldJSONObject(childFields, DBConstants.KEY.SUR_NAME); + String surName = surNameObject != null ? surNameObject.optString(org.smartregister.chw.anc.util.JsonFormUtils.VALUE) : null; + + String lastName = sameASFamilyNameCheck(childFields) ? familyName : surName; + JSONObject pncForm = new BaseAncRegisterModel().getFormAsJson( + AncLibrary.getInstance().context().applicationContext(), + org.smartregister.chw.anc.util.Constants.FORMS.PNC_CHILD_REGISTRATION, + childBaseEntityId, + allSharedPreferences.getPreference(AllConstants.CURRENT_LOCATION_ID) + ); + pncForm = org.smartregister.chw.anc.util.JsonFormUtils.populatePNCForm(pncForm, childFields, familyBaseEntityId, motherBaseId, uniqueChildID, dob, lastName); + processPncChild(childFields, allSharedPreferences, childBaseEntityId, familyBaseEntityId, motherBaseId, uniqueChildID, lastName, dob); + if (pncForm != null) { + saveRegistration(pncForm.toString(), EC_CHILD); + } + + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + private static void saveRegistration(final String jsonString, String table) throws Exception { + AllSharedPreferences allSharedPreferences = AncLibrary.getInstance().context().allSharedPreferences(); + Event baseEvent = org.smartregister.chw.anc.util.JsonFormUtils.processJsonForm(allSharedPreferences, jsonString, table); + + NCUtils.addEvent(allSharedPreferences, baseEvent); + NCUtils.startClientProcessing(); + } + + private static boolean sameASFamilyNameCheck(JSONArray childFields) { + if (childFields.length() > 0) { + JSONObject sameAsFamNameCheck = org.smartregister.util.JsonFormUtils.getFieldJSONObject(childFields, DBConstants.KEY.SAME_AS_FAM_NAME_CHK); + sameAsFamNameCheck = sameAsFamNameCheck != null ? sameAsFamNameCheck : org.smartregister.util.JsonFormUtils.getFieldJSONObject(childFields, DBConstants.KEY.SAME_AS_FAM_NAME); + JSONObject sameAsFamNameObject = sameAsFamNameCheck.optJSONArray(DBConstants.KEY.OPTIONS).optJSONObject(0); + if (sameAsFamNameCheck != null) { + return sameAsFamNameObject.optBoolean(org.smartregister.chw.anc.util.JsonFormUtils.VALUE); + } + } + return false; + } + + public static void processPncChild(JSONArray fields, AllSharedPreferences allSharedPreferences, String entityId, String familyBaseEntityId, String motherBaseId, String uniqueChildID, String lastName, String dob) { + try { + Client pncChild = org.smartregister.util.JsonFormUtils.createBaseClient(fields, org.smartregister.chw.anc.util.JsonFormUtils.formTag(allSharedPreferences), entityId); + Map identifiers = new HashMap<>(); + identifiers.put(org.smartregister.chw.anc.util.Constants.JSON_FORM_EXTRA.OPENSPR_ID, uniqueChildID.replace("-", "")); + SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy"); + Date date = formatter.parse(dob); + pncChild.setLastName(lastName); + pncChild.setBirthdate(date); + pncChild.setIdentifiers(identifiers); + pncChild.addRelationship(org.smartregister.chw.anc.util.Constants.RELATIONSHIP.FAMILY, familyBaseEntityId); + pncChild.addRelationship(org.smartregister.chw.anc.util.Constants.RELATIONSHIP.MOTHER, motherBaseId); + + JSONObject eventJson = new JSONObject(org.smartregister.chw.anc.util.JsonFormUtils.gson.toJson(pncChild)); + AncLibrary.getInstance().getUniqueIdRepository().close(pncChild.getIdentifier(org.smartregister.chw.anc.util.Constants.JSON_FORM_EXTRA.OPENSPR_ID)); + + NCUtils.getSyncHelper().addClient(pncChild.getBaseEntityId(), eventJson); + + } catch (Exception e) { + Timber.e(e); + } + } + + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/PncVisitUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/PncVisitUtils.java new file mode 100644 index 000000000..c45283804 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/PncVisitUtils.java @@ -0,0 +1,204 @@ +package org.smartregister.chw.hf.utils; + +import com.google.gson.Gson; + +import org.joda.time.Days; +import org.joda.time.LocalDate; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.repository.VisitDetailsRepository; +import org.smartregister.chw.anc.repository.VisitRepository; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.core.model.ChildModel; +import org.smartregister.chw.hf.dao.HeiDao; +import org.smartregister.chw.hf.dao.HfPncDao; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.clientandeventmodel.Obs; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.UUID; + +import timber.log.Timber; + +public class PncVisitUtils extends org.smartregister.chw.anc.util.VisitUtils { + public static void processVisits() throws Exception { + processVisits(AncLibrary.getInstance().visitRepository(), AncLibrary.getInstance().visitDetailsRepository()); + } + + public static void processVisits(VisitRepository visitRepository, VisitDetailsRepository visitDetailsRepository) throws Exception { + Calendar calendar = Calendar.getInstance(); + + List visits = visitRepository.getAllUnSynced(calendar.getTime().getTime()); + + List pncVisitsCompleted = new ArrayList<>(); + List childVisitCompleted = new ArrayList<>(); + + + for (Visit v : visits) { + Date updatedAtDate = new Date(v.getDate().getTime()); + int daysDiff = TimeUtils.getElapsedDays(updatedAtDate); + if (daysDiff >= 1) { + if (v.getVisitType().equalsIgnoreCase(Constants.Events.PNC_VISIT)) { + try { + JSONObject jsonObject = new JSONObject(v.getJson()); + JSONArray obs = jsonObject.getJSONArray("obs"); + String baseEntityId = jsonObject.getString("baseEntityId"); + + List checks = new ArrayList(); + + boolean isMotherGeneralExaminationDone = computeCompletionStatus(obs, "systolic"); + boolean isFamilyPlanningServicesDone = computeCompletionStatus(obs, "education_counselling_given"); + boolean isImmunizationDone = computeCompletionStatus(obs, "tetanus_vaccination") || computeCompletionStatus(obs, "hepatitis_b_vaccination"); + boolean isHivTestingDone = computeCompletionStatus(obs, "hiv"); + boolean isNutritionSupplementsDone = computeCompletionStatus(obs, "iron_and_folic_acid"); + boolean nextFacilityVisitDateDone = computeCompletionStatus(obs, "next_facility_visit_date"); + + if (HfPncDao.isMotherEligibleForHivTest(baseEntityId)) { + checks.add(isHivTestingDone); + } + if (HfPncDao.isMotherEligibleForTetanus(baseEntityId) || HfPncDao.isMotherEligibleForHepB(baseEntityId)) { + checks.add(isImmunizationDone); + } + + checks.add(isMotherGeneralExaminationDone); + checks.add(isFamilyPlanningServicesDone); + checks.add(isNutritionSupplementsDone); + checks.add(nextFacilityVisitDateDone); + if (!checks.contains(false)) { + pncVisitsCompleted.add(v); + } + } catch (Exception e) { + Timber.e(e); + } + } + if (v.getVisitType().equalsIgnoreCase(Constants.Events.PNC_CHILD_FOLLOWUP)) { + try { + JSONObject jsonObject = new JSONObject(v.getJson()); + JSONArray obs = jsonObject.getJSONArray("obs"); + + boolean isChildFollowupDone = computeCompletionStatus(obs, "child_activeness"); + if (isChildFollowupDone) { + childVisitCompleted.add(v); + } + } catch (JSONException e) { + Timber.e(e); + } + } + } + } + if (pncVisitsCompleted.size() > 0) { + for (Visit v : pncVisitsCompleted) { + if (childVisitCompleted.size() > 0) { + List completedChildVisit = new ArrayList<>(); + List completedMotherVisit = new ArrayList<>(); + for (Visit childVisit : childVisitCompleted) { + if (v.getVisitId().equals(childVisit.getParentVisitID())) { + completedChildVisit.add(childVisit); + completedMotherVisit.add(v); + } + } + processVisits(completedMotherVisit, visitRepository, visitDetailsRepository); + processVisits(completedChildVisit, visitRepository, visitDetailsRepository); + } else { + processVisits(Collections.singletonList(v), visitRepository, visitDetailsRepository); + } + } + } + + } + + public static boolean computeCompletionStatus(JSONArray obs, String checkString) throws JSONException { + int size = obs.length(); + for (int i = 0; i < size; i++) { + JSONObject checkObj = obs.getJSONObject(i); + if (checkObj.getString("fieldCode").equalsIgnoreCase(checkString)) { + return true; + } + } + return false; + } + + public static void createHeiRegistrationEvent(String motherBaseEntityId) throws Exception { + List childModels = HfPncDao.childrenForPncWoman(motherBaseEntityId); + for (ChildModel childModel : childModels) { + if (HeiDao.getMember(childModel.getBaseEntityId()) == null) { + JSONObject jsonObjectForChild = new JSONObject(); + jsonObjectForChild.put("baseEntityId", childModel.getBaseEntityId()); + jsonObjectForChild.put("mother_entity_id", motherBaseEntityId); + jsonObjectForChild.put("relational_id", motherBaseEntityId); + jsonObjectForChild.put("birthdate", childModel.getDateOfBirth()); + + String childBaseEntityId = childModel.getBaseEntityId(); + Event baseEvent = new Gson().fromJson(jsonObjectForChild.toString(), Event.class); + baseEvent.setFormSubmissionId(UUID.randomUUID().toString()); + baseEvent.setEventType(Constants.Events.HEI_REGISTRATION); + baseEvent.setEventDate(new Date()); + + baseEvent.addObs( + (new Obs()) + .withFormSubmissionField("risk_category") + .withValue("high") + .withFieldCode("risk_category") + .withFieldType("formsubmissionField") + .withFieldDataType("text") + .withParentCode("") + .withHumanReadableValues(new ArrayList<>())); + + + baseEvent.setBaseEntityId(childBaseEntityId); + AllSharedPreferences allSharedPreferences = AncLibrary.getInstance().context().allSharedPreferences(); + NCUtils.addEvent(allSharedPreferences, baseEvent); + NCUtils.startClientProcessing(); + } + } + + } + + private static boolean isMotherFoundPositive(Visit visit) { + boolean isPositive = false; + try { + JSONObject jsonObject = new JSONObject(visit.getJson()); + JSONArray obs = jsonObject.getJSONArray("obs"); + int size = obs.length(); + for (int i = 0; i < size; i++) { + JSONObject checkObj = obs.getJSONObject(i); + if (checkObj.getString("fieldCode").equalsIgnoreCase("hiv_status")) { + JSONArray values = checkObj.getJSONArray("values"); + if (values.getString(0).equalsIgnoreCase("positive")) { + isPositive = true; + break; + } + } + } + } catch (Exception e) { + Timber.e(e); + } + return isPositive; + } + + public static int getElapsedTimeDays(Date startDate, Date endDate) { + if (startDate == null || endDate == null) + return 0; + + Calendar startDateCal = Calendar.getInstance(); + startDateCal.setTimeInMillis(startDate.getTime()); + + Calendar endDateCal = Calendar.getInstance(); + endDateCal.setTimeInMillis(endDate.getTime()); + + LocalDate startLocalDate = new LocalDate(startDateCal.get(Calendar.YEAR), startDateCal.get(Calendar.MONTH) + 1, startDateCal.get(Calendar.DAY_OF_MONTH)); + LocalDate endLocalDate = new LocalDate(endDateCal.get(Calendar.YEAR), endDateCal.get(Calendar.MONTH) + 1, endDateCal.get(Calendar.DAY_OF_MONTH)); + + + return Days.daysBetween(startLocalDate, endLocalDate).getDays(); + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/PullEventClientRecordUtil.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/PullEventClientRecordUtil.java new file mode 100644 index 000000000..5c2fc4be5 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/PullEventClientRecordUtil.java @@ -0,0 +1,133 @@ +package org.smartregister.chw.hf.utils; + +import android.app.ProgressDialog; +import android.os.AsyncTask; +import android.util.Log; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.Context; +import org.smartregister.CoreLibrary; +import org.smartregister.DristhiConfiguration; +import org.smartregister.chw.core.utils.CoreConstants; +import org.smartregister.chw.hf.HealthFacilityApplication; +import org.smartregister.chw.hf.sync.HfClientProcessor; +import org.smartregister.domain.Client; +import org.smartregister.domain.Event; +import org.smartregister.domain.Response; +import org.smartregister.domain.db.EventClient; +import org.smartregister.event.Listener; +import org.smartregister.repository.EventClientRepository; +import org.smartregister.sync.intent.SyncIntentService; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import timber.log.Timber; + +public class PullEventClientRecordUtil { + + public static void pullEventClientRecord(final String baseEntityId, final Listener listener, + final ProgressDialog progressDialog, String originalBaseEntityId) { + + org.smartregister.util.Utils.startAsyncTask(new AsyncTask() { + + @Override + protected void onPreExecute() { + progressDialog.show(); + } + + @Override + protected String[] doInBackground(Void... params) { + publishProgress(); + return pull(baseEntityId); + } + + @Override + protected void onPostExecute(String[] result) { + if (!result[1].equalsIgnoreCase(CoreConstants.EventType.FAMILY_REGISTRATION)) { + // pull family record + PullEventClientRecordUtil.pullEventClientRecord(result[2], listener, progressDialog, baseEntityId); + } else { + listener.onEvent(originalBaseEntityId); + progressDialog.dismiss(); + } + } + }, null); + } + + private static String[] pull(String baseEntityId) { + if (baseEntityId == null || baseEntityId.isEmpty()) { + Timber.d("entityId doesn't exist"); + return null; + } + + Context context = CoreLibrary.getInstance().context(); + DristhiConfiguration configuration = context.configuration(); + + String baseUrl = configuration.dristhiBaseURL(); + + String paramString = "?baseEntityId=" + urlEncode(baseEntityId.trim()) + "&limit=1000"; + String uri = baseUrl + SyncIntentService.SYNC_URL + paramString; + + Timber.d(new StringBuilder(PullEventClientRecordUtil.class.getCanonicalName()).append(" ").append(uri).toString()); + + String eventType = ""; + String familyId = ""; + try { + Response response = context.getHttpAgent().fetch(uri); + // TO Do: validate response + if (response == null || response.isFailure()) { + return null; + } + + JSONObject jsonObject = new JSONObject(response.payload()); + + EventClientRepository eventClientRepository = new EventClientRepository(); + Event event = eventClientRepository.convert(jsonObject.getJSONArray("events").get(0).toString(), Event.class); + Client client = eventClientRepository.convert(jsonObject.getJSONArray("clients").get(0).toString(), Client.class); + + eventType = event.getEventType(); + if (!eventType.equalsIgnoreCase(CoreConstants.EventType.FAMILY_REGISTRATION) && client.getRelationships().get("family") != null) { + familyId = client.getRelationships().get("family").get(0); + } + + List eventClientList = new ArrayList<>(); + eventClientList.add(new EventClient(event, client)); + + JSONArray events = getOutOFCatchmentJsonArray(new JSONObject(response.payload()), "events"); + JSONArray clients = getOutOFCatchmentJsonArray(new JSONObject(response.payload()), "clients"); + + HealthFacilityApplication.getInstance().getEcSyncHelper().batchSave(events, clients); + + List clientEventsSaved = CoreLibrary.getInstance().context().getEventClientRepository().getEventsByBaseEntityIdsAndSyncStatus("Synced", Arrays.asList(baseEntityId)); + for (EventClient eventClient : clientEventsSaved) { + eventClient.setClient(client); + } + eventClientList.addAll(clientEventsSaved); + HfClientProcessor.getInstance(context.applicationContext()).processClient(eventClientList); + + } catch (Exception e) { + Log.d("Pull EventClient error", e.toString()); + } + + return new String[]{baseEntityId, eventType, familyId}; + } + + private static String urlEncode(String value) { + try { + return URLEncoder.encode(value, "UTF-8"); + } catch (UnsupportedEncodingException e) { + return value; + } + } + + private static JSONArray getOutOFCatchmentJsonArray(JSONObject jsonObject, String clients) throws + JSONException { + return jsonObject.has(clients) ? jsonObject.getJSONArray(clients) : new JSONArray(); + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/ReportUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/ReportUtils.java new file mode 100644 index 000000000..6dd34928e --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/ReportUtils.java @@ -0,0 +1,364 @@ +package org.smartregister.chw.hf.utils; + +import static org.smartregister.chw.hf.utils.Constants.ReportConstants.PMTCTReportKeys.EID_MONTHLY; +import static org.smartregister.chw.hf.utils.Constants.ReportConstants.PMTCTReportKeys.THREE_MONTHS; +import static org.smartregister.chw.hf.utils.Constants.ReportConstants.PMTCTReportKeys.TWELVE_MONTHS; +import static org.smartregister.chw.hf.utils.Constants.ReportConstants.PMTCTReportKeys.TWENTY_FOUR_MONTHS; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.os.Build; +import android.print.PrintAttributes; +import android.print.PrintDocumentAdapter; +import android.print.PrintManager; +import android.webkit.WebSettings; +import android.webkit.WebView; + +import androidx.annotation.RequiresApi; +import androidx.webkit.WebViewAssetLoader; + +import org.apache.commons.lang3.StringUtils; +import org.joda.time.DateTime; +import org.json.JSONException; +import org.smartregister.chw.hf.domain.anc_reports.AncMonthlyReportObject; +import org.smartregister.chw.hf.domain.cbhs_reports.CbhsMonthlyReportObject; +import org.smartregister.chw.hf.domain.cdp_reports.CdpIssuingAtFacilityReportObject; +import org.smartregister.chw.hf.domain.cdp_reports.CdpIssuingFromFacilityReportObject; +import org.smartregister.chw.hf.domain.cdp_reports.CdpReceivingReportObject; +import org.smartregister.chw.hf.domain.kvp_reports.KvpMonthlyReportObject; +import org.smartregister.chw.hf.domain.ld_reports.LdMonthlyReportObject; +import org.smartregister.chw.hf.domain.ltfu_summary.LTFUSummaryObject; +import org.smartregister.chw.hf.domain.mother_champion_repots.MotherChampionReportObject; +import org.smartregister.chw.hf.domain.pmtct_reports.Pmtct12MonthsReportObject; +import org.smartregister.chw.hf.domain.pmtct_reports.Pmtct24MonthsReportObject; +import org.smartregister.chw.hf.domain.pmtct_reports.Pmtct3MonthsReportObject; +import org.smartregister.chw.hf.domain.pmtct_reports.PmtctEIDMonthlyReportObject; +import org.smartregister.chw.hf.domain.pnc_reports.PncMonthlyReportObject; +import org.smartregister.chw.hf.domain.self_testing_reports.SelfTestingMonthlyReportObject; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; + +import timber.log.Timber; + +public class ReportUtils { + private static final int year = Calendar.getInstance().get(Calendar.YEAR); + private static final int month = Calendar.getInstance().get(Calendar.MONTH) + 1; + public static String[] monthNames = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"}; + private static String printJobName; + private static String reportPeriod; + + public static String getDefaultReportPeriod() { + String monthString = String.valueOf(month); + if (month < 10) { + monthString = "0" + monthString; + } + return monthString + "-" + year; + } + + public static int getMonth() { + return month; + } + + public static int getYear() { + return year; + } + + public static String displayMonthAndYear(int month, int year) { + return monthNames[month] + ", " + year; + } + + public static String displayMonthAndYear() { + return monthNames[getMonth() - 1] + ", " + getYear(); + } + + public static String getPrintJobName() { + return printJobName; + } + + public static void setPrintJobName(String printJobName) { + ReportUtils.printJobName = printJobName; + } + + public static Date getReportDate() { + if (StringUtils.isNotBlank(reportPeriod)) { + + try { + return new SimpleDateFormat("MM-yyyy", Locale.getDefault()).parse(reportPeriod); + } catch (ParseException e) { + Timber.e(e); + } + } + + return new Date(); + } + + public static String getReportPeriod() { + return reportPeriod; + } + + public static void setReportPeriod(String reportPeriod) { + ReportUtils.reportPeriod = reportPeriod; + } + + public static String getReportPeriodForCohortReport(String reportKey) { + int minusPeriod; + switch (reportKey) { + case THREE_MONTHS: + minusPeriod = 3; + break; + case TWELVE_MONTHS: + minusPeriod = 12; + break; + case TWENTY_FOUR_MONTHS: + minusPeriod = 24; + break; + case EID_MONTHLY: + return reportPeriod; + default: + minusPeriod = 0; + break; + } + return getReportPeriodWithStartingMonth(minusPeriod); + } + + private static String getReportPeriodWithStartingMonth(int minusPeriod) { + try { + DateTime endTime = new DateTime(new SimpleDateFormat("MM-yyyy", Locale.getDefault()).parse(reportPeriod)); + DateTime startTime = endTime.minusMonths(minusPeriod); + + return "" + startTime.getMonthOfYear() + "-" + startTime.getYear() + " to " + endTime.getMonthOfYear() + "-" + endTime.getYear(); + + } catch (ParseException e) { + Timber.e(e); + } + return reportPeriod; + } + + @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) + public static void printTheWebPage(WebView webView, Context context) { + + // Creating PrintManager instance + PrintManager printManager = (PrintManager) context.getSystemService(Context.PRINT_SERVICE); + PrintDocumentAdapter printAdapter = webView.createPrintDocumentAdapter(getPrintJobName()); + + // Create a print job with name and adapter instance + assert printManager != null; + printManager.print(getPrintJobName(), printAdapter, + new PrintAttributes.Builder().build()); + } + + @SuppressLint("SetJavaScriptEnabled") + public static void loadReportView(String reportPath, WebView mWebView, Context context, String reportType) { + + WebSettings webSettings = mWebView.getSettings(); + webSettings.setJavaScriptEnabled(true); + final WebViewAssetLoader assetLoader = new WebViewAssetLoader.Builder() + .addPathHandler("/assets/", new WebViewAssetLoader.AssetsPathHandler(context)) + .build(); + mWebView.setWebViewClient(new LocalContentWebViewClient(assetLoader)); + mWebView.addJavascriptInterface(new HfWebAppInterface(context, reportType), "Android"); + + if (reportType.equals(Constants.ReportConstants.ReportTypes.CONDOM_DISTRIBUTION_REPORT)){ + mWebView.loadUrl("https://appassets.androidplatform.net/assets/reports/cdp_reports/" + reportPath + ".html"); + }else { + mWebView.loadUrl("https://appassets.androidplatform.net/assets/reports/" + reportPath + ".html"); + } + + } + + public static class PMTCTReports { + public static String computeThreeMonths(Date startDate) { + Pmtct3MonthsReportObject pmtct3MonthsReportObject = new Pmtct3MonthsReportObject(startDate); + try { + return pmtct3MonthsReportObject.getIndicatorDataAsGson(pmtct3MonthsReportObject.getIndicatorData()); + } catch (JSONException e) { + Timber.e(e); + } + return ""; + } + + public static String computeTwelveMonths(Date startDate) { + Pmtct12MonthsReportObject pmtct12MonthsReportObject = new Pmtct12MonthsReportObject(startDate); + try { + return pmtct12MonthsReportObject.getIndicatorDataAsGson(pmtct12MonthsReportObject.getIndicatorData()); + } catch (JSONException e) { + Timber.e(e); + } + return ""; + } + + public static String computeTwentyFourMonths(Date startDate) { + Pmtct24MonthsReportObject pmtct24MonthsReportObject = new Pmtct24MonthsReportObject(startDate); + try { + return pmtct24MonthsReportObject.getIndicatorDataAsGson(pmtct24MonthsReportObject.getIndicatorData()); + } catch (JSONException e) { + Timber.e(e); + } + return ""; + } + + public static String computeEIDMonthly(Date startDate) { + PmtctEIDMonthlyReportObject pmtctEIDMonthlyReportObject = new PmtctEIDMonthlyReportObject(startDate); + try { + return pmtctEIDMonthlyReportObject.getIndicatorDataAsGson(pmtctEIDMonthlyReportObject.getIndicatorData()); + } catch (JSONException e) { + Timber.e(e); + } + return ""; + } + } + + public static class PNCReports { + public static String computePncReport(Date now) { + String report = ""; + PncMonthlyReportObject pncMonthlyReportObject = new PncMonthlyReportObject(now); + try { + report = pncMonthlyReportObject.getIndicatorDataAsGson(pncMonthlyReportObject.getIndicatorData()); + } catch (Exception e) { + Timber.e(e); + } + return report; + } + } + + public static class ANCReports { + public static String computeAncReport(Date now) { + String report = ""; + AncMonthlyReportObject ancMonthlyReportObject = new AncMonthlyReportObject(now); + try { + report = ancMonthlyReportObject.getIndicatorDataAsGson(ancMonthlyReportObject.getIndicatorData()); + } catch (Exception e) { + Timber.e(e); + } + return report; + } + } + + public static class CBHSReports { + public static String computeCbhsReport(Date now) { + String report = ""; + CbhsMonthlyReportObject cbhsMonthlyReportObject = new CbhsMonthlyReportObject(now); + try { + report = cbhsMonthlyReportObject.getIndicatorDataAsGson(cbhsMonthlyReportObject.getIndicatorData()); + } catch (Exception e) { + Timber.e(e); + } + return report; + } + } + + public static class LDReports { + public static String computeLdReport(Date now) { + String report = ""; + LdMonthlyReportObject ldMonthlyReportObject = new LdMonthlyReportObject(now); + try { + report = ldMonthlyReportObject.getIndicatorDataAsGson(ldMonthlyReportObject.getIndicatorData()); + } catch (Exception e) { + Timber.e(e); + } + return report; + } + } + + public static class MotherChampionReports { + public static String computeMotherChampionReport(Date now) { + String report = ""; + MotherChampionReportObject motherChampionReportObject = new MotherChampionReportObject(now); + try { + report = motherChampionReportObject.getIndicatorDataAsGson(motherChampionReportObject.getIndicatorData()); + } catch (Exception e) { + Timber.e(e); + } + return report; + } + } + + public static class LTFUReports { + public static String computeLTFUReport(Date now) { + String report = ""; + LTFUSummaryObject ltfuSummaryObject = new LTFUSummaryObject(now); + try { + report = ltfuSummaryObject.getIndicatorDataAsGson(ltfuSummaryObject.getIndicatorData()); + } catch (Exception e) { + Timber.e(e); + } + return report; + } + } + + public static class SelfTestingReport { + public static String computeSelfTestingReportReport(Date now) { + String report = ""; + SelfTestingMonthlyReportObject selfTestingMonthlyReportObject = new SelfTestingMonthlyReportObject(now); + try { + report = selfTestingMonthlyReportObject.getIndicatorDataAsGson(selfTestingMonthlyReportObject.getIndicatorData()); + } catch (Exception e) { + Timber.e(e); + } + return report; + } + } + + public static class KvpReport { + public static String computeReport(Date now) { + String report = ""; + KvpMonthlyReportObject kvpMonthlyReportObject = new KvpMonthlyReportObject(now); + try { + report = kvpMonthlyReportObject.getIndicatorDataAsGson(kvpMonthlyReportObject.getIndicatorData()); + } catch (Exception e) { + Timber.e(e); + } + return report; + } + } + + public static class CDPReports { + public static String computeIssuingAtFacilityReports(Date startDate) { + CdpIssuingAtFacilityReportObject cdpIssuingAtFacilityReportObject = new CdpIssuingAtFacilityReportObject(startDate); + try { + return cdpIssuingAtFacilityReportObject.getIndicatorDataAsGson(cdpIssuingAtFacilityReportObject.getIndicatorData()); + } catch (JSONException e) { + Timber.e(e); + } + return ""; + } + + public static String computeIssuingFromFacilityReports(Date startDate) { + CdpIssuingFromFacilityReportObject cdpIssuingFromFacilityReportObject = new CdpIssuingFromFacilityReportObject(startDate); + try { + return cdpIssuingFromFacilityReportObject.getIndicatorDataAsGson(cdpIssuingFromFacilityReportObject.getIndicatorData()); + } catch (JSONException e) { + Timber.e(e); + } + return ""; + } + +// public static String computeReceivingReports(Date startDate, Context context) { +// CdpReceivingReportObject cdpReceivingReportObject = new CdpReceivingReportObject(startDate,context); +// try { +// return cdpReceivingReportObject.getIndicatorDataAsGson(cdpReceivingReportObject.getIndicatorData()); +// } catch (JSONException e) { +// Timber.e(e); +// } +// return ""; +// } + } + + public static class CBHSReport { + public static String computeReport(Date now) { + String report = ""; + CdpReceivingReportObject cdpReceivingReportObject = new CdpReceivingReportObject(now); + try { + report = cdpReceivingReportObject.getIndicatorDataAsGson(cdpReceivingReportObject.getIndicatorData()); + } catch (Exception e) { + Timber.e(e); + } + return report; + } + } + +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/TimeUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/TimeUtils.java new file mode 100644 index 000000000..a19612fd5 --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/TimeUtils.java @@ -0,0 +1,31 @@ +package org.smartregister.chw.hf.utils; + +import org.joda.time.DateTime; +import org.joda.time.Days; + +import java.util.Date; +import java.util.Calendar; + +public class TimeUtils { + + /** + * This method gets the elapsed days from a given date + * @param startDate starting date that would be truncated to midnight + * @return number of days elapsed from the starting date to the current date regardless of time + * + * */ + public static int getElapsedDays(Date startDate) { + Calendar startDateCal = Calendar.getInstance(); + startDateCal.setTime(startDate); + + Calendar nowCal = Calendar.getInstance(); + nowCal.set(nowCal.get(Calendar.YEAR), nowCal.get(Calendar.MONTH), nowCal.get(Calendar.DATE), 0, 0, 0); + + + Calendar startDateCalTruncated = Calendar.getInstance(); + startDateCalTruncated.set(startDateCal.get(Calendar.YEAR), startDateCal.get(Calendar.MONTH), startDateCal.get(Calendar.DATE), 0, 0, 0); + + return Days.daysBetween(new DateTime(startDateCalTruncated.getTimeInMillis()), new DateTime(nowCal.getTimeInMillis())).getDays(); + + } +} diff --git a/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/VisitUtils.java b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/VisitUtils.java new file mode 100644 index 000000000..4545ea0fa --- /dev/null +++ b/opensrp-chw-hf/src/main/java/org/smartregister/chw/hf/utils/VisitUtils.java @@ -0,0 +1,314 @@ +package org.smartregister.chw.hf.utils; + +import static org.smartregister.chw.anc.util.NCUtils.getSyncHelper; +import static org.smartregister.chw.hf.utils.LDVisitUtils.getFieldValue; +import static org.smartregister.chw.hf.utils.PncVisitUtils.computeCompletionStatus; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; + +import com.google.gson.Gson; + +import org.apache.commons.lang3.StringUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.smartregister.chw.anc.AncLibrary; +import org.smartregister.chw.anc.domain.Visit; +import org.smartregister.chw.anc.domain.VisitDetail; +import org.smartregister.chw.anc.repository.VisitDetailsRepository; +import org.smartregister.chw.anc.repository.VisitRepository; +import org.smartregister.chw.anc.util.JsonFormUtils; +import org.smartregister.chw.anc.util.NCUtils; +import org.smartregister.chw.core.dao.ChwNotificationDao; +import org.smartregister.chw.hf.dao.HfAncDao; +import org.smartregister.chw.pmtct.dao.PmtctDao; +import org.smartregister.clientandeventmodel.Event; +import org.smartregister.immunization.service.intent.RecurringIntentService; +import org.smartregister.immunization.service.intent.VaccineIntentService; +import org.smartregister.repository.AllSharedPreferences; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import timber.log.Timber; + +public class VisitUtils extends org.smartregister.chw.anc.util.VisitUtils { + public static String Complete = "complete"; + public static String Pending = "pending"; + public static String Ongoing = "ongoing"; + + public static void processVisits() throws Exception { + processVisits(AncLibrary.getInstance().visitRepository(), AncLibrary.getInstance().visitDetailsRepository()); + } + + public static void processVisits(VisitRepository visitRepository, VisitDetailsRepository visitDetailsRepository) throws Exception { + Calendar calendar = Calendar.getInstance(); + + List visits = visitRepository.getAllUnSynced(calendar.getTime().getTime()); + + List ancFirstVisitsCompleted = new ArrayList<>(); + List ancFollowupVisitsCompleted = new ArrayList<>(); + + + for (Visit v : visits) { + Date updatedAtDate = new Date(v.getDate().getTime()); + int daysDiff = TimeUtils.getElapsedDays(updatedAtDate); + if (daysDiff >= 1) { + if (v.getVisitType().equalsIgnoreCase(Constants.Events.ANC_FIRST_FACILITY_VISIT)) { + if (isAncVisitComplete(v)) { + ancFirstVisitsCompleted.add(v); + } + } else if (v.getVisitType().equalsIgnoreCase(Constants.Events.ANC_RECURRING_FACILITY_VISIT)) { + if (isAncVisitComplete(v)) { + ancFollowupVisitsCompleted.add(v); + } + } + } + } + if (ancFirstVisitsCompleted.size() > 0) { + processVisits(ancFirstVisitsCompleted, visitRepository, visitDetailsRepository); + } + + if (ancFollowupVisitsCompleted.size() > 0) { + processVisits(ancFollowupVisitsCompleted, visitRepository, visitDetailsRepository); + for (Visit v : ancFollowupVisitsCompleted) { + if (isNextVisitsCancelled(v)) { + createCancelledEvent(v.getJson()); + createEventToMoveAncClientsWithStillBirthToPnc(v.getJson()); + if (PmtctDao.isRegisteredForPmtct(v.getBaseEntityId())) { + createClosePmtctEvent(v.getJson()); + } + } + } + } + } + + private static void createCancelledEvent(String json) throws Exception { + Event baseEvent = new Gson().fromJson(json, Event.class); + baseEvent.setFormSubmissionId(UUID.randomUUID().toString()); + baseEvent.setEventType("ANC Close Followup Visits"); + AllSharedPreferences allSharedPreferences = AncLibrary.getInstance().context().allSharedPreferences(); + NCUtils.addEvent(allSharedPreferences, baseEvent); + NCUtils.startClientProcessing(); + } + + private static void createEventToMoveAncClientsWithStillBirthToPnc(String json) throws Exception { + JSONObject visitJson = new JSONObject(json); + JSONArray obs = visitJson.getJSONArray("obs"); + String pregnancyStatus = getFieldValue(obs, "pregnancy_status"); + if (pregnancyStatus.equalsIgnoreCase("intrauterine_fetal_death")) { + Event baseEvent = new Gson().fromJson(json, Event.class); + baseEvent.setFormSubmissionId(UUID.randomUUID().toString()); + baseEvent.setEventType("Transfer to PNC"); + AllSharedPreferences allSharedPreferences = AncLibrary.getInstance().context().allSharedPreferences(); + NCUtils.addEvent(allSharedPreferences, baseEvent); + NCUtils.startClientProcessing(); + } + } + + protected static void createClosePmtctEvent(String jsonString) { + Event closePmtctEvent = new Gson().fromJson(jsonString, Event.class); + closePmtctEvent.setEntityType(org.smartregister.chw.pmtct.util.Constants.TABLES.PMTCT_REGISTRATION); + closePmtctEvent.setEventType(Constants.Events.PMTCT_CLOSE_VISITS); + closePmtctEvent.setFormSubmissionId(UUID.randomUUID().toString()); + closePmtctEvent.setEventDate(new Date()); + try { + AllSharedPreferences allSharedPreferences = AncLibrary.getInstance().context().allSharedPreferences(); + NCUtils.addEvent(allSharedPreferences, closePmtctEvent); + NCUtils.startClientProcessing(); + } catch (Exception e) { + Timber.e(e); + } + + } + + public static boolean computeCompletionStatusForAction(JSONArray obs, String checkString) throws JSONException { + int size = obs.length(); + for (int i = 0; i < size; i++) { + JSONObject checkObj = obs.getJSONObject(i); + if (checkObj.getString("fieldCode").equalsIgnoreCase(checkString)) { + String status = checkObj.getJSONArray("values").getString(0); + return status.equalsIgnoreCase("complete"); + } + } + return false; + } + + public static boolean checkIfStatusIsViable(JSONArray obs) throws JSONException { + String pregnancyStatus = ""; + int size = obs.length(); + for (int i = 0; i < size; i++) { + JSONObject checkObj = obs.getJSONObject(i); + if (checkObj.getString("fieldCode").equalsIgnoreCase("pregnancy_status")) { + JSONArray values = checkObj.getJSONArray("values"); + pregnancyStatus = values.getString(0); + break; + } + } + return pregnancyStatus.equalsIgnoreCase("viable"); + } + + public static boolean isNextVisitsCancelled(Visit visit) { + boolean isCancelled = false; + try { + JSONObject jsonObject = new JSONObject(visit.getJson()); + JSONArray obs = jsonObject.getJSONArray("obs"); + isCancelled = !checkIfStatusIsViable(obs); + } catch (Exception e) { + Timber.e(e); + } + return isCancelled; + } + + public static boolean isAncVisitComplete(Visit visit) { + boolean isComplete = false; + if (visit.getVisitType().equalsIgnoreCase(Constants.Events.ANC_FIRST_FACILITY_VISIT)) { + try { + JSONObject jsonObject = new JSONObject(visit.getJson()); + JSONArray obs = jsonObject.getJSONArray("obs"); + HashMap completionObject = new HashMap<>(); + completionObject.put("isMedicalAndSurgicalHistoryDone", computeCompletionStatusForAction(obs, "medical_surgical_history_completion_status")); + completionObject.put("isBaselineInvestigationComplete", computeCompletionStatusForAction(obs, "baseline_investigation_completion_status")); + completionObject.put("isObstetricExaminationComplete", computeCompletionStatusForAction(obs, "obstetric_examination_completion_status")); + completionObject.put("isTbScreeningComplete", computeCompletionStatusForAction(obs, "tb_screening_completion_status")); + completionObject.put("isMalariaInvestigationComplete", computeCompletionStatusForAction(obs, "malaria_investigation_completion_status")); + completionObject.put("isPharmacyComplete", computeCompletionStatusForAction(obs, "pharmacy_completion_status")); + completionObject.put("isTTVaccinationComplete", computeCompletionStatusForAction(obs, "tt_vaccination_completion_status")); + completionObject.put("isCounsellingComplete", computeCompletionStatusForAction(obs, "counselling_completion_status")); + boolean isNextVisitSet = computeCompletionStatus(obs, "next_facility_visit_date"); + + if (!completionObject.containsValue(false) && isNextVisitSet) { + isComplete = true; + } + } catch (Exception e) { + Timber.e(e); + } + } + if (visit.getVisitType().equalsIgnoreCase(Constants.Events.ANC_RECURRING_FACILITY_VISIT)) { + try { + JSONObject jsonObject = new JSONObject(visit.getJson()); + JSONArray obs = jsonObject.getJSONArray("obs"); + HashMap completionObject = new HashMap<>(); + completionObject.put("isPregnancyStatusDone", computeCompletionStatusForAction(obs, "pregnancy_status_completion_status")); + boolean isNextVisitSet = true; + if (checkIfStatusIsViable(obs)) { + completionObject.put("isTriageDone", computeCompletionStatusForAction(obs, "triage_completion_status")); + completionObject.put("isConsultationDone", computeCompletionStatusForAction(obs, "consultation_completion_status")); + completionObject.put("isMalariaInvestigationComplete", computeCompletionStatusForAction(obs, "malaria_investigation_completion_status")); + completionObject.put("isPharmacyComplete", computeCompletionStatusForAction(obs, "pharmacy_completion_status")); + completionObject.put("isLabTestComplete", computeCompletionStatusForAction(obs, "lab_test_completion_status")); + if (HfAncDao.isEligibleForTtVaccination(visit.getBaseEntityId())) { + completionObject.put("isTTVaccinationComplete", computeCompletionStatusForAction(obs, "tt_vaccination_completion_status")); + } + completionObject.put("isCounsellingComplete", computeCompletionStatusForAction(obs, "counselling_completion_status")); + isNextVisitSet = computeCompletionStatus(obs, "next_facility_visit_date"); + } + + if (!completionObject.containsValue(false) && isNextVisitSet) { + isComplete = true; + } + } catch (Exception e) { + Timber.e(e); + } + } + return isComplete; + } + + public static String getActionStatus(Map checkObject) { + for (Map.Entry entry : checkObject.entrySet()) { + if (entry.getValue()) { + if (checkObject.containsValue(false)) { + return Ongoing; + } + return Complete; + } + } + return Pending; + } + + public static void manualProcessVisit(Visit visit, Context context) throws Exception { + List manualProcessedVisits = new ArrayList<>(); + VisitDetailsRepository visitDetailsRepository = AncLibrary.getInstance().visitDetailsRepository(); + VisitRepository visitRepository = AncLibrary.getInstance().visitRepository(); + manualProcessedVisits.add(visit); + processVisits(manualProcessedVisits, visitRepository, visitDetailsRepository); + if (visit.getVisitType().equalsIgnoreCase(Constants.Events.ANC_RECURRING_FACILITY_VISIT) && isNextVisitsCancelled(visit)) { + createCancelledEvent(visit.getJson()); + createEventToMoveAncClientsWithStillBirthToPnc(visit.getJson()); + if (PmtctDao.isRegisteredForPmtct(visit.getBaseEntityId())) { + createClosePmtctEvent(visit.getJson()); + } + ((Activity) context).finish(); + } + } + + public static void processVisits(List visits, VisitRepository visitRepository, VisitDetailsRepository visitDetailsRepository) throws Exception { + String visitGroupId = UUID.randomUUID().toString(); + for (Visit v : visits) { + if (!v.getProcessed()) { + + // persist to db + Event baseEvent = new Gson().fromJson(v.getPreProcessedJson(), Event.class); + if (StringUtils.isBlank(baseEvent.getFormSubmissionId())) + baseEvent.setFormSubmissionId(UUID.randomUUID().toString()); + + String locationId = ChwNotificationDao.getSyncLocationId(baseEvent.getBaseEntityId()); + + baseEvent.addDetails(org.smartregister.chw.anc.util.Constants.HOME_VISIT_GROUP, visitGroupId); + + + AllSharedPreferences allSharedPreferences = AncLibrary.getInstance().context().allSharedPreferences(); + JsonFormUtils.tagEvent(allSharedPreferences, baseEvent); + baseEvent.setLocationId(locationId); + JSONObject eventJson = new JSONObject(JsonFormUtils.gson.toJson(baseEvent)); + getSyncHelper().addEvent(baseEvent.getBaseEntityId(), eventJson); + + // process details + processVisitDetails(visitGroupId, v, visitDetailsRepository, v.getVisitId(), v.getBaseEntityId()); + + visitRepository.completeProcessing(v.getVisitId()); + } + } + + // process after all events are saved + NCUtils.startClientProcessing(); + + // process vaccines and services + Context context = AncLibrary.getInstance().context().applicationContext(); + context.startService(new Intent(context, VaccineIntentService.class)); + context.startService(new Intent(context, RecurringIntentService.class)); + } + + private static void processVisitDetails(String visitGroupId, Visit visit, VisitDetailsRepository visitDetailsRepository, String visitID, String baseEntityID) { + List visitDetailList = visitDetailsRepository.getVisits(visitID); + for (VisitDetail visitDetail : visitDetailList) { + if (!visitDetail.getProcessed()) { + if (org.smartregister.chw.anc.util.Constants.HOME_VISIT_TASK.SERVICE.equalsIgnoreCase(visitDetail.getPreProcessedType())) { + saveVisitDetailsAsServiceRecord(visitGroupId, visitDetail, baseEntityID, visit.getDate()); + visitDetailsRepository.completeProcessing(visitDetail.getVisitDetailsId()); + continue; + } + + + if ( + org.smartregister.chw.anc.util.Constants.HOME_VISIT_TASK.VACCINE.equalsIgnoreCase(visitDetail.getParentCode()) || + org.smartregister.chw.anc.util.Constants.HOME_VISIT_TASK.VACCINE.equalsIgnoreCase(visitDetail.getPreProcessedType()) + ) { + saveVisitDetailsAsVaccine(visitGroupId, visitDetail, baseEntityID, visit.getDate()); + visitDetailsRepository.completeProcessing(visitDetail.getVisitDetailsId()); + continue; + } + + visitDetailsRepository.completeProcessing(visitDetail.getVisitDetailsId()); + } + } + } + +} diff --git a/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_cbhs_summary.xml b/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_cbhs_summary.xml new file mode 100644 index 000000000..03d8eee8e --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_cbhs_summary.xml @@ -0,0 +1,10 @@ + + + diff --git a/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_feedback.xml b/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_feedback.xml new file mode 100644 index 000000000..7121d2ee8 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_feedback.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_referral.xml b/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_referral.xml new file mode 100644 index 000000000..503ffa275 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_referral.xml @@ -0,0 +1,23 @@ + + + + + + + diff --git a/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_sidemenu_hei.xml b/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_sidemenu_hei.xml new file mode 100644 index 000000000..50257a5dd --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_sidemenu_hei.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_sidemenu_hei_active.xml b/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_sidemenu_hei_active.xml new file mode 100644 index 000000000..1ccfebb04 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_sidemenu_hei_active.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_sidemenu_labour_and_delivery.xml b/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_sidemenu_labour_and_delivery.xml new file mode 100644 index 000000000..7460d2c53 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_sidemenu_labour_and_delivery.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_sidemenu_labour_and_delivery_active.xml b/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_sidemenu_labour_and_delivery_active.xml new file mode 100644 index 000000000..3423b6836 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable-anydpi/ic_sidemenu_labour_and_delivery_active.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/opensrp-chw-hf/src/main/res/drawable-hdpi/activityrow_visit_in_progress.png b/opensrp-chw-hf/src/main/res/drawable-hdpi/activityrow_visit_in_progress.png new file mode 100644 index 000000000..d3eec19ac Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-hdpi/activityrow_visit_in_progress.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_feedback.png b/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_feedback.png new file mode 100644 index 000000000..a5df54bd3 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_feedback.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_logo.png b/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_logo_ba.png similarity index 100% rename from opensrp-chw-hf/src/main/res/drawable-hdpi/ic_logo.png rename to opensrp-chw-hf/src/main/res/drawable-hdpi/ic_logo_ba.png diff --git a/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_referral.png b/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_referral.png new file mode 100644 index 000000000..f20e4c952 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_referral.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_sidemenu_hei.png b/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_sidemenu_hei.png new file mode 100644 index 000000000..a8d9b5463 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_sidemenu_hei.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_sidemenu_hei_active.png b/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_sidemenu_hei_active.png new file mode 100644 index 000000000..0239b958a Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_sidemenu_hei_active.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_sidemenu_labour_and_delivery.png b/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_sidemenu_labour_and_delivery.png new file mode 100644 index 000000000..964e22834 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_sidemenu_labour_and_delivery.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_sidemenu_labour_and_delivery_active.png b/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_sidemenu_labour_and_delivery_active.png new file mode 100644 index 000000000..293405147 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-hdpi/ic_sidemenu_labour_and_delivery_active.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-ldpi/ld_edit_partograph_button_selector.xml b/opensrp-chw-hf/src/main/res/drawable-ldpi/ld_edit_partograph_button_selector.xml new file mode 100644 index 000000000..5f1f64c4a --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable-ldpi/ld_edit_partograph_button_selector.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/drawable-mdpi/activityrow_visit_in_progress.png b/opensrp-chw-hf/src/main/res/drawable-mdpi/activityrow_visit_in_progress.png new file mode 100644 index 000000000..ee8a020a1 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-mdpi/activityrow_visit_in_progress.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_feedback.png b/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_feedback.png new file mode 100644 index 000000000..614682694 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_feedback.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_referral.png b/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_referral.png new file mode 100644 index 000000000..9382a8dd8 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_referral.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_sidemenu_hei.png b/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_sidemenu_hei.png new file mode 100644 index 000000000..5e6428397 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_sidemenu_hei.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_sidemenu_hei_active.png b/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_sidemenu_hei_active.png new file mode 100644 index 000000000..968500ae8 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_sidemenu_hei_active.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_sidemenu_labour_and_delivery.png b/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_sidemenu_labour_and_delivery.png new file mode 100644 index 000000000..f6248471b Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_sidemenu_labour_and_delivery.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_sidemenu_labour_and_delivery_active.png b/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_sidemenu_labour_and_delivery_active.png new file mode 100644 index 000000000..aaf964d37 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-mdpi/ic_sidemenu_labour_and_delivery_active.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-mdpi/reports_bg_blue_green.xml b/opensrp-chw-hf/src/main/res/drawable-mdpi/reports_bg_blue_green.xml new file mode 100644 index 000000000..b5d746460 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable-mdpi/reports_bg_blue_green.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/drawable-xhdpi/activityrow_visit_in_progress.png b/opensrp-chw-hf/src/main/res/drawable-xhdpi/activityrow_visit_in_progress.png new file mode 100644 index 000000000..b175a96d5 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xhdpi/activityrow_visit_in_progress.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_feedback.png b/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_feedback.png new file mode 100644 index 000000000..bb6bcf064 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_feedback.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_referral.png b/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_referral.png new file mode 100644 index 000000000..da9694f4f Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_referral.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_sidemenu_hei.png b/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_sidemenu_hei.png new file mode 100644 index 000000000..c5ee8d1af Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_sidemenu_hei.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_sidemenu_hei_active.png b/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_sidemenu_hei_active.png new file mode 100644 index 000000000..fa042a7e0 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_sidemenu_hei_active.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_sidemenu_labour_and_delivery.png b/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_sidemenu_labour_and_delivery.png new file mode 100644 index 000000000..094c56774 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_sidemenu_labour_and_delivery.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_sidemenu_labour_and_delivery_active.png b/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_sidemenu_labour_and_delivery_active.png new file mode 100644 index 000000000..0b0c53fe3 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xhdpi/ic_sidemenu_labour_and_delivery_active.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-xxhdpi/activityrow_visit_in_progress.png b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/activityrow_visit_in_progress.png new file mode 100644 index 000000000..23fd242f0 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/activityrow_visit_in_progress.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-xxhdpi/advanced_search_bg.xml b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/advanced_search_bg.xml new file mode 100644 index 000000000..d5e0bb3f9 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/advanced_search_bg.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/drawable-xxhdpi/advanced_search_disabled_bg.xml b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/advanced_search_disabled_bg.xml new file mode 100644 index 000000000..abb772920 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/advanced_search_disabled_bg.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/drawable-xxhdpi/advanced_search_enabled_bg.xml b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/advanced_search_enabled_bg.xml new file mode 100644 index 000000000..69e5cd0c7 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/advanced_search_enabled_bg.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_feedback.png b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_feedback.png new file mode 100644 index 000000000..bd84ce502 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_feedback.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_referral.png b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_referral.png new file mode 100644 index 000000000..8cc35d886 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_referral.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_sidemenu_hei.png b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_sidemenu_hei.png new file mode 100644 index 000000000..110b36cd1 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_sidemenu_hei.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_sidemenu_hei_active.png b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_sidemenu_hei_active.png new file mode 100644 index 000000000..44dcd43af Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_sidemenu_hei_active.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_sidemenu_labour_and_delivery.png b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_sidemenu_labour_and_delivery.png new file mode 100644 index 000000000..8b23b28b2 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_sidemenu_labour_and_delivery.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_sidemenu_labour_and_delivery_active.png b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_sidemenu_labour_and_delivery_active.png new file mode 100644 index 000000000..651ba5459 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/ic_sidemenu_labour_and_delivery_active.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable-xxhdpi/light_grey_background.xml b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/light_grey_background.xml new file mode 100644 index 000000000..d0f49db7f --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable-xxhdpi/light_grey_background.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/drawable-xxxhdpi/activityrow_visit_in_progress.png b/opensrp-chw-hf/src/main/res/drawable-xxxhdpi/activityrow_visit_in_progress.png new file mode 100644 index 000000000..94f8ac54a Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable-xxxhdpi/activityrow_visit_in_progress.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable/contact_phone_collection.png b/opensrp-chw-hf/src/main/res/drawable/contact_phone_collection.png new file mode 100644 index 000000000..56f207d75 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable/contact_phone_collection.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable/ic_anc_reports.xml b/opensrp-chw-hf/src/main/res/drawable/ic_anc_reports.xml new file mode 100644 index 000000000..8d75db588 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/ic_anc_reports.xml @@ -0,0 +1,14 @@ + + + + diff --git a/opensrp-chw-hf/src/main/res/drawable/ic_baseline_filter_list_24.xml b/opensrp-chw-hf/src/main/res/drawable/ic_baseline_filter_list_24.xml new file mode 100644 index 000000000..e4094cfb4 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/ic_baseline_filter_list_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/opensrp-chw-hf/src/main/res/drawable/ic_baseline_notes.xml b/opensrp-chw-hf/src/main/res/drawable/ic_baseline_notes.xml new file mode 100644 index 000000000..fd34d93d0 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/ic_baseline_notes.xml @@ -0,0 +1,5 @@ + + + diff --git a/opensrp-chw-hf/src/main/res/drawable/ic_baseline_save_alt_24.xml b/opensrp-chw-hf/src/main/res/drawable/ic_baseline_save_alt_24.xml new file mode 100644 index 000000000..ddb9d4df5 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/ic_baseline_save_alt_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/opensrp-chw-hf/src/main/res/drawable/ic_baseline_wifi_off_204.xml b/opensrp-chw-hf/src/main/res/drawable/ic_baseline_wifi_off_204.xml new file mode 100644 index 000000000..0e89f3509 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/ic_baseline_wifi_off_204.xml @@ -0,0 +1,5 @@ + + + diff --git a/opensrp-chw-hf/src/main/res/drawable/ic_labor_delivery.xml b/opensrp-chw-hf/src/main/res/drawable/ic_labor_delivery.xml new file mode 100644 index 000000000..3c03c0cdc --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/ic_labor_delivery.xml @@ -0,0 +1,9 @@ + + + diff --git a/opensrp-chw-hf/src/main/res/drawable/ic_logo.png b/opensrp-chw-hf/src/main/res/drawable/ic_logo.png index c075e49c1..c799be157 100644 Binary files a/opensrp-chw-hf/src/main/res/drawable/ic_logo.png and b/opensrp-chw-hf/src/main/res/drawable/ic_logo.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable/ic_logo_ba.png b/opensrp-chw-hf/src/main/res/drawable/ic_logo_ba.png new file mode 100644 index 000000000..c075e49c1 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/drawable/ic_logo_ba.png differ diff --git a/opensrp-chw-hf/src/main/res/drawable/ic_ltfu_report.xml b/opensrp-chw-hf/src/main/res/drawable/ic_ltfu_report.xml new file mode 100644 index 000000000..d7ec3783f --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/ic_ltfu_report.xml @@ -0,0 +1,9 @@ + + + diff --git a/opensrp-chw-hf/src/main/res/drawable/ic_pmtct_cohort_report.xml b/opensrp-chw-hf/src/main/res/drawable/ic_pmtct_cohort_report.xml new file mode 100644 index 000000000..4e63849b6 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/ic_pmtct_cohort_report.xml @@ -0,0 +1,9 @@ + + + diff --git a/opensrp-chw-hf/src/main/res/drawable/ic_pnc_reports.xml b/opensrp-chw-hf/src/main/res/drawable/ic_pnc_reports.xml new file mode 100644 index 000000000..dc521b1e5 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/ic_pnc_reports.xml @@ -0,0 +1,9 @@ + + + diff --git a/opensrp-chw-hf/src/main/res/drawable/ic_report_button_bg.xml b/opensrp-chw-hf/src/main/res/drawable/ic_report_button_bg.xml new file mode 100644 index 000000000..35a5b521c --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/ic_report_button_bg.xml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/drawable/ld_partograph_button_selector.xml b/opensrp-chw-hf/src/main/res/drawable/ld_partograph_button_selector.xml new file mode 100644 index 000000000..bfbb8a4bf --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/ld_partograph_button_selector.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/drawable/reports_bg_blue.xml b/opensrp-chw-hf/src/main/res/drawable/reports_bg_blue.xml new file mode 100644 index 000000000..15e178e9c --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/reports_bg_blue.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/drawable/reports_bg_blue_green.xml b/opensrp-chw-hf/src/main/res/drawable/reports_bg_blue_green.xml new file mode 100644 index 000000000..b5d746460 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/reports_bg_blue_green.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/drawable/reports_bg_green.xml b/opensrp-chw-hf/src/main/res/drawable/reports_bg_green.xml new file mode 100644 index 000000000..822d00c2b --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/reports_bg_green.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/drawable/reports_bg_red.xml b/opensrp-chw-hf/src/main/res/drawable/reports_bg_red.xml new file mode 100644 index 000000000..71db38241 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/reports_bg_red.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/drawable/ripple_custom.xml b/opensrp-chw-hf/src/main/res/drawable/ripple_custom.xml new file mode 100644 index 000000000..69d165cad --- /dev/null +++ b/opensrp-chw-hf/src/main/res/drawable/ripple_custom.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/font/google_sans_bold.ttf b/opensrp-chw-hf/src/main/res/font/google_sans_bold.ttf new file mode 100755 index 000000000..80497666e Binary files /dev/null and b/opensrp-chw-hf/src/main/res/font/google_sans_bold.ttf differ diff --git a/opensrp-chw-hf/src/main/res/font/google_sans_bolditalic.ttf b/opensrp-chw-hf/src/main/res/font/google_sans_bolditalic.ttf new file mode 100755 index 000000000..e940d022e Binary files /dev/null and b/opensrp-chw-hf/src/main/res/font/google_sans_bolditalic.ttf differ diff --git a/opensrp-chw-hf/src/main/res/font/google_sans_italic.ttf b/opensrp-chw-hf/src/main/res/font/google_sans_italic.ttf new file mode 100755 index 000000000..bfb1a2cd2 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/font/google_sans_italic.ttf differ diff --git a/opensrp-chw-hf/src/main/res/font/google_sans_medium.ttf b/opensrp-chw-hf/src/main/res/font/google_sans_medium.ttf new file mode 100755 index 000000000..1543660da Binary files /dev/null and b/opensrp-chw-hf/src/main/res/font/google_sans_medium.ttf differ diff --git a/opensrp-chw-hf/src/main/res/font/google_sans_mediumitalic.ttf b/opensrp-chw-hf/src/main/res/font/google_sans_mediumitalic.ttf new file mode 100755 index 000000000..7c1667bbf Binary files /dev/null and b/opensrp-chw-hf/src/main/res/font/google_sans_mediumitalic.ttf differ diff --git a/opensrp-chw-hf/src/main/res/font/google_sans_regular.ttf b/opensrp-chw-hf/src/main/res/font/google_sans_regular.ttf new file mode 100755 index 000000000..ab605f9e2 Binary files /dev/null and b/opensrp-chw-hf/src/main/res/font/google_sans_regular.ttf differ diff --git a/opensrp-chw-hf/src/main/res/layout/activity_all_male_clients.xml b/opensrp-chw-hf/src/main/res/layout/activity_all_male_clients.xml new file mode 100644 index 000000000..a76d4a215 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/layout/activity_all_male_clients.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/opensrp-chw-hf/src/main/res/layout/activity_anc_filter.xml b/opensrp-chw-hf/src/main/res/layout/activity_anc_filter.xml new file mode 100644 index 000000000..f48794f37 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/layout/activity_anc_filter.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/layout/activity_anc_member_profile.xml b/opensrp-chw-hf/src/main/res/layout/activity_anc_member_profile.xml new file mode 100644 index 000000000..6725a6607 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/layout/activity_anc_member_profile.xml @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/layout/activity_anc_reports.xml b/opensrp-chw-hf/src/main/res/layout/activity_anc_reports.xml new file mode 100644 index 000000000..a8e8ae45a --- /dev/null +++ b/opensrp-chw-hf/src/main/res/layout/activity_anc_reports.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/layout/activity_base_anc_medical_history.xml b/opensrp-chw-hf/src/main/res/layout/activity_base_anc_medical_history.xml new file mode 100644 index 000000000..9b162c963 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/layout/activity_base_anc_medical_history.xml @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/layout/activity_base_hiv_index_contact_profile.xml b/opensrp-chw-hf/src/main/res/layout/activity_base_hiv_index_contact_profile.xml new file mode 100644 index 000000000..b7f523b99 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/layout/activity_base_hiv_index_contact_profile.xml @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/layout/activity_base_hiv_profile.xml b/opensrp-chw-hf/src/main/res/layout/activity_base_hiv_profile.xml new file mode 100644 index 000000000..78fcc7a48 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/layout/activity_base_hiv_profile.xml @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/layout/activity_cdp_reports.xml b/opensrp-chw-hf/src/main/res/layout/activity_cdp_reports.xml new file mode 100644 index 000000000..09ee00d81 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/layout/activity_cdp_reports.xml @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/layout/activity_login.xml b/opensrp-chw-hf/src/main/res/layout/activity_login.xml index 94411f136..28f95b4d4 100644 --- a/opensrp-chw-hf/src/main/res/layout/activity_login.xml +++ b/opensrp-chw-hf/src/main/res/layout/activity_login.xml @@ -34,19 +34,18 @@ android:layout_weight="1" android:contentDescription="@string/logo" android:scaleType="fitCenter" - android:src="@drawable/ic_logo" /> + android:src="@drawable/ic_logo_ba" /> + android:textSize="@dimen/login_title_text_size" /> @@ -80,6 +80,7 @@ android:cursorVisible="true" android:ems="10" android:hint="@string/username" + android:fontFamily="@font/google_sans_regular" android:imeOptions="actionNext" android:inputType="text" android:lines="1" @@ -98,6 +99,7 @@ android:layout_marginTop="15dp" android:layout_weight="8" android:background="@drawable/rounded_corner_edit_text_bg" + android:fontFamily="@font/google_sans_regular" android:cursorVisible="true" android:ems="10" android:hint="@string/password" @@ -133,6 +135,7 @@ android:layout_centerVertical="true" android:layout_marginLeft="10dp" android:layout_toRightOf="@id/login_show_password_checkbox" + android:fontFamily="@font/google_sans_regular" android:text="@string/show_password_text" android:textColor="#585858" android:textSize="@dimen/login_edit_text_textSize" /> @@ -146,6 +149,7 @@ android:layout_marginTop="20dp" android:layout_weight="8" android:background="@drawable/login_button_bg" + android:fontFamily="@font/google_sans_bold" android:ems="10" android:shadowColor="#ffffff" android:shadowDx="0" diff --git a/opensrp-chw-hf/src/main/res/layout/activity_partner_registration.xml b/opensrp-chw-hf/src/main/res/layout/activity_partner_registration.xml new file mode 100644 index 000000000..ce8e63b54 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/layout/activity_partner_registration.xml @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/opensrp-chw-hf/src/main/res/layout/activity_pmtct_reports.xml b/opensrp-chw-hf/src/main/res/layout/activity_pmtct_reports.xml new file mode 100644 index 000000000..6bd1271b7 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/layout/activity_pmtct_reports.xml @@ -0,0 +1,277 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/layout/activity_pnc_reports.xml b/opensrp-chw-hf/src/main/res/layout/activity_pnc_reports.xml new file mode 100644 index 000000000..1d76b88cd --- /dev/null +++ b/opensrp-chw-hf/src/main/res/layout/activity_pnc_reports.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/layout/activity_reports.xml b/opensrp-chw-hf/src/main/res/layout/activity_reports.xml new file mode 100644 index 000000000..9747b6172 --- /dev/null +++ b/opensrp-chw-hf/src/main/res/layout/activity_reports.xml @@ -0,0 +1,605 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/layout/activity_reports_view.xml b/opensrp-chw-hf/src/main/res/layout/activity_reports_view.xml new file mode 100644 index 000000000..148d756bf --- /dev/null +++ b/opensrp-chw-hf/src/main/res/layout/activity_reports_view.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-chw-hf/src/main/res/layout/activity_request_call_phone_permission.xml b/opensrp-chw-hf/src/main/res/layout/activity_request_call_phone_permission.xml new file mode 100644 index 000000000..cc4e7f60d --- /dev/null +++ b/opensrp-chw-hf/src/main/res/layout/activity_request_call_phone_permission.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + +